xref: /haiku/src/preferences/screen/ScreenApplication.cpp (revision 24159a0c7d6d6dcba9f2a0c1a7c08d2c8167f21b)
1 /*
2  * Copyright 2001-2005, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Rafael Romo
7  *		Stefano Ceccherini (burton666@libero.it)
8  *		Andrew Bachmann
9  *		Sergei Panteleev
10  */
11 
12 
13 #include "ScreenApplication.h"
14 #include "ScreenWindow.h"
15 #include "ScreenSettings.h"
16 #include "Constants.h"
17 
18 #include <Alert.h>
19 
20 
21 ScreenApplication::ScreenApplication()
22 	:	BApplication(kAppSignature),
23 	fScreenWindow(new ScreenWindow(new ScreenSettings()))
24 {
25 	fScreenWindow->Show();
26 }
27 
28 
29 void
30 ScreenApplication::AboutRequested()
31 {
32 	BAlert *aboutAlert = new BAlert("About", "Screen preferences by the Haiku team",
33 		"Ok", NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_INFO_ALERT);
34 	aboutAlert->SetShortcut(0, B_OK);
35 	aboutAlert->Go();
36 }
37 
38 
39 void
40 ScreenApplication::MessageReceived(BMessage* message)
41 {
42 	switch (message->what) {
43 		case SET_INITIAL_MODE_MSG:
44 		case SET_CUSTOM_REFRESH_MSG:
45 		case MAKE_INITIAL_MSG:
46 			fScreenWindow->PostMessage(message);
47 			break;
48 
49 		default:
50 			BApplication::MessageReceived(message);
51 			break;
52 	}
53 }
54 
55 
56 //	#pragma mark -
57 
58 
59 int
60 main()
61 {
62 	ScreenApplication app;
63 	app.Run();
64 
65 	return 0;
66 }
67