tvplanit: In contact editor, replace font Ms Sans Serif by system's default font, and some cosmetic changes.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4692 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-06-08 13:54:27 +00:00
parent a574813335
commit 462c767aad
2 changed files with 64 additions and 57 deletions

View File

@@ -1,22 +1,25 @@
object ContactEditForm: TContactEditForm object ContactEditForm: TContactEditForm
Left = 311 Left = 311
Height = 321 Height = 320
Top = 245 Top = 245
Width = 433 Width = 433
HorzScrollBar.Page = 432 HorzScrollBar.Page = 432
VertScrollBar.Page = 320 VertScrollBar.Page = 320
ActiveControl = tsContacts ActiveControl = tsContacts
Caption = 'ContactEdit' Caption = 'ContactEdit'
ClientHeight = 321 ClientHeight = 320
ClientWidth = 433 ClientWidth = 433
Font.Height = -11 Font.Height = -11
Font.Name = 'MS Sans Serif' Font.Name = 'Default'
OnCreate = FormCreate OnCreate = FormCreate
OnKeyDown = FormKeyDown OnKeyDown = FormKeyDown
OnShow = FormShow OnShow = FormShow
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '1.7'
object tsContacts: TPageControl object tsContacts: TPageControl
Height = 280 Left = 0
Height = 279
Top = 0
Width = 433 Width = 433
ActivePage = tabMain ActivePage = tabMain
Align = alClient Align = alClient
@@ -25,7 +28,7 @@ object ContactEditForm: TContactEditForm
OnChange = tsContactsChange OnChange = tsContactsChange
object tabMain: TTabSheet object tabMain: TTabSheet
Caption = '&Main' Caption = '&Main'
ClientHeight = 254 ClientHeight = 252
ClientWidth = 425 ClientWidth = 425
object NameLbl: TLabel object NameLbl: TLabel
Left = 8 Left = 8
@@ -116,11 +119,12 @@ object ContactEditForm: TContactEditForm
ParentColor = False ParentColor = False
end end
object CompanyLbl: TLabel object CompanyLbl: TLabel
Left = 91 Left = 8
Height = 14 Height = 16
Top = 175 Top = 175
Width = 46 Width = 127
Alignment = taRightJustify Alignment = taRightJustify
AutoSize = False
Caption = 'Company' Caption = 'Company'
FocusControl = CompanyEdit FocusControl = CompanyEdit
ParentColor = False ParentColor = False
@@ -138,7 +142,7 @@ object ContactEditForm: TContactEditForm
end end
object NameEdit: TEdit object NameEdit: TEdit
Left = 136 Left = 136
Height = 21 Height = 22
Top = 4 Top = 4
Width = 247 Width = 247
MaxLength = 100 MaxLength = 100
@@ -147,7 +151,7 @@ object ContactEditForm: TContactEditForm
end end
object AddressEdit: TEdit object AddressEdit: TEdit
Left = 136 Left = 136
Height = 21 Height = 22
Top = 52 Top = 52
Width = 247 Width = 247
MaxLength = 100 MaxLength = 100
@@ -156,7 +160,7 @@ object ContactEditForm: TContactEditForm
end end
object CityEdit: TEdit object CityEdit: TEdit
Left = 136 Left = 136
Height = 21 Height = 22
Top = 76 Top = 76
Width = 247 Width = 247
MaxLength = 50 MaxLength = 50
@@ -165,7 +169,7 @@ object ContactEditForm: TContactEditForm
end end
object StateEdit: TEdit object StateEdit: TEdit
Left = 168 Left = 168
Height = 21 Height = 22
Top = 100 Top = 100
Width = 247 Width = 247
MaxLength = 25 MaxLength = 25
@@ -174,7 +178,7 @@ object ContactEditForm: TContactEditForm
end end
object ZipCodeEdit: TEdit object ZipCodeEdit: TEdit
Left = 136 Left = 136
Height = 21 Height = 22
Top = 124 Top = 124
Width = 121 Width = 121
MaxLength = 10 MaxLength = 10
@@ -183,7 +187,7 @@ object ContactEditForm: TContactEditForm
end end
object PositionEdit: TEdit object PositionEdit: TEdit
Left = 136 Left = 136
Height = 21 Height = 22
Top = 197 Top = 197
Width = 121 Width = 121
MaxLength = 50 MaxLength = 50
@@ -192,7 +196,7 @@ object ContactEditForm: TContactEditForm
end end
object TitleEdit: TEdit object TitleEdit: TEdit
Left = 136 Left = 136
Height = 21 Height = 22
Top = 29 Top = 29
Width = 121 Width = 121
MaxLength = 50 MaxLength = 50
@@ -201,7 +205,7 @@ object ContactEditForm: TContactEditForm
end end
object CompanyEdit: TEdit object CompanyEdit: TEdit
Left = 136 Left = 136
Height = 21 Height = 22
Top = 173 Top = 173
Width = 121 Width = 121
MaxLength = 50 MaxLength = 50
@@ -210,28 +214,26 @@ object ContactEditForm: TContactEditForm
end end
object cboxCategory: TComboBox object cboxCategory: TComboBox
Left = 136 Left = 136
Height = 21 Height = 22
Top = 224 Top = 224
Width = 121 Width = 121
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending] ItemHeight = 14
ItemHeight = 13
MaxLength = 65535 MaxLength = 65535
TabOrder = 11 TabOrder = 11
end end
object cboxState: TComboBox object cboxState: TComboBox
Left = 136 Left = 136
Height = 21 Height = 22
Top = 100 Top = 100
Width = 249 Width = 249
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending] ItemHeight = 14
ItemHeight = 13
MaxLength = 65535 MaxLength = 65535
TabOrder = 4 TabOrder = 4
Visible = False Visible = False
end end
object edtCountry: TEdit object edtCountry: TEdit
Left = 152 Left = 152
Height = 21 Height = 22
Top = 148 Top = 148
Width = 249 Width = 249
TabOrder = 8 TabOrder = 8
@@ -241,67 +243,68 @@ object ContactEditForm: TContactEditForm
Height = 21 Height = 21
Top = 148 Top = 148
Width = 249 Width = 249
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
Font.Height = -11 Font.Height = -11
Font.Name = 'MS Sans Serif' Font.Name = 'MS Sans Serif'
ItemHeight = 13 ItemHeight = 13
MaxLength = 65535 MaxLength = 65535
OnChange = cboxCountryChange OnChange = cboxCountryChange
ParentFont = False
TabOrder = 7 TabOrder = 7
end end
end end
object tabContact: TTabSheet object tabContact: TTabSheet
Caption = 'Con&tact' Caption = 'Con&tact'
ClientHeight = 280 ClientHeight = 252
ClientWidth = 433 ClientWidth = 425
ImageIndex = 1 ImageIndex = 1
object EMailLbl: TLabel object EMailLbl: TLabel
Left = 91 Left = 91
Height = 14 Height = 14
Top = 136 Top = 133
Width = 38 Width = 38
Caption = 'EMailLbl' Caption = 'EMailLbl'
FocusControl = EMailEdit
ParentColor = False ParentColor = False
end end
object cboxPhoneLbl1: TComboBox object cboxPhoneLbl1: TComboBox
Left = 8 Left = 8
Height = 21 Height = 22
Top = 8 Top = 8
Width = 121 Width = 121
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending] ItemHeight = 14
MaxLength = 65535 MaxLength = 65535
TabOrder = 0 TabOrder = 0
end end
object cboxPhoneLbl2: TComboBox object cboxPhoneLbl2: TComboBox
Left = 8 Left = 8
Height = 21 Height = 22
Top = 32 Top = 32
Width = 121 Width = 121
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending] ItemHeight = 14
MaxLength = 65535 MaxLength = 65535
TabOrder = 2 TabOrder = 2
end end
object cboxPhoneLbl3: TComboBox object cboxPhoneLbl3: TComboBox
Left = 8 Left = 8
Height = 21 Height = 22
Top = 56 Top = 56
Width = 121 Width = 121
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending] ItemHeight = 14
MaxLength = 65535 MaxLength = 65535
TabOrder = 4 TabOrder = 4
end end
object cboxPhoneLbl4: TComboBox object cboxPhoneLbl4: TComboBox
Left = 8 Left = 8
Height = 21 Height = 22
Top = 80 Top = 80
Width = 121 Width = 121
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending] ItemHeight = 14
MaxLength = 65535 MaxLength = 65535
TabOrder = 6 TabOrder = 6
end end
object Phone4Edit: TEdit object Phone4Edit: TEdit
Left = 136 Left = 136
Height = 21 Height = 22
Top = 80 Top = 80
Width = 121 Width = 121
MaxLength = 25 MaxLength = 25
@@ -310,7 +313,7 @@ object ContactEditForm: TContactEditForm
end end
object Phone3Edit: TEdit object Phone3Edit: TEdit
Left = 136 Left = 136
Height = 21 Height = 22
Top = 56 Top = 56
Width = 121 Width = 121
MaxLength = 25 MaxLength = 25
@@ -319,7 +322,7 @@ object ContactEditForm: TContactEditForm
end end
object Phone2Edit: TEdit object Phone2Edit: TEdit
Left = 136 Left = 136
Height = 21 Height = 22
Top = 32 Top = 32
Width = 121 Width = 121
MaxLength = 25 MaxLength = 25
@@ -328,7 +331,7 @@ object ContactEditForm: TContactEditForm
end end
object Phone1Edit: TEdit object Phone1Edit: TEdit
Left = 136 Left = 136
Height = 21 Height = 22
Top = 8 Top = 8
Width = 121 Width = 121
MaxLength = 25 MaxLength = 25
@@ -337,16 +340,16 @@ object ContactEditForm: TContactEditForm
end end
object cboxPhoneLbl5: TComboBox object cboxPhoneLbl5: TComboBox
Left = 8 Left = 8
Height = 21 Height = 22
Top = 104 Top = 104
Width = 121 Width = 121
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending] ItemHeight = 14
MaxLength = 65535 MaxLength = 65535
TabOrder = 8 TabOrder = 8
end end
object Phone5Edit: TEdit object Phone5Edit: TEdit
Left = 136 Left = 136
Height = 21 Height = 22
Top = 104 Top = 104
Width = 121 Width = 121
MaxLength = 25 MaxLength = 25
@@ -355,7 +358,7 @@ object ContactEditForm: TContactEditForm
end end
object EMailEdit: TEdit object EMailEdit: TEdit
Left = 136 Left = 136
Height = 21 Height = 22
Top = 128 Top = 128
Width = 121 Width = 121
TabOrder = 10 TabOrder = 10
@@ -363,8 +366,8 @@ object ContactEditForm: TContactEditForm
end end
object tabCustom: TTabSheet object tabCustom: TTabSheet
Caption = 'C&ustom' Caption = 'C&ustom'
ClientHeight = 280 ClientHeight = 252
ClientWidth = 433 ClientWidth = 425
ImageIndex = 2 ImageIndex = 2
object CustomLbl1: TLabel object CustomLbl1: TLabel
Left = 8 Left = 8
@@ -400,7 +403,7 @@ object ContactEditForm: TContactEditForm
end end
object Custom1Edit: TEdit object Custom1Edit: TEdit
Left = 80 Left = 80
Height = 21 Height = 22
Top = 8 Top = 8
Width = 121 Width = 121
MaxLength = 100 MaxLength = 100
@@ -409,7 +412,7 @@ object ContactEditForm: TContactEditForm
end end
object Custom2Edit: TEdit object Custom2Edit: TEdit
Left = 80 Left = 80
Height = 21 Height = 22
Top = 32 Top = 32
Width = 121 Width = 121
MaxLength = 100 MaxLength = 100
@@ -418,7 +421,7 @@ object ContactEditForm: TContactEditForm
end end
object Custom3Edit: TEdit object Custom3Edit: TEdit
Left = 80 Left = 80
Height = 21 Height = 22
Top = 56 Top = 56
Width = 121 Width = 121
MaxLength = 100 MaxLength = 100
@@ -427,7 +430,7 @@ object ContactEditForm: TContactEditForm
end end
object Custom4Edit: TEdit object Custom4Edit: TEdit
Left = 80 Left = 80
Height = 21 Height = 22
Top = 80 Top = 80
Width = 121 Width = 121
MaxLength = 100 MaxLength = 100
@@ -437,12 +440,12 @@ object ContactEditForm: TContactEditForm
end end
object tabNotes: TTabSheet object tabNotes: TTabSheet
Caption = '&Notes' Caption = '&Notes'
ClientHeight = 280 ClientHeight = 252
ClientWidth = 433 ClientWidth = 425
ImageIndex = 3 ImageIndex = 3
object NoteEdit: TMemo object NoteEdit: TMemo
Left = 8 Left = 8
Height = 234 Height = 238
Top = 8 Top = 8
Width = 409 Width = 409
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
@@ -453,8 +456,9 @@ object ContactEditForm: TContactEditForm
end end
end end
object pnlBottom: TPanel object pnlBottom: TPanel
Left = 0
Height = 41 Height = 41
Top = 280 Top = 279
Width = 433 Width = 433
Align = alBottom Align = alBottom
BevelOuter = bvNone BevelOuter = bvNone
@@ -462,7 +466,7 @@ object ContactEditForm: TContactEditForm
ClientWidth = 433 ClientWidth = 433
TabOrder = 1 TabOrder = 1
object OKBtn: TButton object OKBtn: TButton
Left = 278 Left = 272
Height = 25 Height = 25
Top = 9 Top = 9
Width = 75 Width = 75
@@ -474,7 +478,7 @@ object ContactEditForm: TContactEditForm
TabStop = False TabStop = False
end end
object CancelBtn: TButton object CancelBtn: TButton
Left = 357 Left = 351
Height = 25 Height = 25
Top = 9 Top = 9
Width = 75 Width = 75

