tvplanit: Update VpEdElem to scale correctly in the HighDpi mode of Lazarus 1.8.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5885 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2017-05-20 20:43:20 +00:00
parent e9103a1af1
commit 6dcc6c4a4b
2 changed files with 362 additions and 273 deletions

View File

@ -1,42 +1,48 @@
object frmEditElement: TfrmEditElement
Left = 486
Height = 449
Top = 220
Width = 489
Left = 288
Height = 516
Top = 321
Width = 661
HorzScrollBar.Page = 378
VertScrollBar.Page = 444
AutoSize = True
BorderStyle = bsDialog
Caption = 'Edit Element'
ClientHeight = 449
ClientWidth = 489
ClientHeight = 516
ClientWidth = 661
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '1.7'
LCLVersion = '1.6.4.0'
object gbVisual: TGroupBox
Left = 12
Height = 152
Top = 181
Width = 465
Height = 144
Top = 196
Width = 637
Align = alTop
AutoSize = True
BorderSpacing.Left = 12
BorderSpacing.Top = 8
BorderSpacing.Top = 12
BorderSpacing.Right = 12
Caption = ' Visual '
ClientHeight = 132
ClientWidth = 461
ClientHeight = 124
ClientWidth = 633
Font.Style = [fsBold]
ParentFont = False
TabOrder = 3
object rgMeasurement: TRadioGroup
Left = 104
Height = 124
AnchorSideLeft.Control = rgRotation
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = gbVisual
Left = 102
Height = 116
Top = 0
Width = 98
Align = alLeft
Width = 106
AutoFill = True
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Left = 16
BorderSpacing.Bottom = 8
BorderSpacing.InnerBorder = 4
Caption = ' Measurement '
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
@ -46,8 +52,8 @@ object frmEditElement: TfrmEditElement
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 104
ClientWidth = 94
ClientHeight = 96
ClientWidth = 102
ItemIndex = 1
Items.Strings = (
'Pixels'
@ -56,18 +62,21 @@ object frmEditElement: TfrmEditElement
'cm'
)
OnClick = rgMeasurementClick
ParentFont = False
TabOrder = 1
end
object rgRotation: TRadioGroup
AnchorSideLeft.Control = gbVisual
AnchorSideTop.Control = gbVisual
Left = 8
Height = 124
Height = 116
Top = 0
Width = 88
Align = alLeft
Width = 78
AutoFill = True
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Bottom = 8
BorderSpacing.InnerBorder = 8
BorderSpacing.InnerBorder = 4
Caption = ' Rotation '
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
@ -77,8 +86,8 @@ object frmEditElement: TfrmEditElement
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 104
ClientWidth = 84
ClientHeight = 96
ClientWidth = 74
ItemIndex = 0
Items.Strings = (
'0'
@ -86,171 +95,284 @@ object frmEditElement: TfrmEditElement
'180'
'270'
)
ParentFont = False
TabOrder = 0
end
object Panel3: TPanel
Left = 202
Height = 132
Top = 0
Width = 239
Align = alLeft
object HeightWidthPanel: TPanel
AnchorSideLeft.Control = TopLeftPanel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = rgMeasurement
AnchorSideTop.Side = asrCenter
AnchorSideBottom.Side = asrBottom
Left = 332
Height = 54
Top = 31
Width = 99
AutoSize = True
BorderSpacing.Left = 16
BorderSpacing.Top = 10
BorderSpacing.Right = 12
BevelOuter = bvNone
ClientHeight = 132
ClientWidth = 239
ClientHeight = 54
ClientWidth = 99
ParentFont = False
TabOrder = 2
object LblTop: TLabel
Left = 8
Height = 15
Top = 28
Width = 23
Caption = 'Top:'
FocusControl = edTop
ParentColor = False
end
object LblHeight: TLabel
Left = 136
AnchorSideTop.Control = edHeight
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = edHeight
Left = 0
Height = 15
Top = 28
Top = 4
Width = 39
BorderSpacing.Right = 4
Anchors = [akTop, akRight]
BorderSpacing.Right = 8
Caption = 'Height:'
FocusControl = edHeight
ParentColor = False
end
object edTop: TEdit
Left = 44
object edHeight: TEdit
AnchorSideTop.Control = BevelHeightWidth
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = udHeight
AnchorSideBottom.Control = BevelHeightWidth
Left = 47
Height = 23
Top = 24
Width = 48
Top = 0
Width = 40
Anchors = [akRight, akBottom]
OnEnter = PosEditEnter
OnExit = PosEditExit
TabOrder = 0
Text = '0.00'
end
object edHeight: TEdit
Left = 183
object udHeight: TUpDown
AnchorSideTop.Control = edHeight
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = HeightWidthPanel
AnchorSideRight.Side = asrBottom
Left = 87
Height = 23
Top = 24
Top = 0
Width = 12
Anchors = [akTop, akRight]
Associate = edHeight
Min = 0
OnClick = UpDownClick
Position = 0
TabOrder = 1
Wrap = False
end
object LblWidth: TLabel
AnchorSideTop.Control = edWidth
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = edWidth
Left = 4
Height = 15
Top = 35
Width = 35
Anchors = [akTop, akRight]
BorderSpacing.Right = 8
Caption = 'Width:'
FocusControl = edWidth
ParentColor = False
end
object edWidth: TEdit
AnchorSideTop.Control = BevelHeightWidth
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = udWidth
Left = 47
Height = 23
Top = 31
Width = 40
Anchors = [akTop, akRight]
OnEnter = PosEditEnter
OnExit = PosEditExit
TabOrder = 1
TabOrder = 2
Text = '0.00'
end
object udHeight: TUpDown
object udWidth: TUpDown
AnchorSideTop.Control = edWidth
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = HeightWidthPanel
AnchorSideRight.Side = asrBottom
Left = 223
Left = 87
Height = 23
Top = 24
Top = 31
Width = 12
Associate = edHeight
Anchors = [akTop, akRight]
Associate = edWidth
Min = 0
OnClick = UpDownClick
Position = 0
TabOrder = 3
Wrap = False
end
object BevelHeightWidth: TBevel
AnchorSideLeft.Control = HeightWidthPanel
AnchorSideTop.Control = HeightWidthPanel
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = HeightWidthPanel
AnchorSideRight.Side = asrBottom
Left = 0
Height = 8
Top = 23
Width = 99
Anchors = [akTop, akLeft, akRight]
end
end
object TopLeftPanel: TPanel
AnchorSideLeft.Control = rgMeasurement
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = rgMeasurement
AnchorSideTop.Side = asrCenter
Left = 224
Height = 54
Top = 31
Width = 92
AutoSize = True
BorderSpacing.Left = 16
BevelOuter = bvNone
ClientHeight = 54
ClientWidth = 92
ParentFont = False
TabOrder = 3
object BevelTopLeft: TBevel
AnchorSideTop.Control = TopLeftPanel
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = TopLeftPanel
AnchorSideRight.Side = asrBottom
Left = 0
Height = 8
Top = 23
Width = 92
Anchors = [akTop, akLeft, akRight]
end
object LblTop: TLabel
AnchorSideTop.Control = edTop
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = edTop
Left = 1
Height = 15
Top = 4
Width = 23
Anchors = [akTop, akRight]
BorderSpacing.Left = 1
BorderSpacing.Right = 8
Caption = 'Top:'
FocusControl = edTop
ParentColor = False
end
object edTop: TEdit
AnchorSideRight.Control = udTop
AnchorSideBottom.Control = BevelTopLeft
Left = 32
Height = 23
Top = 0
Width = 48
Anchors = [akRight, akBottom]
OnEnter = PosEditEnter
OnExit = PosEditExit
TabOrder = 0
Text = '0.00'
end
object udTop: TUpDown
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = TopLeftPanel
AnchorSideRight.Side = asrBottom
Left = 80
Height = 23
Top = 0
Width = 12
Anchors = [akTop, akRight]
Associate = edTop
Min = 0
OnClick = UpDownClick
Position = 0
TabOrder = 1
Wrap = False
end
object udLeft: TUpDown
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edLeft
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = TopLeftPanel
AnchorSideRight.Side = asrBottom
Left = 80
Height = 23
Top = 31
Width = 12
Anchors = [akTop, akRight]
Associate = edLeft
Min = 0
OnClick = UpDownClick
Position = 0
TabOrder = 2
Wrap = False
end
object LblLeft: TLabel
Left = 8
Height = 15
Top = 60
Width = 23
Caption = 'Left:'
FocusControl = edLeft
ParentColor = False
end
object LblWidth: TLabel
Left = 141
Height = 15
Top = 60
Width = 35
BorderSpacing.Right = 4
Caption = 'Width:'
FocusControl = edWidth
ParentColor = False
end
object edLeft: TEdit
Left = 44
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = udLeft
Left = 32
Height = 23
Top = 56
Top = 31
Width = 48
Anchors = [akTop, akRight]
OnEnter = PosEditEnter
OnExit = PosEditExit
TabOrder = 3
Text = '0.00'
end
object edWidth: TEdit
Left = 183
Height = 23
Top = 56
Width = 40
OnEnter = PosEditEnter
OnExit = PosEditExit
TabOrder = 4
Text = '0.00'
end
object udLeft: TUpDown
Left = 92
Height = 23
Top = 56
Width = 12
Associate = edLeft
Min = 0
OnClick = UpDownClick
Position = 0
TabOrder = 5
Wrap = False
end
object udWidth: TUpDown
AnchorSideRight.Side = asrBottom
Left = 223
Height = 23
Top = 56
Width = 12
Associate = edWidth
object LblLeft: TLabel
AnchorSideTop.Control = edLeft
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = edLeft
Left = 1
Height = 15
Top = 35
Width = 23
Anchors = [akTop, akRight]
BorderSpacing.Left = 1
BorderSpacing.Right = 8
Min = 0
OnClick = UpDownClick
Position = 0
TabOrder = 6
Wrap = False
Caption = 'Left:'
FocusControl = edLeft
ParentColor = False
end
end
object chkVisible: TCheckBox
Left = 48
AnchorSideLeft.Control = TopLeftPanel
AnchorSideRight.Control = TopLeftPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = rgMeasurement
AnchorSideBottom.Side = asrBottom
Left = 262
Height = 19
Top = 88
Top = 97
Width = 54
Alignment = taLeftJustify
Anchors = [akRight, akBottom]
Caption = 'Visible'
TabOrder = 7
end
object udTop: TUpDown
Left = 92
Height = 23
Top = 24
Width = 12
Associate = edTop
Min = 0
OnClick = UpDownClick
Position = 0
TabOrder = 8
Wrap = False
end
ParentFont = False
TabOrder = 4
end
end
object gbCaption: TGroupBox
Left = 12
Height = 54
Top = 341
Width = 465
Top = 352
Width = 637
Align = alTop
AutoSize = True
BorderSpacing.Left = 12
BorderSpacing.Top = 8
BorderSpacing.Top = 12
BorderSpacing.Right = 12
BorderSpacing.Bottom = 6
Caption = ' Caption '
ClientHeight = 34
ClientWidth = 461
ClientWidth = 633
Font.Style = [fsBold]
ParentFont = False
TabOrder = 4
object lblCaptionText: TLabel
AnchorSideLeft.Control = gbCaption
@ -264,37 +386,41 @@ object frmEditElement: TfrmEditElement
Caption = 'Text: '
FocusControl = edCaptionText
ParentColor = False
ParentFont = False
end
object btnCaptionFont: TButton
AnchorSideTop.Control = edCaptionText
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = gbCaption
AnchorSideRight.Side = asrBottom
Left = 386
Left = 566
Height = 25
Top = 1
Width = 67
Width = 59
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Font...'
OnClick = btnCaptionFontClick
ParentFont = False
TabOrder = 1
end
object edCaptionText: TEdit
AnchorSideLeft.Control = lblCaptionText
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = btnCaptionFont
Left = 39
Left = 43
Height = 23
Top = 2
Width = 343
Width = 519
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 4
BorderSpacing.Left = 8
BorderSpacing.Top = 2
BorderSpacing.Right = 4
BorderSpacing.Bottom = 8
OnChange = edCaptionTextChange
ParentFont = False
TabOrder = 0
end
end
@ -302,7 +428,7 @@ object frmEditElement: TfrmEditElement
Left = 12
Height = 23
Top = 8
Width = 465
Width = 637
Align = alTop
AutoSize = True
BorderSpacing.Left = 12
@ -311,7 +437,7 @@ object frmEditElement: TfrmEditElement
BorderSpacing.Bottom = 8
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 465
ClientWidth = 637
TabOrder = 0
object lblName: TLabel
AnchorSideTop.Control = edName
@ -329,7 +455,7 @@ object frmEditElement: TfrmEditElement
Left = 42
Height = 23
Top = 0
Width = 423
Width = 595
Align = alRight
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 4
@ -338,44 +464,61 @@ object frmEditElement: TfrmEditElement
end
object Panel2: TPanel
Left = 12
Height = 56
Top = 117
Width = 467
Height = 51
Top = 133
Width = 639
Align = alTop
AutoSize = True
BorderSpacing.Left = 12
BorderSpacing.Top = 8
BorderSpacing.Top = 12
BorderSpacing.Right = 10
BevelOuter = bvNone
ClientHeight = 56
ClientWidth = 467
ClientHeight = 51
ClientWidth = 639
TabOrder = 2
object gbDayOffset: TGroupBox
AnchorSideTop.Control = Panel2
AnchorSideBottom.Control = rgDayOffsetUnit
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 56
Height = 51
Top = 0
Width = 98
Width = 96
Anchors = [akTop, akLeft, akBottom]
AutoSize = True
Caption = 'Day Offset'
ClientHeight = 36
ClientWidth = 94
ClientHeight = 31
ClientWidth = 92
Font.Style = [fsBold]
ParentFont = False
TabOrder = 0
object edOffset: TEdit
AnchorSideLeft.Control = gbDayOffset
AnchorSideTop.Control = gbDayOffset
Left = 8
Height = 23
Top = 2
Top = 3
Width = 64
Alignment = taRightJustify
BorderSpacing.Left = 8
BorderSpacing.Top = 3
BorderSpacing.Bottom = 8
ParentFont = False
TabOrder = 0
Text = '0'
end
object udOffset: TUpDown
AnchorSideLeft.Control = edOffset
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edOffset
AnchorSideTop.Side = asrCenter
Left = 72
Height = 23
Top = 2
Top = 3
Width = 12
Associate = edOffset
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Min = 0
Position = 0
TabOrder = 1
@ -387,14 +530,14 @@ object frmEditElement: TfrmEditElement
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Panel2
AnchorSideRight.Side = asrBottom
Left = 106
Left = 108
Height = 51
Top = 0
Width = 361
Width = 531
Anchors = [akTop, akLeft, akRight]
AutoFill = True
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Left = 12
Caption = ' Day Offset Unit '
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
@ -405,7 +548,7 @@ object frmEditElement: TfrmEditElement
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 4
ClientHeight = 31
ClientWidth = 357
ClientWidth = 527
Columns = 4
ItemIndex = 0
Items.Strings = (
@ -414,51 +557,59 @@ object frmEditElement: TfrmEditElement
'Month'
'Year'
)
ParentFont = False
TabOrder = 1
end
end
object ButtonPanel: TPanel
Left = 12
Left = 0
Height = 25
Top = 403
Width = 465
Top = 414
Width = 649
Align = alTop
BorderSpacing.Left = 12
AutoSize = True
BorderSpacing.Top = 8
BorderSpacing.Right = 12
BorderSpacing.Bottom = 9
BorderSpacing.Bottom = 8
BevelOuter = bvNone
ClientHeight = 25
ClientWidth = 465
ClientWidth = 649
TabOrder = 5
object btnShape: TButton
AnchorSideLeft.Control = ButtonPanel
Left = 0
Left = 12
Height = 25
Top = 0
Width = 75
Width = 67
AutoSize = True
BorderSpacing.Left = 12
Caption = 'Shape...'
Enabled = False
OnClick = btnShapeClick
TabOrder = 0
end
object btnOk: TButton
Left = 316
AnchorSideRight.Control = btnCancel
Left = 512
Height = 25
Top = 0
Width = 75
Width = 71
Anchors = [akTop, akRight]
BorderSpacing.Right = 4
Caption = 'OK'
Default = True
OnClick = btnOkClick
TabOrder = 1
end
object btnCancel: TButton
AnchorSideRight.Control = ButtonPanel
AnchorSideRight.Side = asrBottom
Left = 391
Left = 587
Height = 25
Top = 0
Width = 74
Anchors = [akTop]
Width = 62
Anchors = [akTop, akRight]
AutoSize = True
Cancel = True
Caption = 'Cancel'
OnClick = btnCancelClick
@ -467,25 +618,26 @@ object frmEditElement: TfrmEditElement
end
object ItemTypePanel: TPanel
Left = 12
Height = 70
Top = 39
Width = 467
Height = 78
Top = 43
Width = 639
Align = alTop
AutoSize = True
BorderSpacing.Left = 12
BorderSpacing.Top = 8
BorderSpacing.Top = 12
BorderSpacing.Right = 10
BevelOuter = bvNone
ClientHeight = 70
ClientWidth = 467
ClientHeight = 78
ClientWidth = 639
TabOrder = 1
object rgItemType: TRadioGroup
Left = 0
Height = 70
Height = 78
Top = 0
Width = 303
Width = 639
Align = alClient
AutoFill = True
AutoSize = True
BorderSpacing.InnerBorder = 4
Caption = 'Item Type '
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
@ -495,8 +647,8 @@ object frmEditElement: TfrmEditElement
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 4
ClientHeight = 50
ClientWidth = 299
ClientHeight = 58
ClientWidth = 635
Columns = 4
ItemIndex = 0
Items.Strings = (
@ -510,6 +662,7 @@ object frmEditElement: TfrmEditElement
'Contacts'
)
OnClick = rgItemTypeClick
ParentFont = False
TabOrder = 0
end
end
@ -518,7 +671,7 @@ object frmEditElement: TfrmEditElement
Font.Name = 'MS Sans Serif'
MinFontSize = 0
MaxFontSize = 0
left = 224
top = 352
left = 272
top = 424
end
end

