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 "FontDemo.h" 11 #include "FontDemoView.h" 12 #include "ControlView.h" 13 14 #include <Window.h> 15 16 17 FontDemo::FontDemo() 18 : BApplication("application/x-vnd.Haiku-FontDemo") 19 { 20 // Create the demo window where we draw the string 21 BWindow* demoWindow = new BWindow(BRect(80, 30, 490, 300), "FontDemo", 22 B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE); 23 24 FontDemoView* demoView = new FontDemoView(demoWindow->Bounds()); 25 demoWindow->AddChild(demoView); 26 27 BWindow* controlWindow = new BWindow(BRect(500, 30, 700, 402), "Controls", 28 B_FLOATING_WINDOW_LOOK, B_FLOATING_APP_WINDOW_FEEL, 29 B_NOT_CLOSABLE | B_NOT_ZOOMABLE | B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS); 30 31 ControlView* controlView = new ControlView(controlWindow->Bounds()); 32 controlWindow->AddChild(controlView); 33 34 controlView->SetTarget(demoView); 35 36 demoWindow->Show(); 37 controlWindow->Show(); 38 } 39 40 41 FontDemo::~FontDemo() 42 { 43 } 44 45 46 void 47 FontDemo::ReadyToRun() 48 { 49 50 } 51 52 53 // #pragma mark - 54 55 56 int 57 main() 58 { 59 FontDemo fontdemo; 60 fontdemo.Run(); 61 return 0; 62 } 63 64