MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLInteractionModeEdit Class Reference
Inheritance diagram for TSLInteractionModeEdit:

Detailed Description

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)
 
TSLEditoreditor ()
 
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)
 
- Public Member Functions inherited from TSLInteractionMode
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

- Protected Member Functions inherited from TSLInteractionMode
 TSLInteractionMode (int modeID, bool middleButtonPansToPoint=true)
 
- Protected Attributes inherited from TSLInteractionMode
int m_id
 
TSLDrawingSurfacem_drawingSurface
 
bool m_middleButtonPansToPoint
 
TSLInteractionModeDisplaym_display
 

Constructor & Destructor Documentation

◆ TSLInteractionModeEdit() [1/3]

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.

Parameters
modeIDThis ID is not used by the mode itself, but is used as a unique identified by the mode manager.
reqApplication 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.

Parameters
iniFileSectionDefault '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() [2/3]

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.

Parameters
modeIDThis ID is not used by the mode itself, but is used as a unique identified by the mode manager.
reqApplication Request Handler - used for all requests except for set Cursor and setPrompt.
contextContext handler for the winselect operation - pass 0 if not required.

iniFileName : Name of .ini file to be passed to the TSLEditor::initialise method.

Parameters
iniFileSectionDefault '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() [3/3]

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.

Parameters
modeIDThis ID is not used by the mode itself, but is used as a unique identified by the mode manager.
edtA 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::~TSLInteractionModeEdit ( )

Destructor for Edit mode. Deletes editor if applicable.

Member Function Documentation

◆ activate()

virtual void TSLInteractionModeEdit::activate ( )
virtual

This method is triggered when a mode is activated by the user - and therefore becomes the current mode.

Reimplemented from TSLInteractionMode.

◆ allowEditing()

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.

Parameters
allowTrue to allow editing, false to disable it.

◆ deactivate()

virtual void TSLInteractionModeEdit::deactivate ( )
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.

◆ displayPrompt()

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.

Parameters
promptPrompt to return from queryPrompt.

◆ editor()

TSLEditor * TSLInteractionModeEdit::editor ( )

Query the TSLEditor instance that is used by the Interaction Mode. This may either be passed to the Interaction Mode or created by it.

Returns TSLEditor instance, 0 if no valid instance is associated with the Interaction Mode.

◆ onDraw()

virtual void TSLInteractionModeEdit::onDraw ( TSLDeviceUnits x1,
TSLDeviceUnits y1,
TSLDeviceUnits x2,
TSLDeviceUnits y2 )
virtual

Event handler for the paint method.

The default handler does nothing.

Parameters
(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.

◆ onLButtonDown()

virtual bool TSLInteractionModeEdit::onLButtonDown ( TSLDeviceUnits x,
TSLDeviceUnits y,
bool shift,
bool control )
virtual

Locator handler for interaction modes. This event will be passed on to the currently active mode.

The default base implementation returns false.

Parameters
(x,y)Position of locator event, in device unit coordinates.
shiftFlag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour.
controlFlag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour.
Returns
true if the view needs to be redrawn, false otherwise.

Reimplemented from TSLInteractionMode.

◆ onLButtonUp()

virtual bool TSLInteractionModeEdit::onLButtonUp ( TSLDeviceUnits x,
TSLDeviceUnits y,
bool shift,
bool control )
virtual

Locator handler for interaction modes. This event will be passed on to the currently active mode.

The default base implementation returns false.

Parameters
(x,y)Position of locator event, in device unit coordinates.
shiftFlag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour.
controlFlag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour.
Returns
true if the view needs to be redrawn, false otherwise.

Reimplemented from TSLInteractionMode.

◆ onMButtonDown()

virtual bool TSLInteractionModeEdit::onMButtonDown ( TSLDeviceUnits x,
TSLDeviceUnits y,
bool shift,
bool control )
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.

Parameters
(x,y)Position of locator event, in device unit coordinates.
shiftFlag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour.
controlFlag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour.
Returns
true if the view needs to be redrawn, false otherwise.

Reimplemented from TSLInteractionMode.

◆ onMButtonUp()

virtual bool TSLInteractionModeEdit::onMButtonUp ( TSLDeviceUnits x,
TSLDeviceUnits y,
bool shift,
bool control )
virtual

Locator handler for interaction modes. This event will be passed on to the currently active mode.

The default base implementation returns false.

Parameters
(x,y)Position of locator event, in device unit coordinates.
shiftFlag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour.
controlFlag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour.
Returns
true if the view needs to be redrawn, false otherwise.

Reimplemented from TSLInteractionMode.

◆ onMouseMove()

virtual bool TSLInteractionModeEdit::onMouseMove ( TSLButtonType button,
TSLDeviceUnits x,
TSLDeviceUnits y,
bool shift,
bool control )
virtual

Mouse move handlers for interaction mode base class

The default base class implementations all do nothing and return false.

Parameters
buttonType of button pressed, if any.
(x,y)Position of locator event, in device unit co-ordinates.
shiftFlag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour.
controlFlag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour.
Returns
true if the view needs to be redrawn, false otherwise. The default base class implementations all return false.

Reimplemented from TSLInteractionMode.

◆ onRButtonDown()

virtual bool TSLInteractionModeEdit::onRButtonDown ( TSLDeviceUnits x,
TSLDeviceUnits y,
bool shift,
bool control )
virtual

Locator handler for interaction modes. This event will be passed on to the currently active mode.

The default base implementation returns false.

Parameters
(x,y)Position of locator event, in device unit coordinates.
shiftFlag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour.
controlFlag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour.
Returns
true if the view needs to be redrawn, false otherwise.

Reimplemented from TSLInteractionMode.

◆ onRButtonUp()

virtual bool TSLInteractionModeEdit::onRButtonUp ( TSLDeviceUnits x,
TSLDeviceUnits y,
bool shift,
bool control )
virtual

Locator handler for interaction modes. This event will be passed on to the currently active mode.

The default base implementation returns false.

Parameters
(x,y)Position of locator event, in device unit coordinates.
shiftFlag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour.
controlFlag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour.
Returns
true if the view needs to be redrawn, false otherwise.

Reimplemented from TSLInteractionMode.

◆ queryCursor()

virtual TSLCursorStyle TSLInteractionModeEdit::queryCursor ( )
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.

◆ queryPrompt()

virtual const char * TSLInteractionModeEdit::queryPrompt ( )
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.

◆ setCursor()

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.

Parameters
styleCursor style to return from queryCursor.

◆ setDisplay()

void TSLInteractionModeEdit::setDisplay ( TSLInteractionModeDisplay * display)
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.