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