Using infotips – Pitney Bowes MapXtreme User Manual

Page 145

Advertising
background image

Chapter 7: Desktop Applications, Controls, Dialogs, and Tools

MapXtreme Desktop Tools API

MapXtreme v7.1

145

Developer Guide

the mouse button creates the Circle. If the Ctrl key is pressed while dragging, the Circle is drawn
from perimeter point to perimeter point. Pressing the Esc key before releasing the mouse cancels
the operation.

Rectangle Tools

The tools included in this group are AddRectangleMapTool and CustomRectangleMapTool. These
tools draw a Rectangle. The tool is activated by clicking and dragging from one corner to the
opposite corner. Releasing the mouse button creates the Rectangle. Note that the drawn object is
always axis-aligned. If the Shift key is pressed while dragging, the Rectangle is constrained to a
square. If the Ctrl key is pressed while dragging, the Rectangle is drawn with the starting point in the
center. Pressing the Esc key before releasing the mouse cancels the operation.

Using InfoTips

An InfoTip is a small text box that can appear when the mouse hovers over a map feature. A map is
associated with an instance of MapInfo.Tools.MapTools, which contains all the tools (instances of
MapInfo.Tools.MapTool) that can be used on the map.

The MapInfo.Tools.MapTools class has three properties that control the appearance of InfoTips.
They are:

InfoTipsEnabled–Gets/Sets whether InfoTips will appear when the mouse is idle.

InfoTipTimerDelay–Gets/Sets the amount of time (in milliseconds) that must elapse before the
InfoTip appears. The default is 500.

InfoTipDisplayDelay –Gets/Sets the amount of time (in milliseconds) that the InfoTip will be
displayed. The default is 0, which means that the Infotip will be displayed until the mouse is
moved.

Note that as long as the mouse is moving, InfoTips will not appear. An InfoTip will only appear when
the mouse is over a feature with a label and has been idle for at least the interval specified by
InfoTipTimerDelay. The InfoTip will disappear when the mouse is moved or when the mouse has
been idle for longer than the time specified by the InfoTipDisplayDelay provided that time is greater
than zero.

You can prevent InfoTips from being displayed at all with:

mapControl1.Tools.InfoTipsEnabled = false;

You can set the delay before an InfoTip is displayed to one second with:

mapControl1.Tools.InfoTipTimerDelay = 1000;

You can set the length of time an InfoTip is displayed even though the mouse remains idle to 2.5
seconds with:

mapControl1.Tools.InfoTipDisplayDelay = 2500;

See the MapInfo.Tools.MapTools class in the MapXtreme Developer Reference for more information
on using InfoTips in the API.

Advertising