mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 13:39:24 +02:00
MG: added LCLPlatform to build lazarus dialog
git-svn-id: trunk@3458 -
This commit is contained in:
parent
9268921ead
commit
1ce803bc1c
@ -39,6 +39,7 @@ uses
|
|||||||
|
|
||||||
type
|
type
|
||||||
TMakeMode = (mmNone, mmBuild, mmCleanBuild);
|
TMakeMode = (mmNone, mmBuild, mmCleanBuild);
|
||||||
|
TLCLPlatform = (lpGtk, lpGnome, lpWin32);
|
||||||
|
|
||||||
TBuildLazarusOptions = class
|
TBuildLazarusOptions = class
|
||||||
private
|
private
|
||||||
@ -52,6 +53,7 @@ type
|
|||||||
fMakeFilename: string;
|
fMakeFilename: string;
|
||||||
fExtraOptions: string;
|
fExtraOptions: string;
|
||||||
fTargetOS: string;
|
fTargetOS: string;
|
||||||
|
fLCLPlatform: TLCLPlatform;
|
||||||
public
|
public
|
||||||
constructor Create;
|
constructor Create;
|
||||||
procedure Load(XMLConfig: TXMLConfig; const Path: string);
|
procedure Load(XMLConfig: TXMLConfig; const Path: string);
|
||||||
@ -67,6 +69,7 @@ type
|
|||||||
property MakeFilename: string read fMakeFilename write fMakeFilename;
|
property MakeFilename: string read fMakeFilename write fMakeFilename;
|
||||||
property ExtraOptions: string read fExtraOptions write fExtraOptions;
|
property ExtraOptions: string read fExtraOptions write fExtraOptions;
|
||||||
property TargetOS: string read fTargetOS write fTargetOS;
|
property TargetOS: string read fTargetOS write fTargetOS;
|
||||||
|
property LCLPlatform: TLCLPlatform read fLCLPlatform write fLCLPlatform;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TConfigureBuildLazarusDlg = class(TForm)
|
TConfigureBuildLazarusDlg = class(TForm)
|
||||||
@ -80,6 +83,7 @@ type
|
|||||||
BuildExamplesRadioGroup: TRadioGroup;
|
BuildExamplesRadioGroup: TRadioGroup;
|
||||||
OptionsLabel: TLabel;
|
OptionsLabel: TLabel;
|
||||||
OptionsEdit: TEdit;
|
OptionsEdit: TEdit;
|
||||||
|
LCLInterfaceRadioGroup: TRadioGroup;
|
||||||
TargetOSLabel: TLabel;
|
TargetOSLabel: TLabel;
|
||||||
TargetOSEdit: TEdit;
|
TargetOSEdit: TEdit;
|
||||||
OkButton: TButton;
|
OkButton: TButton;
|
||||||
@ -115,6 +119,9 @@ const
|
|||||||
MakeModeNames: array[TMakeMode] of string = (
|
MakeModeNames: array[TMakeMode] of string = (
|
||||||
'None', 'Build', 'Clean+Build'
|
'None', 'Build', 'Clean+Build'
|
||||||
);
|
);
|
||||||
|
LCLPlatformNames: array[TLCLPlatform] of string = (
|
||||||
|
'gtk', 'gnome', 'win32'
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
function StrToMakeMode(const s: string): TMakeMode;
|
function StrToMakeMode(const s: string): TMakeMode;
|
||||||
@ -124,6 +131,13 @@ begin
|
|||||||
Result:=mmNone;
|
Result:=mmNone;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function StrToLCLPlatform(const s: string): TLCLPlatform;
|
||||||
|
begin
|
||||||
|
for Result:=Low(TLCLPlatform) to High(TLCLPlatform) do
|
||||||
|
if AnsiCompareText(s,LCLPlatformNames[Result])=0 then exit;
|
||||||
|
Result:=lpGtk;
|
||||||
|
end;
|
||||||
|
|
||||||
function ShowConfigureBuildLazarusDlg(
|
function ShowConfigureBuildLazarusDlg(
|
||||||
Options: TBuildLazarusOptions): TModalResult;
|
Options: TBuildLazarusOptions): TModalResult;
|
||||||
var ConfigBuildLazDlg: TConfigureBuildLazarusDlg;
|
var ConfigBuildLazDlg: TConfigureBuildLazarusDlg;
|
||||||
@ -164,6 +178,8 @@ begin
|
|||||||
Tool:=TExternalToolOptions.Create;
|
Tool:=TExternalToolOptions.Create;
|
||||||
try
|
try
|
||||||
Tool.Filename:=Options.MakeFilename;
|
Tool.Filename:=Options.MakeFilename;
|
||||||
|
Tool.EnvironmentOverrides.Values['LCL_PLATFORM']:=
|
||||||
|
LCLPlatformNames[Options.LCLPlatform];
|
||||||
if not FileExists(Tool.Filename) then begin
|
if not FileExists(Tool.Filename) then begin
|
||||||
Tool.Filename:=FindDefaultMakePath;
|
Tool.Filename:=FindDefaultMakePath;
|
||||||
if not FileExists(Tool.Filename) then exit;
|
if not FileExists(Tool.Filename) then exit;
|
||||||
@ -251,11 +267,13 @@ end;
|
|||||||
{ TConfigureBuildLazarusDlg }
|
{ TConfigureBuildLazarusDlg }
|
||||||
|
|
||||||
constructor TConfigureBuildLazarusDlg.Create(AnOwner: TComponent);
|
constructor TConfigureBuildLazarusDlg.Create(AnOwner: TComponent);
|
||||||
var MakeMode: TMakeMode;
|
var
|
||||||
|
MakeMode: TMakeMode;
|
||||||
|
LCLInterface: TLCLPlatform;
|
||||||
begin
|
begin
|
||||||
inherited Create(AnOwner);
|
inherited Create(AnOwner);
|
||||||
if LazarusResources.Find(Classname)=nil then begin
|
if LazarusResources.Find(Classname)=nil then begin
|
||||||
Width:=350;
|
Width:=480;
|
||||||
Height:=435;
|
Height:=435;
|
||||||
Position:=poScreenCenter;
|
Position:=poScreenCenter;
|
||||||
Caption:='Configure "Build Lazarus"';
|
Caption:='Configure "Build Lazarus"';
|
||||||
@ -266,7 +284,7 @@ begin
|
|||||||
with CleanAllCheckBox do begin
|
with CleanAllCheckBox do begin
|
||||||
Parent:=Self;
|
Parent:=Self;
|
||||||
Name:='CleanAllCheckBox';
|
Name:='CleanAllCheckBox';
|
||||||
SetBounds(10,10,Self.ClientWidth-20,20);
|
SetBounds(10,10,Self.ClientWidth-150,20);
|
||||||
Caption:='Clean all';
|
Caption:='Clean all';
|
||||||
Visible:=true;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
@ -389,8 +407,7 @@ begin
|
|||||||
with TargetOSLabel do begin
|
with TargetOSLabel do begin
|
||||||
Name:='TargetOSLabel';
|
Name:='TargetOSLabel';
|
||||||
Parent:=Self;
|
Parent:=Self;
|
||||||
SetBounds(10,
|
SetBounds(10,OptionsLabel.Top+OptionsLabel.Height+12,
|
||||||
OptionsLabel.Top+OptionsLabel.Height+12,
|
|
||||||
80,Height);
|
80,Height);
|
||||||
Caption:='Target OS:';
|
Caption:='Target OS:';
|
||||||
Visible:=true;
|
Visible:=true;
|
||||||
@ -407,6 +424,21 @@ begin
|
|||||||
Visible:=true;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
LCLInterfaceRadioGroup:=TRadioGroup.Create(Self);
|
||||||
|
with LCLInterfaceRadioGroup do begin
|
||||||
|
Name:='LCLInterfaceRadioGroup';
|
||||||
|
Parent:=Self;
|
||||||
|
Left:=BuildLCLRadioGroup.Left+BuildLCLRadioGroup.Width+10;
|
||||||
|
Top:=BuildLCLRadioGroup.Top;
|
||||||
|
Width:=Parent.ClientHeight-Left-BuildLCLRadioGroup.Left;
|
||||||
|
Height:=100;
|
||||||
|
Caption:='LCL interface';
|
||||||
|
for LCLInterface:=Low(TLCLPlatform) to High(TLCLPlatform) do begin
|
||||||
|
Items.Add(LCLPlatformNames[LCLInterface]);
|
||||||
|
end;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
OkButton:=TButton.Create(Self);
|
OkButton:=TButton.Create(Self);
|
||||||
with OkButton do begin
|
with OkButton do begin
|
||||||
Parent:=Self;
|
Parent:=Self;
|
||||||
@ -453,7 +485,7 @@ end;
|
|||||||
procedure TConfigureBuildLazarusDlg.ConfigureBuildLazarusDlgResize(
|
procedure TConfigureBuildLazarusDlg.ConfigureBuildLazarusDlgResize(
|
||||||
Sender: TObject);
|
Sender: TObject);
|
||||||
begin
|
begin
|
||||||
CleanAllCheckBox.SetBounds(10,10,Self.ClientWidth-24,20);
|
CleanAllCheckBox.SetBounds(10,10,Self.ClientWidth-150,20);
|
||||||
BuildAllButton.SetBounds(CleanAllCheckBox.Left,
|
BuildAllButton.SetBounds(CleanAllCheckBox.Left,
|
||||||
CleanAllCheckBox.Top+CleanAllCheckBox.Height+5,
|
CleanAllCheckBox.Top+CleanAllCheckBox.Height+5,
|
||||||
200,BuildAllButton.Height);
|
200,BuildAllButton.Height);
|
||||||
@ -489,6 +521,11 @@ begin
|
|||||||
TargetOSLabel.Top,
|
TargetOSLabel.Top,
|
||||||
OptionsEdit.Width,
|
OptionsEdit.Width,
|
||||||
TargetOSEdit.Height);
|
TargetOSEdit.Height);
|
||||||
|
with LCLInterfaceRadioGroup do begin
|
||||||
|
Left:=BuildLCLRadioGroup.Left+BuildLCLRadioGroup.Width+10;
|
||||||
|
Top:=BuildLCLRadioGroup.Top;
|
||||||
|
Width:=Parent.ClientWidth-Left-10;
|
||||||
|
end;
|
||||||
OkButton.SetBounds(Self.ClientWidth-180,Self.ClientHeight-38,80,25);
|
OkButton.SetBounds(Self.ClientWidth-180,Self.ClientHeight-38,80,25);
|
||||||
CancelButton.SetBounds(Self.ClientWidth-90,OkButton.Top,
|
CancelButton.SetBounds(Self.ClientWidth-90,OkButton.Top,
|
||||||
OkButton.Width,OkButton.Height);
|
OkButton.Width,OkButton.Height);
|
||||||
@ -514,6 +551,7 @@ begin
|
|||||||
BuildIDERadioGroup.ItemIndex:=MakeModeToInt(Options.BuildIDE);
|
BuildIDERadioGroup.ItemIndex:=MakeModeToInt(Options.BuildIDE);
|
||||||
BuildExamplesRadioGroup.ItemIndex:=MakeModeToInt(Options.BuildExamples);
|
BuildExamplesRadioGroup.ItemIndex:=MakeModeToInt(Options.BuildExamples);
|
||||||
OptionsEdit.Text:=Options.ExtraOptions;
|
OptionsEdit.Text:=Options.ExtraOptions;
|
||||||
|
LCLInterfaceRadioGroup.ItemIndex:=ord(Options.LCLPlatform);
|
||||||
TargetOSEdit.Text:=Options.TargetOS;
|
TargetOSEdit.Text:=Options.TargetOS;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -528,6 +566,7 @@ begin
|
|||||||
Options.BuildIDE:=IntToMakeMode(BuildIDERadioGroup.ItemIndex);
|
Options.BuildIDE:=IntToMakeMode(BuildIDERadioGroup.ItemIndex);
|
||||||
Options.BuildExamples:=IntToMakeMode(BuildExamplesRadioGroup.ItemIndex);
|
Options.BuildExamples:=IntToMakeMode(BuildExamplesRadioGroup.ItemIndex);
|
||||||
Options.ExtraOptions:=OptionsEdit.Text;
|
Options.ExtraOptions:=OptionsEdit.Text;
|
||||||
|
Options.LCLPlatform:=TLCLPlatform(LCLInterfaceRadioGroup.ItemIndex);
|
||||||
Options.TargetOS:=TargetOSEdit.Text;
|
Options.TargetOS:=TargetOSEdit.Text;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -563,6 +602,7 @@ begin
|
|||||||
XMLConfig.SetValue(Path+'ExtraOptions/Value',fExtraOptions);
|
XMLConfig.SetValue(Path+'ExtraOptions/Value',fExtraOptions);
|
||||||
XMLConfig.SetValue(Path+'TargetOS/Value',fTargetOS);
|
XMLConfig.SetValue(Path+'TargetOS/Value',fTargetOS);
|
||||||
XMLConfig.SetValue(Path+'MakeFilename/Value',fMakeFilename);
|
XMLConfig.SetValue(Path+'MakeFilename/Value',fMakeFilename);
|
||||||
|
XMLConfig.SetValue(Path+'LCLPlatform/Value',LCLPlatformNames[fLCLPlatform]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBuildLazarusOptions.Load(XMLConfig: TXMLConfig; const Path: string);
|
procedure TBuildLazarusOptions.Load(XMLConfig: TXMLConfig; const Path: string);
|
||||||
@ -583,12 +623,15 @@ begin
|
|||||||
fExtraOptions:=XMLConfig.GetValue(Path+'ExtraOptions/Value',fExtraOptions);
|
fExtraOptions:=XMLConfig.GetValue(Path+'ExtraOptions/Value',fExtraOptions);
|
||||||
fTargetOS:=XMLConfig.GetValue(Path+'TargetOS/Value','');
|
fTargetOS:=XMLConfig.GetValue(Path+'TargetOS/Value','');
|
||||||
fMakeFilename:=XMLConfig.GetValue(Path+'MakeFilename/Value',fMakeFilename);
|
fMakeFilename:=XMLConfig.GetValue(Path+'MakeFilename/Value',fMakeFilename);
|
||||||
|
fLCLPlatform:=StrToLCLPlatform(XMLConfig.GetValue(Path+'LCLPlatform/Value',
|
||||||
|
LCLPlatformNames[fLCLPlatform]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TBuildLazarusOptions.Create;
|
constructor TBuildLazarusOptions.Create;
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
fMakeFilename:='';
|
fMakeFilename:='';
|
||||||
|
fLCLPlatform:=lpGtk;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user