32 #ifndef TBX_COLOURDBOX_H_
33 #define TBX_COLOURDBOX_H_
35 #include "showpointobject.h"
42 class AboutToBeShownListener;
43 class HasBeenHiddenListener;
44 class ColourSelectedListener;
45 class ColourDboxDialogueCompletedListener;
62 enum { TOOLBOX_CLASS = 0x829C0 };
205 unsigned char *_block;
220 bool none()
const {
return _none;}
225 unsigned char blue()
const {
return _block[1];}
229 unsigned char green()
const {
return _block[2];}
233 unsigned char red()
const {
return _block[3];}
void remove_about_to_be_shown_listener(AboutToBeShownListener *listener)
Remove about to be shown listener.
Definition: colourdbox.cc:58
int int_property(int property_id) const
Return the value of a property that returns an integer.
Definition: object.cc:477
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
ColourDbox & operator=(const Object &other)
Assign this ColourDbox from an Object that refers to a ColourDbox.
Definition: colourdbox.h:127
ObjectId handle() const
Return the underlying toolbox object id this object references.
Definition: object.h:93
bool operator==(const Object &other) const
Check if this ColourDbox refers to the same underlying toolbox object as another.
Definition: colourdbox.h:136
int dialog_handle() const
Return the underlying dialogue handle used by the ColourPicker module.
Definition: colourdbox.h:155
ColourDbox(const std::string &template_name)
Create a ColourDbox from the named template.
Definition: colourdbox.h:97
unsigned char green() const
Green amount selected.
Definition: colourdbox.h:229
ObjectId _handle
Handle for toolbox object.
Definition: object.h:175
ColourDbox colour_dbox() const
Return colour dbox that generated this event.
Definition: colourdbox.h:215
ColourSelectedEvent & operator=(const ColourSelectedEvent &other)
Make this object to another ColourSelectedEvent object.
Definition: colourdbox.cc:165
Object that can be shown at a specific position as well as its default place.
Definition: showpointobject.h:43
void remove_colour_selected_listener(ColourSelectedListener *listener)
Remove the colour selected listener.
Definition: colourdbox.cc:118
ColourModel
Enumeration for the colour models.
Definition: colourdbox.h:160
unsigned char red() const
Red amount selected.
Definition: colourdbox.h:233
Class to show a toolbox ColourDbox object which allows a user to pick a colour using a variety of col...
Definition: colourdbox.h:60
Listener for when the Colour dialogue box has been closed.
Definition: colourdbox.h:185
void remove_dialogue_completed_listener(ColourDboxDialogueCompletedListener *listener)
Remove listener to be called when the dialogue has been completed.
Definition: colourdbox.cc:86
virtual void colour_selected(const ColourSelectedEvent &event)=0
Colour has been selected in ColourDbox nd OK is pressed.
Event listener for colour selected event.
Definition: colourdbox.h:244
ColourDbox()
Construct creates an unassigned ColourDbox.
Definition: colourdbox.h:69
int WindowHandle
Type for WIMP windows handle.
Definition: handles.h:35
void check_toolbox_class(int class_id) const
Check if this objects toolbox class is as specified.
Definition: object.cc:122
Listener for about to be shown event.
Definition: abouttobeshownlistener.h:77
void add_about_to_be_shown_listener(AboutToBeShownListener *listener)
This event is raised just before the ColourDbox underlying window is about to be shown.
Definition: colourdbox.cc:48
Class to manipulate a toolbox object.
Definition: object.h:51
Base class for all toolbox event listeners.
Definition: listener.h:34
ColourDbox::ColourModel model() const
Colour model selected.
Definition: colourdbox.h:237
ColourDbox(const ColourDbox &other)
Construct a ColourDbox from another ColourDbox.
Definition: colourdbox.h:78
unsigned char blue() const
Blue amount selected.
Definition: colourdbox.h:225
ColourDbox(const Object &other)
Construct a ColourDbox from an Object that refers to a ColourDbox.
Definition: colourdbox.h:89
WindowHandle wimp_handle() const
Return the underlying wimp window used by the ColourPicker module.
Definition: colourdbox.h:150
void none_available(bool available)
Set if an option for no colour is included.
Definition: colourdbox.h:165
bool none_available() const
Return true if a no colour option is included on the dialog box.
Definition: colourdbox.h:169
void add_colour_selected_listener(ColourSelectedListener *listener)
Add listener to report colour select when dialog is finished with OK.
Definition: colourdbox.cc:108
Class for ColourDbox object template.
Definition: rescolourdbox.h:37
ColourDbox & operator=(const ColourDbox &other)
Assign this ColourDbox from another.
Definition: colourdbox.h:114
Event data for colour selected event.
Definition: colourdbox.h:202
bool bool_property(int property_id) const
Get a boolean property from the toolbox Cobject.
Definition: object.cc:595
virtual void colourdbox_dialogue_completed(ColourDbox colour_dbox, bool colour_selected)=0
Called when dialogue has be closed.
ColourSelectedEvent(ColourDbox cbox, bool none, const unsigned char *block)
Construct a colour selected event from event data.
Definition: colourdbox.cc:130
void add_dialogue_completed_listener(ColourDboxDialogueCompletedListener *listener)
Add listener to be called when the dialogue has been completed.
Definition: colourdbox.cc:76
bool none() const
None colour was selected.
Definition: colourdbox.h:220
bool operator!=(const Object &other) const
Check if this ColourDbox does not refers to the same underlying toolbox object as another.
Definition: colourdbox.h:144