home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Acorn User 2
/
AUCD2.iso
/
program
/
vista.arc
/
!Vista
/
h
/
tools
< prev
next >
Wrap
Text File
|
1996-01-25
|
3KB
|
120 lines
// **************************************************************************
// 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.
//
// *************************************************************************
//
// h.tools
//
//
// these class are the various types of tools you see in a window
//
#ifndef __tools_h
#include "Vista:icon.h"
#endif
//
// adjuster arrows
//
//
// an adjuster has:
//
// 1. an up arrow to adjust upwards
// 2. a down arrow
// 3. a value
class Adjuster : virtual public Icon, public IconSet
{
public:
enum buttons {UP, DOWN} ;
public:
Adjuster (Window *w, int upicon, int downicon, int valueicon,
int write_init = 1 , int defvalue = 0) ;
virtual ~Adjuster() ;
int compare (int icon) ;
void write (int value) ;
protected:
int value ;
void click (int mx, int my, int button, int icon) ;
} ;
//
// a meter.
//
// This is a display only tool which takes a percentage to display
//
class Meter : virtual public Icon
{
public:
Meter (Window *w, int backgroundicon, int valueicon, int maxvalue) ;
virtual ~Meter() ;
void write (int value) ;
void reset() ; // reset meter
protected:
int percent ; // current percentage
int range ; // range of meter
int background_icon ;
int max_value ;
int xsize ;
} ;
//
// slider icon
//
class Slider : public Adjuster , public Meter
{
public:
Slider (Window *w, int upicon, int downicon, int valueicon,
int backgroundicon, int maxvalue, int defvalue = 0) ;
~Slider() ;
protected:
void write (int value) ;
void click(int mx, int my, int button, int icon) ; // icon has been clicked
void read (int &) ;
} ;
//
// a pop-up menu
//
class Popup : virtual public Icon, public IconSet
{
public:
Popup(Window *w, int displayicon, int menuicon, char *menu = 0) ;
~Popup() ;
int compare (int handle) ; // compare an icon number
void menu (MenuItem item[]) ; // menu click
void click (int mx, int my, int button, int icon) ;
} ;