View File

@ -47,6 +47,8 @@ type
{ TfrmEditElement }
TfrmEditElement = class(TForm)
BevelHeightWidth: TBevel;
BevelTopLeft: TBevel;
btnCancel: TButton;
btnOk: TButton;
btnShape: TButton;
@ -57,7 +59,8 @@ type
Panel2: TPanel;
ButtonPanel: TPanel;
ItemTypePanel: TPanel;
Panel3: TPanel;
HeightWidthPanel: TPanel;
TopLeftPanel: TPanel;
rgDayOffsetUnit: TRadioGroup;
rgItemType: TRadioGroup;
gbVisual: TGroupBox;
@ -134,6 +137,8 @@ begin
end;
{=====}
procedure TfrmEditElement.FormCreate(Sender: TObject);
var
i: Integer;
begin
btnShape.Enabled := False;
@ -142,6 +147,14 @@ begin
lblCaptionText.Enabled := False;
btnCaptionFont.Enabled := False;
for i:=0 to rgDayOffsetUnit.ComponentCount-1 do
TRadioButton(rgDayOffsetUnit.Components[i]).ParentFont := false;
rgDayOffsetUnit.Font.Style := [fsBold];
for i:=0 to rgItemType.ComponentCount-1 do
TRadioButton(rgItemType.Components[i]).ParentFont := false;
rgItemType.Font.Style := [fsBold];
SetCaptions;
end;
{=====}
@ -296,94 +309,17 @@ begin
end;
procedure TfrmEditElement.PositionControls;
var
w, hEd, hBtn: Integer;
DELTA: Integer = 8;
begin
DELTA := ScaleX(DELTA, DesignTimeDPI);
AutoSize := false;
AlignOKCancel(btnOK, btnCancel, ButtonPanel);
// Fix edit heights at higher dpi
with TEdit.Create(self) do
try
Parent := self;
hEd := Height;
finally
free;
end;
edName.Height := hEd;
edOffset.Height := hEd;
udOffset.Height := hEd;
edTop.Height := hEd;
edLeft.Height := hEd;
edHeight.Height := hEd;
edWidth.Height := hEd;
udTop.Height := hEd;
udLeft.Height := hEd;
udHeight.Height := hEd;
udWidth.Height := hEd;
edCaptionText.Height := hEd;
udOffset.Width := udOffset.Height div 2 + 1;
udTop.Width := udTop.Height div 2 + 1;
udLeft.Width := udLeft.Height div 2 + 1;
udHeight.Width := udHeight.Height div 2 + 1;
udWidth.Width := udWidth.Height div 2 + 1;
// Fix button heights a higher dpi
hBtn := ScaleY(btnOK.Height, DesignTimeDPI);
btnOK.Height := hBtn;
btnCancel.Height := hBtn;
btnShape.Height := hBtn;
btnCaptionFont.Height := hBtn;
ButtonPanel.Height := btnOK.Top + btnOK.Height + btnOK.Top;
gbDayOffset.Height := rgDayOffsetUnit.Height;
rgRotation.Height := rgMeasurement.Height;
rgRotation.Width := rgMeasurement.Width;
// Position Left/Top etc controls
w := Max(GetLabelWidth(lblLeft), GetLabelWidth(lblTop));
edTop.Left := 2*DELTA + w + DELTA;
udTop.Left := RightOf(edTop);
lblTop.Left := edTop.Left - DELTA - GetLabelWidth(lblTop);
edLeft.Left := edTop.Left;
udLeft.Left := RightOf(edLeft);
lblLeft.Left := edLeft.Left - DELTA - GetLabelWidth(lblLeft);
w := Max(GetLabelWidth(lblWidth), GetLabelWidth(lblHeight));
edHeight.Left := RightOf(edTop) + 3*DELTA + w + DELTA;
edWidth.Left := edHeight.Left;
udHeight.Left := RightOf(edHeight);
udWidth.Left := RightOf(edWidth);
lblHeight.Left := edHeight.Left - DELTA - GetLabelWidth(lblHeight);
lblWidth.Left := edWidth.Left - DELTA - GetLabelWidth(lblWidth);
chkVisible.Left := edTop.Left;
Panel3.Width := RightOf(udHeight) + 2*DELTA;
// Caption
btnCaptionFont.Width := GetButtonWidth(btnCaptionFont);
// Buttons at the bottom
w := Max(GetButtonWidth(btnOK), GetButtonWidth(btnCancel));
btnOK.Width := w;
btnCancel.Width := w;
btnShape.Width := GetButtonWidth(btnShape);
// Form size
rgItemType.Align := alNone;
ClientWidth := rgItemType.Width + ItemTypePanel.BorderSpacing.Left + ItemTypePanel.BorderSpacing.Right;
rgItemType.Align := alClient;
if RightOf(udHeight) > gbVisual.ClientWidth then
ClientWidth := RightOf(udHeight) + gbVisual.BorderSpacing.Left + gbVisual.BorderSpacing.Right;
AutoSize := true;
{$IFDEF MSWINDOWS}
btnCancel.Left := ButtonPanel.ClientWidth - btnCancel.Width;
btnOK.Left := btnCancel.Left - btnOK.Width - DELTA;
btnOK.TabOrder := 1;
btnCancel.TabOrder := 2;
{$ELSE}
btnOK.Left := ButtonPanel.ClientWidth - btnOK.Width;
btnCancel.Left := btnOK.Left - btnCancel.Width - DELTA;
btnCancel.TabOrder := 1;
btnOK.TabOrder := 2;
{$ENDIF}
BevelTopLeft.Shape := bsSpacer;
BevelHeightWidth.Shape := bsSpacer;
end;
procedure TfrmEditElement.SetData(AnElement : TVpPrintFormatElementItem);