Project templates: Use ButtonPanel in frmTemplateVariables. Issue #28050, patch from Alexey Torgashin.

git-svn-id: trunk@49066 -
This commit is contained in:
juha 2015-05-17 11:41:45 +00:00
parent 419960642b
commit 46c96c036f
2 changed files with 43 additions and 53 deletions

View File

@ -1,20 +1,20 @@
object ProjectVariablesForm: TProjectVariablesForm
Left = 505
Height = 326
Height = 350
Top = 306
Width = 573
Width = 584
Caption = 'New project from template'
ClientHeight = 326
ClientWidth = 573
ClientHeight = 350
ClientWidth = 584
OnCreate = FormCreate
OnShow = ProjectVariablesFormShow
Position = poScreenCenter
LCLVersion = '0.9.29'
LCLVersion = '1.5'
object Label1: TLabel
Left = 8
Height = 14
Height = 15
Top = 16
Width = 109
Width = 118
Alignment = taRightJustify
Caption = '&Name for new project:'
Layout = tlCenter
@ -22,9 +22,9 @@ object ProjectVariablesForm: TProjectVariablesForm
end
object Label2: TLabel
Left = 8
Height = 14
Height = 15
Top = 48
Width = 95
Width = 100
Alignment = taRightJustify
Caption = 'Create in &directory:'
Layout = tlCenter
@ -34,7 +34,7 @@ object ProjectVariablesForm: TProjectVariablesForm
Left = 8
Height = 58
Top = 80
Width = 559
Width = 570
Anchors = [akTop, akLeft, akRight]
BevelInner = bvRaised
BevelOuter = bvLowered
@ -44,72 +44,64 @@ object ProjectVariablesForm: TProjectVariablesForm
end
object SGVariables: TStringGrid
Left = 10
Height = 138
Height = 162
Top = 144
Width = 557
Width = 568
Anchors = [akTop, akLeft, akRight, akBottom]
AutoFillColumns = True
ColCount = 3
DefaultColWidth = 120
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goColSizing, goEditing, goAlwaysShowEditor, goDblClickAutoSize, goSmoothScroll]
TabOrder = 5
TabOrder = 3
ColWidths = (
120
216
217
222
222
)
end
object BOK: TButton
Left = 485
Height = 25
Top = 290
Width = 75
Anchors = [akRight, akBottom]
BorderSpacing.InnerBorder = 4
Caption = '&OK'
Default = True
ModalResult = 1
OnClick = BOKClick
TabOrder = 1
end
object BCancel: TButton
Left = 397
Height = 25
Top = 290
Width = 75
Anchors = [akRight, akBottom]
BorderSpacing.InnerBorder = 4
Cancel = True
Caption = '&Cancel'
ModalResult = 2
TabOrder = 2
end
object EProjectName: TEdit
AnchorSideLeft.Control = Label1
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 123
Height = 21
Left = 132
Height = 23
Top = 16
Width = 444
Width = 446
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Right = 6
TabOrder = 3
TabOrder = 1
end
object DEProject: TDirectoryEdit
AnchorSideLeft.Control = EProjectName
AnchorSideRight.Side = asrBottom
Left = 123
Height = 21
Left = 132
Height = 23
Top = 48
Width = 420
Width = 444
ShowHidden = False
ButtonWidth = 23
NumGlyphs = 1
Anchors = [akTop, akLeft, akRight]
MaxLength = 0
TabOrder = 2
end
object ButtonPanel1: TButtonPanel
Left = 6
Height = 34
Top = 310
Width = 572
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
OKButton.OnClick = BOKClick
HelpButton.Name = 'HelpButton'
HelpButton.DefaultCaption = True
CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 4
ShowButtons = [pbOK, pbCancel]
end
end

View File

@ -6,15 +6,14 @@ interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,
Grids, ProjectTemplates, Buttons, StdCtrls, EditBtn;
Grids, ProjectTemplates, Buttons, StdCtrls, EditBtn, ButtonPanel;
type
{ TProjectVariablesForm }
TProjectVariablesForm = class(TForm)
BOK: TButton;
BCancel: TButton;
ButtonPanel1: TButtonPanel;
DEProject: TDirectoryEdit;
EProjectName: TEdit;
Label1: TLabel;
@ -73,7 +72,6 @@ procedure TProjectVariablesForm.BOKClick(Sender: TObject);
Var
N,V : String;
I : Integer;
begin
For I:=0 to FVariables.Count-1 do
begin
@ -91,8 +89,8 @@ begin
Label1.Caption:= SNameforProject;
Label2.Caption:= SCreateinDir;
PDescription.Caption:= SThisProject;
BCancel.Caption:= SbtnCancel;
BOK.Caption:= SbtnOK;
ButtonPanel1.CancelButton.Caption:= SbtnCancel;
ButtonPanel1.OKButton.Caption:= SbtnOK;
end;
procedure TProjectVariablesForm.SetVariables(const AValue: TStrings);