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_rchart
Class:TRChart
Declaration:function Mousebox (var xLo, yLo, xHi, yHi: double): boolean;

The function MouseBox allows to select a rectangular region of the data. 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 real-world coordinates of the rectangular region of the active layer 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).

Example: This method is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): rchdrag



Last Update: 2016-Jun-26