IDE, fix form size for NewField dialog, from Aleksey Lagunov, issue #35249

git-svn-id: trunk@60733 -
This commit is contained in:
jesus 2019-03-20 06:11:22 +00:00
parent 1a7930cb2c
commit f414bde383
2 changed files with 385 additions and 286 deletions

View File

@ -1,82 +1,163 @@
object NewFieldFrm: TNewFieldFrm object NewFieldFrm: TNewFieldFrm
Left = 447 Left = 447
Height = 439 Height = 461
Top = 271 Top = 271
Width = 383 Width = 510
HorzScrollBar.Page = 261 HorzScrollBar.Page = 261
VertScrollBar.Page = 375 VertScrollBar.Page = 375
BorderStyle = bsDialog
Caption = 'Dialog' Caption = 'Dialog'
ClientHeight = 439 ClientHeight = 461
ClientWidth = 383 ClientWidth = 510
OnClose = FormClose OnClose = FormClose
OnCreate = FormCreate OnCreate = FormCreate
ParentFont = True ParentFont = True
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '1.9.0.0' LCLVersion = '2.1.0.0'
object Panel2: TPanel object ButtonPanel1: TButtonPanel
Left = 0
Height = 145
Top = 110
Width = 383
Align = alTop
ClientHeight = 145
ClientWidth = 383
FullRepaint = False
TabOrder = 0
object GroupBox1: TGroupBox
Left = 8
Height = 132
Top = 8
Width = 365
Anchors = [akTop, akLeft, akRight]
Caption = 'Field properties'
ClientHeight = 105
ClientWidth = 361
TabOrder = 0
object Label1: TLabel
Left = 6 Left = 6
Height = 15 Height = 42
Top = 11 Top = 413
Width = 40 Width = 498
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
HelpButton.Name = 'HelpButton'
HelpButton.DefaultCaption = True
CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 0
ShowButtons = [pbOK, pbCancel]
end
object RadioGroup1: TRadioGroup
Left = 0
Height = 55
Top = 0
Width = 510
Align = alTop
AutoFill = True
AutoSize = True
Caption = 'Field Type'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 3
ClientHeight = 35
ClientWidth = 508
Columns = 3
ItemIndex = 0
Items.Strings = (
'&Data'
'&Calculated'
'&Lookup'
)
OnClick = RadioGroup1Click
TabOrder = 1
end
object NoteLbl: TLabel
Left = 0
Height = 19
Top = 55
Width = 510
Align = alTop
Caption = 'NoteLbl'
ParentColor = False
Visible = False
WordWrap = True
end
object GroupBox1: TGroupBox
AnchorSideRight.Side = asrBottom
Left = 0
Height = 170
Top = 248
Width = 510
Align = alTop
AutoSize = True
Caption = 'Field properties'
ClientHeight = 150
ClientWidth = 508
TabOrder = 2
object Label1: TLabel
AnchorSideLeft.Control = GroupBox1
AnchorSideBottom.Control = EditName
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 19
Top = 18
Width = 44
Anchors = [akLeft, akBottom]
BorderSpacing.Left = 6
Caption = '&Name:' Caption = '&Name:'
FocusControl = EditName FocusControl = EditName
ParentColor = False ParentColor = False
end end
object Label2: TLabel object Label2: TLabel
AnchorSideLeft.Control = GroupBox1
AnchorSideBottom.Control = SelectType
AnchorSideBottom.Side = asrBottom
Left = 6 Left = 6
Height = 15 Height = 19
Top = 59 Top = 88
Width = 32 Width = 36
Anchors = [akLeft, akBottom]
BorderSpacing.Left = 6
Caption = '&Type:' Caption = '&Type:'
FocusControl = SelectType FocusControl = SelectType
ParentColor = False ParentColor = False
end end
object Label3: TLabel object Label3: TLabel
AnchorSideLeft.Control = GroupBox1
AnchorSideRight.Control = Label8
AnchorSideBottom.Control = EditSize
AnchorSideBottom.Side = asrBottom
Left = 6 Left = 6
Height = 15 Height = 19
Top = 83 Top = 125
Width = 29 Width = 32
Anchors = [akLeft, akBottom]
BorderSpacing.Left = 6
BorderSpacing.Right = 6
Caption = '&Size:' Caption = '&Size:'
FocusControl = EditSize FocusControl = EditSize
ParentColor = False ParentColor = False
end end
object EditName: TEdit object EditName: TEdit
Left = 158 AnchorSideLeft.Control = Label8
Height = 29 AnchorSideLeft.Side = asrBottom
Top = 8 AnchorSideTop.Control = GroupBox1
Width = 168 AnchorSideRight.Control = GroupBox1
AnchorSideRight.Side = asrBottom
Left = 255
Height = 31
Top = 6
Width = 247
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
BorderSpacing.Right = 6
OnChange = EditNameChange OnChange = EditNameChange
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
TabOrder = 0 TabOrder = 0
end end
object SelectType: TComboBox object SelectType: TComboBox
Left = 158 AnchorSideLeft.Control = Label8
Height = 29 AnchorSideLeft.Side = asrBottom
Top = 56 AnchorSideTop.Control = EditCompName
Width = 168 AnchorSideTop.Side = asrBottom
ItemHeight = 21 AnchorSideRight.Control = GroupBox1
AnchorSideRight.Side = asrBottom
Left = 255
Height = 27
Top = 80
Width = 247
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
BorderSpacing.Right = 6
ItemHeight = 0
Items.Strings = ( Items.Strings = (
'String' 'String'
'Integer' 'Integer'
@ -98,202 +179,220 @@ object NewFieldFrm: TNewFieldFrm
TabOrder = 2 TabOrder = 2
end end
object EditSize: TEdit object EditSize: TEdit
Left = 158 AnchorSideLeft.Control = Label8
Height = 29 AnchorSideLeft.Side = asrBottom
Top = 80 AnchorSideTop.Control = SelectType
Width = 168 AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = GroupBox1
AnchorSideRight.Side = asrBottom
Left = 255
Height = 31
Top = 113
Width = 247
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
BorderSpacing.Right = 6
BorderSpacing.Bottom = 6
Color = clBtnFace Color = clBtnFace
Enabled = False Enabled = False
TabOrder = 3 TabOrder = 3
end end
object Label7: TLabel object Label7: TLabel
AnchorSideLeft.Control = GroupBox1
AnchorSideBottom.Control = EditCompName
AnchorSideBottom.Side = asrBottom
Left = 6 Left = 6
Height = 15 Height = 19
Top = 35 Top = 55
Width = 113 Width = 123
Anchors = [akLeft, akBottom]
BorderSpacing.Left = 6
Caption = 'Co&mponent Name:' Caption = 'Co&mponent Name:'
FocusControl = EditCompName FocusControl = EditCompName
ParentColor = False ParentColor = False
end end
object EditCompName: TEdit object EditCompName: TEdit
Left = 158 AnchorSideLeft.Control = Label8
Height = 29 AnchorSideLeft.Side = asrBottom
Top = 32 AnchorSideTop.Control = EditName
Width = 168 AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = GroupBox1
AnchorSideRight.Side = asrBottom
Left = 255
Height = 31
Top = 43
Width = 247
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
BorderSpacing.Right = 6
OnChange = EditCompNameChange OnChange = EditCompNameChange
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
TabOrder = 1 TabOrder = 1
end end
object Label8: TLabel
AnchorSideLeft.Control = GroupBox1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = GroupBox1
Left = 254
Height = 1
Top = 0
Width = 1
ParentColor = False
end end
end end
object Panel3: TPanel
Left = 0
Height = 144
Top = 255
Width = 383
Align = alTop
ClientHeight = 144
ClientWidth = 383
FullRepaint = False
TabOrder = 1
Visible = False
object GroupBox2: TGroupBox object GroupBox2: TGroupBox
Left = 8 Left = 0
Height = 129 Height = 174
Top = 8 Top = 74
Width = 365 Width = 510
Anchors = [akTop, akLeft, akRight, akBottom] Align = alTop
AutoSize = True
Caption = 'Lookup definition' Caption = 'Lookup definition'
ClientHeight = 102 ClientHeight = 154
ClientWidth = 361 ClientWidth = 508
TabOrder = 0 TabOrder = 3
object Label4: TLabel object Label4: TLabel
AnchorSideLeft.Control = GroupBox2
AnchorSideBottom.Control = SelectKeyFields
AnchorSideBottom.Side = asrBottom
Left = 6 Left = 6
Height = 15 Height = 19
Top = 10 Top = 18
Width = 58 Width = 63
Anchors = [akLeft, akBottom]
BorderSpacing.Left = 6
Caption = '&Key fields' Caption = '&Key fields'
FocusControl = SelectKeyFields FocusControl = SelectKeyFields
ParentColor = False ParentColor = False
end end
object Label5: TLabel object Label5: TLabel
AnchorSideLeft.Control = GroupBox2
AnchorSideBottom.Control = SelectLookupKeys
AnchorSideBottom.Side = asrBottom
Left = 6 Left = 6
Height = 15 Height = 19
Top = 58 Top = 92
Width = 75 Width = 79
Anchors = [akLeft, akBottom]
BorderSpacing.Left = 6
Caption = 'L&ookup keys' Caption = 'L&ookup keys'
FocusControl = SelectLookupKeys FocusControl = SelectLookupKeys
ParentColor = False ParentColor = False
end end
object Label6: TLabel object Label6: TLabel
AnchorSideLeft.Control = GroupBox2
AnchorSideBottom.Control = SelectResultField
AnchorSideBottom.Side = asrBottom
Left = 6 Left = 6
Height = 15 Height = 19
Top = 82 Top = 129
Width = 75 Width = 84
Anchors = [akLeft, akBottom]
BorderSpacing.Left = 6
Caption = '&Result Fields' Caption = '&Result Fields'
FocusControl = SelectResultField FocusControl = SelectResultField
ParentColor = False ParentColor = False
end end
object Label10: TLabel object Label10: TLabel
AnchorSideLeft.Control = GroupBox2
AnchorSideBottom.Control = DataSetsCombo
AnchorSideBottom.Side = asrBottom
Left = 6 Left = 6
Height = 15 Height = 19
Top = 34 Top = 55
Width = 47 Width = 52
Anchors = [akLeft, akBottom]
BorderSpacing.Left = 6
Caption = 'Dataset' Caption = 'Dataset'
ParentColor = False ParentColor = False
end end
object SelectKeyFields: TComboBox object SelectKeyFields: TComboBox
Left = 158 AnchorSideLeft.Control = Label9
Height = 29 AnchorSideLeft.Side = asrBottom
Top = 7 AnchorSideTop.Control = GroupBox2
Width = 168 AnchorSideRight.Control = GroupBox2
ItemHeight = 21 AnchorSideRight.Side = asrBottom
Left = 255
Height = 31
Top = 6
Width = 247
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
BorderSpacing.Right = 6
ItemHeight = 0
OnChange = SelectKeyFieldsChange OnChange = SelectKeyFieldsChange
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
TabOrder = 0 TabOrder = 0
end end
object SelectLookupKeys: TComboBox object SelectLookupKeys: TComboBox
Left = 158 AnchorSideLeft.Control = DataSetsCombo
Height = 29 AnchorSideTop.Control = DataSetsCombo
Top = 55 AnchorSideTop.Side = asrBottom
Width = 168 AnchorSideRight.Control = GroupBox2
AnchorSideRight.Side = asrBottom
Left = 255
Height = 31
Top = 80
Width = 247
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
BorderSpacing.Right = 6
Enabled = False Enabled = False
ItemHeight = 21 ItemHeight = 0
OnChange = SelectLookupKeysChange OnChange = SelectLookupKeysChange
TabOrder = 2 TabOrder = 2
end end
object SelectResultField: TComboBox object SelectResultField: TComboBox
Left = 158 AnchorSideLeft.Control = Label9
Height = 29 AnchorSideTop.Control = SelectLookupKeys
Top = 79 AnchorSideTop.Side = asrBottom
Width = 168 AnchorSideRight.Control = GroupBox2
AnchorSideRight.Side = asrBottom
Left = 254
Height = 31
Top = 117
Width = 248
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
BorderSpacing.Right = 6
BorderSpacing.Bottom = 6
Enabled = False Enabled = False
ItemHeight = 21 ItemHeight = 0
OnChange = SelectResultFieldChange OnChange = SelectResultFieldChange
TabOrder = 3 TabOrder = 3
end end
object DataSetsCombo: TComboBox object DataSetsCombo: TComboBox
Left = 158 AnchorSideLeft.Control = Label9
Height = 29 AnchorSideLeft.Side = asrBottom
Top = 31 AnchorSideTop.Control = SelectKeyFields
Width = 168 AnchorSideTop.Side = asrBottom
ItemHeight = 15 AnchorSideRight.Control = GroupBox2
AnchorSideRight.Side = asrBottom
Left = 255
Height = 31
Top = 43
Width = 247
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
BorderSpacing.Right = 6
ItemHeight = 0
OnChange = DataSetsComboChange OnChange = DataSetsComboChange
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
Style = csDropDownList Style = csDropDownList
TabOrder = 1 TabOrder = 1
end end
end object Label9: TLabel
end AnchorSideLeft.Control = GroupBox2
object Panel1: TPanel AnchorSideLeft.Side = asrCenter
Left = 0 AnchorSideTop.Control = GroupBox2
Height = 110 Left = 254
Height = 1
Top = 0 Top = 0
Width = 383 Width = 1
Align = alTop
ClientHeight = 110
ClientWidth = 383
FullRepaint = False
TabOrder = 2
object NoteLbl: TLabel
Left = 7
Height = 15
Top = 61
Width = 369
Align = alTop
BorderSpacing.Around = 6
Caption = 'NoteLbl'
ParentColor = False ParentColor = False
Visible = False
WordWrap = True
end end
object RadioGroup1: TRadioGroup
Left = 7
Height = 48
Top = 7
Width = 369
Align = alTop
AutoFill = True
BorderSpacing.Around = 6
Caption = 'Field Type'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 3
ClientHeight = 21
ClientWidth = 365
Columns = 3
ItemIndex = 0
Items.Strings = (
'&Data'
'&Calculated'
'&Lookup'
)
OnClick = RadioGroup1Click
TabOrder = 0
end
end
object ButtonPanel1: TButtonPanel
Left = 6
Height = 35
Top = 398
Width = 371
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
HelpButton.Name = 'HelpButton'
HelpButton.DefaultCaption = True
CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 3
ShowButtons = [pbOK, pbCancel]
end end
end end

View File

@ -30,18 +30,17 @@ type
ButtonPanel1: TButtonPanel; ButtonPanel1: TButtonPanel;
EditCompName: TEdit; EditCompName: TEdit;
Label7: TLabel; Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
NoteLbl: TLabel; NoteLbl: TLabel;
Panel2: TPanel;
GroupBox1: TGroupBox; GroupBox1: TGroupBox;
Label1: TLabel; Label1: TLabel;
Label2: TLabel; Label2: TLabel;
Label3: TLabel; Label3: TLabel;
EditName: TEdit; EditName: TEdit;
Panel1: TPanel;
RadioGroup1: TRadioGroup; RadioGroup1: TRadioGroup;
SelectType: TComboBox; SelectType: TComboBox;
EditSize: TEdit; EditSize: TEdit;
Panel3: TPanel;
GroupBox2: TGroupBox; GroupBox2: TGroupBox;
Label4: TLabel; Label4: TLabel;
Label5: TLabel; Label5: TLabel;
@ -134,6 +133,7 @@ begin
AddLookupDatasetProc := @AddLookupDataset; AddLookupDatasetProc := @AddLookupDataset;
UpdateFieldsTypes; UpdateFieldsTypes;
UpdateLookupDatasets(Self); UpdateLookupDatasets(Self);
RadioGroup1Click(nil);
end; end;
destructor TNewFieldFrm.Destroy; destructor TNewFieldFrm.Destroy;
@ -172,7 +172,7 @@ begin
except except
on E:Exception do begin on E:Exception do begin
NoteLbl.visible := true; NoteLbl.visible := true;
Panel1.Height := 100; //Panel1.Height := 100;
end; end;
end; end;
end; end;
@ -350,14 +350,14 @@ begin
try try
case RadioGroup1.ItemIndex of case RadioGroup1.ItemIndex of
0..1: begin //data,calculated field 0..1: begin //data,calculated field
Panel3.Visible := False; GroupBox2.Visible := False;
Panel2.Visible := True; GroupBox1.Visible := True;
ClientHeight := Panel1.Height + Panel2.Height + ButtonPanel1.Height; ClientHeight := RadioGroup1.Height + NoteLbl.Height + GroupBox1.Height + ButtonPanel1.Height;
end; end;
2: begin //lookup field 2: begin //lookup field
Panel3.Visible := True; GroupBox2.Visible := True;
Panel2.Visible := False; GroupBox1.Visible := False;
ClientHeight := Panel1.Height + Panel3.Height + ButtonPanel1.Height; ClientHeight := RadioGroup1.Height + NoteLbl.Height + GroupBox2.Height + ButtonPanel1.Height;
end; end;
end; end;
SetButtons; SetButtons;