The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



MouseBox


Unit:SDL_geomap
Class:TGeoMap
Declaration:function Mousebox (var xLo, yLo, xHi, yHi: integer): boolean;

The function MouseBox allows to select a rectangular region of the map. The user can select a region by clicking and holding the left mouse button. Thereafter a rubber-band rectangle follows the mouse cursor until the mouse button is released again. At this point the function MouseBox returns the coordinates of selected rectangle. The selection process may be aborted at any time by calling the method MouseBoxAbort.

The function MouseBox returns a TRUE value if the selection is valid; the pixel coordinates of the rectangular region are then contained in the parameters xLo... yHi.

Hint: The method MouseBox must not be used within any of the mouse event handlers (i.e. OnMouseDown, OnMouseUp, or OnMouseMove). Instead of using the function MouseBox it is recommended to set the property MouseAction to maSelectRect (which has the same effect as calling MouseBox).

 



Last Update: 2023-Dec-13