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 __threads_h
- #define __threads_h
-
- #include "Vista:vista.h"
- #include <stdio.h>
-
-
- class Tracker : public Window, public Thread
- {
- enum icon_numbers
- {
- POSITION = 0,
- TIME = 26,
- SELECT = 3,
- MENU = 4,
- ADJUST = 5,
- SELSTAT = 22,
- MENSTAT = 23,
- ADJSTAT= 24,
- SPEED = 7,
- DIST = 18,
- WINDOW = 10,
- ICON = 12,
- STOP = 8,
- SPEEDOMETER_BACKGROUND = 16,
- SPEEDOMETER_VALUE = 17
- } ;
- public:
- Tracker (Task *t) ; // constructor
- ~Tracker() ; // destructor
- void run() ; // thread run function
- void click(int x, int y, int button, int icon) ; // I want clicks
-
- private:
- bool running ;
- int prev_x ;
- int prev_y ;
- int prev_time ;
- Icon *coords_display ;
- Icon *select_button ;
- Icon *menu_button ;
- Icon *adjust_button ;
- Icon *select_display ;
- Icon *menu_display ;
- Icon *adjust_display ;
- Icon *speed_display ;
- Icon *dist_display ;
- Icon *window_display ;
- Icon *icon_display ;
- Icon *time_display ;
- Meter *speedometer ;
- } ;
-
-
- //
- // 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 Threads : public Task
- {
- enum menu_items
- {
- INFO, // program info
- QUIT // quit application
- } ;
- public:
- Threads() ;
- void click(int x, int y, int button, int icon) ; // I want iconbar clicks
- void menu (MenuItem items[]) ; // iconbar menu hit
- } ;
-
- #endif
-