From 199795b4c119c1b3d5aff103eb66c6821f0a4296 Mon Sep 17 00:00:00 2001 From: paul Date: Sun, 3 Jan 2010 10:43:21 +0000 Subject: [PATCH] ide: implement custom buttons and checkbox for the compiler options git-svn-id: trunk@23354 - --- ide/frames/compiler_path_options.lfm | 1 - ide/frames/compiler_path_options.lrs | 150 +++++++++++++-------------- ide/frames/compiler_path_options.pas | 88 +++++++++++++++- 3 files changed, 160 insertions(+), 79 deletions(-) diff --git a/ide/frames/compiler_path_options.lfm b/ide/frames/compiler_path_options.lfm index 334c975494..72f4d86755 100644 --- a/ide/frames/compiler_path_options.lfm +++ b/ide/frames/compiler_path_options.lfm @@ -3,7 +3,6 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame Width = 473 ClientHeight = 356 ClientWidth = 473 - TabOrder = 0 DesignLeft = 346 DesignTop = 328 object lblOtherUnits: TLabel[0] diff --git a/ide/frames/compiler_path_options.lrs b/ide/frames/compiler_path_options.lrs index 0c35b92b73..8fdffa1ce4 100644 --- a/ide/frames/compiler_path_options.lrs +++ b/ide/frames/compiler_path_options.lrs @@ -2,81 +2,81 @@ LazarusResources.Add('TCompilerPathOptionsFrame','FORMDATA',[ 'TPF0'#241#25'TCompilerPathOptionsFrame'#24'CompilerPathOptionsFrame'#6'Heigh' - +'t'#3'd'#1#5'Width'#3#217#1#12'ClientHeight'#3'd'#1#11'ClientWidth'#3#217#1#8 - +'TabOrder'#2#0#10'DesignLeft'#3'Z'#1#9'DesignTop'#3'H'#1#0#242#2#0#6'TLabel' - +#13'lblOtherUnits'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Co' - +'ntrol'#7#5'Owner'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight' - +'.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#14#3'Top'#2#0#5'Width'#3#217#1 - +#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#7'Caption'#6#13'lblOtherUnits' - +#11'ParentColor'#8#0#0#242#2#1#6'TLabel'#15'lblIncludeFiles'#22'AnchorSideLe' - +'ft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#13'edtOtherUnits'#18'Anc' - +'horSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'A' - +'nchorSideRight.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#14#3'Top'#2')'#5 - +'Width'#3#217#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#17'BorderSpaci' - +'ng.Top'#2#6#7'Caption'#6#15'lblIncludeFiles'#11'ParentColor'#8#0#0#242#2#2#6 - +'TLabel'#15'lblOtherSources'#22'AnchorSideLeft.Control'#7#5'Owner'#21'Anchor' - +'SideTop.Control'#7#15'edtIncludeFiles'#18'AnchorSideTop.Side'#7#9'asrBottom' + +'t'#3'd'#1#5'Width'#3#217#1#12'ClientHeight'#3'd'#1#11'ClientWidth'#3#217#1 + +#10'DesignLeft'#3'Z'#1#9'DesignTop'#3'H'#1#0#242#2#0#6'TLabel'#13'lblOtherUn' + +'its'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#5'Ow' + +'ner'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'as' + +'rBottom'#4'Left'#2#0#6'Height'#2#14#3'Top'#2#0#5'Width'#3#217#1#7'Anchors' + +#11#5'akTop'#6'akLeft'#7'akRight'#0#7'Caption'#6#13'lblOtherUnits'#11'Parent' + +'Color'#8#0#0#242#2#1#6'TLabel'#15'lblIncludeFiles'#22'AnchorSideLeft.Contro' + +'l'#7#5'Owner'#21'AnchorSideTop.Control'#7#13'edtOtherUnits'#18'AnchorSideTo' + +'p.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSide' + +'Right.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#14#3'Top'#2')'#5'Width'#3 + +#217#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#17'BorderSpacing.Top'#2 + +#6#7'Caption'#6#15'lblIncludeFiles'#11'ParentColor'#8#0#0#242#2#2#6'TLabel' + +#15'lblOtherSources'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.' + +'Control'#7#15'edtIncludeFiles'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'Anc' + +'horSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4 + +'Left'#2#0#6'Height'#2#14#3'Top'#2'R'#5'Width'#3#217#1#7'Anchors'#11#5'akTop' + +#6'akLeft'#7'akRight'#0#17'BorderSpacing.Top'#2#6#7'Caption'#6#15'lblOtherSo' + +'urces'#11'ParentColor'#8#0#0#242#2#3#6'TLabel'#12'lblLibraries'#22'AnchorSi' + +'deLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#15'edtOtherSources' + +#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#5'Owner' + +#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#14#3'Top'#2 + +'{'#5'Width'#3#217#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#17'Border' + +'Spacing.Top'#2#6#7'Caption'#6#12'lblLibraries'#11'ParentColor'#8#0#0#242#2#4 + +#6'TLabel'#16'lblUnitOutputDir'#22'AnchorSideLeft.Control'#7#5'Owner'#21'Anc' + +'horSideTop.Control'#7#12'edtLibraries'#18'AnchorSideTop.Side'#7#9'asrBottom' +#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBott' - +'om'#4'Left'#2#0#6'Height'#2#14#3'Top'#2'R'#5'Width'#3#217#1#7'Anchors'#11#5 - +'akTop'#6'akLeft'#7'akRight'#0#17'BorderSpacing.Top'#2#6#7'Caption'#6#15'lbl' - +'OtherSources'#11'ParentColor'#8#0#0#242#2#3#6'TLabel'#12'lblLibraries'#22'A' - +'nchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#15'edtOtherSo' - +'urces'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#5 - +'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#14#3 - +'Top'#2'{'#5'Width'#3#217#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#17 - +'BorderSpacing.Top'#2#6#7'Caption'#6#12'lblLibraries'#11'ParentColor'#8#0#0 - +#242#2#4#6'TLabel'#16'lblUnitOutputDir'#22'AnchorSideLeft.Control'#7#5'Owner' - +#21'AnchorSideTop.Control'#7#12'edtLibraries'#18'AnchorSideTop.Side'#7#9'asr' + +'om'#4'Left'#2#0#6'Height'#2#14#3'Top'#3#164#0#5'Width'#3#217#1#7'Anchors'#11 + +#5'akTop'#6'akLeft'#7'akRight'#0#17'BorderSpacing.Top'#2#6#7'Caption'#6#16'l' + +'blUnitOutputDir'#11'ParentColor'#8#0#0#242#2#5#6'TLabel'#12'lblDebugPath'#22 + +'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#16'edtUnitOu' + +'tputDir'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7 + +#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#14 + +#3'Top'#3#205#0#5'Width'#3#217#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight' + +#0#17'BorderSpacing.Top'#2#6#7'Caption'#6#12'lblDebugPath'#11'ParentColor'#8 + +#0#0#242#2#6#6'TLabel'#18'LCLWidgetTypeLabel'#22'AnchorSideLeft.Control'#7#5 + +'Owner'#21'AnchorSideTop.Control'#7#21'LCLWidgetTypeComboBox'#18'AnchorSideT' + +'op.Side'#7#9'asrCenter'#4'Left'#2#0#6'Height'#2#14#3'Top'#3#249#0#5'Width'#2 + +'e'#7'Caption'#6#18'LCLWidgetTypeLabel'#11'ParentColor'#8#0#0#242#2#7#5'TEdi' + +'t'#13'edtOtherUnits'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop' + +'.Control'#7#13'lblOtherUnits'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'Anch' + +'orSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'L' + +'eft'#2#0#6'Height'#2#21#3'Top'#2#14#5'Width'#3#217#1#7'Anchors'#11#5'akTop' + +#6'akLeft'#7'akRight'#0#20'BorderSpacing.Bottom'#2#6#8'TabOrder'#2#0#4'Text' + +#6#13'edtOtherUnits'#0#0#242#2#8#5'TEdit'#15'edtIncludeFiles'#22'AnchorSideL' + +'eft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#15'lblIncludeFiles'#18 + +'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#5'Owner'#20 + +'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#21#3'Top'#2'7' + +#5'Width'#3#217#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#20'BorderSpa' + +'cing.Bottom'#2#6#8'TabOrder'#2#1#4'Text'#6#15'edtIncludeFiles'#0#0#242#2#9#5 + +'TEdit'#15'edtOtherSources'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorS' + +'ideTop.Control'#7#15'lblOtherSources'#18'AnchorSideTop.Side'#7#9'asrBottom' + +#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBott' + +'om'#4'Left'#2#0#6'Height'#2#21#3'Top'#2'`'#5'Width'#3#217#1#7'Anchors'#11#5 + +'akTop'#6'akLeft'#7'akRight'#0#20'BorderSpacing.Bottom'#2#6#8'TabOrder'#2#2#4 + +'Text'#6#15'edtOtherSources'#0#0#242#2#10#5'TEdit'#12'edtLibraries'#22'Ancho' + +'rSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#12'lblLibraries' + +#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#5'Owner' + +#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#21#3'Top'#3 + +#137#0#5'Width'#3#217#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#20'Bor' + +'derSpacing.Bottom'#2#6#8'TabOrder'#2#3#4'Text'#6#12'edtLibraries'#0#0#242#2 + +#11#5'TEdit'#16'edtUnitOutputDir'#22'AnchorSideLeft.Control'#7#5'Owner'#21'A' + +'nchorSideTop.Control'#7#16'lblUnitOutputDir'#18'AnchorSideTop.Side'#7#9'asr' +'Bottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9 - +'asrBottom'#4'Left'#2#0#6'Height'#2#14#3'Top'#3#164#0#5'Width'#3#217#1#7'Anc' - +'hors'#11#5'akTop'#6'akLeft'#7'akRight'#0#17'BorderSpacing.Top'#2#6#7'Captio' - +'n'#6#16'lblUnitOutputDir'#11'ParentColor'#8#0#0#242#2#5#6'TLabel'#12'lblDeb' - +'ugPath'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#16 - +'edtUnitOutputDir'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.' - +'Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2#0#6'H' - +'eight'#2#14#3'Top'#3#205#0#5'Width'#3#217#1#7'Anchors'#11#5'akTop'#6'akLeft' - +#7'akRight'#0#17'BorderSpacing.Top'#2#6#7'Caption'#6#12'lblDebugPath'#11'Par' - +'entColor'#8#0#0#242#2#6#6'TLabel'#18'LCLWidgetTypeLabel'#22'AnchorSideLeft.' - +'Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#21'LCLWidgetTypeComboBox'#18 - +'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#2#0#6'Height'#2#14#3'Top'#3#249#0 - +#5'Width'#2'e'#7'Caption'#6#18'LCLWidgetTypeLabel'#11'ParentColor'#8#0#0#242 - +#2#7#5'TEdit'#13'edtOtherUnits'#22'AnchorSideLeft.Control'#7#5'Owner'#21'Anc' - +'horSideTop.Control'#7#13'lblOtherUnits'#18'AnchorSideTop.Side'#7#9'asrBotto' - +'m'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrB' - +'ottom'#4'Left'#2#0#6'Height'#2#21#3'Top'#2#14#5'Width'#3#217#1#7'Anchors'#11 - +#5'akTop'#6'akLeft'#7'akRight'#0#20'BorderSpacing.Bottom'#2#6#8'TabOrder'#2#0 - +#4'Text'#6#13'edtOtherUnits'#0#0#242#2#8#5'TEdit'#15'edtIncludeFiles'#22'Anc' - +'horSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#15'lblIncludeFi' - +'les'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#5 - +'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#21#3 - +'Top'#2'7'#5'Width'#3#217#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#20 - +'BorderSpacing.Bottom'#2#6#8'TabOrder'#2#1#4'Text'#6#15'edtIncludeFiles'#0#0 - +#242#2#9#5'TEdit'#15'edtOtherSources'#22'AnchorSideLeft.Control'#7#5'Owner' - +#21'AnchorSideTop.Control'#7#15'lblOtherSources'#18'AnchorSideTop.Side'#7#9 - +'asrBottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7 - +#9'asrBottom'#4'Left'#2#0#6'Height'#2#21#3'Top'#2'`'#5'Width'#3#217#1#7'Anch' - +'ors'#11#5'akTop'#6'akLeft'#7'akRight'#0#20'BorderSpacing.Bottom'#2#6#8'TabO' - +'rder'#2#2#4'Text'#6#15'edtOtherSources'#0#0#242#2#10#5'TEdit'#12'edtLibrari' - +'es'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#12'lb' - +'lLibraries'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Contro' - +'l'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height' - +#2#21#3'Top'#3#137#0#5'Width'#3#217#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akR' - +'ight'#0#20'BorderSpacing.Bottom'#2#6#8'TabOrder'#2#3#4'Text'#6#12'edtLibrar' - +'ies'#0#0#242#2#11#5'TEdit'#16'edtUnitOutputDir'#22'AnchorSideLeft.Control'#7 - +#5'Owner'#21'AnchorSideTop.Control'#7#16'lblUnitOutputDir'#18'AnchorSideTop.' - +'Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRi' - ,'ght.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#21#3'Top'#3#178#0#5'Width' - +#3#217#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#20'BorderSpacing.Bott' - +'om'#2#6#8'TabOrder'#2#4#4'Text'#6#16'edtUnitOutputDir'#0#0#242#2#12#5'TEdit' - +#12'edtDebugPath'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Con' - +'trol'#7#12'lblDebugPath'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSid' - +'eRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2 - +#0#6'Height'#2#21#3'Top'#3#219#0#5'Width'#3#217#1#7'Anchors'#11#5'akTop'#6'a' - +'kLeft'#7'akRight'#0#20'BorderSpacing.Bottom'#2#6#8'TabOrder'#2#5#4'Text'#6 - +#12'edtDebugPath'#0#0#242#2#13#9'TComboBox'#21'LCLWidgetTypeComboBox'#22'Anc' - +'horSideLeft.Control'#7#18'LCLWidgetTypeLabel'#19'AnchorSideLeft.Side'#7#9'a' - +'srBottom'#21'AnchorSideTop.Control'#7#12'edtDebugPath'#18'AnchorSideTop.Sid' - +'e'#7#9'asrBottom'#4'Left'#2'k'#6'Height'#2#21#3'Top'#3#246#0#5'Width'#3#171 - +#0#18'BorderSpacing.Left'#2#6#17'BorderSpacing.Top'#2#6#10'ItemHeight'#2#13#5 - +'Style'#7#14'csDropDownList'#8'TabOrder'#2#6#0#0#0 + ,'asrBottom'#4'Left'#2#0#6'Height'#2#21#3'Top'#3#178#0#5'Width'#3#217#1#7'Anc' + +'hors'#11#5'akTop'#6'akLeft'#7'akRight'#0#20'BorderSpacing.Bottom'#2#6#8'Tab' + +'Order'#2#4#4'Text'#6#16'edtUnitOutputDir'#0#0#242#2#12#5'TEdit'#12'edtDebug' + +'Path'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#12 + +'lblDebugPath'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Cont' + +'rol'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2#0#6'Heigh' + +'t'#2#21#3'Top'#3#219#0#5'Width'#3#217#1#7'Anchors'#11#5'akTop'#6'akLeft'#7 + +'akRight'#0#20'BorderSpacing.Bottom'#2#6#8'TabOrder'#2#5#4'Text'#6#12'edtDeb' + +'ugPath'#0#0#242#2#13#9'TComboBox'#21'LCLWidgetTypeComboBox'#22'AnchorSideLe' + +'ft.Control'#7#18'LCLWidgetTypeLabel'#19'AnchorSideLeft.Side'#7#9'asrBottom' + +#21'AnchorSideTop.Control'#7#12'edtDebugPath'#18'AnchorSideTop.Side'#7#9'asr' + +'Bottom'#4'Left'#2'k'#6'Height'#2#21#3'Top'#3#246#0#5'Width'#3#171#0#18'Bord' + +'erSpacing.Left'#2#6#17'BorderSpacing.Top'#2#6#10'ItemHeight'#2#13#5'Style'#7 + +#14'csDropDownList'#8'TabOrder'#2#6#0#0#0 ]); diff --git a/ide/frames/compiler_path_options.pas b/ide/frames/compiler_path_options.pas index 99307af229..1f8f0103d4 100644 --- a/ide/frames/compiler_path_options.pas +++ b/ide/frames/compiler_path_options.pas @@ -6,9 +6,9 @@ interface uses Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, - StdCtrls, InterfaceBase, IDEOptionsIntf, Project, CompilerOptions, - LazarusIDEStrConsts, PathEditorDlg, LazConf, IDEProcs, CheckCompilerOpts, - MacroIntf; + Buttons, StdCtrls, LCLType, InterfaceBase, IDEOptionsIntf, Project, + CompilerOptions, LazarusIDEStrConsts, PathEditorDlg, LazConf, IDEProcs, + CheckCompilerOpts, MacroIntf, ShowCompilerOpts; type @@ -37,11 +37,20 @@ type LibrariesPathEditBtn: TPathEditorButton; btnUnitOutputDir: TButton; DebugPathEditBtn: TPathEditorButton; + btnShowOptions: TBitBtn; + btnCheck: TBitBtn; + btnLoadSave: TBitBtn; + chkUseAsDefault: TCheckBox; function CheckSearchPath(const Context, ExpandedPath: string; Level: TCheckCompileOptionsMsgLvl): boolean; procedure FileBrowseBtnClick(Sender: TObject); procedure PathEditBtnClick(Sender: TObject); procedure PathEditBtnExecuted(Sender: TObject); + procedure DoShowOptions(Sender: TObject); + procedure DoCheck(Sender: TObject); + procedure DoLoadSave(Sender: TObject); + protected + procedure DoSaveSettings(AOptions: TAbstractIDEOptions); public function Check: boolean; override; function GetTitle: string; override; @@ -113,6 +122,51 @@ begin Result := dlgSearchPaths; end; +procedure TCompilerPathOptionsFrame.DoShowOptions(Sender: TObject); +var + Options: TBaseCompilerOptions; +begin + Options := TBaseCompilerOptionsClass(FCompilerOpts.ClassType).Create(FCompilerOpts.Owner); + try + DoSaveSettings(Options); + ShowCompilerOptionsDialog(Self, Options); + finally + Options.Free; + end; +end; + +procedure TCompilerPathOptionsFrame.DoCheck(Sender: TObject); +var + Options: TBaseCompilerOptions; +begin + Options := TBaseCompilerOptionsClass(FCompilerOpts.ClassType).Create(FCompilerOpts.Owner); + try + DoSaveSettings(Options); + if Assigned(TestCompilerOptions) then + begin + btnCheck.Enabled := False; + try + TestCompilerOptions(Options); + finally + btnCheck.Enabled := True; + end; + end; + finally + Options.Free; + end; +end; + +procedure TCompilerPathOptionsFrame.DoLoadSave(Sender: TObject); +begin + ShowMessage('TODO: unimplemented'); +end; + +procedure TCompilerPathOptionsFrame.DoSaveSettings(AOptions: TAbstractIDEOptions); +begin + if Assigned(OnSaveIDEOptions) then + OnSaveIDEOptions(Self, AOptions); +end; + function TCompilerPathOptionsFrame.CheckSearchPath(const Context, ExpandedPath: string; Level: TCheckCompileOptionsMsgLvl): boolean; var @@ -322,6 +376,14 @@ begin end; procedure TCompilerPathOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog); + + function CreateButton(ACaption: String; AKind: TBitBtnKind = bkCustom): TBitBtn; + begin + Result := ADialog.AddButton; + Result.Kind := AKind; + Result.Caption := ACaption; + end; + var LCLInterface: TLCLPlatform; s: string; @@ -456,6 +518,25 @@ begin ItemIndex := 1; Constraints.MinWidth := 150; end; + + // register special buttons in the dialog itself + btnShowOptions := CreateButton(dlgCOShowOptions); + btnShowOptions.LoadGlyphFromLazarusResource('menu_compiler_options'); + btnShowOptions.OnClick := @DoShowOptions; + btnCheck := CreateButton(lisCompTest, bkYes); + btnCheck.ModalResult := mrNone; + btnCheck.OnClick := @DoCheck; + btnLoadSave := CreateButton('...'); + btnLoadSave.OnClick := @DoLoadSave; + btnLoadSave.Hint := dlgCOLoadSave; + btnLoadSave.LoadGlyphFromStock(idButtonSave); + if btnLoadSave.Glyph.Empty then + btnLoadSave.LoadGlyphFromLazarusResource('laz_save'); + + chkUseAsDefault := TCheckBox(ADialog.AddControl(TCheckBox)); + chkUseAsDefault.Caption := dlgCOUseAsDefault; + chkUseAsDefault.ShowHint := True; + chkUseAsDefault.Hint := lisWhenEnabledTheCurrentOptionsAreSavedToTheTemplateW; end; procedure TCompilerPathOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions); @@ -477,6 +558,7 @@ begin LCLWidgetTypeComboBox.ItemIndex := Ord(LCLPlatform) + 1 else LCLWidgetTypeComboBox.ItemIndex := 0; + chkUseAsDefault.Visible := CanBeDefaulForProject; end; end;