xref: /haiku/src/apps/fontdemo/FontDemo.cpp (revision 2b76973fa2401f7a5edf68e6470f3d3210cbcff3)
1 /*
2  * Copyright 2006, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Mikael Konradson, mikael.konradson@gmail.com
7  */
8 
9 
10 #include "ControlView.h"
11 #include "FontDemo.h"
12 #include "FontDemoView.h"
13 
14 #include <Catalog.h>
15 #include <Window.h>
16 
17 #undef B_TRANSLATION_CONTEXT
18 #define B_TRANSLATION_CONTEXT "FontDemo"
19 
20 const BString APP_NAME = B_TRANSLATE_SYSTEM_NAME("FontDemo");
21 
22 FontDemo::FontDemo()
23 	: BApplication("application/x-vnd.Haiku-FontDemo")
24 {
25 	// Create the demo window where we draw the string
26 	BWindow* demoWindow = new BWindow(BRect(80, 30, 490, 300), APP_NAME,
27 		B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE);
28 
29 	FontDemoView* demoView = new FontDemoView(demoWindow->Bounds());
30 	demoWindow->AddChild(demoView);
31 
32 	BWindow* controlWindow = new BWindow(BRect(500, 30, 700, 420), B_TRANSLATE("Controls"),
33 		B_FLOATING_WINDOW_LOOK, B_FLOATING_APP_WINDOW_FEEL,
34 		B_NOT_CLOSABLE | B_NOT_ZOOMABLE | B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS);
35 
36 	ControlView* controlView = new ControlView(controlWindow->Bounds());
37 	controlWindow->AddChild(controlView);
38 
39 	controlView->SetTarget(demoView);
40 
41 	demoWindow->Show();
42 	controlWindow->Show();
43 }
44 
45 
46 FontDemo::~FontDemo()
47 {
48 }
49 
50 
51 void
52 FontDemo::ReadyToRun()
53 {
54 
55 }
56 
57 
58 //	#pragma mark -
59 
60 
61 int
62 main()
63 {
64 	FontDemo fontdemo;
65 	fontdemo.Run();
66 	return 0;
67 }
68 
69