tcp: Fix 64 bit build with debugging features enabled.
[haiku.git] / src / preferences / keyboard / Keyboard.cpp
blobcbe1d6aa2567d50c53cd86c8ff3552b5a70914ad
1 /*
2 * Copyright 2004-2006, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors in chronological order:
6 * Andrew McCall, mccall@digitalparadise.co.uk
7 * Jérôme Duval
8 * Marcus Overhagen
9 */
12 #include "Keyboard.h"
13 #include "KeyboardWindow.h"
14 #include "KeyboardMessages.h"
16 #include <Alert.h>
18 #undef B_TRANSLATION_CONTEXT
19 #define B_TRANSLATION_CONTEXT "KeyboardApplication"
21 KeyboardApplication::KeyboardApplication()
22 : BApplication("application/x-vnd.Haiku-Keyboard")
24 new KeyboardWindow();
28 void
29 KeyboardApplication::MessageReceived(BMessage* message)
31 switch (message->what) {
32 case ERROR_DETECTED:
34 BAlert* errorAlert = new BAlert("Error",
35 B_TRANSLATE("Something has gone wrong!"),
36 B_TRANSLATE("OK"), NULL, NULL,
37 B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT);
38 errorAlert->SetFlags(errorAlert->Flags() | B_CLOSE_ON_ESCAPE);
39 errorAlert->Go();
40 be_app->PostMessage(B_QUIT_REQUESTED);
41 break;
43 default:
44 BApplication::MessageReceived(message);
45 break;
50 void
51 KeyboardApplication::AboutRequested()
53 BAlert* alert = new BAlert("about",
54 B_TRANSLATE("Written by Andrew Edward McCall"), B_TRANSLATE("OK"));
55 alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
56 alert->Go();
60 // #pragma mark -
63 int
64 main(int, char**)
66 KeyboardApplication app;
67 app.Run();
69 return 0;