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 real-world and screen coordinates. By default, the real-world 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 canvases of the PaintBox, BottomPaintBox, and Image subcomponents.
FBottomPaintBox: TPaintBox; |
|
FEndX: Integer; |
|
FEndY: Integer; |
|
FExaggeration: real; |
|
FExaggerationDirection: TExaggerationDirection; |
|
FHorizontalDirection: THorizontalDirection; |
|
FImage: TImage; |
|
FImmediateResize: boolean; |
|
FMagnification: real; |
|
FOriginX: real; |
|
FOriginY: real; |
|
FPaintBox: TzbPaintBox; |
|
FPanning: boolean; |
|
FStartX: Integer; |
|
FStartY: Integer; |
|
FStartXPosition: integer; |
|
FStartYPosition: integer; |
|
FStopXPosition: integer; |
|
FStopYPosition: integer; |
|
FVerticalDirection: TVerticalDirection; |
|
FZooming: boolean; |
|
FOnPan: TPanEvent; |
function GetCanZoomIn: boolean; |
|
function GetCanZoomOut: boolean; |
|
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 ContinueZoom(X, Y: Integer); |
|
procedure FinishZoom(X, Y: Integer); |
|
procedure InitWidget; override; |
|
procedure InvalidatePaintBoxesAndImage; |
|
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; |
|
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; |
|
procedure PaintZoomWindow(Sender: TObject); |
|
procedure Pan; virtual; |
|
procedure Resize; override; |
|
procedure AbortZoom; |
|
procedure BeginZoom(X, Y: Integer); |
|
constructor Create(AOwner: TComponent); override; |
|
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); |
FBottomPaintBox: TPaintBox; |
|
|
FEndX: Integer; |
|
|
FEndY: Integer; |
|
|
FExaggeration: real; |
|
|
FExaggerationDirection: TExaggerationDirection; |
|
|
FHorizontalDirection: THorizontalDirection; |
|
|
FImage: TImage; |
|
|
FImmediateResize: boolean; |
|
|
FMagnification: real; |
|
|
FOriginX: real; |
|
|
FOriginY: real; |
|
|
FPaintBox: TzbPaintBox; |
|
|
FPanning: boolean; |
|
|
FStartX: Integer; |
|
|
FStartY: Integer; |
|
|
FStartXPosition: integer; |
|
|
FStartYPosition: integer; |
|
|
FStopXPosition: integer; |
|
|
FStopYPosition: integer; |
|
|
FVerticalDirection: TVerticalDirection; |
|
|
FZooming: boolean; |
|
|
FOnPan: TPanEvent; |
|
function GetCanZoomIn: boolean; |
|
|
function GetCanZoomOut: boolean; |
|
|
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 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; override; |
|
|
procedure InvalidatePaintBoxesAndImage; |
|
|
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; |
|
|
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; |
|
|
procedure PaintZoomWindow(Sender: TObject); |
|
During zooming operations, a rectangle is drawn on PaintBox to indicate the area that will be visible after zooming is complete. |
procedure Pan; virtual; |
|
If Panning is true, BottomPaintBox, Image, and PaintBox 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; |
|
|
function X(XCoord: integer): extended; |
|
X converts a screen coordinate into a real-number X coordinate. |
function XCoord(X: extended): integer; |
|
XCoord converts a real-number X coordinate into a screen coordinate. |
function Y(YCoord: integer): extended; |
|
Y converts a screen coordinate into a real-number Y coordinate. |
function YCoord(Y: extended): integer; |
|
YCoord converts a real-number 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 BottomPaintBox: TPaintBox read FBottomPaintBox; |
|
|
property Exaggeration: real read FExaggeration write SetExaggeration; |
|
|
property ExaggerationDirection: TExaggerationDirection
read FExaggerationDirection write SetExaggerationDirection default
edVertical; |
|
|
property HorizontalDirection: THorizontalDirection
read FHorizontalDirection write SetHorizontalDirection; |
|
|
property Image: TImage read FImage; |
|
|
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 PaintBox: TzbPaintBox read FPaintBox; |
|
|
property VerticalDirection: TVerticalDirection read FVerticalDirection write
SetVerticalDirection; |
|
|
property OnPan: TPanEvent read FOnPan write FOnPan; |
|
|