1 /**************************************************************************
2 ** (c) Copyright 2002, Andromeda Technology & Automation
3 ***************************************************************************
4 ** MODULE INFORMATION *
5 ***********************
6 ** FILE NAME : doodle2.cpp
7 ** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation
8 ** VERSION NUMBER : $Revision: 1.2 $
10 ** DESCRIPTION : Doodle is an exmaple application to demonstrate
11 ** the functions in AXE as a tutorial.
12 ** The second phase shows how to draw graphics in a
13 ** window and the event handling mechanism.
18 ***************************************************************************
19 ** ADMINISTRATIVE INFORMATION *
20 ********************************
21 ** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
22 ** CREATION DATE : Mar 01, 2002
23 **************************************************************************/
25 /*****************************
27 Revision 1.2 2002-11-04 07:44:45 arjen
28 Use proper namespace for iostream classes
29 Use local header files and not the installed ones.
31 Revision 1.1 2002/07/25 08:01:18 arjen
32 First checkin, AXE release 0.2
34 *****************************/
36 static const char *RCSID = "$Id: doodle2.cpp,v 1.2 2002-11-04 07:44:45 arjen Exp $";
40 class doodle_view : public window
44 doodle_view(window *parent) : window (*parent, 10, 30, 300, 220)
46 SelectInput(ExposureMask, 1);
47 Background(color("lightyellow"));
50 virtual int EV_Expose(XExposeEvent);
53 class doodle: public xapplication
55 managed_window *main_frame;
56 doodle_view *draw_frame;
58 virtual void SetupResources(void);
63 void doodle::SetupResources()
65 main_frame = new managed_window("Doodling with AXE");
68 draw_frame = new doodle_view(main_frame);
72 int doodle_view::EV_Expose(XExposeEvent ev)
76 DrawRectangle(graphic, 50, 70, 200, 100);