IDE: add a link for Widgetset settings also to Config and Target page. Fix comp. names.

git-svn-id: trunk@45061 -
This commit is contained in:
juha 2014-05-17 17:00:20 +00:00
parent a94d290c94
commit 2026bcfa22
2 changed files with 94 additions and 50 deletions

View File

@ -8,20 +8,20 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
TabOrder = 0 TabOrder = 0
DesignLeft = 338 DesignLeft = 338
DesignTop = 284 DesignTop = 284
object grpConfigFile: TGroupBox object grbConfigFile: TGroupBox
Left = 0 Left = 0
Height = 106 Height = 102
Top = 0 Top = 0
Width = 594 Width = 594
Align = alTop Align = alTop
AutoSize = True AutoSize = True
Caption = 'grpConfigFile' Caption = 'grbConfigFile'
ClientHeight = 86 ClientHeight = 83
ClientWidth = 590 ClientWidth = 590
TabOrder = 0 TabOrder = 0
object chkConfigFile: TCheckBox object chkConfigFile: TCheckBox
Left = 6 Left = 6
Height = 22 Height = 21
Top = 6 Top = 6
Width = 578 Width = 578
Align = alTop Align = alTop
@ -33,8 +33,8 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
end end
object chkCustomConfigFile: TCheckBox object chkCustomConfigFile: TCheckBox
Left = 6 Left = 6
Height = 22 Height = 21
Top = 31 Top = 30
Width = 578 Width = 578
Align = alTop Align = alTop
BorderSpacing.Left = 6 BorderSpacing.Left = 6
@ -51,8 +51,8 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
AnchorSideRight.Control = chkCustomConfigFile AnchorSideRight.Control = chkCustomConfigFile
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 25 Left = 25
Height = 26 Height = 25
Top = 54 Top = 52
Width = 559 Width = 559
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 19 BorderSpacing.Left = 19
@ -62,27 +62,27 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
Text = 'edtConfigPath' Text = 'edtConfigPath'
end end
end end
object grpTargetPlatform: TGroupBox object grbTargetPlatform: TGroupBox
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 0 Left = 0
Height = 125 Height = 109
Top = 114 Top = 110
Width = 594 Width = 594
Align = alTop Align = alTop
AutoSize = True AutoSize = True
BorderSpacing.Top = 8 BorderSpacing.Top = 8
Caption = 'Target Platform' Caption = 'Target Platform'
ClientHeight = 105 ClientHeight = 90
ClientWidth = 590 ClientWidth = 590
TabOrder = 1 TabOrder = 1
object lblTargetOS: TLabel object lblTargetOS: TLabel
AnchorSideLeft.Control = grpTargetPlatform AnchorSideLeft.Control = grbTargetPlatform
AnchorSideTop.Control = TargetOSComboBox AnchorSideTop.Control = TargetOSComboBox
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 6 Left = 6
Height = 18 Height = 15
Top = 9 Top = 8
Width = 83 Width = 70
BorderSpacing.Left = 6 BorderSpacing.Left = 6
Caption = 'lblTargetOS' Caption = 'lblTargetOS'
ParentColor = False ParentColor = False
@ -92,9 +92,9 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
AnchorSideTop.Control = TargetCPUComboBox AnchorSideTop.Control = TargetCPUComboBox
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 6 Left = 6
Height = 18 Height = 15
Top = 42 Top = 36
Width = 91 Width = 78
Caption = 'lblTargetCPU' Caption = 'lblTargetCPU'
ParentColor = False ParentColor = False
end end
@ -103,22 +103,22 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
AnchorSideTop.Control = TargetProcComboBox AnchorSideTop.Control = TargetProcComboBox
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 6 Left = 6
Height = 18 Height = 15
Top = 75 Top = 64
Width = 93 Width = 81
Caption = 'lblTargetProc' Caption = 'lblTargetProc'
ParentColor = False ParentColor = False
end end
object TargetOSComboBox: TComboBox object TargetOSComboBox: TComboBox
AnchorSideLeft.Control = lblTargetOS AnchorSideLeft.Control = lblTargetOS
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = grpTargetPlatform AnchorSideTop.Control = grbTargetPlatform
AnchorSideRight.Control = grpTargetPlatform AnchorSideRight.Control = grbTargetPlatform
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 95 Left = 82
Height = 30 Height = 25
Top = 3 Top = 3
Width = 489 Width = 502
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 3 BorderSpacing.Top = 3
@ -133,12 +133,12 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = TargetOSComboBox AnchorSideTop.Control = TargetOSComboBox
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = grpTargetPlatform AnchorSideRight.Control = grbTargetPlatform
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 103 Left = 90
Height = 30 Height = 25
Top = 36 Top = 31
Width = 481 Width = 494
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 3 BorderSpacing.Top = 3
@ -153,12 +153,12 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = TargetCPUComboBox AnchorSideTop.Control = TargetCPUComboBox
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = grpTargetPlatform AnchorSideRight.Control = grbTargetPlatform
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 105 Left = 93
Height = 30 Height = 25
Top = 69 Top = 59
Width = 479 Width = 491
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 3 BorderSpacing.Top = 3
@ -171,19 +171,19 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
end end
object grbTargetOptions: TGroupBox object grbTargetOptions: TGroupBox
Left = 0 Left = 0
Height = 54 Height = 57
Top = 247 Top = 227
Width = 594 Width = 594
Align = alTop Align = alTop
AutoSize = True AutoSize = True
BorderSpacing.Top = 8 BorderSpacing.Top = 8
Caption = 'Target-specific options' Caption = 'Target-specific options'
ClientHeight = 34 ClientHeight = 38
ClientWidth = 590 ClientWidth = 590
TabOrder = 2 TabOrder = 2
object chkWin32GraphicApp: TCheckBox object chkWin32GraphicApp: TCheckBox
Left = 6 Left = 6
Height = 22 Height = 21
Top = 6 Top = 6
Width = 578 Width = 578
Align = alTop Align = alTop
@ -192,4 +192,20 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
TabOrder = 0 TabOrder = 0
end end
end end
object LCLWidgetTypeLabel: TLabel
AnchorSideTop.Control = grbTargetOptions
AnchorSideTop.Side = asrBottom
Left = 3
Height = 15
Top = 292
Width = 122
BorderSpacing.Top = 8
Caption = 'LCLWidgetTypeLabel'
Font.Color = clBlue
ParentColor = False
ParentFont = False
OnClick = LCLWidgetTypeLabelClick
OnMouseEnter = LCLWidgetTypeLabelMouseEnter
OnMouseLeave = LCLWidgetTypeLabelMouseLeave
end
end end

