mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 13:00:35 +02:00
IDE: SysVarUserOvr dialog refactoring. Issue #28136, patch from Alexey Torgashin.
git-svn-id: trunk@49142 -
This commit is contained in:
parent
2f09386a24
commit
1ab36dad1d
@ -1,24 +1,24 @@
|
||||
object SysVarUserOverrideDialog: TSysVarUserOverrideDialog
|
||||
Left = 348
|
||||
Height = 161
|
||||
Height = 145
|
||||
Top = 397
|
||||
Width = 400
|
||||
Width = 417
|
||||
HorzScrollBar.Page = 399
|
||||
VertScrollBar.Page = 146
|
||||
ActiveControl = VariableEdit
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BorderIcons = [biSystemMenu]
|
||||
BorderStyle = bsDialog
|
||||
Caption = 'SysVarUserOverrideDialog'
|
||||
ClientHeight = 161
|
||||
ClientWidth = 400
|
||||
OnCreate = FormCreate
|
||||
ClientHeight = 145
|
||||
ClientWidth = 417
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '0.9.29'
|
||||
LCLVersion = '1.5'
|
||||
object VariableLabel: TLabel
|
||||
Left = 6
|
||||
Height = 18
|
||||
Height = 15
|
||||
Top = 6
|
||||
Width = 388
|
||||
Width = 405
|
||||
Align = alTop
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'VariableLabel'
|
||||
@ -26,9 +26,9 @@ object SysVarUserOverrideDialog: TSysVarUserOverrideDialog
|
||||
end
|
||||
object ValueLabel: TLabel
|
||||
Left = 6
|
||||
Height = 18
|
||||
Top = 63
|
||||
Width = 388
|
||||
Height = 15
|
||||
Top = 56
|
||||
Width = 405
|
||||
Align = alTop
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'ValueLabel'
|
||||
@ -36,9 +36,9 @@ object SysVarUserOverrideDialog: TSysVarUserOverrideDialog
|
||||
end
|
||||
object ValueEdit: TEdit
|
||||
Left = 6
|
||||
Height = 27
|
||||
Top = 87
|
||||
Width = 388
|
||||
Height = 23
|
||||
Top = 77
|
||||
Width = 405
|
||||
Align = alTop
|
||||
BorderSpacing.Around = 6
|
||||
TabOrder = 1
|
||||
@ -46,9 +46,9 @@ object SysVarUserOverrideDialog: TSysVarUserOverrideDialog
|
||||
end
|
||||
object VariableEdit: TEdit
|
||||
Left = 6
|
||||
Height = 27
|
||||
Top = 30
|
||||
Width = 388
|
||||
Height = 23
|
||||
Top = 27
|
||||
Width = 405
|
||||
Align = alTop
|
||||
BorderSpacing.Around = 6
|
||||
TabOrder = 0
|
||||
@ -56,10 +56,18 @@ object SysVarUserOverrideDialog: TSysVarUserOverrideDialog
|
||||
end
|
||||
object ButtonPanel: TButtonPanel
|
||||
Left = 6
|
||||
Height = 34
|
||||
Top = 120
|
||||
Width = 388
|
||||
Align = alTop
|
||||
Height = 26
|
||||
Top = 113
|
||||
Width = 405
|
||||
OKButton.Name = 'OKButton'
|
||||
OKButton.DefaultCaption = True
|
||||
OKButton.OnClick = OkButtonClick
|
||||
HelpButton.Name = 'HelpButton'
|
||||
HelpButton.DefaultCaption = True
|
||||
CloseButton.Name = 'CloseButton'
|
||||
CloseButton.DefaultCaption = True
|
||||
CancelButton.Name = 'CancelButton'
|
||||
CancelButton.DefaultCaption = True
|
||||
TabOrder = 2
|
||||
ShowButtons = [pbOK, pbCancel]
|
||||
ShowBevel = False
|
||||
|
@ -47,33 +47,32 @@ type
|
||||
VariableEdit: TEdit;
|
||||
ValueLabel: TLabel;
|
||||
ValueEdit: TEdit;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure OkButtonClick(Sender: TObject);
|
||||
private
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
end;
|
||||
|
||||
function ShowSysVarUserOverrideDialog(var Variable, Value: string): TModalResult;
|
||||
function ShowSysVarUserOverrideDialog(var AName, AValue: string): TModalResult;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
function ShowSysVarUserOverrideDialog(var Variable, Value: string): TModalResult;
|
||||
var SysVarUserOverrideDialog: TSysVarUserOverrideDialog;
|
||||
function ShowSysVarUserOverrideDialog(var AName, AValue: string): TModalResult;
|
||||
begin
|
||||
SysVarUserOverrideDialog:=TSysVarUserOverrideDialog.Create(nil);
|
||||
with SysVarUserOverrideDialog do begin
|
||||
VariableEdit.Text:=Variable;
|
||||
ValueEdit.Text:=Value;
|
||||
if Variable=''
|
||||
then ActiveControl := VariableEdit;
|
||||
with TSysVarUserOverrideDialog.Create(nil) do
|
||||
try
|
||||
VariableEdit.Text:=AName;
|
||||
ValueEdit.Text:=AValue;
|
||||
//if AName=''
|
||||
// then ActiveControl := VariableEdit;
|
||||
Result:=ShowModal;
|
||||
if (Result=mrOk) then begin
|
||||
Variable:=Trim(VariableEdit.Text);
|
||||
Value:=ValueEdit.Text;
|
||||
AName:=Trim(VariableEdit.Text);
|
||||
AValue:=ValueEdit.Text;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
end;
|
||||
@ -92,12 +91,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSysVarUserOverrideDialog.FormCreate(Sender: TObject);
|
||||
begin
|
||||
//XXX: ButtonPanel's button event can't be assigned from OI
|
||||
ButtonPanel.OKButton.OnClick:=@OKButtonClick;
|
||||
end;
|
||||
|
||||
constructor TSysVarUserOverrideDialog.Create(TheOwner: TComponent);
|
||||
begin
|
||||
inherited Create(TheOwner);
|
||||
|
Loading…
Reference in New Issue
Block a user