xref: /haiku/src/apps/fontdemo/FontDemo.cpp (revision 1e60bdeab63fa7a57bc9a55b032052e95a18bd2c)
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 <GroupLayout.h>
16 #include <Window.h>
17 
18 #undef B_TRANSLATION_CONTEXT
19 #define B_TRANSLATION_CONTEXT "FontDemo"
20 
21 const BString APP_NAME = B_TRANSLATE_SYSTEM_NAME("FontDemo");
22 
23 FontDemo::FontDemo()
24 	: BApplication("application/x-vnd.Haiku-FontDemo")
25 {
26 	// Create the demo window where we draw the string
27 	BWindow* demoWindow = new BWindow(BRect(80, 30, 490, 300), APP_NAME,
28 		B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE);
29 
30 	FontDemoView* demoView = new FontDemoView(demoWindow->Bounds());
31 	demoWindow->AddChild(demoView);
32 
33 	BWindow* controlWindow = new BWindow(BRect(500, 30, 700, 420), B_TRANSLATE("Controls"),
34 		B_FLOATING_WINDOW_LOOK, B_FLOATING_APP_WINDOW_FEEL,
35 		B_NOT_CLOSABLE | B_NOT_ZOOMABLE | B_NOT_RESIZABLE
36 			| B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS);
37 
38 	ControlView* controlView = new ControlView();
39 	controlWindow->SetLayout(new BGroupLayout(B_VERTICAL));
40 	controlWindow->AddChild(controlView);
41 
42 	controlView->SetTarget(demoView);
43 
44 	demoWindow->Show();
45 	controlWindow->Show();
46 }
47 
48 
49 FontDemo::~FontDemo()
50 {
51 }
52 
53 
54 void
55 FontDemo::ReadyToRun()
56 {
57 
58 }
59 
60 
61 //	#pragma mark -
62 
63 
64 int
65 main()
66 {
67 	FontDemo fontdemo;
68 	fontdemo.Run();
69 	return 0;
70 }
71 
72