OpenASIP
2.0
|
#include <MachineCanvasTool.hh>
Public Member Functions | |
virtual | ~MachineCanvasTool () |
virtual void | activate ()=0 |
virtual void | deactivate ()=0 |
virtual void | onMouseEvent (wxMouseEvent &event, wxDC &dc)=0 |
virtual Figure * | figure () |
Protected Member Functions | |
MachineCanvasTool (MachineCanvas *canvas) | |
Protected Attributes | |
MachineCanvas * | canvas_ |
Machine canvas where the tool is used. More... | |
Base class for the mouse tools used on the MachineCanvas.
MachineCanvas and MachineCanvasTool follow the 'state' -design pattern. MachineCanvas has always an active tool, which handles the mouse events on the canvas, such as mouse button clicks. The actual tools handling the mouse events are subclasses of this interface class.
Definition at line 49 of file MachineCanvasTool.hh.
|
virtual |
|
protected |
The Constructor.
canvas | MachineCanvas where the tool is used. |
Definition at line 41 of file MachineCanvasTool.cc.
|
pure virtual |
Activate the tool.
Implemented in ConnectTool, SelectTool, and ProximMachineCanvasTool.
Referenced by BridgeDialog::onCancel(), BridgeDialog::onOK(), and MachineCanvas::setTool().
|
pure virtual |
Deactivate the tool.
Implemented in ConnectTool, SelectTool, and ProximMachineCanvasTool.
Referenced by BridgeDialog::BridgeDialog(), and MachineCanvas::setTool().
|
virtual |
Returns figure of the tool, or NULL if the tool has no figure.
Reimplemented in ConnectTool, and SelectTool.
Definition at line 59 of file MachineCanvasTool.cc.
Referenced by MachineCanvas::OnDraw(), and MachineCanvas::refreshToolFigure().
|
pure virtual |
Handle the mouse events of the canvas in a tool-specific way.
event | Mouse event to handle. |
dc | Device context. |
Implemented in ConnectTool, SelectTool, and ProximMachineCanvasTool.
Referenced by MachineCanvas::onMouseEvent().
|
protected |
Machine canvas where the tool is used.
Definition at line 77 of file MachineCanvasTool.hh.
Referenced by ConnectTool::activate(), ConnectTool::deactivate(), ConnectTool::figure(), ConnectTool::leftClick(), SelectTool::leftClick(), SelectTool::onMouseEvent(), and ConnectTool::onMouseEvent().