#include <sttool.h>


Public Member Functions | |
| a2dStToolContr (a2dCanvasView *view, wxFrame *where) | |
| Constructor. | |
| ~a2dStToolContr () | |
| destructor | |
| virtual void | ReStart () |
| sets the m_toptool (if set ) as first tool. | |
| wxMenu * | GetMousePopupMenu () |
| to get the current mouse menu of the controller | |
| void | SetMousePopupMenu (wxMenu *mousemenu) |
| to set the current mouse menu of the controller | |
| bool | PushTool (a2dBaseTool *tool) |
| specialize to keep first tool on the stack active | |
| virtual bool | PopTool (a2dSmrtPtr< a2dBaseTool > &poped, bool force=true) |
| specialize to keep m_topTool tool active | |
| void | SetZoomoutCentered (bool center) |
| if true a zoomout is centered to the view. | |
| bool | GetZoomoutCentered () |
| see SetZoomoutCentered() | |
| void | SetZoomFirst (bool zoomfirst) |
| first tool on the tool stack is the zoom tool. | |
| void | SetTopTool (a2dBaseTool *toolOnTop) |
| when all tools are poped, this tool will be pushed. | |
| void | SetZoomTool (a2dBaseTool *toolForZoom) |
| for zooming purposes this tool wil be used | |
| void | SetShowMouse (bool showmouse) |
| if true, show mouse position in the ShowMouse function | |
| void | SetDragMode (DRAGMODE mode) |
| drag mode used in drag tool (if used) | |
| DRAGMODE | GetDragMode () |
| Returns drag mode. | |
| void | SetDrawMode (a2dDrawStyle drawstyle) |
| a2dDrawStyle | GetDrawMode () |
| void | SetDefaultBehavior (unsigned int behavior) |
| Control the default behavior. | |
| unsigned int | GetDefaultBehavior () |
| void | Undo (wxCommandEvent &) |
| redirect to command processor of document | |
| void | Redo (wxCommandEvent &) |
| redirect to command processor of document | |
| void | EndTool (wxCommandEvent &) |
| End the current active tool if not busy. | |
| void | EditProperties (wxCommandEvent &) |
| default implementation for property editing | |
| void | OnSetmenuStrings (a2dCommandProcessorEvent &event) |
| how to set mouse menu undo/redo | |
| void | ZoomWindow () |
| start one shot zoomtool from popup menu (used while another tool is active) | |
| void | ZoomPan () |
| zoompan from popup menu (used while another tool is active) | |
| void | ZoomUndo () |
| go to previous zoom area (used while another tool is active) | |
| void | Zoomout () |
| show all on canvas | |
| void | Zoomout2 () |
| zoom out two times the current visible area | |
| void | Zoomin2 () |
| zoom in two half the current visible area | |
| void | Zoom (double x, double y, double uppx, double uppy) |
| void | ZoomOut2AtMouse () |
| zoom out two times the current visible area at mouse position | |
| void | ZoomIn2AtMouse () |
| zoom in two half the current visible area at mouse position | |
| wxZoomList & | GetZoomList () |
| Get zoom stack list, that is use to store zooming areas. | |
| virtual void | ShowMouse () |
| function called at mouse events, the default displays cursor in statusbar. | |
| wxPoint | GetMousePosition () |
| return mouse position in device coordinates | |
| wxFrame * | GetFrame () |
| what frame has the statusbar | |
| virtual bool | StartEditingObject (a2dCanvasObject *objectToEdit) |
| start editing this object | |
| virtual bool | StartEditingObject (a2dCanvasObject *objectToEdit, a2dIterC &ic) |
| start editing this object | |
| bool | TriggerReStartEdit (wxUint16 editmode) |
| when edit tool is firsttool, restart it. | |
| void | SetOpacityFactorEditcopy (wxUint8 editOpacity) |
| when enabling m_useEditOpaque, this is how transparent the editcopy will be made. | |
| wxUint8 | GetOpacityFactorEditcopy () |
| see SetOpacityFactorEditcopy() | |
| void | SetUseOpaqueEditcopy (bool editOpaque) |
| When set true, instead of using a special style for editcopies, a clone of the. | |
| bool | GetUseOpaqueEditcopy () |
| see SetUseOpaqueEditcopy() | |
Static Public Attributes | |
| static const a2dPropertyIdBool | PROPID_zoomfirst |
| static const wxEventType | sm_showCursor |
Protected Member Functions | |
| void | ZoomWindowMenu (wxCommandEvent &) |
| start one shot zoomtool from popup menu (used while another tool is active) | |
| void | ZoomPanMenu (wxCommandEvent &) |
| zoompan from popup menu (used while another tool is active) | |
| void | ZoomUndoMenu (wxCommandEvent &) |
| go to previous zoom area (used while another tool is active) | |
| void | ZoomoutMenu (wxCommandEvent &) |
| show all on canvas | |
| void | Zoomout2Menu (wxCommandEvent &) |
| zoom out two times the current visible area | |
| void | Zoomin2Menu (wxCommandEvent &) |
| zoom in two half the current visible area | |
| void | OnComEvent (a2dComEvent &event) |
| handler for this event | |
| void | OnMouseEvent (wxMouseEvent &event) |
| called on mouse events | |
| void | OnChar (wxKeyEvent &event) |
| called on key events | |
| void | OnKeyDown (wxKeyEvent &event) |
| called on keydown events | |
| void | OnKeyUp (wxKeyEvent &event) |
| called on keyup events | |
Protected Attributes | |
| bool | m_show_mousepos |
| if true, show mouse position in the ShowMouse function | |
| wxFrame * | m_where |
| statusbar frame | |
| wxZoomList | m_zoomstack |
| zoom stack containing previous zooms | |
| wxMenu * | m_mousemenu |
| popup menu | |
| int | m_mouse_x |
| mouse position | |
| int | m_mouse_y |
| mouse position | |
| bool | m_zoomoutCentered |
| when true zoom out and center to middle of the view | |
| DRAGMODE | m_dragmode |
| manner to drag | |
| a2dDrawStyle | m_drawmode |
| manner to draw | |
| unsigned int | m_defaultBehavior |
| control the default behavior | |
| a2dSmrtPtr< a2dBaseTool > | m_topTool |
| tool always on top of the stack, or non if NULL | |
| a2dSmrtPtr< a2dBaseTool > | m_toolForZoom |
| tool used for zooming | |
| wxUint8 | m_editOpacityFactor |
| when using cloned style for editcopy, use this opacity. | |
| bool | m_useEditOpaque |
| when true editcopies are using a half transparent cloned style. | |
It maintains tools that allows zooming while drawing is in progress. It has a stack of tools, some tools remain on the stack, while other or pushed and poped from it. A tool to show the cursor is a tool that is always on the stack and active, a tool to draw something is only on the stack as long the user wants. Zooming while drawing something is done by temporarily pushing a zoomtool to the stack. When the zoom as done, the tools is removed again. You can develop new tools by deriving new tools from a2dStTool.
Definition at line 437 of file sttool.h.
| a2dStToolContr::a2dStToolContr | ( | a2dCanvasView * | view, | |
| wxFrame * | where | |||
| ) |
Constructor.
| view | a2dCanvasView where the controller takes events from | |
| where | wxFrame to display statusbar text in. |
Definition at line 136 of file sttool.cpp.
| wxMenu* a2dStToolContr::GetMousePopupMenu | ( | ) | [inline] |
| void a2dStToolContr::SetMousePopupMenu | ( | wxMenu * | mousemenu | ) |
to set the current mouse menu of the controller
NULL sets the menu to non.
Definition at line 201 of file sttool.cpp.
| bool a2dStToolContr::PushTool | ( | a2dBaseTool * | tool | ) | [virtual] |
specialize to keep first tool on the stack active
| tool | The tools to push, also checks if it is a a2dStTool derived tools, else an assert. |
Reimplemented from a2dToolContr.
Definition at line 414 of file sttool.cpp.
| bool a2dStToolContr::PopTool | ( | a2dSmrtPtr< a2dBaseTool > & | poped, | |
| bool | force = true | |||
| ) | [virtual] |
specialize to keep m_topTool tool active
It the new first tool was already stopped for some reason, this tool will also be poped, this continues recursive until a tool is found which does not want to be stopped.
Reimplemented from a2dToolContr.
Definition at line 423 of file sttool.cpp.
| void a2dStToolContr::SetZoomFirst | ( | bool | zoomfirst | ) |
first tool on the tool stack is the zoom tool.
This is the same as SetTopTool( new a2dZoomTool( MyController ) )
Definition at line 256 of file sttool.cpp.
| void a2dStToolContr::SetTopTool | ( | a2dBaseTool * | toolOnTop | ) |
when all tools are poped, this tool will be pushed.
The effect is that this tool always stays on top of the stack. This call also makes this the top tool right now.
| toolOnTop | pointer to a tool you want to habve on top, NULL if non. |
Definition at line 265 of file sttool.cpp.
| void a2dStToolContr::SetZoomTool | ( | a2dBaseTool * | toolForZoom | ) |
for zooming purposes this tool wil be used
This only sets for future use.
| toolForZoom | pointer to a tool you want to use for zooming |
Definition at line 272 of file sttool.cpp.
| void a2dStToolContr::SetShowMouse | ( | bool | showmouse | ) | [inline] |
| void a2dStToolContr::SetDragMode | ( | DRAGMODE | mode | ) | [inline] |
| DRAGMODE a2dStToolContr::GetDragMode | ( | ) | [inline] |
| void a2dStToolContr::SetDefaultBehavior | ( | unsigned int | behavior | ) | [inline] |
| void a2dStToolContr::ShowMouse | ( | ) | [virtual] |
function called at mouse events, the default displays cursor in statusbar.
Override in a derived class to change behaviour.
Definition at line 664 of file sttool.cpp.
| void a2dStToolContr::SetOpacityFactorEditcopy | ( | wxUint8 | editOpacity | ) | [inline] |
| void a2dStToolContr::SetUseOpaqueEditcopy | ( | bool | editOpaque | ) | [inline] |
When set true, instead of using a special style for editcopies, a clone of the.
fill and stroke of the original are made, and used for the editcopy, but its transparancy is set using m_editOpacityFactor. The effect is that when dragging such an object, that in the editcopy mode, a half transparent object is shown.