Class TCustomInteractiveTool

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TCustomInteractiveTool = class(TComponent)

Description

TCustomInteractiveTool is an abstract base class. Its descendants (mainly in InteractiveTools) handle on-screen interaction between the user and the grid or TScreenObjects.

The main procedures in which the interaction is handled are MouseDown, MouseMove and MouseUp. These are called in TframeView.ZoomBoxImage32MouseDown, TframeView.ZoomBoxImage32MouseMove, and TframeView.ZoomBoxImage32MouseUp.

The hints in TfrmGoPhast.frameTopView, TfrmGoPhast.frameFrontView, and TfrmGoPhast.frameSideView are set by the current tool via GetHint, Activate, and Deactivate.

See also
CurrentTool
CurrentTool is the TCustomInteractiveTool that is currently being used to handle the user interaction with TframeView.ZoomBox.

Hierarchy

Overview

Fields

Private FCursor: TCursor;
Private FViewDirection: TViewDirection;
Protected FTopLayer: TPositionedLayer;
Protected FSideLayer: TPositionedLayer;
Protected FFrontLayer: TPositionedLayer;

Methods

Private procedure SetViewDirection(const Value: TViewDirection);
Private function GetMouseIsDown: boolean;
Protected procedure CreateLayers; virtual;
Protected function Layer32: TPositionedLayer;
Protected function GetCursor: TCursor; virtual;
Protected procedure GetColLayer(APoint: TPoint2D; out Col, Layer: integer);
Protected function GetHint: string; virtual;
Protected procedure GetRowCol(APoint: TPoint2D; out Row, Column: integer);
Protected procedure GetRowLayer(APoint: TPoint2D; out Row, Layer: integer);
Protected procedure SetCursor(const Value: TCursor); virtual;
Protected procedure UpdateCursors; virtual;
Protected function View: TframeView; overload;
Protected function View(Direction: TViewDirection): TframeView; overload;
Protected function ZoomBox: TQRbwZoomBox2;
Protected procedure DrawOnBitMap32(Sender: TObject; Buffer: TBitmap32); virtual;
Protected function GetEvaluatedAt(const Direction: TViewDirection): TEvaluatedAt;
Protected function FindNodeInSelectedScreenObjects(const X, Y: integer; const AScreenObject: TScreenObject): integer;
Public procedure UpdateAllViews;
Public procedure Activate; virtual;
Public procedure Deactivate; virtual;
Public procedure DoubleClick(Sender: TObject); virtual;
Public procedure MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual;
Public procedure MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); virtual;
Public procedure MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual;
Public procedure RightClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual;
Public procedure SetAllCursors(const Value: TCursor); virtual;

Properties

Public property Cursor: TCursor read GetCursor write SetCursor;
Public property Hint: string read GetHint;
Public property MouseIsDown: boolean read GetMouseIsDown;
Public property ViewDirection: TViewDirection read FViewDirection write SetViewDirection;

Description

Fields

Private FCursor: TCursor;

See Cursor.

Private FViewDirection: TViewDirection;

See ViewDirection;

Protected FTopLayer: TPositionedLayer;
 
Protected FSideLayer: TPositionedLayer;
 
Protected FFrontLayer: TPositionedLayer;
 

Methods

Private procedure SetViewDirection(const Value: TViewDirection);

See ViewDirection.

Private function GetMouseIsDown: boolean;

Getter for MouseIsDown

Protected procedure CreateLayers; virtual;
 
Protected function Layer32: TPositionedLayer;
 
Protected function GetCursor: TCursor; virtual;

See Cursor.

Protected procedure GetColLayer(APoint: TPoint2D; out Col, Layer: integer);

GetColLayer determines the column and layer of the cell in the grid containing APoint.

Protected function GetHint: string; virtual;

See Hint

Protected procedure GetRowCol(APoint: TPoint2D; out Row, Column: integer);

GetRowCol determines the row and column of the cell in the grid containing APoint.

Protected procedure GetRowLayer(APoint: TPoint2D; out Row, Layer: integer);

GetRowLayer determines the row and layer of the cell in the grid containing APoint.

Protected procedure SetCursor(const Value: TCursor); virtual;

See Cursor.

Protected procedure UpdateCursors; virtual;

UpdateCursors sets the cursors of TQRbwZoomBox2.Image32 and TframeView.ZoomBox.

Protected function View: TframeView; overload;

View is the TframeView to which this TCustomInteractiveTool applies.

Protected function View(Direction: TViewDirection): TframeView; overload;
 
Protected function ZoomBox: TQRbwZoomBox2;

ZoomBox is the TQRbwZoomBox2 of View.

Protected procedure DrawOnBitMap32(Sender: TObject; Buffer: TBitmap32); virtual;
 
Protected function GetEvaluatedAt(const Direction: TViewDirection): TEvaluatedAt;
 
Protected function FindNodeInSelectedScreenObjects(const X, Y: integer; const AScreenObject: TScreenObject): integer;

FindNodeInSelectedScreenObjects returns the index of the first vertex in AScreenObject that is within SelectionWidth of X,Y.

Public procedure UpdateAllViews;
 
Public procedure Activate; virtual;

Activate is called when a TCustomInteractiveTool is made the CurrentTool. Activate sets the Hint of TfrmGoPhast.frameTopView, TfrmGoPhast.frameFrontView, and TfrmGoPhast.frameSideView.

Public procedure Deactivate; virtual;

Deactivate is called when another TCustomInteractiveTool replaces the current instance of TCustomInteractiveTool as the CurrentTool.

Public procedure DoubleClick(Sender: TObject); virtual;

Descendants of TCustomInteractiveTool override DoubleClick to respond to OnDoubleClick events.

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

Descendants of TCustomInteractiveTool override MouseDown to respond to OnMouseDown events.

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

Descendants of TCustomInteractiveTool override MouseMove to respond to OnMouseMove events.

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

Descendants of TCustomInteractiveTool override MouseUp to respond to OnMouseUp events.

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

handle a right click

Public procedure SetAllCursors(const Value: TCursor); virtual;

SetAllCursors sets the cursors in all views.

Properties

Public property Cursor: TCursor read GetCursor write SetCursor;

Cursor defines the cursor that is displayed to the user when the mouse is over a TframeView.

(Note: in some cases, setting the cursor has no effect because GetCursor does not refer to the value that was set.

Public property Hint: string read GetHint;

Hint is used to set the hint of TfrmGoPhast.frameTopView, TfrmGoPhast.frameFrontView, and TfrmGoPhast.frameSideView.

Public property MouseIsDown: boolean read GetMouseIsDown;

MouseIsDown is True if the mouse is down. It reads a global variable in the implementation section.

Public property ViewDirection: TViewDirection read FViewDirection write SetViewDirection;

ViewDirection is the TViewDirection from which this tool is viewed.


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