From 82f445a910535ef586940981abef47668037fea2 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Fri, 5 Aug 2016 22:34:24 +0000 Subject: [PATCH] tvplanit: Make properties Achors, BorderSpacing and ChildSizing available for TVpResourceCombob and TVpPrintFormatCombobox. Improved, high-dpi aware layout of print preview form. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5076 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tvplanit/source/vpbaseds.pas | 10 ++- components/tvplanit/source/vpprtfmtcbox.pas | 8 ++ components/tvplanit/source/vpprtprvdlg.lfm | 89 +++++++++++++-------- components/tvplanit/source/vpprtprvdlg.pas | 7 +- 4 files changed, 78 insertions(+), 36 deletions(-) diff --git a/components/tvplanit/source/vpbaseds.pas b/components/tvplanit/source/vpbaseds.pas index 9e1d242e7..8a44d331c 100644 --- a/components/tvplanit/source/vpbaseds.pas +++ b/components/tvplanit/source/vpbaseds.pas @@ -159,6 +159,10 @@ type constructor Create (AOwner : TComponent); override; destructor Destroy; override; + {$IFDEF LCL} + property ChildSizing; + {$ENDIF} + published property DataStore : TVpCustomDataStore read FDataStore write SetDataStore; @@ -167,10 +171,14 @@ type default ruOnChange; property Version : string read GetAbout write SetAbout stored False; - + + property Align; property Anchors; property Constraints; property Style; + {$IFDEF LCL} + property Borderspacing; + {$ENDIF} end; diff --git a/components/tvplanit/source/vpprtfmtcbox.pas b/components/tvplanit/source/vpprtfmtcbox.pas index 4054d368e..4a4b635c1 100644 --- a/components/tvplanit/source/vpprtfmtcbox.pas +++ b/components/tvplanit/source/vpprtfmtcbox.pas @@ -67,11 +67,19 @@ type procedure UpdateItems; property Style; + {$IFDEF LCL} + property ChildSizing; + {$ENDIF} published property Version: string read GetAbout write SetAbout stored False; property ControlLink: TVpControlLink read FControlLink write SetControlLink; + property Align; + property Anchors; + {$IFDEF LCL} + property Borderspacing; + {$ENDIF} property Cursor; property DragCursor; property DragMode; diff --git a/components/tvplanit/source/vpprtprvdlg.lfm b/components/tvplanit/source/vpprtprvdlg.lfm index 523c474c5..e59002cac 100644 --- a/components/tvplanit/source/vpprtprvdlg.lfm +++ b/components/tvplanit/source/vpprtprvdlg.lfm @@ -17,42 +17,14 @@ object frmPrintPreview: TfrmPrintPreview LCLVersion = '1.7' object Panel1: TPanel Left = 0 - Height = 62 + Height = 58 Top = 0 Width = 540 Align = alTop - ClientHeight = 62 + AutoSize = True + ClientHeight = 58 ClientWidth = 540 TabOrder = 0 - object cboxZoom: TComboBox - Left = 296 - Height = 23 - Top = 32 - Width = 145 - ItemHeight = 15 - Items.Strings = ( - 'Fit to Control' - 'Actual Size' - '25%' - '33%' - '50%' - '67%' - '75%' - ) - OnChange = cboxZoomChange - Style = csDropDownList - TabOrder = 2 - end - object VpPrintFormatComboBox1: TVpPrintFormatComboBox - Left = 8 - Height = 23 - Top = 32 - Width = 280 - ItemHeight = 15 - Sorted = True - TabOrder = 1 - OnChange = VpPrintFormatComboBox1Change - end object ToolBar1: TToolBar Left = 1 Height = 27 @@ -122,11 +94,62 @@ object frmPrintPreview: TfrmPrintPreview Action = actCancel end end + object Panel2: TPanel + Left = 1 + Height = 29 + Top = 28 + Width = 538 + Align = alTop + AutoSize = True + BevelOuter = bvNone + ClientHeight = 29 + ClientWidth = 538 + TabOrder = 1 + object cboxZoom: TComboBox + Left = 389 + Height = 23 + Top = 2 + Width = 145 + Align = alRight + BorderSpacing.Top = 2 + BorderSpacing.Right = 4 + BorderSpacing.Bottom = 4 + ItemHeight = 15 + Items.Strings = ( + 'Fit to Control' + 'Actual Size' + '25%' + '33%' + '50%' + '67%' + '75%' + ) + OnChange = cboxZoomChange + Style = csDropDownList + TabOrder = 0 + end + object VpPrintFormatComboBox1: TVpPrintFormatComboBox + AnchorSideRight.Control = cboxZoom + Left = 4 + Height = 23 + Top = 2 + Width = 381 + Anchors = [akTop, akLeft, akRight] + Borderspacing.Left = 4 + Borderspacing.Top = 2 + Borderspacing.Right = 4 + Borderspacing.Bottom = 2 + ItemHeight = 15 + Sorted = True + TabOrder = 1 + OnChange = VpPrintFormatComboBox1Change + end + end end object VpPrintPreview1: TVpPrintPreview Left = 0 - Height = 756 - Top = 62 + Height = 760 + Top = 58 Width = 540 CurPage = 0 EndDate = 37355.4526088079 diff --git a/components/tvplanit/source/vpprtprvdlg.pas b/components/tvplanit/source/vpprtprvdlg.pas index bfe0fac33..b47324e69 100644 --- a/components/tvplanit/source/vpprtprvdlg.pas +++ b/components/tvplanit/source/vpprtprvdlg.pas @@ -50,9 +50,11 @@ type { TfrmPrintPreview } TfrmPrintPreview = class(TForm) + Bevel1: TBevel; Panel1: TPanel; cboxZoom: TComboBox; btnCancel: TToolButton; + Panel2: TPanel; VpPrintPreview1: TVpPrintPreview; VpPrintFormatComboBox1: TVpPrintFormatComboBox; ToolBar1: TToolBar; @@ -170,6 +172,7 @@ procedure TfrmPrintPreview.FormCreate(Sender: TObject); begin ReturnCode := rtAbandon; SetCaptions; + Toolbar1.ButtonHeight := ScaleY(Toolbar1.ButtonHeight, DesignTimeDPI); end; procedure TfrmPrintPreview.SetCaptions; @@ -422,7 +425,7 @@ var begin if VpPrintPreview1.ControlLink = nil then exit; - + (* cnv := TControlCanvas.Create; try cnv.Control := VpPrintFormatCombobox1; @@ -437,7 +440,7 @@ begin finally cnv.Free; - end; + end;*) end; end.