IDE: show a link to LCLWidgetType in Project Options only when there is LCL dependency.

git-svn-id: trunk@45223 -
This commit is contained in:
juha 2014-05-29 19:40:05 +00:00
parent 081cf3a9ee
commit ed01999291
3 changed files with 50 additions and 46 deletions

View File

@ -30,7 +30,7 @@ interface
uses uses
Classes, SysUtils, strutils, FileUtil, Controls, Dialogs, Graphics, StdCtrls, Classes, SysUtils, strutils, FileUtil, Controls, Dialogs, Graphics, StdCtrls,
LCLProc, IDEOptionsIntf, IDEDialogs, CompilerOptions, LazarusIDEStrConsts, LCLProc, IDEOptionsIntf, IDEDialogs, CompilerOptions, LazarusIDEStrConsts,
TransferMacros, PackageDefs, compiler_parsing_options; TransferMacros, PackageDefs, Project, compiler_parsing_options;
type type
@ -382,6 +382,7 @@ end;
procedure TCompilerConfigTargetFrame.ReadSettings(AOptions: TAbstractIDEOptions); procedure TCompilerConfigTargetFrame.ReadSettings(AOptions: TAbstractIDEOptions);
var var
i: Integer; i: Integer;
PkgDep: TPkgDependency;
begin begin
FCompOptions:=AOptions as TBaseCompilerOptions; FCompOptions:=AOptions as TBaseCompilerOptions;
FIsPackage:=FCompOptions is TPkgCompilerOptions; FIsPackage:=FCompOptions is TPkgCompilerOptions;
@ -417,7 +418,8 @@ begin
UpdateByTargetCPU(TargetCPU); UpdateByTargetCPU(TargetCPU);
UpdateByTargetOS(TargetOS); UpdateByTargetOS(TargetOS);
TargetProcComboBox.Text := ProcessorToCaption(TargetProcessor); TargetProcComboBox.Text := ProcessorToCaption(TargetProcessor);
LCLWidgetTypeLabel.Visible:=true; PkgDep:=(AOptions as TProjectCompilerOptions).LazProject.FindDependencyByName('LCL');
LCLWidgetTypeLabel.Visible:=Assigned(PkgDep);
end; end;
chkWin32GraphicApp.Checked := Win32GraphicApp; chkWin32GraphicApp.Checked := Win32GraphicApp;
chkWin32GraphicApp.Enabled := NeedsLinkerOpts; chkWin32GraphicApp.Enabled := NeedsLinkerOpts;

View File

@ -15,7 +15,7 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
Left = 0 Left = 0
Height = 15 Height = 15
Top = 0 Top = 0
Width = 92 Width = 100
Caption = 'OtherUnitsLabel' Caption = 'OtherUnitsLabel'
ParentColor = False ParentColor = False
end end
@ -26,8 +26,8 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 0 Left = 0
Height = 15 Height = 15
Top = 44 Top = 46
Width = 95 Width = 105
BorderSpacing.Top = 6 BorderSpacing.Top = 6
Caption = 'IncludeFilesLabel' Caption = 'IncludeFilesLabel'
ParentColor = False ParentColor = False
@ -39,8 +39,8 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 0 Left = 0
Height = 15 Height = 15
Top = 241 Top = 251
Width = 106 Width = 119
Caption = 'OtherSourcesLabel' Caption = 'OtherSourcesLabel'
ParentColor = False ParentColor = False
end end
@ -51,8 +51,8 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 0 Left = 0
Height = 15 Height = 15
Top = 88 Top = 92
Width = 78 Width = 86
BorderSpacing.Top = 6 BorderSpacing.Top = 6
Caption = 'LibrariesLabel' Caption = 'LibrariesLabel'
ParentColor = False ParentColor = False
@ -64,8 +64,8 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 0 Left = 0
Height = 15 Height = 15
Top = 132 Top = 138
Width = 110 Width = 118
BorderSpacing.Top = 6 BorderSpacing.Top = 6
Caption = 'UnitOutputDirLabel' Caption = 'UnitOutputDirLabel'
ParentColor = False ParentColor = False
@ -77,8 +77,8 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 0 Left = 0
Height = 15 Height = 15
Top = 285 Top = 297
Width = 92 Width = 102
BorderSpacing.Top = 6 BorderSpacing.Top = 6
Caption = 'DebugPathLabel' Caption = 'DebugPathLabel'
ParentColor = False ParentColor = False
@ -89,8 +89,8 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 0 Left = 0
Height = 15 Height = 15
Top = 329 Top = 343
Width = 115 Width = 122
Caption = 'LCLWidgetTypeLabel' Caption = 'LCLWidgetTypeLabel'
Font.Color = clBlue Font.Color = clBlue
ParentColor = False ParentColor = False
@ -106,7 +106,7 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 0 Left = 0
Height = 23 Height = 25
Top = 15 Top = 15
Width = 509 Width = 509
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
@ -121,8 +121,8 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 0 Left = 0
Height = 23 Height = 25
Top = 59 Top = 61
Width = 509 Width = 509
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Bottom = 6 BorderSpacing.Bottom = 6
@ -136,8 +136,8 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 0 Left = 0
Height = 23 Height = 25
Top = 256 Top = 266
Width = 509 Width = 509
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Bottom = 6 BorderSpacing.Bottom = 6
@ -151,8 +151,8 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 0 Left = 0
Height = 23 Height = 25
Top = 103 Top = 107
Width = 509 Width = 509
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Bottom = 6 BorderSpacing.Bottom = 6
@ -166,8 +166,8 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 0 Left = 0
Height = 23 Height = 25
Top = 147 Top = 153
Width = 509 Width = 509
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Bottom = 6 BorderSpacing.Bottom = 6
@ -181,8 +181,8 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 0 Left = 0
Height = 23 Height = 25
Top = 300 Top = 312
Width = 509 Width = 509
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Bottom = 6 BorderSpacing.Bottom = 6
@ -195,8 +195,8 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 0 Left = 0
Height = 15 Height = 15
Top = 176 Top = 184
Width = 108 Width = 116
Caption = 'ProjTargetFileLabel' Caption = 'ProjTargetFileLabel'
ParentColor = False ParentColor = False
end end
@ -207,8 +207,8 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 0 Left = 0
Height = 23 Height = 25
Top = 191 Top = 199
Width = 509 Width = 509
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
OnChange = ProjTargetFileEditChange OnChange = ProjTargetFileEditChange
@ -222,8 +222,8 @@ object CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 0 Left = 0
Height = 21 Height = 21
Top = 214 Top = 224
Width = 237 Width = 257
BorderSpacing.Bottom = 6 BorderSpacing.Bottom = 6
Caption = 'ProjTargetApplyConventionsCheckBox' Caption = 'ProjTargetApplyConventionsCheckBox'
TabOrder = 5 TabOrder = 5

