mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 13:17:18 +02:00
Project Templates: Disable OK button while necessary information is not given.
(cherry picked from commit 734cf1a136
)
This commit is contained in:
parent
f7b5b14c2d
commit
8a72f0f832
@ -9,7 +9,7 @@ object ProjectVariablesForm: TProjectVariablesForm
|
|||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnShow = ProjectVariablesFormShow
|
OnShow = ProjectVariablesFormShow
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '2.1.0.0'
|
LCLVersion = '2.3.0.0'
|
||||||
object ProjNameLabel: TLabel
|
object ProjNameLabel: TLabel
|
||||||
AnchorSideTop.Control = EProjectName
|
AnchorSideTop.Control = EProjectName
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
@ -20,7 +20,6 @@ object ProjectVariablesForm: TProjectVariablesForm
|
|||||||
Alignment = taRightJustify
|
Alignment = taRightJustify
|
||||||
Caption = '&Name for new project:'
|
Caption = '&Name for new project:'
|
||||||
Layout = tlCenter
|
Layout = tlCenter
|
||||||
ParentColor = False
|
|
||||||
end
|
end
|
||||||
object DEDestDirLabel: TLabel
|
object DEDestDirLabel: TLabel
|
||||||
AnchorSideTop.Control = DEDestDir
|
AnchorSideTop.Control = DEDestDir
|
||||||
@ -32,7 +31,6 @@ object ProjectVariablesForm: TProjectVariablesForm
|
|||||||
Alignment = taRightJustify
|
Alignment = taRightJustify
|
||||||
Caption = 'Create in &directory:'
|
Caption = 'Create in &directory:'
|
||||||
Layout = tlCenter
|
Layout = tlCenter
|
||||||
ParentColor = False
|
|
||||||
end
|
end
|
||||||
object PDescription: TPanel
|
object PDescription: TPanel
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
@ -89,6 +87,7 @@ object ProjectVariablesForm: TProjectVariablesForm
|
|||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Right = 6
|
BorderSpacing.Right = 6
|
||||||
|
OnChange = EssentialDataChange
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
object DEDestDir: TDirectoryEdit
|
object DEDestDir: TDirectoryEdit
|
||||||
@ -104,6 +103,7 @@ object ProjectVariablesForm: TProjectVariablesForm
|
|||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
MaxLength = 0
|
MaxLength = 0
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
|
OnChange = EssentialDataChange
|
||||||
end
|
end
|
||||||
object ButtonPanel1: TButtonPanel
|
object ButtonPanel1: TButtonPanel
|
||||||
Left = 6
|
Left = 6
|
||||||
|
@ -24,6 +24,7 @@ type
|
|||||||
PDescription: TPanel;
|
PDescription: TPanel;
|
||||||
SGVariables: TStringGrid;
|
SGVariables: TStringGrid;
|
||||||
procedure BOKClick(Sender: TObject);
|
procedure BOKClick(Sender: TObject);
|
||||||
|
procedure EssentialDataChange(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure ProjectVariablesFormShow(Sender: TObject);
|
procedure ProjectVariablesFormShow(Sender: TObject);
|
||||||
procedure SGVariablesSelectEditor(Sender: TObject; aCol, aRow: Integer;
|
procedure SGVariablesSelectEditor(Sender: TObject; aCol, aRow: Integer;
|
||||||
@ -74,20 +75,24 @@ Var
|
|||||||
begin
|
begin
|
||||||
For I:=0 to FVariables.Count-1 do
|
For I:=0 to FVariables.Count-1 do
|
||||||
begin
|
begin
|
||||||
V:='';
|
|
||||||
N:='';
|
|
||||||
FVariables.GetNameValue(I,N,V);
|
FVariables.GetNameValue(I,N,V);
|
||||||
V:=SGVariables.Cells[1,I+1];
|
V:=SGVariables.Cells[1,I+1];
|
||||||
FVariables[i]:=N+'='+V;
|
FVariables[i]:=N+'='+V;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TProjectVariablesForm.EssentialDataChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ButtonPanel1.OKButton.Enabled:=(EProjectName.Text<>'') and (DEDestDir.Text<>'');
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TProjectVariablesForm.FormCreate(Sender: TObject);
|
procedure TProjectVariablesForm.FormCreate(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Caption := SNewFromTemplate;
|
Caption := SNewFromTemplate;
|
||||||
ProjNameLabel.Caption:= SNameforProject;
|
ProjNameLabel.Caption:= SNameforProject;
|
||||||
DEDestDirLabel.Caption:= SCreateinDir;
|
DEDestDirLabel.Caption:= SCreateinDir;
|
||||||
PDescription.Caption:= SThisProject;
|
PDescription.Caption:= SThisProject;
|
||||||
|
EssentialDataChange(Nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TProjectVariablesForm.SetVariables(const AValue: TStrings);
|
procedure TProjectVariablesForm.SetVariables(const AValue: TStrings);
|
||||||
|
Loading…
Reference in New Issue
Block a user