Class TQRbwDynamicCursor

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TQRbwDynamicCursor = class(TComponent)

Description

TQRbwDynamicCursor provides a convenient way to draw a cursor at runtime.

Hierarchy

Overview

Fields

Private FHotPointY: integer;
Private FHotPointX: integer;
Private FCursor: TCursor;
Private FOnDrawCursor: TDrawCursor;
Private Modified: boolean;
Private Drawing: boolean;

Methods

Private procedure SetCursor(const Value: TCursor);
Private procedure SetHotPointX(const Value: integer);
Private procedure SetHotPointY(const Value: integer);
Private procedure SetOnDrawCursor(const Value: TDrawCursor);
Protected Procedure DrawCursor; virtual;
Protected procedure DrawDefaultBitMap(const AndImage : TBitMap); virtual;
Protected function GetCursor : TCursor; virtual;
Protected function GetCursorHeight : integer; virtual;
Protected function GetCursorWidth : integer; virtual;
Protected procedure Loaded; override;
Public procedure CreateCursor(const AndImage, XorImage: Qgraphics.TBitmap); virtual;
Public Constructor Create(AOwner: TComponent); override;
Public Destructor Destroy; override;
Public procedure RedrawCursor; virtual;

Properties

Public property CursorHeight : integer read GetCursorHeight;
Public property CursorWidth : integer read GetCursorWidth;
Published property Cursor : TCursor read GetCursor write SetCursor;
Published property HotPointX : integer read FHotPointX write SetHotPointX;
Published property HotPointY : integer read FHotPointY write SetHotPointY;
Published property OnDrawCursor : TDrawCursor read FOnDrawCursor write SetOnDrawCursor;

Description

Fields

Private FHotPointY: integer;
 
Private FHotPointX: integer;
 
Private FCursor: TCursor;
 
Private FOnDrawCursor: TDrawCursor;
 
Private Modified: boolean;

Modified is set to True whenever the cursor needs to be redrawn. Modified is set to False after the cursor has been redrawn in DrawCursor. DrawCursor only does anything if Modified is True;

Private Drawing: boolean;
 

Methods

Private procedure SetCursor(const Value: TCursor);
 
Private procedure SetHotPointX(const Value: integer);
 
Private procedure SetHotPointY(const Value: integer);
 
Private procedure SetOnDrawCursor(const Value: TDrawCursor);
 
Protected Procedure DrawCursor; virtual;

Private declarations

Protected procedure DrawDefaultBitMap(const AndImage : TBitMap); virtual;
 
Protected function GetCursor : TCursor; virtual;
 
Protected function GetCursorHeight : integer; virtual;
 
Protected function GetCursorWidth : integer; virtual;
 
Protected procedure Loaded; override;
 
Public procedure CreateCursor(const AndImage, XorImage: Qgraphics.TBitmap); virtual;

Protected declarations

Public Constructor Create(AOwner: TComponent); override;

Create calls the inherited create and then searches for other instances of TQRbwDynamicCursor. It then sets the Cursor property to a different value than all the other existing TQRbwDynamicCursor's.

Public Destructor Destroy; override;
 
Public procedure RedrawCursor; virtual;

RedrawCursor should be called when the cursor defined by TQRbwDynamicCursor needs to be changed.

Properties

Public property CursorHeight : integer read GetCursorHeight;

CursorHeight is the height of the cursor in pixels supported by the current display driver.

Public property CursorWidth : integer read GetCursorWidth;

CursorWidth is the Width of the cursor in pixels supported by the current display driver.

Published property Cursor : TCursor read GetCursor write SetCursor;

Cursor is a TCursor value that may be assigned to instances of other components, such as TForm that have a Cursor property. Doing so, will cause the cursor of that other component to be the one defined using TQRbwDynamicCursor. You should be certain that the value assigned to Cursor does not conflict with a custom cursor defined by something other than a TQRbwDynamicCursor.

Published property HotPointX : integer read FHotPointX write SetHotPointX;

HotPointX specifies the horizontal position of the cursor's hot spot. Setting HotPointX will not cause the cursor to be redrawn.

Published property HotPointY : integer read FHotPointY write SetHotPointY;

HotPointY specifies the vertical position of the cursor's hot spot. Setting HotPointY will not cause the cursor to be redrawn.

Published property OnDrawCursor : TDrawCursor read FOnDrawCursor write SetOnDrawCursor;

OnDrawCursor occurs after the creation of a pair of monochrome TBitMap's used to define the cursor that appears on the screen. These TBitMap's are passed to the event handler which should draw on the TBitMap's Canvas's to define the cursor that appears on the screen. If the event handler is not assigned, the protected method, DrawDefaultCursor, is called instead. The AndImage will apply bitwise and operation to the area overlain by the cursor. The XorImage will apply bitwise xor operation to the area overlain by the cursor.


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