FMX.Objects.TSelection.MouseMove

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure MouseMove(Shift: TShiftState; X, Y: Single); override;

C++

virtual void __fastcall MouseMove(System::Classes::TShiftState Shift, float X, float Y);

Properties

Type Visibility Source Unit Parent
procedure
function
public
FMX.Objects.pas
FMX.Objects.hpp
FMX.Objects TSelection

Description

Handles moving of the mouse pointer over a TSelection object.

As the mouse pointer moves over a TSelection object, this method is called repeatedly. It is called each time with the new mouse pointer coordinates that reflect the continuous path of the mouse pointer.

Parameters

MouseMove has the following parameters:

  • Shift--belongs to the TShiftState type and passes additional information, such as: which mouse button was pressed (ssLeft--left, ssRight--right) or whether shift keys (ssShift--SHIFT, ssCtrl--CTRL, or ssAlt--ALT) were pressed when the mouse button was clicked.
  • X and Y--are the local pixel coordinates of the mouse pointer within the TSelection object.

Functionality

MouseMove executes the following operations:

  1. MouseMove calls the inherited FMX.Controls.TControl.MouseMove method. Then:
  2. If the mouse button is not pressed down:
    1. Check whether the mouse pointer hovers over a grip control:
      • When the mouse pointer moves over a grip control--shows the resizing arrow on the grip control over which the mouse pointer is moving.
      • When the mouse pointer moves outside a grip control--clears the resizing arrows, if any.
    2. Force repaint of the selection shape.
  3. If the left mouse button is pressed inside the TSelection object:
    1. Moves the shape of the TSelection object on the vector with the start point having the coordinates where the mouse button was pressed and the end point having the current coordinates of the mouse.
    2. Calls the customer event handler of the OnTrack event.
  4. If the left mouse button is pressed down on one of the grip controls of the TSelection object:
    1. The shape of the TSelection object is resized to reflect the moving of the selected grip control.
      • If ParentBounds is True, the TSelection object shape is resized to fit the boundaries of the parent control.
      • If ParentBounds is False, the TSelection object shape is resized to fit the boundaries of the current TCanvas object.
      • If Proportional is True, the object shape is resized keeping the Width/Height proportion.
    2. Call the customer event handler of the OnTrack event.
    3. Force the repaint of the selection shape.


Override the public MouseMove method to provide a customized response when the mouse pointer is moved over the TSelection object.

See Also