From 5572830dac478251a0059cf219c6ac249f87a09a Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Fri, 19 May 2017 15:06:32 +0000 Subject: [PATCH] tvplanit: Update TContactEditForm to scale correctly in the HiDPI mode of Lazarus 1.8 git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5872 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../tvplanit/source/vpcontacteditdlg.lfm | 695 +++++++++++------- .../tvplanit/source/vpcontacteditdlg.pas | 176 +---- 2 files changed, 448 insertions(+), 423 deletions(-) diff --git a/components/tvplanit/source/vpcontacteditdlg.lfm b/components/tvplanit/source/vpcontacteditdlg.lfm index a28d54e44..bf8057122 100644 --- a/components/tvplanit/source/vpcontacteditdlg.lfm +++ b/components/tvplanit/source/vpcontacteditdlg.lfm @@ -1,135 +1,185 @@ object ContactEditForm: TContactEditForm - Left = 679 - Height = 629 - Top = 224 - Width = 575 + Left = 479 + Height = 739 + Top = 22 + Width = 480 HorzScrollBar.Page = 432 VertScrollBar.Page = 320 ActiveControl = PageControl Caption = 'ContactEdit' - ClientHeight = 629 - ClientWidth = 575 + ClientHeight = 739 + ClientWidth = 480 + Constraints.MinWidth = 480 OnCreate = FormCreate OnKeyDown = FormKeyDown OnShow = FormShow Position = poScreenCenter - LCLVersion = '1.7' + LCLVersion = '1.9.0.0' object PageControl: TPageControl Left = 0 - Height = 592 + Height = 706 Top = 0 - Width = 575 - ActivePage = tabContact + Width = 480 + ActivePage = tabBaseData Align = alClient - TabIndex = 2 + TabIndex = 0 TabOrder = 0 OnChange = PageControlChange object tabBaseData: TTabSheet Caption = 'tabBaseData' - ClientHeight = 564 - ClientWidth = 567 + ClientHeight = 678 + ClientWidth = 472 ImageIndex = 0 object lblLastName: TLabel - Left = 9 + AnchorSideTop.Control = edLastName + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = edLastName + Left = 44 Height = 15 - Top = 6 + Top = 12 Width = 54 Alignment = taRightJustify + Anchors = [akTop, akRight] BorderSpacing.Left = 8 + BorderSpacing.Right = 8 Caption = 'Last name' FocusControl = edLastName ParentColor = False end object edLastName: TEdit - Left = 136 + AnchorSideTop.Control = tabBaseData + AnchorSideRight.Control = tabBaseData + AnchorSideRight.Side = asrBottom + Left = 106 Height = 23 - Top = 6 - Width = 232 + Top = 8 + Width = 358 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Top = 8 BorderSpacing.Right = 8 MaxLength = 100 OnChange = ItemChanged TabOrder = 0 end object lblFirstName: TLabel - Left = 8 + AnchorSideTop.Control = edFirstName + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = edFirstName + Left = 43 Height = 15 - Top = 31 + Top = 39 Width = 55 Alignment = taRightJustify + Anchors = [akTop, akRight] BorderSpacing.Left = 8 + BorderSpacing.Right = 8 Caption = 'First name' FocusControl = edFirstName ParentColor = False end object edFirstName: TEdit - Left = 136 + AnchorSideLeft.Control = edLastName + AnchorSideTop.Control = edLastName + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = tabBaseData + AnchorSideRight.Side = asrBottom + Left = 106 Height = 23 - Top = 29 - Width = 232 + Top = 35 + Width = 358 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Top = 4 BorderSpacing.Right = 8 MaxLength = 100 OnChange = ItemChanged TabOrder = 1 end object lblTitle: TLabel - Left = 8 + AnchorSideTop.Control = edTitle + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = edTitle + Left = 75 Height = 15 - Top = 58 + Top = 66 Width = 23 Alignment = taRightJustify + Anchors = [akTop, akRight] BorderSpacing.Left = 8 + BorderSpacing.Right = 8 Caption = 'Title' FocusControl = edTitle ParentColor = False end object edTitle: TEdit - Left = 136 + AnchorSideLeft.Control = edLastName + AnchorSideTop.Control = edFirstName + AnchorSideTop.Side = asrBottom + Left = 106 Height = 23 - Top = 56 + Top = 62 Width = 153 + BorderSpacing.Top = 4 MaxLength = 50 OnChange = ItemChanged TabOrder = 2 end object lblCategory: TLabel - Left = 8 + AnchorSideTop.Control = cbCategory + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = cbCategory + Left = 50 Height = 15 - Top = 90 + Top = 93 Width = 48 Alignment = taRightJustify + Anchors = [akTop, akRight] BorderSpacing.Left = 8 + BorderSpacing.Right = 8 Caption = 'Category' FocusControl = cbCategory ParentColor = False end object cbCategory: TComboBox - Left = 136 + AnchorSideLeft.Control = edLastName + AnchorSideTop.Control = edTitle + AnchorSideTop.Side = asrBottom + Left = 106 Height = 23 - Top = 88 + Top = 89 Width = 153 + BorderSpacing.Top = 4 ItemHeight = 15 MaxLength = 65535 TabOrder = 3 end object lblBirthdate: TLabel - Left = 16 + AnchorSideTop.Control = edBirthdate + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = edBirthdate + Left = 47 Height = 15 - Top = 124 + Top = 120 Width = 51 Alignment = taRightJustify + Anchors = [akTop, akRight] BorderSpacing.Left = 8 + BorderSpacing.Right = 8 Caption = 'Birth date' FocusControl = edBirthdate ParentColor = False end object edBirthdate: TDateEdit - Left = 136 + AnchorSideLeft.Control = edLastName + AnchorSideTop.Control = cbCategory + AnchorSideTop.Side = asrBottom + Left = 106 Height = 23 - Top = 120 + Top = 116 Width = 153 CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames] DateOrder = doNone ButtonWidth = 23 + BorderSpacing.Top = 4 BorderSpacing.Bottom = 8 NumGlyphs = 1 MaxLength = 0 @@ -140,14 +190,14 @@ object ContactEditForm: TContactEditForm end object tabAddresses: TTabSheet Caption = 'tabAddresses' - ClientHeight = 564 - ClientWidth = 567 + ClientHeight = 752 + ClientWidth = 617 ImageIndex = 1 object gbWorkAddress: TGroupBox Left = 8 - Height = 311 + Height = 408 Top = 8 - Width = 551 + Width = 601 Align = alTop AutoSize = True BorderSpacing.Left = 8 @@ -155,8 +205,8 @@ object ContactEditForm: TContactEditForm BorderSpacing.Right = 8 BorderSpacing.Bottom = 8 Caption = 'gbWorkAddress' - ClientHeight = 291 - ClientWidth = 547 + ClientHeight = 388 + ClientWidth = 597 Font.Style = [fsBold] ParentFont = False TabOrder = 0 @@ -164,12 +214,11 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = gbWorkAddress AnchorSideRight.Control = gbWorkAddress AnchorSideRight.Side = asrBottom - Left = 201 - Height = 23 + Left = 251 + Height = 33 Top = 0 Width = 338 Anchors = [akTop, akRight] - AutoSize = False BorderSpacing.Right = 8 MaxLength = 50 OnChange = ItemChanged @@ -180,10 +229,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = edCompany AnchorSideTop.Side = asrCenter AnchorSideRight.Control = edCompany - Left = 128 - Height = 15 + Left = 147 + Height = 25 Top = 4 - Width = 65 + Width = 96 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -197,10 +246,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = edDepartment AnchorSideTop.Side = asrCenter AnchorSideRight.Control = edCompany - Left = 117 - Height = 15 - Top = 31 - Width = 76 + Left = 129 + Height = 25 + Top = 41 + Width = 114 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -216,9 +265,9 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Side = asrBottom AnchorSideRight.Control = edCompany AnchorSideRight.Side = asrBottom - Left = 201 - Height = 23 - Top = 27 + Left = 251 + Height = 33 + Top = 37 Width = 338 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 4 @@ -231,10 +280,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = edPosition AnchorSideTop.Side = asrCenter AnchorSideRight.Control = edCompany - Left = 137 - Height = 15 - Top = 58 - Width = 56 + Left = 160 + Height = 25 + Top = 78 + Width = 83 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -248,15 +297,14 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Control = edDepartment AnchorSideTop.Control = edDepartment AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = edDepartment + AnchorSideRight.Control = edCompany AnchorSideRight.Side = asrBottom - Left = 201 - Height = 23 - Top = 54 + Left = 251 + Height = 33 + Top = 74 Width = 338 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 4 - BorderSpacing.Bottom = 17 MaxLength = 50 OnChange = ItemChanged ParentFont = False @@ -266,10 +314,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = edAddressW AnchorSideTop.Side = asrCenter AnchorSideRight.Control = edCompany - Left = 138 - Height = 15 - Top = 98 - Width = 55 + Left = 159 + Height = 25 + Top = 115 + Width = 84 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -283,11 +331,11 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Control = edPosition AnchorSideTop.Control = edPosition AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = edPosition + AnchorSideRight.Control = edCompany AnchorSideRight.Side = asrBottom - Left = 201 - Height = 23 - Top = 94 + Left = 251 + Height = 33 + Top = 111 Width = 338 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 4 @@ -300,10 +348,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = edCityW AnchorSideTop.Side = asrCenter AnchorSideRight.Control = edCompany - Left = 159 - Height = 15 - Top = 125 - Width = 34 + Left = 194 + Height = 25 + Top = 152 + Width = 49 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -317,11 +365,11 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Control = edAddressW AnchorSideTop.Control = edAddressW AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = edAddressW + AnchorSideRight.Control = edCompany AnchorSideRight.Side = asrBottom - Left = 201 - Height = 23 - Top = 121 + Left = 251 + Height = 33 + Top = 148 Width = 338 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 4 @@ -334,10 +382,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = edStateW AnchorSideTop.Side = asrCenter AnchorSideRight.Control = edCompany - Left = 154 - Height = 15 - Top = 152 - Width = 39 + Left = 184 + Height = 25 + Top = 189 + Width = 59 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -351,11 +399,11 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Control = edCityW AnchorSideTop.Control = edCityW AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = edCityW + AnchorSideRight.Control = edCompany AnchorSideRight.Side = asrBottom - Left = 201 - Height = 23 - Top = 148 + Left = 251 + Height = 33 + Top = 185 Width = 338 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 4 @@ -368,10 +416,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = cbStateW AnchorSideTop.Side = asrCenter AnchorSideRight.Control = edCompany - Left = 118 - Height = 15 - Top = 179 - Width = 79 + Left = 128 + Height = 25 + Top = 226 + Width = 119 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -386,11 +434,11 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Control = edStateW AnchorSideTop.Control = edStateW AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = edStateW + AnchorSideRight.Control = edCompany AnchorSideRight.Side = asrBottom - Left = 201 + Left = 251 Height = 23 - Top = 175 + Top = 222 Width = 338 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 4 @@ -404,10 +452,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = edZipCodeW AnchorSideTop.Side = asrCenter AnchorSideRight.Control = edCompany - Left = 135 - Height = 15 - Top = 206 - Width = 58 + Left = 157 + Height = 25 + Top = 263 + Width = 86 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -422,9 +470,9 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = cbStateW AnchorSideTop.Side = asrBottom AnchorSideRight.Side = asrBottom - Left = 201 - Height = 23 - Top = 202 + Left = 251 + Height = 33 + Top = 259 Width = 120 BorderSpacing.Top = 4 BorderSpacing.Right = 8 @@ -437,10 +485,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = cbCountryW AnchorSideTop.Side = asrCenter AnchorSideRight.Control = edCompany - Left = 97 - Height = 15 - Top = 233 - Width = 96 + Left = 101 + Height = 25 + Top = 300 + Width = 142 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -455,15 +503,14 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Control = edZipCodeW AnchorSideTop.Control = edZipCodeW AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = gbWorkAddress + AnchorSideRight.Control = edCompany AnchorSideRight.Side = asrBottom - Left = 201 + Left = 251 Height = 23 - Top = 229 + Top = 296 Width = 338 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 4 - BorderSpacing.Right = 8 BorderSpacing.Bottom = 8 ItemHeight = 15 MaxLength = 65535 @@ -476,10 +523,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = edCountryW AnchorSideTop.Side = asrCenter AnchorSideRight.Control = edCompany - Left = 137 - Height = 15 - Top = 264 - Width = 56 + Left = 161 + Height = 25 + Top = 341 + Width = 82 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -493,15 +540,14 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Control = cbCountryW AnchorSideTop.Control = cbCountryW AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = gbWorkAddress + AnchorSideRight.Control = edCompany AnchorSideRight.Side = asrBottom - Left = 201 - Height = 23 - Top = 260 + Left = 251 + Height = 33 + Top = 337 Width = 338 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 4 - BorderSpacing.Right = 8 BorderSpacing.Bottom = 8 ParentFont = False TabOrder = 9 @@ -509,9 +555,9 @@ object ContactEditForm: TContactEditForm end object gbHomeAddress: TGroupBox Left = 8 - Height = 217 - Top = 335 - Width = 551 + Height = 297 + Top = 432 + Width = 601 Align = alTop AutoSize = True BorderSpacing.Left = 8 @@ -519,8 +565,8 @@ object ContactEditForm: TContactEditForm BorderSpacing.Right = 8 BorderSpacing.Bottom = 8 Caption = 'gbHomeAddress' - ClientHeight = 197 - ClientWidth = 547 + ClientHeight = 277 + ClientWidth = 597 Font.Style = [fsBold] ParentFont = False TabOrder = 1 @@ -528,10 +574,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = edAddressH AnchorSideTop.Side = asrCenter AnchorSideRight.Control = edAddressH - Left = 138 - Height = 15 + Left = 159 + Height = 25 Top = 4 - Width = 55 + Width = 84 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -543,12 +589,14 @@ object ContactEditForm: TContactEditForm end object edAddressH: TEdit AnchorSideTop.Control = gbHomeAddress + AnchorSideRight.Control = gbHomeAddress AnchorSideRight.Side = asrBottom - Left = 201 - Height = 23 + Left = 251 + Height = 33 Top = 0 Width = 338 Anchors = [akTop, akRight] + BorderSpacing.Right = 8 MaxLength = 100 OnChange = ItemChanged ParentFont = False @@ -558,10 +606,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = edCityH AnchorSideTop.Side = asrCenter AnchorSideRight.Control = edCityH - Left = 159 - Height = 15 - Top = 31 - Width = 34 + Left = 194 + Height = 25 + Top = 41 + Width = 49 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -577,9 +625,9 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Side = asrBottom AnchorSideRight.Control = edAddressH AnchorSideRight.Side = asrBottom - Left = 201 - Height = 23 - Top = 27 + Left = 251 + Height = 33 + Top = 37 Width = 338 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 4 @@ -592,10 +640,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = edStateH AnchorSideTop.Side = asrCenter AnchorSideRight.Control = edStateH - Left = 154 - Height = 15 - Top = 58 - Width = 39 + Left = 184 + Height = 25 + Top = 78 + Width = 59 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -609,11 +657,11 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Control = edCityH AnchorSideTop.Control = edCityH AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = edCityH + AnchorSideRight.Control = edAddressH AnchorSideRight.Side = asrBottom - Left = 201 - Height = 23 - Top = 54 + Left = 251 + Height = 33 + Top = 74 Width = 338 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 4 @@ -626,10 +674,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = cbStateH AnchorSideTop.Side = asrCenter AnchorSideRight.Control = cbStateH - Left = 118 - Height = 15 - Top = 85 - Width = 79 + Left = 128 + Height = 25 + Top = 115 + Width = 119 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -644,11 +692,11 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Control = edStateH AnchorSideTop.Control = edStateH AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = edStateH + AnchorSideRight.Control = edAddressH AnchorSideRight.Side = asrBottom - Left = 201 + Left = 251 Height = 23 - Top = 81 + Top = 111 Width = 338 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 4 @@ -662,10 +710,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = edZipCodeH AnchorSideTop.Side = asrCenter AnchorSideRight.Control = edZipCodeH - Left = 135 - Height = 15 - Top = 112 - Width = 58 + Left = 157 + Height = 25 + Top = 152 + Width = 86 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -680,9 +728,9 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = cbStateH AnchorSideTop.Side = asrBottom AnchorSideRight.Side = asrBottom - Left = 201 - Height = 23 - Top = 108 + Left = 251 + Height = 33 + Top = 148 Width = 120 BorderSpacing.Top = 4 BorderSpacing.Right = 8 @@ -695,10 +743,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = cbCountryH AnchorSideTop.Side = asrCenter AnchorSideRight.Control = cbCountryH - Left = 97 - Height = 15 - Top = 139 - Width = 96 + Left = 101 + Height = 25 + Top = 189 + Width = 142 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -713,15 +761,14 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Control = edZipCodeH AnchorSideTop.Control = edZipCodeH AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = gbHomeAddress + AnchorSideRight.Control = edAddressH AnchorSideRight.Side = asrBottom - Left = 201 + Left = 251 Height = 23 - Top = 135 + Top = 185 Width = 338 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 4 - BorderSpacing.Right = 8 BorderSpacing.Bottom = 8 ItemHeight = 15 MaxLength = 65535 @@ -734,10 +781,10 @@ object ContactEditForm: TContactEditForm AnchorSideTop.Control = edCountryH AnchorSideTop.Side = asrCenter AnchorSideRight.Control = edCountryH - Left = 137 - Height = 15 - Top = 170 - Width = 56 + Left = 161 + Height = 25 + Top = 230 + Width = 82 Alignment = taRightJustify Anchors = [akTop, akRight] BorderSpacing.Left = 8 @@ -751,15 +798,14 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Control = cbCountryH AnchorSideTop.Control = cbCountryH AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = gbHomeAddress + AnchorSideRight.Control = edAddressH AnchorSideRight.Side = asrBottom - Left = 201 - Height = 23 - Top = 166 + Left = 251 + Height = 33 + Top = 226 Width = 338 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 4 - BorderSpacing.Right = 8 BorderSpacing.Bottom = 8 ParentFont = False TabOrder = 6 @@ -768,21 +814,22 @@ object ContactEditForm: TContactEditForm end object tabContact: TTabSheet Caption = 'tabContact' - ClientHeight = 564 - ClientWidth = 567 + ClientHeight = 752 + ClientWidth = 617 ImageIndex = 1 object gbPhone: TGroupBox - AnchorSideTop.Control = tabContact Left = 8 - Height = 159 + Height = 219 Top = 8 - Width = 384 + Width = 601 + Align = alTop + AutoSize = True BorderSpacing.Left = 8 BorderSpacing.Top = 8 BorderSpacing.Right = 8 Caption = 'Phone / fax' - ClientHeight = 139 - ClientWidth = 380 + ClientHeight = 199 + ClientWidth = 597 Font.Style = [fsBold] ParentFont = False TabOrder = 0 @@ -793,6 +840,7 @@ object ContactEditForm: TContactEditForm Top = 0 Width = 88 BorderSpacing.Left = 8 + DropDownCount = 24 ItemHeight = 15 MaxLength = 65535 ParentFont = False @@ -807,11 +855,12 @@ object ContactEditForm: TContactEditForm AnchorSideRight.Side = asrBottom Left = 8 Height = 23 - Top = 27 + Top = 37 Width = 88 Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 8 BorderSpacing.Top = 4 + DropDownCount = 24 ItemHeight = 15 MaxLength = 65535 ParentFont = False @@ -826,11 +875,12 @@ object ContactEditForm: TContactEditForm AnchorSideRight.Side = asrBottom Left = 8 Height = 23 - Top = 54 + Top = 74 Width = 88 Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 8 BorderSpacing.Top = 4 + DropDownCount = 24 ItemHeight = 15 MaxLength = 65535 ParentFont = False @@ -845,11 +895,12 @@ object ContactEditForm: TContactEditForm AnchorSideRight.Side = asrBottom Left = 8 Height = 23 - Top = 81 + Top = 111 Width = 88 Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 8 BorderSpacing.Top = 4 + DropDownCount = 24 ItemHeight = 15 MaxLength = 65535 ParentFont = False @@ -864,9 +915,9 @@ object ContactEditForm: TContactEditForm AnchorSideRight.Control = edPhone3 AnchorSideRight.Side = asrBottom Left = 100 - Height = 23 - Top = 81 - Width = 260 + Height = 33 + Top = 111 + Width = 489 Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 4 MaxLength = 25 @@ -882,9 +933,9 @@ object ContactEditForm: TContactEditForm AnchorSideRight.Control = edPhone2 AnchorSideRight.Side = asrBottom Left = 100 - Height = 23 - Top = 54 - Width = 260 + Height = 33 + Top = 74 + Width = 489 Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 4 MaxLength = 25 @@ -900,9 +951,9 @@ object ContactEditForm: TContactEditForm AnchorSideRight.Control = edPhone1 AnchorSideRight.Side = asrBottom Left = 100 - Height = 23 - Top = 27 - Width = 260 + Height = 33 + Top = 37 + Width = 489 Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 4 MaxLength = 25 @@ -915,10 +966,13 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Side = asrBottom AnchorSideTop.Control = cbPhone1 AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = gbPhone + AnchorSideRight.Side = asrBottom Left = 100 - Height = 23 + Height = 33 Top = 0 - Width = 260 + Width = 489 + Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 4 BorderSpacing.Right = 8 MaxLength = 25 @@ -934,11 +988,12 @@ object ContactEditForm: TContactEditForm AnchorSideRight.Side = asrBottom Left = 8 Height = 23 - Top = 108 + Top = 148 Width = 88 Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 8 BorderSpacing.Top = 4 + DropDownCount = 24 ItemHeight = 15 MaxLength = 65535 ParentFont = False @@ -953,9 +1008,9 @@ object ContactEditForm: TContactEditForm AnchorSideRight.Control = edPhone4 AnchorSideRight.Side = asrBottom Left = 100 - Height = 23 - Top = 108 - Width = 260 + Height = 33 + Top = 148 + Width = 489 Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 4 BorderSpacing.Bottom = 8 @@ -966,18 +1021,18 @@ object ContactEditForm: TContactEditForm end end object gbEMail: TGroupBox - AnchorSideTop.Control = gbPhone - AnchorSideTop.Side = asrBottom Left = 8 - Height = 109 - Top = 183 - Width = 421 + Height = 149 + Top = 243 + Width = 601 + Align = alTop AutoSize = True + BorderSpacing.Left = 8 BorderSpacing.Top = 16 BorderSpacing.Right = 8 Caption = 'E-Mail' - ClientHeight = 89 - ClientWidth = 417 + ClientHeight = 129 + ClientWidth = 597 Font.Style = [fsBold] ParentFont = False TabOrder = 1 @@ -986,10 +1041,13 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Side = asrBottom AnchorSideTop.Control = cbEMail1 AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = gbEMail + AnchorSideRight.Side = asrBottom Left = 128 - Height = 23 + Height = 33 Top = 4 - Width = 281 + Width = 461 + Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 4 BorderSpacing.Right = 8 ParentFont = False @@ -1000,10 +1058,13 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Side = asrBottom AnchorSideTop.Control = cbEMail2 AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = edEMail1 + AnchorSideRight.Side = asrBottom Left = 128 - Height = 23 - Top = 31 - Width = 281 + Height = 33 + Top = 41 + Width = 461 + Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 4 ParentFont = False TabOrder = 3 @@ -1013,10 +1074,13 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Side = asrBottom AnchorSideTop.Control = cbEMail3 AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = edEMail1 + AnchorSideRight.Side = asrBottom Left = 128 - Height = 23 - Top = 58 - Width = 281 + Height = 33 + Top = 78 + Width = 461 + Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 4 BorderSpacing.Bottom = 8 ParentFont = False @@ -1030,6 +1094,7 @@ object ContactEditForm: TContactEditForm Width = 116 BorderSpacing.Left = 8 BorderSpacing.Top = 4 + DropDownCount = 24 ItemHeight = 15 MaxLength = 65535 ParentFont = False @@ -1044,11 +1109,12 @@ object ContactEditForm: TContactEditForm AnchorSideRight.Side = asrBottom Left = 8 Height = 23 - Top = 31 + Top = 41 Width = 116 Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 8 BorderSpacing.Top = 4 + DropDownCount = 24 ItemHeight = 15 MaxLength = 65535 ParentFont = False @@ -1063,11 +1129,12 @@ object ContactEditForm: TContactEditForm AnchorSideRight.Side = asrBottom Left = 8 Height = 23 - Top = 58 + Top = 78 Width = 116 Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 8 BorderSpacing.Top = 4 + DropDownCount = 24 ItemHeight = 15 MaxLength = 65535 ParentFont = False @@ -1076,18 +1143,19 @@ object ContactEditForm: TContactEditForm end end object gbWebsites: TGroupBox - AnchorSideTop.Control = gbEMail - AnchorSideTop.Side = asrBottom - Left = 8 - Height = 82 - Top = 308 - Width = 454 + Left = 6 + Height = 108 + Top = 408 + Width = 603 + Align = alTop + AutoSize = True + BorderSpacing.Left = 6 BorderSpacing.Top = 16 BorderSpacing.Right = 8 BorderSpacing.Bottom = 8 Caption = 'Websites' - ClientHeight = 62 - ClientWidth = 450 + ClientHeight = 88 + ClientWidth = 599 Font.Style = [fsBold] ParentFont = False TabOrder = 2 @@ -1096,10 +1164,13 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Side = asrBottom AnchorSideTop.Control = cbWebsite1 AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = gbWebsites + AnchorSideRight.Side = asrBottom Left = 157 - Height = 23 + Height = 33 Top = 0 - Width = 281 + Width = 434 + Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 4 BorderSpacing.Right = 8 ParentFont = False @@ -1110,12 +1181,14 @@ object ContactEditForm: TContactEditForm AnchorSideLeft.Side = asrBottom AnchorSideTop.Control = cbWebsite2 AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = edWebsite1 + AnchorSideRight.Side = asrBottom Left = 157 - Height = 23 - Top = 27 - Width = 281 + Height = 33 + Top = 37 + Width = 434 + Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 4 - BorderSpacing.Right = 8 BorderSpacing.Bottom = 8 ParentFont = False TabOrder = 3 @@ -1128,6 +1201,7 @@ object ContactEditForm: TContactEditForm Top = 0 Width = 145 BorderSpacing.Left = 8 + DropDownCount = 24 ItemHeight = 15 MaxLength = 65535 ParentFont = False @@ -1142,12 +1216,13 @@ object ContactEditForm: TContactEditForm AnchorSideRight.Side = asrBottom Left = 8 Height = 23 - Top = 27 + Top = 37 Width = 145 Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 8 BorderSpacing.Top = 4 BorderSpacing.Bottom = 8 + DropDownCount = 24 ItemHeight = 15 MaxLength = 65535 ParentFont = False @@ -1158,85 +1233,128 @@ object ContactEditForm: TContactEditForm end object tabCustom: TTabSheet Caption = 'tabCustom' - ClientHeight = 538 - ClientWidth = 518 + ClientHeight = 752 + ClientWidth = 617 ImageIndex = 3 object lblCustom1: TLabel - Left = 8 - Height = 15 + AnchorSideTop.Control = edCustom1 + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = edCustom1 + Left = 61 + Height = 25 Top = 12 - Width = 61 + Width = 91 + Anchors = [akTop, akRight] BorderSpacing.Left = 8 + BorderSpacing.Right = 8 Caption = 'lblCustom1' FocusControl = edCustom1 ParentColor = False end object lblCustom2: TLabel - Left = 8 - Height = 15 - Top = 36 - Width = 61 + AnchorSideTop.Control = edCustom2 + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = edCustom2 + Left = 61 + Height = 25 + Top = 49 + Width = 91 + Anchors = [akTop, akRight] BorderSpacing.Left = 8 + BorderSpacing.Right = 8 Caption = 'lblCustom2' FocusControl = edCustom2 ParentColor = False end object lblCustom3: TLabel - Left = 8 - Height = 15 - Top = 60 - Width = 61 + AnchorSideTop.Control = edCustom3 + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = edCustom3 + Left = 61 + Height = 25 + Top = 86 + Width = 91 + Anchors = [akTop, akRight] BorderSpacing.Left = 8 + BorderSpacing.Right = 8 Caption = 'lblCustom3' FocusControl = edCustom3 ParentColor = False end object lblCustom4: TLabel - Left = 8 - Height = 15 - Top = 84 - Width = 61 + AnchorSideTop.Control = edCustom4 + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = edCustom4 + Left = 61 + Height = 25 + Top = 123 + Width = 91 + Anchors = [akTop, akRight] BorderSpacing.Left = 8 + BorderSpacing.Right = 8 Caption = 'lblCustom4' FocusControl = edCustom4 ParentColor = False end object edCustom1: TEdit - Left = 80 - Height = 23 + AnchorSideTop.Control = tabCustom + AnchorSideRight.Control = tabCustom + AnchorSideRight.Side = asrBottom + Left = 160 + Height = 33 Top = 8 - Width = 337 + Width = 449 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Top = 8 BorderSpacing.Right = 8 MaxLength = 100 OnChange = ItemChanged TabOrder = 0 end object edCustom2: TEdit - Left = 80 - Height = 23 - Top = 32 - Width = 337 - BorderSpacing.Right = 8 + AnchorSideLeft.Control = edCustom1 + AnchorSideTop.Control = edCustom1 + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = edCustom1 + AnchorSideRight.Side = asrBottom + Left = 160 + Height = 33 + Top = 45 + Width = 449 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Top = 4 MaxLength = 100 OnChange = ItemChanged TabOrder = 1 end object edCustom3: TEdit - Left = 80 - Height = 23 - Top = 56 - Width = 337 - BorderSpacing.Right = 8 + AnchorSideLeft.Control = edCustom1 + AnchorSideTop.Control = edCustom2 + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = edCustom1 + AnchorSideRight.Side = asrBottom + Left = 160 + Height = 33 + Top = 82 + Width = 449 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Top = 4 MaxLength = 100 OnChange = ItemChanged TabOrder = 2 end object edCustom4: TEdit - Left = 80 - Height = 23 - Top = 80 - Width = 337 - BorderSpacing.Right = 8 + AnchorSideLeft.Control = edCustom1 + AnchorSideTop.Control = edCustom3 + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = edCustom1 + AnchorSideRight.Side = asrBottom + Left = 160 + Height = 33 + Top = 119 + Width = 449 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Top = 4 BorderSpacing.Bottom = 8 MaxLength = 100 OnChange = ItemChanged @@ -1245,18 +1363,17 @@ object ContactEditForm: TContactEditForm end object tabNotes: TTabSheet Caption = 'tabNotes' - ClientHeight = 264 - ClientWidth = 472 + ClientHeight = 752 + ClientWidth = 617 ImageIndex = 4 object memoNotes: TMemo Left = 4 - Height = 300 + Height = 744 Top = 4 - Width = 600 + Width = 609 Align = alClient BorderSpacing.Around = 4 Constraints.MinHeight = 300 - Constraints.MinWidth = 600 MaxLength = 1024 ScrollBars = ssVertical TabOrder = 0 @@ -1265,22 +1382,26 @@ object ContactEditForm: TContactEditForm end object pnlBottom: TPanel Left = 0 - Height = 37 - Top = 592 - Width = 575 + Height = 33 + Top = 706 + Width = 480 Align = alBottom + AutoSize = True BevelOuter = bvNone - ClientHeight = 37 - ClientWidth = 575 + ClientHeight = 33 + ClientWidth = 480 TabOrder = 1 object OKBtn: TButton - AnchorSideTop.Control = pnlBottom - AnchorSideTop.Side = asrCenter - Left = 415 + AnchorSideTop.Control = CancelBtn + AnchorSideRight.Control = CancelBtn + AnchorSideBottom.Control = CancelBtn + AnchorSideBottom.Side = asrBottom + Left = 328 Height = 25 - Top = 6 + Top = 4 Width = 74 - Anchors = [akTop, akRight] + Anchors = [akTop, akRight, akBottom] + BorderSpacing.Right = 8 Caption = 'OK' Default = True OnClick = OKBtnClick @@ -1288,11 +1409,17 @@ object ContactEditForm: TContactEditForm end object CancelBtn: TButton AnchorSideTop.Side = asrCenter - Left = 493 + AnchorSideRight.Control = pnlBottom + AnchorSideRight.Side = asrBottom + Left = 410 Height = 25 - Top = 6 - Width = 75 + Top = 4 + Width = 62 Anchors = [akTop, akRight] + AutoSize = True + BorderSpacing.Top = 4 + BorderSpacing.Right = 8 + BorderSpacing.Bottom = 4 Cancel = True Caption = 'Cancel' OnClick = CancelBtnClick diff --git a/components/tvplanit/source/vpcontacteditdlg.pas b/components/tvplanit/source/vpcontacteditdlg.pas index 358e820cc..22c33218c 100644 --- a/components/tvplanit/source/vpcontacteditdlg.pas +++ b/components/tvplanit/source/vpcontacteditdlg.pas @@ -40,7 +40,8 @@ uses {$ENDIF} SysUtils, {$IFDEF VERSION6} Variants, {$ENDIF} - Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, ComCtrls, EditBtn, + Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, ComCtrls, + EditBtn, VpData, VpException, VpMisc, VpBase, VpSR, VpDlg, VpBaseDS; type @@ -502,8 +503,6 @@ begin end; procedure TContactEditForm.ResizeControls; -const - ComboArrowWidth = 32; type TLabelArray = array of TLabel; TComboboxArray = array of TCombobox; @@ -515,12 +514,12 @@ var largestLabelWidth: Integer; i: Integer; OldFont: TFont; - FieldTop: Integer; - delta: Integer; hdist: Integer = 4; // Horizontal distance between label and edit/combo vDist: Integer = 4; // Vertical distance between edits hBorder: Integer = 8; // Horizontal distance between container border and label vBorder: Integer = 8; // Vertical distance between container border and 1st control + w,h: Integer; + comboArrowWidth: Integer; begin {----------------------------------------------------------------------------} { Preparations } @@ -530,55 +529,47 @@ begin hBorder := ScaleX(hBorder, DesignTimeDPI); vBorder := ScaleY(vBorder, DesignTimeDPI); edBirthdate.ButtonWidth := FEditHeight; + comboArrowWidth := GetSystemMetrics(SM_CXVSCROLL); + + for i := 0 to ComponentCount-1 do + if Components[i] is TControl then + with TControl(Components[i]) do begin + if BorderSpacing.Left <> 0 then BorderSpacing.Left := hdist; + if BorderSpacing.Right <> 0 then BorderSpacing.Right := hdist; + if BorderSpacing.Top <> 0 then BorderSpacing.Top := vdist; + if BorderSpacing.Bottom <> 0 then BorderSpacing.Bottom := vdist; + end; + + {----------------------------------------------------------------------------} + { Button panel } + {----------------------------------------------------------------------------} + // The cancel button is autosized + OKBtn.Width := CancelBtn.Width; + {$IFDEF MSWINDOWS} // button order: OK - Cancel + CancelBtn.AnchorSideRight.Control := pnlBottom; + CancelBtn.AnchorSideRight.Side := asrRight; + OKBtn.AnchorSideRight.Control := CancelBtn; + OKBtn.AnchorSideRight.Side := asrLeft; + OKBtn.TabOrder := 0; + CancelBtn.TabOrder := 1; + {$ELSE} // button order: Cancel - OK + OKBtn.AnchorSideRight.Control := pnlBottom; + OKBtn.AnchorSideRight.Side := asrRight; + CancelBtn.AnchorSideRight.Control := OKBtn; + CancelBtn.AnchorSideRight.Side := asrLeft; + CancelBtn.TabOrder := 0; + OKBtn.TabOrder := 1; + {$ENDIF} {----------------------------------------------------------------------------} { Page "Base data" } {----------------------------------------------------------------------------} - SetLength(Labels, 5); - Labels[0] := lblLastName; - Labels[1] := lblFirstName; - Labels[2] := lblTitle; - Labels[3] := lblCategory; - Labels[4] := lblBirthdate; - - largestLabelWidth := 0; - for i := Low(Labels) to High(Labels) do - largestLabelWidth := Max(largestLabelWidth, GetLabelWidth(Labels[i])); - - // Determine width of label based upon dpi of screen - for i := Low(Labels) to High(Labels) do begin - Labels[i].FocusControl.Left := HBorder + largestLabelWidth + hDist; - Labels[i].Left := Labels[i].FocusControl.Left - hDist - GetLabelWidth(Labels[i]); - end; - - // Set edit and combo widths - edLastName.Width := edLastName.Parent.ClientWidth - hBorder - edLastName.Left; - edFirstname.Width := edLastName.Width; edBirthdate.Width := edTitle.Width; cbCategory.Width := edTitle.Width; - // Vertically arrange the fields. } - delta := (Labels[0].FocusControl.Height - labels[0].Height) div 2; - FieldTop := vBorder; - for i := Low(Labels) to High(Labels) do - if Labels[i].Visible then begin - Labels[i].FocusControl.Top := FieldTop; - Labels[i].Top := FieldTop + delta; - inc(FieldTop, FEditHeight + VDist); - end; - {----------------------------------------------------------------------------} { Page "Contact" } {----------------------------------------------------------------------------} - gbPhone.Left := hBorder; - gbPhone.Width := gbPhone.Parent.ClientWidth - 2*hBorder; - - gbEMail.Left := hBorder; - gbEMail.Width := gbPhone.Width; - - gbWebsites.Left := hBorder; - gbWebsites.Width := gbPhone.Width; - SetLength(Comboboxes, 10); Comboboxes[0] := cbPhone1; Comboboxes[1] := cbPhone2; @@ -590,19 +581,6 @@ begin Comboboxes[7] := cbEMail3; Comboboxes[8] := cbWebsite1; Comboboxes[9] := cbWebsite1; - - SetLength(Edits, 10); - Edits[0] := edPhone1; - Edits[1] := edPhone2; - Edits[2] := edPhone3; - Edits[3] := edPhone4; - Edits[4] := edPhone5; - Edits[5] := edEMail1; - Edits[6] := edEMail2; - Edits[7] := edEMail3; - Edits[8] := edWebsite1; - Edits[9] := edWebsite2; - largestLabelWidth := 0; OldFont := TFont.Create; try @@ -626,53 +604,6 @@ begin Comboboxes[i].Width := largestLabelWidth; end; - for i:= Low(Edits) to High(Edits) do begin - Edits[i].Left := cbPhone1.Left + cbPhone1.Width + hDist; - Edits[i].Width := Edits[i].Parent.ClientWidth - Edits[i].Left - HBorder; - end; - - gbPhone.AutoSize := true; - gbEMail.AutoSize := true; - gbWebsites.AutoSize := true; - - - {----------------------------------------------------------------------------} - { Page "Addresses" } - {----------------------------------------------------------------------------} - { Note: The resizing algorithm is dependent upon the labels having their - FocusControl property set to the corresponding edit field or combobox. } - - SetLength(Labels, 17); - Labels[0] := lblCompany; - Labels[1] := lblDepartment; - Labels[2] := lblPosition; - Labels[3] := lblAddressW; - Labels[4] := lblCityW; - Labels[5] := lblStateW; - Labels[6] := lblStateComboW; - Labels[7] := lblZipCodeW; - Labels[8] := lblCountryW; - Labels[9] := lblCountryComboW; - Labels[10] := lblAddressH; - Labels[11] := lblCityH; - Labels[12] := lblStateH; - Labels[13] := lblStateComboH; - Labels[14] := lblZipCodeH; - Labels[15] := lblCountryH; - Labels[16] := lblCountryComboH; - - largestLabelWidth := 0; - for i := Low(Labels) to High(Labels) do begin - largestLabelWidth := Max(largestLabelWidth, GetLabelWidth(Labels[i])); - Labels[i].FocusControl.Height := FEditHeight; - end; - - edCompany.Left := HBorder + largestLabelWidth + hDist; - edCompany.Width := edCompany.Parent.ClientWidth - hBorder - edCompany.Left; - - edAddressH.Left := edCompany.Left; - edAddressH.Width := edCompany.Width; - {----------------------------------------------------------------------------} { Page "User-defined" } {----------------------------------------------------------------------------} @@ -686,45 +617,12 @@ begin for i := Low(Labels) to High(Labels) do largestLabelWidth := Max(largestLabelWidth, GetLabelWidth(Labels[i])); - FieldTop := vBorder; edCustom1.Left := hBorder + largestLabelWidth + hDist; - edCustom1.Width := edCustom1.Parent.ClientWidth - hBorder - edCustom1.Left; - for i := Low(Labels) to High(Labels) do begin - Labels[i].FocusControl.Top := FieldTop; - Labels[i].FocusControl.Left := edCustom1.Left; - Labels[i].FocusControl.Width := edCustom1.Width; - Labels[i].FocusControl.Height := FEditHeight; - labels[i].Top := FieldTop + delta; - Labels[i].Width := LargestLabelWidth; - Labels[i].Left := Labels[i].FocusControl.Left - GetLabelWidth(Labels[i]) - hDist; - inc(FieldTop, FEditHeight + vDist); - end; {----------------------------------------------------------------------------} - { Buttons } + { Form size } {----------------------------------------------------------------------------} - OKBtn.Width := Max(GetButtonWidth(OKBtn), GetButtonWidth(CancelBtn)); - CancelBtn.Width := OKBtn.Width; - {$IFDEF MSWINDOWS} // button order: OK - Cancel - CancelBtn.Left := pnlBottom.ClientWidth - HBorder - CancelBtn.Width; - OKBtn.Left := CancelBtn.Left - hDist - OKBtn.Width; - {$ELSE} // button order: Cancel - OK - OKBtn.Left := pnlBottom.ClientWidth - HBorder - OKBtn.Width; - CancelBtn.Left := OKBtn.Left - hDist - CancelBtn.Width; - OKBtn.TabOrder := 1; - {$ENDIF} - OKBtn.Height := FBtnHeight; - CancelBtn.Height := FBtnHeight; - OKBtn.Top := vDist; - CancelBtn.Top := vDist; - pnlBottom.ClientHeight := OKBtn.Height + vDist*2; // Centering is done by anchors - - {----------------------------------------------------------------------------} - { Set form size } - {----------------------------------------------------------------------------} -// ClientHeight := h1 + h2 + pnlBottom.Height + vDist + 16 + PageControl.Height - tabAddresses.ClientHeight; - AutoSize := true; -// AdjustSize; + Autosize := true; end; procedure TContactEditForm.DisplayCurrentCountry(AddressType: TVpAddressType);