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

Detailed Description

This is a simple interaction mode for handling zoom to rectangle and anchored zoom-in/zoom-out.

The user's application creates an instance of one these classes and adds it to a TSLInteractionModeManager. The amount by which the class will zoom may be specified in the constructor.

When an LButtonDown event occurs, the mode stores the event position. If the mouse moves more that 3 pixels from the starting position, then a rubber rectangle is drawn until an LButtonUp event occurs. If, when the LButtonUp event occurs, the mouse is more then 3 pixels from the starting position, then the mode causes the current view of the TSLDrawingSurface to zoom to the specified rectangle. The aspect ratio is maintained.

If the mouse has moved less than 3 pixels, then the press is treated as a zoom. If shift is pressed then a zoom-out occurs, if not then a zoom-in occurs. The press point is kept at the same position on the screen.

When an RButtonUp event occurs, the mode resets to the default mode.

Public Member Functions

 TSLInteractionModeZoom (int modeID, int zoomPercentage=30, const char *prompt="Left button drag zoom to rectangle, Left button click anchored zoom-in, Shift-Left button click anchored zoom-out, Right button click to finish", bool middleButtonPansToPoint=true)
 
virtual ~TSLInteractionModeZoom ()
 
void activate ()
 
void deactivate ()
 
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 onMouseMove (TSLButtonType button, TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control)
 
virtual bool onRButtonUp (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control)
 
TSLCursorStyle queryCursor ()
 
virtual const char * queryPrompt ()
 
void * operator new (size_t size) TSL_NO_THROW
 
void operator delete (void *self)
 
void * operator new (size_t size, char *filename, int line)
 
- Public Member Functions inherited from TSLInteractionMode
virtual ~TSLInteractionMode ()
 
virtual bool onMButtonDown (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control)
 
virtual bool onMButtonUp (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control)
 
virtual bool onMouseWheel (short delta, TSLDeviceUnits x, TSLDeviceUnits y, int zoomPercentage, bool lockCursorLocation)
 
virtual bool onRButtonDown (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control)
 
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)
 
virtual void setDisplay (TSLInteractionModeDisplay *display)
 
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

◆ TSLInteractionModeZoom()

TSLInteractionModeZoom::TSLInteractionModeZoom ( int modeID,
int zoomPercentage = 30,
const char * prompt = "Left button drag zoom to rectangle, Left button click anchored zoom-in, Shift-Left button click anchored zoom-out, Right button click to finish",
bool middleButtonPansToPoint = true )

Constructor for zoom interaction mode class.

Parameters
modeIDThis ID is not used by the mode itself, but is used as a unique identified by the mode manager.
zoomPercentageDefault 30. Percentage to zoom on a button click.
promptDefaulted to interaction description. Prompt to return from queryPrompt method.
middleButtonPansToPointDefaults to true. This flag allows modes to easily provide standard behaviour for pressing of the middle button - typically the mouse wheel.

◆ ~TSLInteractionModeZoom()

virtual TSLInteractionModeZoom::~TSLInteractionModeZoom ( )
virtual

See this class description and base class method description for further details

Member Function Documentation

◆ activate()

void TSLInteractionModeZoom::activate ( )
virtual

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ deactivate()

void TSLInteractionModeZoom::deactivate ( )
virtual

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ onDraw()

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

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ onLButtonDown()

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

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ onLButtonUp()

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

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ onMouseMove()

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

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ onRButtonUp()

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

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ operator delete()

void TSLInteractionModeZoom::operator delete ( void * self)

◆ operator new() [1/2]

void * TSLInteractionModeZoom::operator new ( size_t size)

◆ operator new() [2/2]

void * TSLInteractionModeZoom::operator new ( size_t size,
char * filename,
int line )

When included in an MFC application in debug mode, the debug new expects this to be here. Override it and return the same as the normal one. The library must include it when compiled in release mode, since the user's application may be in debug mode.

◆ queryCursor()

TSLCursorStyle TSLInteractionModeZoom::queryCursor ( )
virtual

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ queryPrompt()

virtual const char * TSLInteractionModeZoom::queryPrompt ( )
virtual

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.