Class TSelectPointTool

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TSelectPointTool = class abstract(TCustomSelectScreenObjectTool)

Description

TSelectPointTool is used to select and move one or more individual vertices in a TScreenObject.

Points can be selected in either of two ways. 1. The user clicks on a node of the selected TScreenObject. If no TScreenObject is selected, the one under the curson will be selected. 2. The user drags with the mouse button down to select a group of nodes inside the selection rectangle.

Hierarchy

Overview

Fields

Private FPointIsSelected: boolean;

Methods

Private procedure ShowMovedPoints(const BitMap: TBitmap32);
Private function FindSelectedScreenObject(const X, Y: integer): TScreenObject;
Private function SelectPointsOfASelectedScreenObject(const X, Y: integer; const AddToSelection: boolean): boolean;
Private function SelectPointsOfAllSelectedScreenObjectsWithLine( const AddToSelection: boolean): boolean;
Private function SelectPointsWithLine(const AScreenObject: TScreenObject; const AddToSelection: boolean; out Changed: boolean): boolean;
Protected procedure DrawOnBitMap32(Sender: TObject; Buffer: TBitmap32); override;
Protected function GetHint: string; override;
Protected procedure GetOffset(const APoint: TPoint2D; out XOffset, YOffset: real); override;
Protected function GetCursor: TCursor; override;
Public procedure Activate; 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;

Description

Fields

Private FPointIsSelected: boolean;

FPointIsSelected: boolean; FPointIsSelected is set to true if one or more vertices on the selected TScreenObject is selected.

Methods

Private procedure ShowMovedPoints(const BitMap: TBitmap32);

ShowMovedPoints shows how the selected TScreenObject would look if the mouse was released at its current position.

Private function FindSelectedScreenObject(const X, Y: integer): TScreenObject;

FindSelectedScreenObject returns the TScreenObject that is already selected and which has a node at or near X,Y.

Private function SelectPointsOfASelectedScreenObject(const X, Y: integer; const AddToSelection: boolean): boolean;

This procedure selects the node of a selected screen object that is at or near (X,Y).

Private function SelectPointsOfAllSelectedScreenObjectsWithLine( const AddToSelection: boolean): boolean;

SelectPointsOfAllSelectedScreenObjectsWithLine selects the nodes in SelectPointsOfAllSelectedScreenObjectsWithLine uses a "lasso" to select nodes in one selected object. All other selected objects are de-selected.

Private function SelectPointsWithLine(const AScreenObject: TScreenObject; const AddToSelection: boolean; out Changed: boolean): boolean;

SelectPointsWithLine selects nodes that are inside TScreenObjectTool.FSelectLine. if AddToSelection is not True, it deselects nodes that are not inside FSelectLine. Changed is set to True if any nodes have been changed from unselected to selected or vice versa.

Protected procedure DrawOnBitMap32(Sender: TObject; Buffer: TBitmap32); override;
 
Protected function GetHint: string; override;

Used to define Hint

Protected procedure GetOffset(const APoint: TPoint2D; out XOffset, YOffset: real); override;
 
Protected function GetCursor: TCursor; override;
 
Public procedure Activate; override;
 
Public procedure MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

MouseDown responds to OnMouseDown events by seeing if a node in a TScreenObject could be selected at this position. If so, it is selected. It also creates an outline that is used in dragging to select points.

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

MouseMove responds to OnMouseMove events by showing how the TScreenObject would be changed if the mouse were released at X,Y. See ShowMovedPoints.

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

MouseUp responds to OnMouseUp events by either moving the selected points or selecting the points inside a rectangle created by dragging with the mouse button down.


Generated by PasDoc 0.12.1 on 2013-05-13 15:41:43