View File

@@ -381,7 +381,7 @@ const
MinFormWidth = 265; MinFormWidth = 265;
FormHeightOffset = 103; FormHeightOffset = 103;
MinFormHeight = 250; MinFormHeight = 250;
TopField = 4; TopField = 8;
type type
TLabelArray = array[0..9] of TLabel; TLabelArray = array[0..9] of TLabel;
@@ -394,6 +394,7 @@ var
j : Integer; j : Integer;
OldFont : TFont; OldFont : TFont;
FieldTop : Integer; FieldTop : Integer;
delta : Integer;
begin begin
{ Note: The resizing algorithm is dependent upon the labels having their { Note: The resizing algorithm is dependent upon the labels having their
@@ -451,6 +452,7 @@ begin
WidestField := 0; WidestField := 0;
OldFont := TFont.Create; OldFont := TFont.Create;
try try
OldFont.Assign(Canvas.Font);
Canvas.Font.Assign (cboxCountry.Font); Canvas.Font.Assign (cboxCountry.Font);
try try
for j := 0 to cboxState.Items.Count - 1 do begin for j := 0 to cboxState.Items.Count - 1 do begin
@@ -484,11 +486,12 @@ begin
end; end;
{ Vertically arrange the fields. } { Vertically arrange the fields. }
delta := (Labels[0].FocusControl.Height - labels[0].Height) div 2;
FieldTop := TopField; FieldTop := TopField;
for i := Low(Labels) to High(Labels) do for i := Low(Labels) to High(Labels) do
if Labels[i].Visible then begin if Labels[i].Visible then begin
Labels[i].FocusControl.Top := FieldTop; Labels[i].FocusControl.Top := FieldTop;
Labels[i].Top := FieldTop + 2; Labels[i].Top := FieldTop + delta;
inc(FieldTop, FieldVertSep); inc(FieldTop, FieldVertSep);
end; end;