Description  Hierarchy  Fields  Methods  Properties 
type TQRbwZoomBox2 = class(TPanel)
TQRbwZoomBox2
is used as an interface for handling drawing with real number coordinates.
The functions X, XCoord, Y, and YCoord can be used to convert between realworld and screen coordinates. By default, the realworld coordinates increase to the left and upward but these directions can be reversed with HorizontalDirection and VerticalDirection.
Zooming operations are performed with BeginZoom and FinishZoom
Panning can be turned on and off with Panning.
Drawing should be done on the subcomponent.
FEndX: Integer; 

FEndY: Integer; 

FExaggeration: real; 

FExaggerationDirection: TExaggerationDirection; 

FHorizontalDirection: THorizontalDirection; 

FImage32: TzbImage32; 

FImmediateResize: boolean; 

FMagnification: real; 

FOnPan: TPanEvent; 

FOriginX: real; 

FOriginY: real; 

FPanning: boolean; 

FPositionedLayer: TPositionedLayer; 

FStartX: Integer; 

FStartY: Integer; 

FStartXPosition: integer; 

FStartYPosition: integer; 

FStopXPosition: integer; 

FStopYPosition: integer; 

FVerticalDirection: TVerticalDirection; 

FZooming: boolean; 

FOnMagnificationChanged: TNotifyEvent; 
function GetCanZoomIn: boolean; 

function GetCanZoomOut: boolean; 

procedure PaintLayer(Sender: TObject; Buffer: TBitmap32); 

procedure PanMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); 

procedure PanUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); 

procedure SetExaggeration(const Value: real); 

procedure SetExaggerationDirection(const Value: TExaggerationDirection); 

procedure SetHorizontalDirection(const Value: THorizontalDirection); 

procedure SetImmediateResize(const Value: boolean); 

procedure SetMagnification(Value: real); 

procedure SetOriginX(const Value: real); 

procedure SetOriginY(const Value: real); 

procedure SetPanning(const Value: boolean); 

procedure SetVerticalDirection(const Value: TVerticalDirection); 

procedure ZoomBoxHitTest(Sender: TObject; X, Y: Integer; var Passed: Boolean); 

procedure ContinueZoom(X, Y: Integer); 

procedure FinishZoom(X, Y: Integer); 

procedure InitWidget; 

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

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

procedure Pan; virtual; 

procedure Resize; override; 

procedure AbortZoom; 

procedure BeginZoom(X, Y: Integer); 

constructor Create(AOwner: TComponent); override; 

procedure InvalidateImage32; 

function X(XCoord: integer): extended; 

function XCoord(X: extended): integer; 

function Y(YCoord: integer): extended; 

function YCoord(Y: extended): integer; 

procedure ZoomBy(Factor: extended); 

procedure ZoomByAt(Factor: extended; CenterX, CenterY: integer); 
FEndX: Integer; 


FEndY: Integer; 


FExaggeration: real; 

See Exaggeration. 
FExaggerationDirection: TExaggerationDirection; 

FHorizontalDirection: THorizontalDirection; 

See HorizontalDirection. 
FImage32: TzbImage32; 


FImmediateResize: boolean; 

See ImmediateResize. 
FMagnification: real; 

See Magnification. 
FOnPan: TPanEvent; 

See OnPan. 
FOriginX: real; 

See OriginX. 
FOriginY: real; 

See OriginY. 
FPanning: boolean; 

See Panning. 
FPositionedLayer: TPositionedLayer; 


FStartX: Integer; 


FStartY: Integer; 


FStartXPosition: integer; 


FStartYPosition: integer; 


FStopXPosition: integer; 


FStopYPosition: integer; 


FVerticalDirection: TVerticalDirection; 

See VerticalDirection. 
FZooming: boolean; 


FOnMagnificationChanged: TNotifyEvent; 

function GetCanZoomIn: boolean; 


function GetCanZoomOut: boolean; 


procedure PaintLayer(Sender: TObject; Buffer: TBitmap32); 


procedure PanMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); 


procedure PanUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); 


procedure SetExaggeration(const Value: real); 

See Exaggeration. 
procedure SetExaggerationDirection(const Value: TExaggerationDirection); 

procedure SetHorizontalDirection(const Value: THorizontalDirection); 

See HorizontalDirection. 
procedure SetImmediateResize(const Value: boolean); 

See ImmediateResize. 
procedure SetMagnification(Value: real); 

See Magnification. 
procedure SetOriginX(const Value: real); 

See OriginX. 
procedure SetOriginY(const Value: real); 

See OriginY. 
procedure SetPanning(const Value: boolean); 

See Panning. 
procedure SetVerticalDirection(const Value: TVerticalDirection); 

See VerticalDirection. 
procedure ZoomBoxHitTest(Sender: TObject; X, Y: Integer; var Passed: Boolean); 


procedure ContinueZoom(X, Y: Integer); 

If BeginZoom has been called, and neither AbortZoom nor FinishZoom have yet been called, 
procedure FinishZoom(X, Y: Integer); 


procedure InitWidget; 


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


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


procedure Pan; virtual; 

If Panning is true, FStopXPosition and FStopYPosition are moved to follow the mouse. Then OnPan is called. 
procedure Resize; override; 

If ImmediateResize is 
procedure AbortZoom; 

If for some reason you want to terminate a zoom operation without doing the zoom, call 
procedure BeginZoom(X, Y: Integer); 


constructor Create(AOwner: TComponent); override; 


procedure InvalidateImage32; 


function X(XCoord: integer): extended; 

X converts a screen coordinate into a realnumber X coordinate. 
function XCoord(X: extended): integer; 

XCoord converts a realnumber X coordinate into a screen coordinate. 
function Y(YCoord: integer): extended; 

Y converts a screen coordinate into a realnumber Y coordinate. 
function YCoord(Y: extended): integer; 

YCoord converts a realnumber Y coordinate into a screen coordinate. 
procedure ZoomBy(Factor: extended); 


procedure ZoomByAt(Factor: extended; CenterX, CenterY: integer); 


property CanZoomIn: boolean read GetCanZoomIn; 

Read 
property CanZoomOut: boolean read GetCanZoomOut; 

Read 
property Panning: boolean read FPanning write SetPanning; 

Set 
property Exaggeration: real read FExaggeration write SetExaggeration; 


property ExaggerationDirection: TExaggerationDirection
read FExaggerationDirection write SetExaggerationDirection default
edVertical; 


property HorizontalDirection: THorizontalDirection
read FHorizontalDirection write SetHorizontalDirection; 


property Image32: TzbImage32 read FImage32; 


property ImmediateResize: boolean read FImmediateResize write SetImmediateResize; 

See Resize. 
property Magnification: real read FMagnification write SetMagnification; 


property OriginX: real read FOriginX write SetOriginX; 


property OriginY: real read FOriginY write SetOriginY; 


property VerticalDirection: TVerticalDirection read FVerticalDirection write
SetVerticalDirection; 


property OnPan: TPanEvent read FOnPan write FOnPan; 


property OnMagnificationChanged: TNotifyEvent
read FOnMagnificationChanged write FOnMagnificationChanged; 