View File

@ -8,7 +8,7 @@ uses
Classes, SysUtils, LCLProc, FileUtil, LazFileCache, Controls, Dialogs, Classes, SysUtils, LCLProc, FileUtil, LazFileCache, Controls, Dialogs,
Graphics, Buttons, StdCtrls, LCLType, IDEOptionsIntf, MacroIntf, IDEDialogs, Graphics, Buttons, StdCtrls, LCLType, IDEOptionsIntf, MacroIntf, IDEDialogs,
CompOptsIntf, Project, CompilerOptions, LazarusIDEStrConsts, PathEditorDlg, CompOptsIntf, Project, CompilerOptions, LazarusIDEStrConsts, PathEditorDlg,
IDEProcs, CheckCompilerOpts, ShowCompilerOpts, MainIntf; IDEProcs, CheckCompilerOpts, ShowCompilerOpts, MainIntf, PackageDefs;
type type
@ -745,19 +745,24 @@ begin
end; end;
procedure TCompilerPathOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions); procedure TCompilerPathOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
var
ProjOpts: TProjectCompilerOptions;
PkgDep: TPkgDependency;
begin begin
if not (AOptions is TBaseCompilerOptions) then exit; if not (AOptions is TBaseCompilerOptions) then exit;
FCompilerOpts := TBaseCompilerOptions(AOptions); FCompilerOpts := TBaseCompilerOptions(AOptions);
if AOptions is TProjectCompilerOptions then if AOptions is TProjectCompilerOptions then
begin begin
ProjOpts:=TProjectCompilerOptions(AOptions);
FHasProjectCompilerOpts:=True; FHasProjectCompilerOpts:=True;
ProjTargetFileEdit.Visible:=true; ProjTargetFileEdit.Visible:=true;
ProjTargetFileLabel.Visible:=true; ProjTargetFileLabel.Visible:=true;
ProjTargetFileEdit.Text:=TProjectCompilerOptions(AOptions).TargetFilename; ProjTargetFileEdit.Text:=ProjOpts.TargetFilename;
ProjTargetApplyConventionsCheckBox.Checked:=TProjectCompilerOptions(AOptions).TargetFilenameApplyConventions; ProjTargetApplyConventionsCheckBox.Checked:=ProjOpts.TargetFilenameApplyConventions;
ProjTargetApplyConventionsCheckBox.Visible:=true; ProjTargetApplyConventionsCheckBox.Visible:=true;
LCLWidgetTypeLabel.Visible:=true;; PkgDep:=ProjOpts.LazProject.FindDependencyByName('LCL');
LCLWidgetTypeLabel.Visible:=Assigned(PkgDep);
UpdateTargetFileLabel; UpdateTargetFileLabel;
end else begin end else begin
FHasProjectCompilerOpts:=False; FHasProjectCompilerOpts:=False;
@ -767,17 +772,14 @@ begin
LCLWidgetTypeLabel.Visible:=false; LCLWidgetTypeLabel.Visible:=false;
end; end;
with AOptions as TBaseCompilerOptions do OtherUnitsEdit.Text := FCompilerOpts.OtherUnitFiles;
begin IncludeFilesEdit.Text := FCompilerOpts.IncludePath;
OtherUnitsEdit.Text := OtherUnitFiles; LibrariesEdit.Text := FCompilerOpts.Libraries;
IncludeFilesEdit.Text := IncludePath; OtherSourcesEdit.Text := FCompilerOpts.SrcPath;
LibrariesEdit.Text := Libraries; UnitOutputDirEdit.Text := FCompilerOpts.UnitOutputDirectory;
OtherSourcesEdit.Text := SrcPath; DebugPathEdit.Text := FCompilerOpts.DebugPath;
UnitOutputDirEdit.Text := UnitOutputDirectory;
DebugPathEdit.Text := DebugPath;
chkUseAsDefault.Visible := CanBeDefaulForProject; chkUseAsDefault.Visible := FCompilerOpts.CanBeDefaulForProject;
end;
end; end;
procedure TCompilerPathOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions); procedure TCompilerPathOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);