home *** CD-ROM | disk | FTP | other *** search
- // **************************************************************************
- // Copyright 1996 David Allison
- //
- // VV VV IIIIII SSSSS TTTTTT AA
- // VV VV II SS TT AA AA
- // VV VV II SSSS TT AA AA
- // VV VV II SS TT AAAAAAAA
- // VV IIIIII SSSS TT AA AA
- //
- // MULTI-THREADED C++ WIMP CLASS LIBRARY
- // for RISC OS
- // **************************************************************************
- //
- // P U B L I C D O M A I N L I C E N C E
- // -------------------------------------------
- //
- // This library is copyright. You may not sell the library for
- // profit, but you may sell products which use it providing
- // those products are presented as executable code and are not
- // libraries themselves. The library is supplied without any
- // warranty and the copyright owner cannot be held responsible for
- // damage resulting from failure of any part of this library.
- //
- // See the User Manual for details of the licence.
- //
- // *************************************************************************
-
-
- //
- // Example of a Dialogue Box
- //
-
- #ifndef __dbox_h
- #define __dbox_h
-
- #include "Vista:vista.h"
- #include <stdio.h>
-
- class MainWindow ; // declaration
-
-
- class ExampleBox : public DialogueBox
- {
- friend class MainWindow ;
- enum icon_numbers // the numbers for the icons
- {
- PORT_NONE = 2,
- PORT_SERIAL = 5,
- PORT_PARALLEL = 3,
- PORT_NET = 4,
- VOICE_DISPLAY = 6,
- VOICE_MENU = 7,
- VOLUME_DOWN = 14,
- VOLUME_UP = 13,
- VOLUME_BACKGROUND = 10,
- VOLUME_VALUE = 12,
- FONTCACHE_UP = 18,
- FONTCACHE_DOWN = 16,
- FONTCACHE_VALUE = 17,
- HSCROLL = 20,
- VSCROLL = 21,
- SCREENMODE = 23,
- OK = 27,
- CANCEL = 24
- } ;
- public:
- ExampleBox (Task *task) ;
- ~ExampleBox() ;
- private:
- //
- // These are the attributes
- //
- bool ports[4] ;
- char voice[32] ;
- int volume ;
- int font_cache ;
- bool hscroll ;
- bool vscroll ;
- int screen_mode ;
-
- //
- // some tools for the composite icons
- //
-
- Slider *volume_control ;
- Popup *voice_control ;
- Adjuster *font_cache_control ;
-
- } ;
-
- //
- // The main window class. Contains a button which, when clicked, displays the
- // dialogue box. It also contains a display field which is used to display
- // the values of the attributes when the dialogue box is closed.
- //
-
-
- class MainWindow : public Window
- {
- enum icon_numbers
- {
- SHOWBOX = 1,
- DISPLAY = 2
- } ;
- public:
- MainWindow (Task *t) ; // constructor
- ~MainWindow() ; // destructor
- void click(int x, int y, int button, int icon) ; // I want clicks
-
- private:
- Icon *display ; // display field
- } ;
-
-
- //
- // This class is the task itself. The icon bar has a menu with 2 items. The task responds
- // to clicks on the icon bar (click() function) and menu hits (menu() function). Private
- // data includes the main window object.
- //
-
-
- class DBox : public Task
- {
- enum menu_items
- {
- INFO, // program info
- QUIT // quit application
- } ;
- public:
- DBox() ;
- void click(int x, int y, int button, int icon) ; // I want iconbar clicks
- void menu (MenuItem items[]) ; // iconbar menu hit
- private:
- Window *mainwin ; // the main window
- } ;
-
- #endif
-