![]() |
MapLink Pro 11.1.2.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
This is a simple interaction mode for handling the magnifying glass.
The user's application creates an instance of one these classes and adds it to a TSLInteractionModeManager.
During mouse move events, a magnifying glass is displayed. When an RButtonUp event occurs, the mode resets to the default mode.
The border around the magnifying glass may be specified using the magnifyingGlassBorder method.
The size and offset of the magnifying glass may be set using the magnifyingGlassProperties method.
The magnification factor may be set and queried using the magnificationFactor methods. Optionally the default value may be set. The current magnification factor is reset to the default value each time the mode is activation.
Public Member Functions | |
TSLInteractionModeMagnify (int modeID, const char *prompt="Mouse move to change magnified area, Right button click to finish", bool middleButtonPansToPoint=true) | |
virtual | ~TSLInteractionModeMagnify () |
void | activate () |
bool | clearBackgroundColour () |
void | deactivate () |
int | getBackgroundColour () const |
void | magnifyingGlassBorder (TSLDeviceUnits thickness, int red, int green, int blue) |
double | magnifyingFactor (bool getDefault=false) |
void | magnifyingFactor (double factor, bool setDefault=false) |
void | magnifyingGlassProperties (double radius, double offset) |
virtual void | onSize (TSLDeviceUnits cx, TSLDeviceUnits cy) |
virtual bool | onMouseMove (TSLButtonType button, TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control) |
virtual bool | onRButtonUp (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control) |
virtual void | onDraw (TSLDeviceUnits x1, TSLDeviceUnits y1, TSLDeviceUnits x2, TSLDeviceUnits y2) |
TSLCursorStyle | queryCursor () |
virtual const char * | queryPrompt () |
virtual void | setDisplay (TSLInteractionModeDisplay *display) |
void * | operator new (size_t size) TSL_NO_THROW |
void | operator delete (void *self) |
void * | operator new (size_t size, char *filename, int line) |
void | setBackgroundColour (int red, int green, int blue) |
![]() | |
virtual | ~TSLInteractionMode () |
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 | 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) |
int | id () |
Additional Inherited Members | |
![]() | |
TSLInteractionMode (int modeID, bool middleButtonPansToPoint=true) | |
![]() | |
int | m_id |
TSLDrawingSurface * | m_drawingSurface |
bool | m_middleButtonPansToPoint |
TSLInteractionModeDisplay * | m_display |
TSLInteractionModeMagnify::TSLInteractionModeMagnify | ( | int | modeID, |
const char * | prompt = "Mouse move to change magnified area, Right button click to finish", | ||
bool | middleButtonPansToPoint = true ) |
Constructor for magnify interaction mode class.
modeID | This ID is not used by the mode itself, but is used as a unique identified by the mode manager. |
prompt | Defaulted to interaction description. Prompt to return from queryPrompt method. |
middleButtonPansToPoint | Defaults to true. This flag allows modes to easily provide standard behaviour for pressing of the middle button - typically the mouse wheel. |
|
virtual |
See this class description and base class method description for further details
|
virtual |
See this class description and base class method description for further details
Reimplemented from TSLInteractionMode.
bool TSLInteractionModeMagnify::clearBackgroundColour | ( | ) |
Clears the background colour of the Magnifying Glass so that anything beneath shall be visible.
|
virtual |
See this class description and base class method description for further details
Reimplemented from TSLInteractionMode.
int TSLInteractionModeMagnify::getBackgroundColour | ( | ) | const |
This method returns the background colour for the magnifying glass.
Returns the background colour of the magnifying glass or -1 if the colour is not defined. The return value will either be a colour index or a composed RGB value. See tslcolourhelper.h for information on determining the type and in the case of an RGB value uncomposing it back into its respective components.
double TSLInteractionModeMagnify::magnifyingFactor | ( | bool | getDefault = false | ) |
Query the current or default magnifying factor.
The current factor is reset to the default factor whenever the mode is activated. A larger factor will magnify more, a small factor will magnify less.
getDefault | Default false. Flag indicating whether the default factor should be queried. |
void TSLInteractionModeMagnify::magnifyingFactor | ( | double | factor, |
bool | setDefault = false ) |
Set the current or default magnifying factor.
The current factor is reset to the default factor whenever the mode is activated. A larger factor will magnify more, a small factor will magnify less.
factor | New factor to use. |
setDefault | Default false. Flag indicating whether the default factor should be set. The default default factor is '15.0'! |
void TSLInteractionModeMagnify::magnifyingGlassBorder | ( | TSLDeviceUnits | thickness, |
int | red, | ||
int | green, | ||
int | blue ) |
Set the rendering attributes for the border around the magnifying glass.
thickness | The thickness of the border, in pixels. |
red,green,blue | RGB components of colour used for border. |
void TSLInteractionModeMagnify::magnifyingGlassProperties | ( | double | radius, |
double | offset ) |
Set the size and offset properties for he magnifying glass.
radius | The radius of the magnifying glass, as a percentage of the drawing surface width. Thus a larger size gives a bigger magnifying glass. The default value is 15.0 |
offset | The offset of the centre of magnifying glass as a multiple of the size. This a value of 0.0 makes the magnifying glass appear centred at the cursor location obscuring the map underneath and a value of 1.0 has the boundary circle of the magnifying glass at the cursor location. The default offset is 1.8 |
|
virtual |
See this class description and base class method description for further details
Reimplemented from TSLInteractionMode.
|
virtual |
See this class description and base class method description for further details
Reimplemented from TSLInteractionMode.
|
virtual |
See this class description and base class method description for further details
Reimplemented from TSLInteractionMode.
|
virtual |
See this class description and base class method description for further details
Reimplemented from TSLInteractionMode.
void TSLInteractionModeMagnify::operator delete | ( | void * | self | ) |
void * TSLInteractionModeMagnify::operator new | ( | size_t | size | ) |
void * TSLInteractionModeMagnify::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.
|
virtual |
See this class description and base class method description for further details
Reimplemented from TSLInteractionMode.
|
virtual |
See this class description and base class method description for further details
Reimplemented from TSLInteractionMode.
|
inline |
Set the background colour of the magnifying glass.
red,green,blue | RGB components of the background colour. |
|
virtual |
Internal function called by the mode manager to bind an instance of TSLInteractionModeDisplay to the mode.
Reimplemented from TSLInteractionMode.