#include <Draggable.h>
Inherits Graphic, and MouseListener.

Public Member Functions | |
| Draggable () | |
| Draggable (int normalType, int hoverType, int clickType, int dragType, Point startLocation, Point size) | |
| Creates a new draggable button with the images at the start location and with the size given. | |
| Draggable (int normalType, int hoverType, int clickType, int dragType, Point startLocation, Point size, PriorityEnum priority) | |
| virtual | ~Draggable () |
| Deletes the button and the clickListenrs attached to it. | |
| void | draw (BITMAP *canvas, Point offset) |
| Draws the button. | |
| void | mouseClick (MouseEvent *) |
| Changes the image on mouse click. | |
| void | mouseDrag (MouseEvent *) |
| Moves the image when dragged. | |
| void | mouseRelease (MouseEvent *) |
| Notifies the clickListeners when the mouse is released on top of the button. | |
| void | mouseHover (MouseEvent *) |
| Changes the image when the mouse is hovered over. | |
| void | mouseExit (MouseEvent *) |
| Returns the image to normal when the mouse leaves the area of the button. | |
| void | addClickListener (ClickListener *l) |
| Adds a clickListener to the button. | |
| void | setImage (int type) |
| Changes the image to the new type given. | |
| Point | getOffset () |
| Returns the offset between the cursor position and the draggable position. | |
| void | setCenterDrag (bool center) |
| Sets center-dragging. | |
| bool | containsPoint (Point p) |
| PriorityEnum | priority () |
Protected Attributes | |
| int | normalType |
| int | hoverType |
| int | clickType |
| int | dragType |
| The images for the button. | |
| PriorityEnum | draggablePriority |
| Point | size |
| Point | curLocation |
| Location and size of the button. | |
| BITMAP * | currentImage |
| The current image of the button. | |
| int | currentType |
| bool | dragging |
| std::list< ClickListener * > * | clickListeners |
| Point | dragOffset |
| bool | centerDrag |
| Whether the image should be centered around the cursor. | |
| Draggable::Draggable | ( | ) |
| Draggable::Draggable | ( | int | normalType, | |
| int | hoverType, | |||
| int | clickType, | |||
| int | dragType, | |||
| Point | startLocation, | |||
| Point | size | |||
| ) |
Creates a new draggable button with the images at the start location and with the size given.
Initializes the button, setting the image types and the location and size of the buttons
| Draggable::Draggable | ( | int | normalType, | |
| int | hoverType, | |||
| int | clickType, | |||
| int | dragType, | |||
| Point | startLocation, | |||
| Point | size, | |||
| PriorityEnum | priority | |||
| ) |
| Draggable::~Draggable | ( | ) | [virtual] |
Deletes the button and the clickListenrs attached to it.
| void Draggable::addClickListener | ( | ClickListener * | l | ) |
Adds a clickListener to the button.
| bool Draggable::containsPoint | ( | Point | p | ) | [virtual] |
Reimplemented from MouseListener.
| void Draggable::draw | ( | BITMAP * | canvas, | |
| Point | offset | |||
| ) | [virtual] |
| Point Draggable::getOffset | ( | ) |
Returns the offset between the cursor position and the draggable position.
| void Draggable::mouseClick | ( | MouseEvent * | e | ) | [virtual] |
| void Draggable::mouseDrag | ( | MouseEvent * | e | ) | [virtual] |
| void Draggable::mouseExit | ( | MouseEvent * | ) | [virtual] |
Returns the image to normal when the mouse leaves the area of the button.
Reimplemented from MouseListener.
| void Draggable::mouseHover | ( | MouseEvent * | ) | [virtual] |
| void Draggable::mouseRelease | ( | MouseEvent * | e | ) | [virtual] |
Notifies the clickListeners when the mouse is released on top of the button.
Reimplemented from MouseListener.
| PriorityEnum Draggable::priority | ( | ) | [virtual] |
Reimplemented from MouseListener.
| void Draggable::setCenterDrag | ( | bool | center | ) |
Sets center-dragging.
| void Draggable::setImage | ( | int | type | ) |
Changes the image to the new type given.
bool Draggable::centerDrag [protected] |
Whether the image should be centered around the cursor.
std::list<ClickListener*>* Draggable::clickListeners [protected] |
int Draggable::clickType [protected] |
Point Draggable::curLocation [protected] |
Location and size of the button.
BITMAP* Draggable::currentImage [protected] |
The current image of the button.
int Draggable::currentType [protected] |
PriorityEnum Draggable::draggablePriority [protected] |
bool Draggable::dragging [protected] |
Point Draggable::dragOffset [protected] |
int Draggable::dragType [protected] |
The images for the button.
int Draggable::hoverType [protected] |
int Draggable::normalType [protected] |
Point Draggable::size [protected] |
1.5.7.1