33 #ifndef TBX_DRAGABLE_H_
34 #define TBX_DRAGABLE_H_
37 #include "mouseclicklistener.h"
42 class DragStartedListener;
43 class DragEndedListener;
52 enum {TOOLBOX_CLASS = 640};
Draggable()
Construct an uninitialised draggable.
Definition: draggable.h:54
Class to store and fetch information about the WIMP mouse pointer.
Definition: pointerinfo.h:43
bool bool_property(int property_id) const
Get a boolean property from the toolbox Component.
Definition: component.cc:214
Draggable & operator=(const Component &other)
Assign a draggable to refer to the same underlying toolbox component as an existing Gadget...
Definition: draggable.h:109
int sprite_length() const
Return length of sprite name.
Definition: draggable.h:138
void remove_drag_ended_listener(DragEndedListener *listener)
Remove listener for end of drag.
Definition: draggable.cc:80
void remove_drag_started_listener(DragStartedListener *listener)
Remove listener for start of drag.
Definition: draggable.cc:58
void sprite(std::string name)
Set name of sprite.
Definition: draggable.h:128
This is the base class for all Gadgets.
Definition: gadget.h:48
std::string sprite() const
Get name of sprite.
Definition: draggable.h:133
PointerInfo where() const
Return drag information as PointerInfo class.
Definition: draggable.cc:102
PollBlock & _data
raw data from the event
Definition: eventinfo.h:53
Structure holding the raw data from a call to Wimp_Poll.
Definition: pollinfo.h:71
Listener for DragStarted events.
Definition: draggable.h:214
int ComponentId
Type for underlying toolbox component id.
Definition: handles.h:33
Listener for DragStarted events.
Definition: draggable.h:297
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
virtual void drag_started(const DragStartedEvent &drag_started_event)=0
Function called when the drag is started from the draggable.
DragStartedEvent(IdBlock &id_block, PollBlock &data)
Construct a drag started event from the information returned for the toolbox.
Definition: draggable.h:187
int string_property_length(int property_id) const
Get a the length of a string property from the toolbox object.
Definition: component.cc:302
int WindowHandle
Type for WIMP windows handle.
Definition: handles.h:35
bool selected() const
Get selected state of draggable.
Definition: draggable.h:163
void add_drag_ended_listener(DragEndedListener *listener)
Add listener for end of drag.
Definition: draggable.cc:72
bool control() const
return true if control is held down
Definition: draggable.h:207
ComponentId id() const
Get the component ID of this component.
Definition: component.h:103
Base class for components in an object.
Definition: component.h:42
Component component() const
Return toolbox component at end of drag if toolbox_ids is true.
Definition: draggable.h:266
Event information for Drag started event.
Definition: draggable.h:177
unsigned int ObjectId
Type for underlying toolbox object id.
Definition: handles.h:31
void remove_mouse_click_listener(MouseClickListener *listener)
Remove listener for mouse click on the button.
Definition: draggable.cc:96
void add_drag_started_listener(DragStartedListener *listener)
Add listener for start of drag.
Definition: draggable.cc:50
bool operator==(const Gadget &other) const
Check if this draggable refers to the same underlying toolbox gadget as another gadget.
Definition: draggable.h:116
Listener for mouse clicks on a Window.
Definition: mouseclicklistener.h:129
std::string string_property(int property_id) const
Get a string property from the toolbox object.
Definition: component.cc:261
Draggable(const Gadget &other)
Construct a draggable from another gadget.
Definition: draggable.h:78
DragEndedEvent(IdBlock &id_block, PollBlock &data)
Construct the event from the information returned by the toolbox.
Definition: draggable.h:245
int IconHandle
Type for WIMP icon handle.
Definition: handles.h:37
Object object() const
Returns toolbox object at end of drag if toolbox_ids is true.
Definition: draggable.h:259
void selected(bool value)
Set selected state of draggable.
Definition: draggable.h:158
int y() const
y coordinate of drag finish
Definition: draggable.h:286
The Window object represents a toolbox window.
Definition: window.h:69
Class to provide information on a toolbox event.
Definition: eventinfo.h:48
bool toolbox_ids() const
Returns true if toolbox ids are returned at end of drag.
Definition: draggable.h:252
Base class for all toolbox event listeners.
Definition: listener.h:33
bool select() const
return true if select is held down
Definition: draggable.h:198
A Draggable is a gadget that shows.
Definition: draggable.h:49
int word[64]
Array containing information return from Wimp_Poll.
Definition: pollinfo.h:76
Event information for Drag ended event.
Definition: draggable.h:236
IconHandle icon_handle() const
Return WIMP icon handle if toolbox_ids is false.
Definition: draggable.h:276
bool shift() const
return true if shift is held down
Definition: draggable.h:203
int x() const
x coordinate of drag finish
Definition: draggable.h:281
void text(std::string name)
Set text.
Definition: draggable.h:143
bool adjust() const
return true if adjust is held down
Definition: draggable.h:193
Draggable(const Draggable &other)
Construct a draggable from another draggable.
Definition: draggable.h:67
ObjectId _handle
Underlying toolbox handle.
Definition: component.h:45
const IdBlock & id_block() const
IdBlock for the current event.
Definition: eventinfo.h:71
~Draggable()
Destroy a draggable gadget.
Definition: draggable.h:60
Draggable & operator=(const Gadget &other)
Assign a draggable to refer to the same underlying toolbox gadget as an existing Gadget.
Definition: draggable.h:100
Information passed back by the Toolbox with each toolbox event providing information on where the eve...
Definition: pollinfo.h:41
int text_length() const
Return length of text.
Definition: draggable.h:153
int _id
Underlying toolbox component id.
Definition: component.h:46
Class to manipulate a toolbox object.
Definition: object.h:50
void add_mouse_click_listener(MouseClickListener *listener)
Add listener for mouse click on the button.
Definition: draggable.cc:88
ObjectId handle() const
Return the object handle for his component.
Definition: component.h:95
Draggable & operator=(const Draggable &other)
Assign a draggable to refer to the same underlying toolbox gadget as another.
Definition: draggable.h:92
virtual void drag_ended(const DragEndedEvent &drag_ended_event)=0
Method called when the drag has finished.
WindowHandle window_handle() const
Returns WIMP Window handle if toolbox_ids if false.
Definition: draggable.h:271
std::string text() const
Get text.
Definition: draggable.h:148
bool operator!=(const Gadget &other) const
Check if this draggable refers to the same underlying toolbox gadget as another gadget.
Definition: draggable.h:123
Draggable(const Component &other)
Construct a draggable from a component.
Definition: draggable.h:86