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....



MouseAction


Unit: SDL_rchart
Class: TSmithChart
Declaration: property MouseAction: TMouseActMode;

The property MouseAction facilitates interactive zooming and panning of the data. This property may take one of the following values. The kind of mouse action is indicated by different cursors (if MouseCursorFixed is set to FALSE).

maDragCrossH Drag any visible crosshair using the mouse. If more than one crosshair is visible, the crosshair closest to the mouse cursor when clicking the left mouse button is selected. The OnCrossHairMove event is triggered whenever a crosshair is moved by the mouse.
maDragLabel Drag any visible user-defined text label. The text label closest to the mouse cursor when pressing the left mouse button can be moved interactively when holding down the left mouse button. The OnTextLabelMove event is triggered whenever a crosshair is moved by the mouse.
maNone No built-in interaction is possible. The only way to apply a mouse controlled action is by utilizing the mouse events.
maPan The data display can be panned by pressing and holding the left mouse button. The data image will then follow the mouse movement.
maPanHoriz The data display can be panned only horizontally by pressing and holding the left mouse button. The data image will then follow the mouse movement parallel to the x-axis.
maPanVert The data display can be panned only vertically by pressing and holding the left mouse button. The data image will then follow the mouse movement parallel to the y-axis.
maRubberband This mode displays a rubber band from the last click position to the current mouse position as long as the left mouse button is down. Releasing the mouse button triggers the OnRubberBand event.
maSelectRect Select a rectangular region by pressing and holding the left mouse button. A rectangle follows the mouse cursor indicating the region to be selected. Releasing the left button selects this region and triggers the OnSelectRect event.
maZoomWind The user can zoom into a rectangular region of the data display. Therefore he has to press and hold down the left mouse button at one of the corners of the intended region. Thereafter a rectangle follows the mouse cursor indicating the region to be zoomed. Releasing the left button selects this region and zooms into the data by displaying exactly this region. Note, that the direction of an axis is reversed if the first point is higher than the second point. In order to avoid this effect, use the mode maZoomWindPos.
maZoomWindPos This is a special version of maZoomWind which prevents the zoom mechanism from turning the direction of an axis in case of a selection window which has been defined from right to left and/or from top to bottom (i.e. the first point corner of the rectangle is located to the right of and/or above the second point).
maZoomDrag This mode enables the user both to increase and to decrease the magnification factor of the graph. The left mouse button has to be pressed and held down. The magnification of the data image will then follow the mouse movement. Moving to the left and/or bottom zooms out of the data; moving to the right and/or top zooms into the data.

Hint: The mouse cursors associated with the different mouse actions are allocated once during the creation of a chart. Additional charts will use the cursor resources of the first chart. However these resources are released only when the application exits. Thus the heap is loaded by 48 extra bytes even if all of the RChart components are destroyed.

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



Last Update: 2023-Dec-13