1adae1a12SAugustin Cavalier/*
2adae1a12SAugustin Cavalier * Copyright 2003-2004 Waldemar Kornewald. All rights reserved.
3adae1a12SAugustin Cavalier * Copyright 2017 Haiku, Inc. All rights reserved.
4adae1a12SAugustin Cavalier * Distributed under the terms of the MIT License.
5adae1a12SAugustin Cavalier */
66046fd95SFredrik Modeen
76046fd95SFredrik Modeen#include <Application.h>
86046fd95SFredrik Modeen#include <Window.h>
96046fd95SFredrik Modeen
106046fd95SFredrik Modeen#include "InterfaceUtils.h"
116046fd95SFredrik Modeen
126046fd95SFredrik Modeen#include "DialUpView.h"
136046fd95SFredrik Modeen
146046fd95SFredrik Modeen
156046fd95SFredrik Modeenstatic const char *kSignature = "application/x-vnd.haiku.dial-up-preflet";
166046fd95SFredrik Modeen
176046fd95SFredrik Modeen
186046fd95SFredrik Modeenclass DialUpApplication : public BApplication {
196046fd95SFredrik Modeen	public:
206046fd95SFredrik Modeen		DialUpApplication();
216046fd95SFredrik Modeen};
226046fd95SFredrik Modeen
236046fd95SFredrik Modeen
246046fd95SFredrik Modeenclass DialUpWindow : public BWindow {
256046fd95SFredrik Modeen	public:
266046fd95SFredrik Modeen		DialUpWindow(BRect frame);
27adae1a12SAugustin Cavalier
286046fd95SFredrik Modeen		virtual bool QuitRequested()
296046fd95SFredrik Modeen			{ be_app->PostMessage(B_QUIT_REQUESTED); return true; }
306046fd95SFredrik Modeen};
316046fd95SFredrik Modeen
326046fd95SFredrik Modeen
336046fd95SFredrik Modeenint main()
346046fd95SFredrik Modeen{
356046fd95SFredrik Modeen	new DialUpApplication();
36adae1a12SAugustin Cavalier
376046fd95SFredrik Modeen	be_app->Run();
38adae1a12SAugustin Cavalier
396046fd95SFredrik Modeen	delete be_app;
40adae1a12SAugustin Cavalier
416046fd95SFredrik Modeen	return 0;
426046fd95SFredrik Modeen}
436046fd95SFredrik Modeen
446046fd95SFredrik Modeen
456046fd95SFredrik ModeenDialUpApplication::DialUpApplication()
466046fd95SFredrik Modeen	: BApplication(kSignature)
476046fd95SFredrik Modeen{
486046fd95SFredrik Modeen	BRect rect(150, 50, 450, 435);
496046fd95SFredrik Modeen	DialUpWindow *window = new DialUpWindow(rect);
506046fd95SFredrik Modeen	window->MoveTo(center_on_screen(rect, window));
516046fd95SFredrik Modeen	window->Show();
526046fd95SFredrik Modeen}
536046fd95SFredrik Modeen
546046fd95SFredrik Modeen
556046fd95SFredrik ModeenDialUpWindow::DialUpWindow(BRect frame)
566046fd95SFredrik Modeen	: BWindow(frame, "DialUp", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
576046fd95SFredrik Modeen{
586046fd95SFredrik Modeen	DialUpView *view = new DialUpView(Bounds());
59adae1a12SAugustin Cavalier
606046fd95SFredrik Modeen	AddChild(view);
616046fd95SFredrik Modeen}
62