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];}
ObjectId _handle
Handle for toolbox object.
Definition: object.h:173
ColourDbox & operator=(const Object &other)
Assign this ColourDbox from an Object that refers to a ColourDbox.
Definition: colourdbox.h:127
unsigned char blue() const
Blue amount selected.
Definition: colourdbox.h:225
ColourDbox::ColourModel model() const
Colour model selected.
Definition: colourdbox.h:237
void add_dialogue_completed_listener(ColourDboxDialogueCompletedListener *listener)
Add listener to be called when the dialogue has been completed.
Definition: colourdbox.cc:76
ColourDbox(const std::string &template_name)
Create a ColourDbox from the named template.
Definition: colourdbox.h:97
ColourModel
Enumeration for the colour models.
Definition: colourdbox.h:160
Listener for when the Colour dialogue box has been closed.
Definition: colourdbox.h:184
Listener for about to be shown event.
Definition: abouttobeshownlistener.h:76
void check_toolbox_class(int class_id) const
Check if this objects toolbox class is as specified.
Definition: object.cc:122
bool none_available() const
Return true if a no colour option is included on the dialog box.
Definition: colourdbox.h:169
void remove_colour_selected_listener(ColourSelectedListener *listener)
Remove the colour selected listener.
Definition: colourdbox.cc:118
void remove_dialogue_completed_listener(ColourDboxDialogueCompletedListener *listener)
Remove listener to be called when the dialogue has been completed.
Definition: colourdbox.cc:86
bool none() const
None colour was selected.
Definition: colourdbox.h:220
int WindowHandle
Type for WIMP windows handle.
Definition: handles.h:35
Event data for colour selected event.
Definition: colourdbox.h:201
ColourSelectedEvent(ColourDbox cbox, bool none, const unsigned char *block)
Construct a colour selected event from event data.
Definition: colourdbox.cc:130
virtual void colourdbox_dialogue_completed(ColourDbox colour_dbox, bool colour_selected)=0
Called when dialogue has be closed.
virtual void colour_selected(const ColourSelectedEvent &event)=0
Colour has been selected in ColourDbox nd OK is pressed.
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
unsigned char red() const
Red amount selected.
Definition: colourdbox.h:233
int int_property(int property_id) const
Return the value of a property that returns an integer.
Definition: object.cc:435
bool bool_property(int property_id) const
Get a boolean property from the toolbox Cobject.
Definition: object.cc:553
ColourDbox(const ColourDbox &other)
Construct a ColourDbox from another ColourDbox.
Definition: colourdbox.h:78
ColourDbox(const Object &other)
Construct a ColourDbox from an Object that refers to a ColourDbox.
Definition: colourdbox.h:89
ColourDbox()
Construct creates an unassigned ColourDbox.
Definition: colourdbox.h:69
void none_available(bool available)
Set if an option for no colour is included.
Definition: colourdbox.h:165
Event listener for colour selected event.
Definition: colourdbox.h:243
ObjectId handle() const
Return the underlying toolbox object id this object references.
Definition: object.h:93
ColourDbox & operator=(const ColourDbox &other)
Assign this ColourDbox from another.
Definition: colourdbox.h:114
unsigned char green() const
Green amount selected.
Definition: colourdbox.h:229
Class to show a toolbox ColourDbox object which allows a user to pick a colour using a variety of col...
Definition: colourdbox.h:59
WindowHandle wimp_handle() const
Return the underlying wimp window used by the ColourPicker module.
Definition: colourdbox.h:150
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
Base class for all toolbox event listeners.
Definition: listener.h:33
Object that can be shown at a specific position as well as its default place.
Definition: showpointobject.h:42
ColourSelectedEvent & operator=(const ColourSelectedEvent &other)
Make this object to another ColourSelectedEvent object.
Definition: colourdbox.cc:165
void remove_about_to_be_shown_listener(AboutToBeShownListener *listener)
Remove about to be shown listener.
Definition: colourdbox.cc:58
int dialog_handle() const
Return the underlying dialogue handle used by the ColourPicker module.
Definition: colourdbox.h:155
void add_colour_selected_listener(ColourSelectedListener *listener)
Add listener to report colour select when dialog is finished with OK.
Definition: colourdbox.cc:108
Class to manipulate a toolbox object.
Definition: object.h:50
Class for ColourDbox object template.
Definition: rescolourdbox.h:36
ColourDbox colour_dbox() const
Return colour dbox that generated this event.
Definition: colourdbox.h:215
bool operator==(const Object &other) const
Check if this ColourDbox refers to the same underlying toolbox object as another. ...
Definition: colourdbox.h:136