36 #include "valuechangedlistener.h"
42 class SliderValueChangedListener;
51 enum {TOOLBOX_CLASS = 576};
139 void get_bounds(
int &lower,
int &upper)
const;
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
A Slider is a gadget that shows bar in a well which may be draggable by the user.
Definition: slider.h:49
void add_value_changed_listener(SliderValueChangedListener *listener)
Add Listener for changes in the slider.
Definition: slider.cc:332
ObjectId handle() const
Return the object handle for his component.
Definition: component.h:95
Class to represent a standard desktop WIMP colour.
Definition: colour.h:147
const IdBlock & id_block() const
IdBlock for the current event.
Definition: eventinfo.h:71
The Window object represents a toolbox window.
Definition: window.h:70
int step_size() const
Get step size of slider.
Definition: slider.cc:178
Slider(const Component &other)
Construct a slider from a gadget.
Definition: slider.h:85
Slider(const Gadget &other)
Construct a slider from another gadget.
Definition: slider.h:77
PollBlock & _data
raw data from the event
Definition: eventinfo.h:53
int int_property(int property_id) const
Get an integer property from the toolbox Component.
Definition: component.cc:165
bool drag_in_progress() const
Check if the drag is in progress.
Definition: slider.h:192
int value() const
Get the value of the slider.
Definition: slider.h:134
void set_colour(WimpColour bar, WimpColour background)
Set colours for the bar and background of the slider.
Definition: slider.cc:196
Base class for components in an object.
Definition: component.h:42
Structure holding the raw data from a call to Wimp_Poll.
Definition: pollinfo.h:72
Slider & operator=(const Gadget &other)
Assign a slider to refer to the same underlying toolbox gadget as an existing Gadget.
Definition: slider.h:99
Slider(const Slider &other)
Construct a slider from another slider.
Definition: slider.h:66
virtual void slider_value_changed(const SliderValueChangedEvent &event)=0
Method called when the slider value has changed.
ObjectId _handle
Underlying toolbox handle.
Definition: component.h:45
Listener for changes in the slider value.
Definition: slider.h:205
ComponentId id() const
Get the component ID of this component.
Definition: component.h:103
void value(int value)
Set the value of the slider.
Definition: slider.h:128
void get_colour(WimpColour &bar, WimpColour &background)
Get colours for the bar and background of the slider.
Definition: slider.cc:214
Event details for a change of an integer value in a gadget.
Definition: valuechangedlistener.h:39
Information passed back by the Toolbox with each toolbox event providing information on where the eve...
Definition: pollinfo.h:42
Slider()
Construct an uninitialised slider.
Definition: slider.h:53
Slider & operator=(const Slider &other)
Assign a slider to refer to the same underlying toolbox gadget as another.
Definition: slider.h:91
void remove_value_changed_listener(SliderValueChangedListener *listener)
Remove Listener for changes in the slider.
Definition: slider.cc:341
WimpColour background_colour() const
Get the background colour of the slider.
Definition: slider.cc:295
int upper_bound() const
Get Upper bound of slider.
Definition: slider.cc:148
bool operator==(const Gadget &other) const
Check if this slider refers to the same underlying toolbox gadget as another gadget.
Definition: slider.h:115
~Slider()
Destroy a slider gadget.
Definition: slider.h:59
Base class for all toolbox event listeners.
Definition: listener.h:34
Listener for value changed events.
Definition: valuechangedlistener.h:62
WimpColour bar_colour() const
Get the bar colour of the slider.
Definition: slider.cc:255
Slider & operator=(const Component &other)
Assign a slider to refer to the same underlying toolbox component as an existing Gadget.
Definition: slider.h:108
Information on event generated when the value of the slider has been changed.
Definition: slider.h:168
SliderValueChangedEvent(IdBlock &id_block, PollBlock &data)
Construct the event from Toolbox and WIMP event data.
Definition: slider.h:176
int _id
Underlying toolbox component id.
Definition: component.h:46
int lower_bound() const
Get Lower bound of slider.
Definition: slider.cc:119
This is the base class for all Gadgets.
Definition: gadget.h:49
int word[64]
Array containing information return from Wimp_Poll.
Definition: pollinfo.h:76
void set_bounds(int lower, int upper, int step_size)
Set all three bounds at once.
Definition: slider.cc:42
void check_toolbox_class(int class_id) const
Check the underlying gadget class for this object has the given class id.
Definition: gadget.cc:47
bool drag_start_or_click() const
Check if value was changed by a click or start of dragging of the bar.
Definition: slider.h:186
bool drag_ended() const
Check if this is the end of a drag.
Definition: slider.h:198
bool operator!=(const Gadget &other) const
Check if this slider refers to the same underlying toolbox gadget as another gadget.
Definition: slider.h:122
void get_bounds(int &lower, int &upper, int &step_size) const
Get all three bounds at once.
Definition: slider.cc:58