#include <edit.h>


Public Member Functions | |
| a2dObjectEditTool (a2dStToolContr *controller, int editmode=1, bool SingleClickToEnd=true) | |
| constructor | |
| a2dObjectEditTool (a2dStToolContr *controller, a2dIterC &ic, int editmode=1, bool SingleClickToEnd=true) | |
| constructor | |
| ~a2dObjectEditTool () | |
| destuctor | |
| bool | SetContext (a2dIterC &ic, a2dCanvasObject *startObject) |
| start editing object within the given iteration context its coordinate system | |
| void | StartToEdit (a2dCanvasObject *startObject) |
| start editing this object | |
| bool | ReStartEdit (wxUint16 editmode) |
| restart editing (after undo event or when changing editing mode ) | |
| virtual void | TriggerReStartEdit (wxUint16 editmode) |
| trigger restart editing (after undo event or when changing editing mode ) | |
| bool | ZoomSave () |
| save to zoom | |
| void | SetMode (int mode) |
| set editing mode to start editing objects | |
| void | SetActive (bool active) |
| used extarnal by controller to activate or deactivate this tool. | |
| void | SetSingleClickToEnd (bool SingleClickToEnd) |
| a single non hit Left Down click is enough to end editing of an object. | |
| void | SetDisableOtherViews (bool disableOtherViews) |
| when set true, other views on the document are disabled when editing a object. | |
| void | Render () |
| implement rendering | |
Static Public Attributes | |
| static const a2dCommandId | COMID_PushTool_ObjectEdit |
| push this tool on the tools stack | |
| static const wxEventType | sm_toolStartEditObject |
| when starting editing an object, this event is sent to tool | |
Protected Member Functions | |
| void | DoStopTool (bool abort) |
| To stop this tools from inside or from the outside, sets m_stop = true. | |
| void | OnUndoEvent (a2dCommandProcessorEvent &event) |
| handler for Undo event | |
| void | OnRedoEvent (a2dCommandProcessorEvent &event) |
| void | OnKeyDown (wxKeyEvent &event) |
| called on key down events | |
| void | OnKeyUp (wxKeyEvent &event) |
| called on key up events | |
| void | OnChar (wxKeyEvent &event) |
| called on key events | |
| virtual void | AdjustRenderOptions () |
| Adjust the rendering options to the needs of this tool. | |
| virtual bool | EnterBusyMode () |
| starts a new action (e.g drawing something ) in a tool that is already pushed. | |
| virtual void | FinishBusyMode () |
| virtual void | AbortBusyMode () |
| Called when the user aborts editing a distinct object */. | |
| void | SetEditObject (a2dCanvasObject *objectToEdit) |
| send an event with id sm_toolComEventSetEditObject to this tool. | |
| bool | RedirectToEditObject (wxMouseEvent &event) |
| redirect event to editng object or to a captured object ( handle or object itself. ) | |
| virtual bool | CreateToolObjects () |
| start editing at m_canvasobject | |
| virtual void | CleanupToolObjects () |
| stop editing of m_canvasobject if busy editing | |
| void | OnIdle (wxIdleEvent &event) |
| handler for idle events | |
| void | OnComEvent (a2dComEvent &event) |
| called when a tool has changed (fill stroke layer spline ) | |
| void | OnMouseEvent (wxMouseEvent &event) |
| called on mouse events | |
| void | OnDoEvent (a2dCommandProcessorEvent &event) |
| handler for Do event | |
| virtual wxString | GetCommandGroupName () |
| return the command group name for commands of a derived class | |
Protected Attributes | |
| bool | m_preserve_select |
| preserve the a2dCANVAS_SELECT flag after editing. | |
| bool | m_SingleClickToEnd |
| a single non hit Left Down click is enough to end editing of an object. | |
| bool | m_disableOtherViews |
| bool | m_triggerRestart |
| a2dCanvasObjectList | m_connectedwirecopies |
| List of wires connected to the draged object. | |
The object its EditStart member is called, this generates a Clone of the object to be edited. And event processing is redirected to the Cloned object to edit it.
The cloned edit copy, issues commands to the command processor of the document, and this changes the original a2dCanvasObject that is being edited. This then changes to make it in sync with editing clone. Undo is possible because of this, but it is possible to not use commands and choose to directly modify the original object.
After editing is done a double click will call the EditEnd member of the a2dCanvasObject. In the end the Cloned editing object is Released.
If SetSingleClickToEnd() is set, a Left Down mouse event outside the object being edited, also stops editing of the current object, and if subediting it even ends this tool. This makes it easy to go to sublevel editing and back with just one click.
The object itself is in control of all editing facilities of that specific object. This might mean that other tools will be pushed on the tool stack, for editing of subobjects.
The EditStart member initializes the a2dCanvasObject for editing, but only if editing is allowed by it.
The editing Clone will have as children editing handles, which can be dragged in order to modify the object. Those handles depend on the object its editing implementation. Rendering of the Cloned editing object can be changed on the basis of the m_editingCopy flag if needed.
The default editing functionality of a2dCanvasObject, is just editing its local matrix.
The TAB charecter should be used to switch between this mode and the object specific editing mode.
Adding editing functionality to an object is implemented by intercepting events using a static event table. When the m_editingCopy is set, we know it is the cloned edit copy we are dealing with. The events in this case should be handled in such a manner that the edit clone and the original object will be modified. Hits on child objects of the editing clone ( e.g a2dHandle ), may generate new events for the editng clone object itself. a2dHandleMouseEvent is such an event. You can intercept this event in the parent event table like this EVT_CANVASHANDLE_MOUSE_EVENT( OnHandleEvent ). In the OnHandleEvent you can define what change a specific handle will have on the object that is edited.
Definition at line 73 of file edit.h.
| a2dObjectEditTool::a2dObjectEditTool | ( | a2dStToolContr * | controller, | |
| int | editmode = 1, |
|||
| bool | SingleClickToEnd = true | |||
| ) |
| a2dObjectEditTool::a2dObjectEditTool | ( | a2dStToolContr * | controller, | |
| a2dIterC & | ic, | |||
| int | editmode = 1, |
|||
| bool | SingleClickToEnd = true | |||
| ) |
| bool a2dObjectEditTool::SetContext | ( | a2dIterC & | ic, | |
| a2dCanvasObject * | startObject | |||
| ) |
start editing object within the given iteration context its coordinate system
Start editing the object within the coordinate system defined by ic (iterative context). Parent of startobject is defined in ic.
The ic is used to calculate the editworld matrix, meaning relative to what coordinates system the editing takes place. This becomes important when editing children of objects directly.
Reimplemented from a2dStTool.
| void a2dObjectEditTool::SetActive | ( | bool | active | ) | [virtual] |
used extarnal by controller to activate or deactivate this tool.
If deactivated this tool, m_halted is set true.
Reimplemented from a2dStTool.
Reimplemented in a2dMultiEditTool.
| void a2dObjectEditTool::SetSingleClickToEnd | ( | bool | SingleClickToEnd | ) | [inline] |
| void a2dObjectEditTool::SetDisableOtherViews | ( | bool | disableOtherViews | ) | [inline] |
| void a2dObjectEditTool::Render | ( | ) | [virtual] |
| void a2dObjectEditTool::DoStopTool | ( | bool | abort | ) | [protected, virtual] |
To stop this tools from inside or from the outside, sets m_stop = true.
The a2dStToolContr will test this with GetStopTool()
Reimplemented from a2dBaseTool.
Reimplemented in a2dMultiEditTool.
| bool a2dObjectEditTool::EnterBusyMode | ( | ) | [protected, virtual] |
starts a new action (e.g drawing something ) in a tool that is already pushed.
Opens a new a2dCommandGroup, which will be closed at the end of an action. This is normally in FinishBusyMode(), but might be delayed when other tools are pushed, like the edit tool to further edit the drawn figure. This should become part of the same command group.
Reimplemented from a2dStTool.
| void a2dObjectEditTool::AbortBusyMode | ( | ) | [protected, virtual] |
Called when the user aborts editing a distinct object */.
Reimplemented from a2dStTool.
| void a2dObjectEditTool::SetEditObject | ( | a2dCanvasObject * | objectToEdit | ) | [protected] |
| bool a2dObjectEditTool::RedirectToEditObject | ( | wxMouseEvent & | event | ) | [protected] |
redirect event to editng object or to a captured object ( handle or object itself. )
return if event is processed or not.
Reimplemented in a2dMultiEditTool.
| bool a2dObjectEditTool::CreateToolObjects | ( | ) | [protected, virtual] |
| virtual wxString a2dObjectEditTool::GetCommandGroupName | ( | ) | [inline, protected, virtual] |
return the command group name for commands of a derived class
this defaults to the class name
Reimplemented from a2dBaseTool.
Reimplemented in a2dRecursiveEditTool.