fpvviewer: Adds properties to the drawer class and a nice instantaneous mousewheel zoom

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2707 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2013-03-22 10:33:46 +00:00
parent b84e2f1705
commit 56183071a6
3 changed files with 51 additions and 20 deletions

View File

@ -29,6 +29,22 @@ type
procedure HandleMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Clear;
public
property OnDblClick;
property OnTripleClick;
property OnQuadClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnMouseEnter;
property OnMouseLeave;
property OnMouseWheel;
property OnMouseWheelDown;
property OnMouseWheelUp;
end;
implementation

View File

@ -14,7 +14,7 @@ object frmFPVViewer: TfrmFPVViewer
Height = 424
Top = 176
Width = 485
PageIndex = 0
PageIndex = 1
Align = alClient
Anchors = [akLeft, akBottom]
TabOrder = 0
@ -26,7 +26,7 @@ object frmFPVViewer: TfrmFPVViewer
AnchorSideTop.Control = btnSearchInTokens
AnchorSideTop.Side = asrBottom
Left = 0
Height = 378
Height = 392
Top = 32
Width = 485
Align = alBottom
@ -65,7 +65,7 @@ object frmFPVViewer: TfrmFPVViewer
TabOrder = 1
object editFileName: TFileNameEdit
Left = 8
Height = 22
Height = 23
Top = 8
Width = 304
DialogOptions = []
@ -87,7 +87,7 @@ object frmFPVViewer: TfrmFPVViewer
end
object spinScale: TFloatSpinEdit
Left = 72
Height = 16
Height = 23
Top = 97
Width = 168
DecimalPlaces = 6
@ -100,9 +100,9 @@ object frmFPVViewer: TfrmFPVViewer
end
object Label1: TLabel
Left = 8
Height = 16
Height = 15
Top = 97
Width = 55
Width = 46
Caption = 'Scale by:'
ParentColor = False
end
@ -144,15 +144,15 @@ object frmFPVViewer: TfrmFPVViewer
end
object Label2: TLabel
Left = 8
Height = 16
Height = 15
Top = 72
Width = 88
Width = 73
Caption = 'Y adjustment:'
ParentColor = False
end
object spinAdjustY: TSpinEdit
Left = 80
Height = 16
Height = 23
Top = 72
Width = 72
Increment = 100
@ -162,7 +162,7 @@ object frmFPVViewer: TfrmFPVViewer
end
object spinAdjustX: TSpinEdit
Left = 232
Height = 16
Height = 23
Top = 72
Width = 72
Increment = 50
@ -172,9 +172,9 @@ object frmFPVViewer: TfrmFPVViewer
end
object Label3: TLabel
Left = 160
Height = 16
Height = 15
Top = 72
Width = 88
Width = 73
Caption = 'X adjustment:'
ParentColor = False
end
@ -189,18 +189,18 @@ object frmFPVViewer: TfrmFPVViewer
end
object Label4: TLabel
Left = 9
Height = 16
Height = 15
Top = 126
Width = 153
Width = 128
Caption = 'Force encoding on read:'
ParentColor = False
end
object comboEncoding: TComboBox
Left = 144
Height = 20
Height = 23
Top = 126
Width = 128
ItemHeight = 0
ItemHeight = 15
ItemIndex = 0
Items.Strings = (
'Read from the file'
@ -236,17 +236,17 @@ object frmFPVViewer: TfrmFPVViewer
end
object labelFileEncoding: TLabel
Left = 278
Height = 16
Height = 15
Top = 130
Width = 88
Width = 74
Caption = 'File encoding:'
ParentColor = False
end
object checkForceWhiteBackground: TCheckBox
Left = 9
Height = 18
Height = 19
Top = 152
Width = 178
Width = 153
Caption = 'Force white background?'
TabOrder = 11
end

View File

@ -51,6 +51,8 @@ type
private
procedure MyContourLineDrawingProc(z,x1,y1,x2,y2: Double);
function FPVDebugAddItemProc(AStr: string; AParent: Pointer): Pointer;
procedure HandleDrawerMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
public
{ public declarations }
Drawer: TFPVVDrawer;
@ -357,6 +359,7 @@ begin
Drawer.Left := 5;
Drawer.AnchorClient(5);
Drawer.TabStop := True;
Drawer.OnMouseWheel := @HandleDrawerMouseWheel;
end;
procedure TfrmFPVViewer.FormDestroy(Sender: TObject);
@ -390,5 +393,17 @@ begin
Result := lTreeItem;
end;
procedure TfrmFPVViewer.HandleDrawerMouseWheel(Sender: TObject;
Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint;
var Handled: Boolean);
begin
if WheelDelta > 0 then
spinScale.Value := spinScale.Value + spinScale.Increment
else
spinScale.Value := spinScale.Value - spinScale.Increment;
btnVisualize.Click();
end;
end.