|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....|
|Home ChartPack RChart Class TRChart Type declarations TMouseMoveInChartEvent|
|See also: OnMouseMoveInChart, MousePosX, MousePosY|
The type declaration TMouseMoveInChartEvent defines the event which occurs when the mouse moves across the chart window. The parameter InChart is TRUE, if the mouse cursor is on the drawing area. The parameter Shift returns the state of the mouse buttons, and the parameters rMousePosX and rMousePosY return the mouse position in terms of the coordinates of the active layer.
Note that InChart can be advantageously used to switch the state of the position display (for example gray out the position values, if the cursor is outside the drawing area).
The following example shows how to use the event in order to display the current mouse position. The components NumLab1 and NumLab2 can be switched off by setting the property Empty to TRUE.
procedure TForm1.RChart1MouseMoveInChart(Sender: TObject; InChart: Boolean; Shift: TShiftState; rMousePosX, rMousePosY: Double); begin NumLab1.Empty := not Inchart; NumLab2.Empty := not Inchart; NumLab1.Value := rMousePosX; NumLab2.Value := rMousePosY; end;
An example how to use the TMouseMoveInChartEvent can also be found in the sample program PRINTCHT.DPR which comes with the RChart package.