xref: /haiku/src/apps/charactermap/CharacterMap.cpp (revision 97901ec593ec4dd50ac115c1c35a6d72f6e489a5)
1 /*
2  * Copyright 2009, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include "CharacterMap.h"
8 
9 #include <stdlib.h>
10 
11 #include <Alert.h>
12 #include <Application.h>
13 #include <TextView.h>
14 
15 #include "CharacterWindow.h"
16 
17 
18 const char* kSignature = "application/x-vnd.Haiku-CharacterMap";
19 
20 
21 CharacterMap::CharacterMap()
22 	: BApplication(kSignature)
23 {
24 }
25 
26 
27 CharacterMap::~CharacterMap()
28 {
29 }
30 
31 
32 void
33 CharacterMap::ReadyToRun()
34 {
35 	fWindow = new CharacterWindow();
36 	fWindow->Show();
37 }
38 
39 
40 void
41 CharacterMap::RefsReceived(BMessage* message)
42 {
43 	fWindow->PostMessage(message);
44 }
45 
46 
47 void
48 CharacterMap::MessageReceived(BMessage* message)
49 {
50 	BApplication::MessageReceived(message);
51 }
52 
53 
54 void
55 CharacterMap::AboutRequested()
56 {
57 	BAlert *alert = new BAlert("about", "CharacterMap\n"
58 		"\twritten by Axel Dörfler\n"
59 		"\tCopyright 2009, Haiku, Inc.\n", "OK");
60 	BTextView *view = alert->TextView();
61 	BFont font;
62 
63 	view->SetStylable(true);
64 
65 	view->GetFont(&font);
66 	font.SetSize(18);
67 	font.SetFace(B_BOLD_FACE);
68 	view->SetFontAndColor(0, 12, &font);
69 
70 	alert->Go();
71 }
72 
73 
74 //	#pragma mark -
75 
76 
77 int
78 main(int /*argc*/, char** /*argv*/)
79 {
80 	CharacterMap app;
81 	app.Run();
82 
83 	return 0;
84 }
85