1/* 2 * Copyright 2003-2004, Waldemar Kornewald <wkornew@gmx.net> 3 * Distributed under the terms of the MIT License. 4 */ 5 6#include <Application.h> 7#include <Window.h> 8 9#include "InterfaceUtils.h" 10 11#include "DialUpView.h" 12 13 14static const char *kSignature = "application/x-vnd.haiku.connect-up-preflet"; 15 16 17class DialUpApplication : public BApplication { 18 public: 19 DialUpApplication(); 20}; 21 22 23class DialUpWindow : public BWindow { 24 public: 25 DialUpWindow(BRect frame); 26 27 virtual bool QuitRequested() 28 { be_app->PostMessage(B_QUIT_REQUESTED); return true; } 29}; 30 31 32int main() 33{ 34 new DialUpApplication(); 35 36 be_app->Run(); 37 38 delete be_app; 39 40 return 0; 41} 42 43 44DialUpApplication::DialUpApplication() 45 : BApplication(kSignature) 46{ 47 BRect rect(150, 50, 450, 435); 48 DialUpWindow *window = new DialUpWindow(rect); 49 window->MoveTo(center_on_screen(rect, window)); 50 window->Show(); 51} 52 53 54DialUpWindow::DialUpWindow(BRect frame) 55 : BWindow(frame, "DialUp", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE) 56{ 57 DialUpView *view = new DialUpView(Bounds()); 58 59 AddChild(view); 60} 61