View File

@ -28,8 +28,8 @@ unit compiler_config_target;
interface interface
uses uses
Classes, SysUtils, strutils, FileUtil, Controls, Dialogs, StdCtrls, LCLProc, Classes, SysUtils, strutils, FileUtil, Controls, Dialogs, Graphics, StdCtrls,
IDEOptionsIntf, IDEDialogs, CompilerOptions, LazarusIDEStrConsts, LCLProc, IDEOptionsIntf, IDEDialogs, CompilerOptions, LazarusIDEStrConsts,
TransferMacros, PackageDefs, compiler_parsing_options; TransferMacros, PackageDefs, compiler_parsing_options;
type type
@ -42,17 +42,21 @@ type
chkWin32GraphicApp: TCheckBox; chkWin32GraphicApp: TCheckBox;
edtConfigPath: TEdit; edtConfigPath: TEdit;
grbTargetOptions: TGroupBox; grbTargetOptions: TGroupBox;
grpConfigFile: TGroupBox; grbConfigFile: TGroupBox;
grpTargetPlatform: TGroupBox; grbTargetPlatform: TGroupBox;
lblTargetCPU: TLabel; lblTargetCPU: TLabel;
lblTargetOS: TLabel; lblTargetOS: TLabel;
lblTargetProc: TLabel; lblTargetProc: TLabel;
LCLWidgetTypeLabel: TLabel;
TargetCPUComboBox: TComboBox; TargetCPUComboBox: TComboBox;
TargetOSComboBox: TComboBox; TargetOSComboBox: TComboBox;
TargetProcComboBox: TComboBox; TargetProcComboBox: TComboBox;
procedure chkCustomConfigFileClick(Sender: TObject); procedure chkCustomConfigFileClick(Sender: TObject);
procedure TargetOSComboBoxSelect(Sender: TObject); procedure TargetOSComboBoxSelect(Sender: TObject);
procedure TargetCPUComboBoxSelect(Sender: TObject); procedure TargetCPUComboBoxSelect(Sender: TObject);
procedure LCLWidgetTypeLabelClick(Sender: TObject);
procedure LCLWidgetTypeLabelMouseEnter(Sender: TObject);
procedure LCLWidgetTypeLabelMouseLeave(Sender: TObject);
private private
FDialog: TAbstractOptionsEditorDialog; FDialog: TAbstractOptionsEditorDialog;
FCompOptions: TBaseCompilerOptions; FCompOptions: TBaseCompilerOptions;
@ -197,6 +201,10 @@ begin
DebugLn(['TCompilerConfigTargetFrame.UpdateTargetSpecific: TargetOS=',aTargetOS,DbgMsg]); DebugLn(['TCompilerConfigTargetFrame.UpdateTargetSpecific: TargetOS=',aTargetOS,DbgMsg]);
// Now hide/show the whole GroupBox because there is only one setting. // Now hide/show the whole GroupBox because there is only one setting.
grbTargetOptions.Visible := AnsiStartsText('Win', aTargetOS); grbTargetOptions.Visible := AnsiStartsText('Win', aTargetOS);
if grbTargetOptions.Visible then
LCLWidgetTypeLabel.AnchorSideTop.Control := grbTargetOptions
else
LCLWidgetTypeLabel.AnchorSideTop.Control := grbTargetPlatform;
end; end;
procedure TCompilerConfigTargetFrame.UpdateByTargetCPU(aTargetCPU: string); procedure TCompilerConfigTargetFrame.UpdateByTargetCPU(aTargetCPU: string);
@ -299,13 +307,13 @@ begin
FDialog := ADialog; FDialog := ADialog;
// Config // Config
grpConfigFile.Caption := dlgConfigFiles; grbConfigFile.Caption := dlgConfigFiles;
chkConfigFile.Caption := dlgUseFpcCfg + ' (If not checked: -n)'; chkConfigFile.Caption := dlgUseFpcCfg + ' (If not checked: -n)';
chkCustomConfigFile.Caption := dlgUseCustomConfig + ' (@)'; chkCustomConfigFile.Caption := dlgUseCustomConfig + ' (@)';
edtConfigPath.Text := ''; edtConfigPath.Text := '';
// Target platform // Target platform
grpTargetPlatform.Caption := dlgTargetPlatform; grbTargetPlatform.Caption := dlgTargetPlatform;
lblTargetOS.Caption := dlgTargetOS + ' (-T)'; lblTargetOS.Caption := dlgTargetOS + ' (-T)';
with TargetOSComboBox do with TargetOSComboBox do
begin begin
@ -364,6 +372,7 @@ begin
end; end;
lblTargetProc.Caption := dlgTargetProc; lblTargetProc.Caption := dlgTargetProc;
LCLWidgetTypeLabel.Caption := lisSelectAnotherLCLWidgetSetMacroLCLWidgetType;
// Target options // Target options
grbTargetOptions.Caption := dlgTargetSpecificOptions; grbTargetOptions.Caption := dlgTargetSpecificOptions;
@ -385,14 +394,15 @@ begin
edtConfigPath.Enabled := chkCustomConfigFile.Checked; edtConfigPath.Enabled := chkCustomConfigFile.Checked;
edtConfigPath.Text := ConfigFilePath; edtConfigPath.Text := ConfigFilePath;
if fIsPackage then begin if fIsPackage then begin
grpTargetPlatform.Visible:=false; grbTargetPlatform.Visible:=false;
TargetOSComboBox.ItemIndex := 0; TargetOSComboBox.ItemIndex := 0;
TargetOSComboBox.Text := 'default'; TargetOSComboBox.Text := 'default';
TargetCPUComboBox.ItemIndex := 0; TargetCPUComboBox.ItemIndex := 0;
TargetCPUComboBox.Text := 'default'; TargetCPUComboBox.Text := 'default';
TargetProcComboBox.Text := 'default'; TargetProcComboBox.Text := 'default';
LCLWidgetTypeLabel.Visible:=false;
end else begin end else begin
grpTargetPlatform.Visible:=true; grbTargetPlatform.Visible:=true;
// Target OS // Target OS
i := TargetOSComboBox.Items.IndexOf(TargetOS); i := TargetOSComboBox.Items.IndexOf(TargetOS);
if i < 0 then if i < 0 then
@ -407,6 +417,7 @@ begin
UpdateByTargetCPU(TargetCPU); UpdateByTargetCPU(TargetCPU);
UpdateByTargetOS(TargetOS); UpdateByTargetOS(TargetOS);
TargetProcComboBox.Text := ProcessorToCaption(TargetProcessor); TargetProcComboBox.Text := ProcessorToCaption(TargetProcessor);
LCLWidgetTypeLabel.Visible:=true;
end; end;
chkWin32GraphicApp.Checked := Win32GraphicApp; chkWin32GraphicApp.Checked := Win32GraphicApp;
chkWin32GraphicApp.Enabled := NeedsLinkerOpts; chkWin32GraphicApp.Enabled := NeedsLinkerOpts;
@ -473,6 +484,23 @@ begin
UpdateByTargetCPU(s); UpdateByTargetCPU(s);
end; end;
procedure TCompilerConfigTargetFrame.LCLWidgetTypeLabelClick(Sender: TObject);
begin
FDialog.OpenEditor(GroupCompiler,CompilerOptionsAdditionsAndOverrides);
end;
procedure TCompilerConfigTargetFrame.LCLWidgetTypeLabelMouseEnter(Sender: TObject);
begin
(Sender as TLabel).Font.Underline := True;
(Sender as TLabel).Font.Color := clRed;
end;
procedure TCompilerConfigTargetFrame.LCLWidgetTypeLabelMouseLeave(Sender: TObject);
begin
(Sender as TLabel).Font.Underline := False;
(Sender as TLabel).Font.Color := clBlue;
end;
class function TCompilerConfigTargetFrame.SupportedOptionsClass: TAbstractIDEOptionsClass; class function TCompilerConfigTargetFrame.SupportedOptionsClass: TAbstractIDEOptionsClass;
begin begin
Result := TBaseCompilerOptions; Result := TBaseCompilerOptions;