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
13 #include "KeyboardWindow.h"
14 #include "KeyboardMessages.h"
18 #undef B_TRANSLATION_CONTEXT
19 #define B_TRANSLATION_CONTEXT "KeyboardApplication"
21 KeyboardApplication::KeyboardApplication()
22 : BApplication("application/x-vnd.Haiku-Keyboard")
29 KeyboardApplication::MessageReceived(BMessage
* message
)
31 switch (message
->what
) {
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
);
40 be_app
->PostMessage(B_QUIT_REQUESTED
);
44 BApplication::MessageReceived(message
);
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
);
66 KeyboardApplication app
;