Class TCustomSelectScreenObjectTool

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TCustomSelectScreenObjectTool = class(TCustomEditScreenObjectTool)

Description

TCustomSelectScreenObjectTool is the abstract ancestor of tools used to select and move TScreenObjects mainly by clicking on them.

See also
TLassoTool
TLassoTool is used to select TScreenObjects by enclosing them with a polygon.

Hierarchy

Overview

Fields

Private FMouseButtonIsDown: boolean;
Private FSelectLine: TLine;
Private FMovingScreenObjects: boolean;
Private FStartX: integer;
Private FStartY: integer;

Methods

Private procedure MoveScreenObjects(const X, Y: integer);
Private procedure DrawMouseSelectionRectangle;
Public procedure Draw(const Sender: TObject; const Direction: TViewDirection); override;
Public procedure MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
Public procedure MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); override;
Public procedure MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
Public destructor Destroy; override;

Description

Fields

Private FMouseButtonIsDown: boolean;

FMouseButtonIsDown: boolean; FMouseButtonIsDown is set to true while the mouse button is down.

Private FSelectLine: TLine;

FSelectLine: TLine; FSelectLine is used to select TScreenObjects by enclosing them in a polygon.

Private FMovingScreenObjects: boolean;

FMovingScreenObjects: boolean; FMovingScreenObjects is set to true when moving TScreenObjects.

Private FStartX: integer;

FStartX: integer; FStartX is the starting X-coordinate of the mouse. It is used when moving the selected TScreenObjects.

Private FStartY: integer;

FStartY: integer; FStartY is the starting Y-coordinate of the mouse. It is used when moving the selected TScreenObjects.

Methods

Private procedure MoveScreenObjects(const X, Y: integer);

MoveScreenObjects returns True if any TScreenObjects are selected in the view to which this TCustomSelectScreenObjectTool applies. function AreScreenObjectsSelected: boolean; MoveScreenObjects moves a TScreenObject based on X and Y.

Private procedure DrawMouseSelectionRectangle;

DrawMouseSelectionRectangle draws a rectangle outline the area that will be used to select TScreenObjects when draging with the mouse.

Public procedure Draw(const Sender: TObject; const Direction: TViewDirection); override;

If FSelectLine is used, Draw draws it on the screen.

Public procedure MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

MouseDown responds to OnMouseDown events by initializing FStartX, FStartY, and FMouseButtonIsDown.

Public procedure MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); override;

MouseMove responds to OnMouseMove events. by updating FMovingScreenObjects.

Public procedure MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

MouseUp responds to OnMouseUp events. by setting FMouseButtonIsDown to False.

Public destructor Destroy; override;

Destroy destroys the current instance of TCustomSelectScreenObjectTool. Do not call Destroy directly. Call Free instead.


Generated by PasDoc 0.10.0 on 2006-10-31 09:56:39