Antares Simulator
Power System Simulator
|
Visual component to make an action on the selected items. More...
#include <tool.h>
Public Member Functions | |
Constructor & Destructor | |
Tool (Manager &manager, const char *icon) | |
Constructor. | |
virtual | ~Tool () |
Destructor. | |
Manager | |
Manager & | manager () |
const Manager & | manager () const |
X-Coordinate | |
int | x () const |
Get the X-Coordinate of the tool. | |
void | x (const int v) |
Set the X-Coordinate of the tool. | |
Y-Coordinate | |
int | y () const |
Get the Y-Coordinate of the tool. | |
void | y (const int v) |
Set the Y-Coordinate of the tool. | |
Sizes | |
uint | width () const |
Get the width of the tool. | |
uint | height () const |
Get the height of the tool. | |
Icon | |
const wxBitmap * | icon () const |
Get the icon of the tool, NULL if not available. | |
void | icon (const char *filename) |
Set the icon representing the tool. | |
Life span | |
LifeSpan | lifeSpan () const |
Get the lifespan of the tool. | |
Drawing | |
Manager & | pManager |
The parent manager. | |
int | pX |
The X-Coordinate. | |
int | pY |
The Y-Coordinate. | |
int | pWidth |
Width. | |
int | pHeight |
Height. | |
wxBitmap * | pIcon |
Icon. | |
bool | contains (const int x, const int y) const |
Get if a point is insided the bounding box of the tool. | |
virtual void | draw (DrawingContext &dc, const bool mouseDown, const wxPoint &position, const wxPoint &absolute) const |
Draw the tool. | |
virtual bool | actionIsImmediate () const |
Get if the action triggered by the tool is immediate. | |
virtual bool | onMouseUp (const int mx, const int my)=0 |
Event: The user has clicked on the tool. | |
Visual component to make an action on the selected items.
Antares::Map::Tool::Tool::Tool | ( | Manager & | manager, |
const char * | icon ) |
Constructor.
manager | The parent manager |
icon | The icon representing this tool (16x16) |
|
inlinevirtual |
Get if the action triggered by the tool is immediate.
When the value is true, the action should be executed as soon as the user clicks on the tool. When equals to false, the action should be delayed until the next click.
Reimplemented in Antares::Map::Tool::ConnectionCreator.
|
inline |
Get if a point is insided the bounding box of the tool.
x | The X-Coordinate of the point |
y | The Y-Coordinate of the point |
|
virtual |
Draw the tool.
dc | A drawing context |
mouseDown | True if the mouse is down |
position | |
absolute |
Reimplemented in Antares::Map::Tool::ConnectionCreator, and Antares::Map::Tool::Remover.
void Antares::Map::Tool::Tool::icon | ( | const char * | filename | ) |
Set the icon representing the tool.
The given filename is a relative filename in the resources folder.
filename | A relative filename |
|
pure virtual |
Event: The user has clicked on the tool.
Implemented in Antares::Map::Tool::ConnectionCreator, and Antares::Map::Tool::Remover.