![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
Edit Interaction Mode
Public Member Functions | |
TSLInteractionModeEdit (int modeID, TSLInteractionModeEditRequest *req, const char *iniFileName, const char *iniFileSection="editor", bool middleButtonPansToPoint=true) | |
TSLInteractionModeEdit (int modeID, TSLInteractionModeEditRequest *req, TSLWinContextHandler *context, const char *iniFileName, const char *iniFileSection="editor", bool middleButtonPansToPoint=true) | |
TSLInteractionModeEdit (int modeID, TSLEditor *edt, bool middleButtonPansToPoint=true) | |
~TSLInteractionModeEdit () | |
virtual void | activate () |
void | allowEditing (bool flag) |
virtual void | deactivate () |
bool | displayPrompt (const char *msg) |
TSLEditor * | editor () |
virtual void | onDraw (TSLDeviceUnits x1, TSLDeviceUnits y1, TSLDeviceUnits x2, TSLDeviceUnits y2) |
virtual bool | onLButtonDown (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control) |
virtual bool | onLButtonUp (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control) |
virtual bool | onMButtonDown (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control) |
virtual bool | onMButtonUp (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control) |
virtual bool | onMouseMove (TSLButtonType button, TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control) |
virtual bool | onRButtonDown (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control) |
virtual bool | onRButtonUp (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control) |
virtual TSLCursorStyle | queryCursor () |
virtual const char * | queryPrompt () |
bool | setCursor (TSLCursorStyle style) |
void | setDisplay (TSLInteractionModeDisplay *display) |
![]() | |
virtual | ~TSLInteractionMode () |
virtual bool | onMouseWheel (short delta, TSLDeviceUnits x, TSLDeviceUnits y, int zoomPercentage, bool lockCursorLocation) |
virtual bool | onGestureZoom (TSLDeviceUnits cx, TSLDeviceUnits cy, double zoomFactor) |
virtual bool | onGesturePan (TSLDeviceUnits startx, TSLDeviceUnits starty, TSLDeviceUnits endx, TSLDeviceUnits endy) |
virtual bool | onGestureRotate (TSLDeviceUnits cx, TSLDeviceUnits cy, double dblAngle) |
virtual bool | onGestureTap (TSLDeviceUnits x, TSLDeviceUnits y) |
virtual bool | onGesturePressAndTap (TSLDeviceUnits firstFingerX, TSLDeviceUnits firstFingerY, long lDelta) |
virtual bool | onGestureTwoFingerTap (TSLDeviceUnits cx, TSLDeviceUnits cy) |
virtual void | onSize (TSLDeviceUnits cx, TSLDeviceUnits cy) |
int | id () |
Additional Inherited Members | |
![]() | |
TSLInteractionMode (int modeID, bool middleButtonPansToPoint=true) | |
![]() | |
int | m_id |
TSLDrawingSurface * | m_drawingSurface |
bool | m_middleButtonPansToPoint |
TSLInteractionModeDisplay * | m_display |
TSLInteractionModeEdit::TSLInteractionModeEdit | ( | int | modeID, |
TSLInteractionModeEditRequest * | req, | ||
const char * | iniFileName, | ||
const char * | iniFileSection = "editor", | ||
bool | middleButtonPansToPoint = true ) |
This constructor for the Edit Interaction Mode should be used when the application wants the Interaction Mode to create the TSLEditor instance and initialise it. All standard operations will be added. Custom operations and Spatial operations may be added by the application - query the TSLEditor instance from the Interaction Mode.
A custom version of the TSLEditorRequest will be created and used to intercept the setCursor and setPrompt methods for use by the Interaction Mode - all other requests will be passed to the applications Editor Request object which is specified.
modeID | This ID is not used by the mode itself, but is used as a unique identified by the mode manager. |
req | Application Request Handler - used for all requests except for set Cursor and setPrompt. |
iniFileName : Name of .ini file to be passed to the TSLEditor::initialise method.
iniFileSection | Default 'editor'. name of the .ini file section to be passed to the TSLEditor::initialise method. |
middleButtonPansToPoint. Default true. This flag allows modes to easily provide standard behaviour for pressing of the middle button - typically the mouse wheel.
TSLInteractionModeEdit::TSLInteractionModeEdit | ( | int | modeID, |
TSLInteractionModeEditRequest * | req, | ||
TSLWinContextHandler * | context, | ||
const char * | iniFileName, | ||
const char * | iniFileSection = "editor", | ||
bool | middleButtonPansToPoint = true ) |
This constructor for the Edit Interaction Mode should be used when the application wants the Interaction Mode to create the TSLEditor instance and initialise it. All standard and all Windows operations will be added - with the context menu handler being passed to the Windows select operation. Custom operations and Spatial operations may be added by the application - query the TSLEditor instance from the Interaction Mode.
A custom version of the TSLEditorRequest will be created and used to intercept the setCursor and setPrompt methods for use by the Interaction Mode - all other requests will be passed to the applications Editor Request object which is specified.
modeID | This ID is not used by the mode itself, but is used as a unique identified by the mode manager. |
req | Application Request Handler - used for all requests except for set Cursor and setPrompt. |
context | Context handler for the winselect operation - pass 0 if not required. |
iniFileName : Name of .ini file to be passed to the TSLEditor::initialise method.
iniFileSection | Default 'editor'. name of the .ini file section to be passed to the TSLEditor::initialise method. |
middleButtonPansToPoint. Default true. This flag allows modes to easily provide standard behaviour for pressing of the middle button - typically the mouse wheel.
TSLInteractionModeEdit::TSLInteractionModeEdit | ( | int | modeID, |
TSLEditor * | edt, | ||
bool | middleButtonPansToPoint = true ) |
This constructor for the Edit Interaction Mode should be used when the application has created the TSLEditor instance externally. It assumes that all operations have been added to editor and that it has been initialised already.
Another assumption is that the 'setCursor' and 'setPrompt' are used by the applications Editor Request handler to set the value that the Interaction Mode should return from queryCursor and queryPrompt.
modeID | This ID is not used by the mode itself, but is used as a unique identified by the mode manager. |
edt | A fully initialised TSLEditor instance created by the application. |
middleButtonPansToPoint. Default true. This flag allows modes to easily provide standard behaviour for pressing of the middle button - typically the mouse wheel.
TSLInteractionModeEdit::~TSLInteractionModeEdit | ( | ) |
Destructor for Edit mode. Deletes editor if applicable.
|
virtual |
This method is triggered when a mode is activated by the user - and therefore becomes the current mode.
Reimplemented from TSLInteractionMode.
void TSLInteractionModeEdit::allowEditing | ( | bool | flag | ) |
This method allows the application to enable or disable editing. The default is true, which causes locator events to be passed on to the TSLEditor instance.
allow | True to allow editing, false to disable it. |
|
virtual |
This method is triggered when a mode is deactivated by the user - and therefore is no longer the current mode.
The derived class should clear any echo lines that may be active and generally tidy up after itself.
Reimplemented from TSLInteractionMode.
bool TSLInteractionModeEdit::displayPrompt | ( | const char * | msg | ) |
This method is used when the application has defined a TSLEditorRequest to trap setCursor and displayPrompt requests.
The value passed to this method will be return by subsequent calls to query Prompt. Note that the string is copied rather then a direct reference held.
prompt | Prompt to return from queryPrompt. |
TSLEditor * TSLInteractionModeEdit::editor | ( | ) |
|
virtual |
Event handler for the paint method.
The default handler does nothing.
(x1,y1) | Bottom left, in device units, of the area being redrawn. |
(x2,y2) | Top right, in device units, of the area being redrawn. |
Reimplemented from TSLInteractionMode.
|
virtual |
Locator handler for interaction modes. This event will be passed on to the currently active mode.
The default base implementation returns false.
(x,y) | Position of locator event, in device unit coordinates. |
shift | Flag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour. |
control | Flag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour. |
Reimplemented from TSLInteractionMode.
|
virtual |
Locator handler for interaction modes. This event will be passed on to the currently active mode.
The default base implementation returns false.
(x,y) | Position of locator event, in device unit coordinates. |
shift | Flag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour. |
control | Flag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour. |
Reimplemented from TSLInteractionMode.
|
virtual |
Locator handler for interaction modes. This event will be passed on to the currently active mode.
The default base implementation pans to the click position and returns true if the pan was successful. This behaviour occurs if the constructor was passed thge appropriate flag.
(x,y) | Position of locator event, in device unit coordinates. |
shift | Flag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour. |
control | Flag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour. |
Reimplemented from TSLInteractionMode.
|
virtual |
Locator handler for interaction modes. This event will be passed on to the currently active mode.
The default base implementation returns false.
(x,y) | Position of locator event, in device unit coordinates. |
shift | Flag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour. |
control | Flag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour. |
Reimplemented from TSLInteractionMode.
|
virtual |
Mouse move handlers for interaction mode base class
The default base class implementations all do nothing and return false.
button | Type of button pressed, if any. |
(x,y) | Position of locator event, in device unit co-ordinates. |
shift | Flag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour. |
control | Flag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour. |
Reimplemented from TSLInteractionMode.
|
virtual |
Locator handler for interaction modes. This event will be passed on to the currently active mode.
The default base implementation returns false.
(x,y) | Position of locator event, in device unit coordinates. |
shift | Flag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour. |
control | Flag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour. |
Reimplemented from TSLInteractionMode.
|
virtual |
Locator handler for interaction modes. This event will be passed on to the currently active mode.
The default base implementation returns false.
(x,y) | Position of locator event, in device unit coordinates. |
shift | Flag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour. |
control | Flag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour. |
Reimplemented from TSLInteractionMode.
|
virtual |
Query the cursor style that may be appropriate to the currently active mode.
Returns TSLCursorStyleNone if no particular cursor style is appropriate. This is also the default return value if the method is not overridden.
Reimplemented from TSLInteractionMode.
|
virtual |
Query prompt to display for this mode.
The default implementation returns an empty string. It is up to the derived modes to decide what prompt to return.
Reimplemented from TSLInteractionMode.
bool TSLInteractionModeEdit::setCursor | ( | TSLCursorStyle | style | ) |
This method is used when the application has defined a TSLEditorRequest to trap setCursor and setPrompt requests. The value passed to this method will be return by subsequent calls to queryCursor.
style | Cursor style to return from queryCursor. |
|
virtual |
Internal function called by the mode manager to bind an instance of TSLInteractionModeDisplay to the mode.
For the TSLInteractionModeEdit, it is this method that triggers the actual creation of the editor.
Reimplemented from TSLInteractionMode.