From 0be07e4e242cfb8855f749be0d0e415665a8d9dc Mon Sep 17 00:00:00 2001 From: juha Date: Sun, 24 May 2015 12:01:06 +0000 Subject: [PATCH] IDE: Rename dialog CustomDefines -> DefinesGui. git-svn-id: trunk@49156 - --- .gitattributes | 4 +- ide/{customdefines.lfm => definesgui.lfm} | 37 ++++++++-------- ide/{customdefines.pas => definesgui.pas} | 38 ++++++++--------- ide/frames/compiler_other_options.lfm | 42 +++++++----------- ide/frames/compiler_other_options.pas | 10 ++--- ide/lazarus.lpi | 49 ++++++++++++--------- ide/project.pp | 52 ++++++++++++----------- 7 files changed, 116 insertions(+), 116 deletions(-) rename ide/{customdefines.lfm => definesgui.lfm} (86%) rename ide/{customdefines.pas => definesgui.pas} (84%) diff --git a/.gitattributes b/.gitattributes index b917c57249..3fb2c4567c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5603,10 +5603,10 @@ ide/componentpalette.pas svneol=native#text/pascal ide/compoptsmodes.pas svneol=native#text/plain ide/comppagespopup.lfm svneol=native#text/plain ide/comppagespopup.pas svneol=native#text/pascal -ide/customdefines.lfm svneol=native#text/plain -ide/customdefines.pas svneol=native#text/pascal ide/customformeditor.pp svneol=native#text/pascal ide/debugmanager.pas svneol=native#text/pascal +ide/definesgui.lfm svneol=native#text/plain +ide/definesgui.pas svneol=native#text/pascal ide/dialogprocs.pas svneol=native#text/pascal ide/diffdialog.lfm svneol=native#text/plain ide/diffdialog.pas svneol=native#text/pascal diff --git a/ide/customdefines.lfm b/ide/definesgui.lfm similarity index 86% rename from ide/customdefines.lfm rename to ide/definesgui.lfm index 254ead8dcf..840fc38b6a 100644 --- a/ide/customdefines.lfm +++ b/ide/definesgui.lfm @@ -1,35 +1,35 @@ -object CustomDefinesForm: TCustomDefinesForm +object DefinesGuiForm: TDefinesGuiForm Left = 305 Height = 326 Top = 265 Width = 341 BorderIcons = [biSystemMenu] - Caption = 'Conditional Defines' + Caption = 'Defines' ClientHeight = 326 ClientWidth = 341 OnCreate = FormCreate OnDestroy = FormDestroy OnShow = FormShow Position = poScreenCenter - LCLVersion = '1.1' + LCLVersion = '1.5' object gbNewDefine: TGroupBox Left = 6 - Height = 79 + Height = 73 Top = 6 Width = 329 Align = alTop AutoSize = True BorderSpacing.Around = 6 Caption = 'gbNewDefine' - ClientHeight = 60 - ClientWidth = 325 + ClientHeight = 57 + ClientWidth = 327 TabOrder = 0 object AddBtn: TBitBtn AnchorSideTop.Control = RemoveBtn AnchorSideRight.Control = RemoveBtn - Left = 163 - Height = 26 - Top = 31 + Left = 165 + Height = 27 + Top = 27 Width = 75 Anchors = [akTop, akRight] AutoSize = True @@ -46,9 +46,9 @@ object CustomDefinesForm: TCustomDefinesForm AnchorSideTop.Side = asrBottom AnchorSideRight.Control = edDefine AnchorSideRight.Side = asrBottom - Left = 244 - Height = 26 - Top = 31 + Left = 246 + Height = 27 + Top = 27 Width = 75 Anchors = [akTop, akRight] AutoSize = True @@ -63,9 +63,9 @@ object CustomDefinesForm: TCustomDefinesForm object edDefine: TEdit AnchorSideTop.Side = asrBottom Left = 6 - Height = 25 + Height = 21 Top = 0 - Width = 313 + Width = 315 Align = alTop BorderSpacing.Left = 6 BorderSpacing.Right = 6 @@ -76,8 +76,8 @@ object CustomDefinesForm: TCustomDefinesForm end object DefinesCheckList: TCheckListBox Left = 6 - Height = 182 - Top = 91 + Height = 187 + Top = 85 Width = 329 Align = alClient Anchors = [akTop, akBottom] @@ -87,11 +87,12 @@ object CustomDefinesForm: TCustomDefinesForm OnDblClick = DefinesCheckListDblClick OnKeyDown = DefinesCheckListKeyDown TabOrder = 1 + TopIndex = -1 end object ButtonPanel: TButtonPanel Left = 6 - Height = 41 - Top = 279 + Height = 42 + Top = 278 Width = 329 OKButton.Name = 'OKButton' OKButton.DefaultCaption = True diff --git a/ide/customdefines.pas b/ide/definesgui.pas similarity index 84% rename from ide/customdefines.pas rename to ide/definesgui.pas index 01e39398b5..877989552f 100644 --- a/ide/customdefines.pas +++ b/ide/definesgui.pas @@ -18,7 +18,7 @@ * * *************************************************************************** } -unit CustomDefines; +unit DefinesGui; {$mode objfpc}{$H+} @@ -30,9 +30,9 @@ uses type - { TCustomDefinesForm } + { TDefinesGuiForm } - TCustomDefinesForm = class(TForm) + TDefinesGuiForm = class(TForm) AddBtn: TBitBtn; ButtonPanel: TButtonPanel; DefinesCheckList: TCheckListBox; @@ -75,9 +75,9 @@ implementation {$R *.lfm} -{ TCustomDefinesForm } +{ TDefinesGuiForm } -procedure TCustomDefinesForm.FormCreate(Sender: TObject); +procedure TDefinesGuiForm.FormCreate(Sender: TObject); begin Caption := lisLazBuildDefines; gbNewDefine.Caption := lisCodeToolsDefsDefine; @@ -87,36 +87,36 @@ begin RemoveBtn.LoadGlyphFromResourceName(HInstance, 'laz_delete'); end; -procedure TCustomDefinesForm.FormShow(Sender: TObject); +procedure TDefinesGuiForm.FormShow(Sender: TObject); begin DefinesCheckListClick(Nil); ActiveControl := DefinesCheckList; IdleConnected := True; end; -procedure TCustomDefinesForm.FormDestroy(Sender: TObject); +procedure TDefinesGuiForm.FormDestroy(Sender: TObject); begin end; -procedure TCustomDefinesForm.AddBtnClick(Sender: TObject); +procedure TDefinesGuiForm.AddBtnClick(Sender: TObject); begin DefinesCheckList.Items.Add(edDefine.Text); DefinesCheckList.ItemIndex := DefinesCheckList.Items.Count-1; UpdateButtons; end; -procedure TCustomDefinesForm.EditChange(Sender: TObject); +procedure TDefinesGuiForm.EditChange(Sender: TObject); begin UpdateButtons; end; -procedure TCustomDefinesForm.HelpButtonClick(Sender: TObject); +procedure TDefinesGuiForm.HelpButtonClick(Sender: TObject); begin LazarusHelp.ShowHelpForIDEControl(Self); end; -procedure TCustomDefinesForm.DefinesCheckListClick(Sender: TObject); +procedure TDefinesGuiForm.DefinesCheckListClick(Sender: TObject); begin with DefinesCheckList do if ItemIndex > -1 then @@ -124,17 +124,17 @@ begin UpdateButtons; end; -procedure TCustomDefinesForm.DefinesCheckListDblClick(Sender: TObject); +procedure TDefinesGuiForm.DefinesCheckListDblClick(Sender: TObject); begin //ModalResult := mrOK; end; -procedure TCustomDefinesForm.RemoveBtnClick(Sender: TObject); +procedure TDefinesGuiForm.RemoveBtnClick(Sender: TObject); begin DeleteSelected; end; -procedure TCustomDefinesForm.DefinesCheckListKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); +procedure TDefinesGuiForm.DefinesCheckListKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if Key = VK_DELETE then begin @@ -143,7 +143,7 @@ begin end; end; -procedure TCustomDefinesForm.SetIdleConnected(AValue: Boolean); +procedure TDefinesGuiForm.SetIdleConnected(AValue: Boolean); begin if FIdleConnected = AValue then exit; FIdleConnected := AValue; @@ -153,7 +153,7 @@ begin Application.RemoveOnIdleHandler(@OnIdle); end; -procedure TCustomDefinesForm.OnIdle(Sender: TObject; var Done: Boolean); +procedure TDefinesGuiForm.OnIdle(Sender: TObject; var Done: Boolean); var s: String; i, ListInd: Integer; @@ -181,7 +181,7 @@ begin end; end; -procedure TCustomDefinesForm.DeleteSelected; +procedure TDefinesGuiForm.DeleteSelected; var i: Integer; begin @@ -194,14 +194,14 @@ begin end; end; -procedure TCustomDefinesForm.UpdateButtons; +procedure TDefinesGuiForm.UpdateButtons; begin AddBtn.Enabled := (edDefine.Text <> '') and (DefinesCheckList.Items.IndexOf(edDefine.Text) = -1); RemoveBtn.Enabled := DefinesCheckList.SelCount > 0; end; -function TCustomDefinesForm.ToCustomOptions(aStrings: TStrings): TModalResult; +function TDefinesGuiForm.ToCustomOptions(aStrings: TStrings): TModalResult; var i: Integer; begin diff --git a/ide/frames/compiler_other_options.lfm b/ide/frames/compiler_other_options.lfm index 4bdaa37052..35aff19895 100644 --- a/ide/frames/compiler_other_options.lfm +++ b/ide/frames/compiler_other_options.lfm @@ -18,15 +18,15 @@ object CompilerOtherOptionsFrame: TCompilerOtherOptionsFrame Align = alClient Anchors = [akTop, akLeft, akRight] Caption = 'grpConditionals' - ClientHeight = 141 - ClientWidth = 517 + ClientHeight = 150 + ClientWidth = 519 TabOrder = 0 inline CondSynEdit: TSynEdit AnchorSideRight.Side = asrBottom Left = 0 - Height = 113 + Height = 133 Top = 0 - Width = 517 + Width = 519 Align = alClient Font.Height = 9 Font.Name = '-misc-dejavu sans mono-*-*-*-*-*-*-*-*-*-*-iso10646-1' @@ -552,7 +552,6 @@ object CompilerOtherOptionsFrame: TCompilerOtherOptionsFrame 'CondSynEdit' ) VisibleSpecialChars = [vscSpace, vscTabAtLast] - SelectedColor.FrameEdges = sfeAround SelectedColor.BackPriority = 50 SelectedColor.ForePriority = 50 SelectedColor.FramePriority = 50 @@ -560,23 +559,17 @@ object CompilerOtherOptionsFrame: TCompilerOtherOptionsFrame SelectedColor.ItalicPriority = 50 SelectedColor.UnderlinePriority = 50 SelectedColor.StrikeOutPriority = 50 - IncrementColor.FrameEdges = sfeAround - HighlightAllColor.FrameEdges = sfeAround BracketHighlightStyle = sbhsBoth BracketMatchColor.Background = clNone BracketMatchColor.Foreground = clNone - BracketMatchColor.FrameEdges = sfeAround BracketMatchColor.Style = [fsBold] FoldedCodeColor.Background = clNone FoldedCodeColor.Foreground = clGray FoldedCodeColor.FrameColor = clGray - FoldedCodeColor.FrameEdges = sfeAround MouseLinkColor.Background = clNone MouseLinkColor.Foreground = clBlue - MouseLinkColor.FrameEdges = sfeAround LineHighlightColor.Background = clNone LineHighlightColor.Foreground = clNone - LineHighlightColor.FrameEdges = sfeAround OnChange = CondSynEditChange OnProcessUserCommand = CondSynEditProcessUserCommand inline SynLeftGutterPartList1: TSynGutterPartList @@ -589,7 +582,6 @@ object CompilerOtherOptionsFrame: TCompilerOtherOptionsFrame MouseActions = <> MarkupInfo.Background = clBtnFace MarkupInfo.Foreground = clNone - MarkupInfo.FrameEdges = sfeAround DigitCount = 2 ShowOnlyLineNumbersMultiplesOf = 1 ZeroStart = False @@ -606,7 +598,6 @@ object CompilerOtherOptionsFrame: TCompilerOtherOptionsFrame MouseActions = <> MarkupInfo.Background = clWhite MarkupInfo.Foreground = clGray - MarkupInfo.FrameEdges = sfeAround end object SynGutterCodeFolding1: TSynGutterCodeFolding MouseActions = < @@ -637,7 +628,6 @@ object CompilerOtherOptionsFrame: TCompilerOtherOptionsFrame end> MarkupInfo.Background = clNone MarkupInfo.Foreground = clGray - MarkupInfo.FrameEdges = sfeAround MouseActionsExpanded = < item ClickCount = ccAny @@ -664,9 +654,9 @@ object CompilerOtherOptionsFrame: TCompilerOtherOptionsFrame end object CondStatusbar: TStatusBar Left = 0 - Height = 28 - Top = 113 - Width = 517 + Height = 17 + Top = 133 + Width = 519 Panels = < item Width = 80 @@ -697,17 +687,17 @@ object CompilerOtherOptionsFrame: TCompilerOtherOptionsFrame Width = 521 Align = alBottom Caption = 'grpCustomOptions' - ClientHeight = 177 - ClientWidth = 517 + ClientHeight = 186 + ClientWidth = 519 TabOrder = 2 object memoCustomOptions: TMemo AnchorSideLeft.Control = grpCustomOptions AnchorSideBottom.Control = grpCustomOptions AnchorSideBottom.Side = asrBottom Left = 0 - Height = 173 + Height = 182 Top = 4 - Width = 361 + Width = 363 Anchors = [akTop, akLeft, akRight, akBottom] BorderSpacing.Right = 6 ParentShowHint = False @@ -721,8 +711,8 @@ object CompilerOtherOptionsFrame: TCompilerOtherOptionsFrame AnchorSideLeft.Side = asrBottom AnchorSideRight.Control = btnDefines AnchorSideRight.Side = asrBottom - Left = 367 - Height = 30 + Left = 369 + Height = 27 Top = 4 Width = 150 Anchors = [akTop, akLeft, akRight] @@ -736,9 +726,9 @@ object CompilerOtherOptionsFrame: TCompilerOtherOptionsFrame AnchorSideTop.Control = btnAllOptions AnchorSideTop.Side = asrBottom AnchorSideRight.Side = asrBottom - Left = 367 - Height = 30 - Top = 40 + Left = 369 + Height = 27 + Top = 37 Width = 150 Anchors = [akTop, akLeft, akRight] AutoSize = True diff --git a/ide/frames/compiler_other_options.pas b/ide/frames/compiler_other_options.pas index e259652883..f7aa564cd2 100644 --- a/ide/frames/compiler_other_options.pas +++ b/ide/frames/compiler_other_options.pas @@ -32,7 +32,7 @@ uses Dialogs, StdCtrls, ComCtrls, ExtCtrls, Buttons, LCLType, LazUTF8, CodeToolsCfgScript, KeywordFuncLists, LazarusIDEStrConsts, IDEOptionsIntf, CompOptsIntf, IDECommands, LazIDEIntf, Project, PackageDefs, - CompilerOptions, Compiler, AllCompilerOptions, CustomDefines, + CompilerOptions, Compiler, AllCompilerOptions, DefinesGui, EditorOptions, SynEdit, SynEditKeyCmds, SynCompletion, SourceSynEditor; type @@ -147,19 +147,19 @@ end; procedure TCompilerOtherOptionsFrame.btnDefinesClick(Sender: TObject); var - EditForm: TCustomDefinesForm; + EditForm: TDefinesGuiForm; begin - EditForm := TCustomDefinesForm.Create(Nil); + EditForm := TDefinesGuiForm.Create(Nil); try try EditForm.OptionsReader := FOptionsReader; EditForm.OptionsThread := FOptionsThread; EditForm.CustomOptions := memoCustomOptions.Lines; - EditForm.DefinesCheckList.Items.Assign(Project1.CustomDefines); + EditForm.DefinesCheckList.Items.Assign(Project1.OtherDefines); EditForm.UseComments := FUseComments; if EditForm.ShowModal = mrOK then begin - Project1.CustomDefines.Assign(EditForm.DefinesCheckList.Items); + Project1.OtherDefines.Assign(EditForm.DefinesCheckList.Items); // Synchronize with custom options memo EditForm.ToCustomOptions(memoCustomOptions.Lines); memoCustomOptions.Invalidate; diff --git a/ide/lazarus.lpi b/ide/lazarus.lpi index 12a8f958b5..1155d3c12e 100644 --- a/ide/lazarus.lpi +++ b/ide/lazarus.lpi @@ -434,6 +434,7 @@ + @@ -604,6 +605,7 @@ + @@ -633,6 +635,7 @@ + @@ -778,6 +781,7 @@ + @@ -1269,66 +1273,69 @@ - + - + - - + - + - - - - - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + diff --git a/ide/project.pp b/ide/project.pp index fa05387b1e..3b3614a1b2 100644 --- a/ide/project.pp +++ b/ide/project.pp @@ -770,7 +770,7 @@ type FStateFlags: TLazProjectStateFlags; FStorePathDelim: TPathDelimSwitch; FUnitList: TFPList; // list of _all_ units (TUnitInfo) - FCustomDefines: TStrings; // list of user selectable defines for custom options + FOtherDefines: TStrings; // list of user selectable defines for custom options FUpdateLock: integer; FUseAsDefault: Boolean; // Variables used by ReadProject / WriteProject @@ -836,7 +836,7 @@ type // Methods for ReadProject function LoadOldProjectType(const Path: string): TOldProjectType; procedure LoadFlags(const Path: string); - procedure LoadCustomDefines(const Path: string); + procedure LoadOtherDefines(const Path: string); procedure LoadSessionInfo(const Path: string; Merge: boolean); procedure LoadFromLPI; procedure LoadFromSession; @@ -845,7 +845,7 @@ type // Methods for WriteProject procedure SaveFlags(const Path: string); procedure SaveUnits(const Path: string; SaveSession: boolean); - procedure SaveCustomDefines(const Path: string); + procedure SaveOtherDefines(const Path: string); procedure SaveSessionInfo(const Path: string); procedure SaveToLPI; procedure SaveToSession; @@ -1111,7 +1111,7 @@ type property StorePathDelim: TPathDelimSwitch read FStorePathDelim write SetStorePathDelim; property TargetFilename: string read GetTargetFilename write SetTargetFilename; property Units[Index: integer]: TUnitInfo read GetUnits; - property CustomDefines: TStrings read FCustomDefines; + property OtherDefines: TStrings read FOtherDefines; property UpdateLock: integer read FUpdateLock; property UseAsDefault: Boolean read FUseAsDefault write FUseAsDefault; // for dialog only (used to store options once) end; @@ -2680,7 +2680,7 @@ begin FRunParameters:=TRunParamsOptions.Create; Title := ''; FUnitList := TFPList.Create; // list of TUnitInfo - FCustomDefines := TStringList.Create; + FOtherDefines := TStringList.Create; FResources := TProjectResources.Create(Self); ProjResources.OnModified := @EmbeddedObjectModified; @@ -2703,7 +2703,7 @@ begin FreeAndNil(FAllEditorsInfoList); FreeThenNil(FResources); FreeThenNil(FBookmarks); - FreeThenNil(FCustomDefines); + FreeThenNil(FOtherDefines); FreeThenNil(FUnitList); FreeThenNil(FJumpHistory); FreeThenNil(FSourceDirectories); @@ -2764,17 +2764,20 @@ begin Flags:=Flags-[pfUseDefaultCompilerOptions]; end; -procedure TProject.LoadCustomDefines(const Path: string); +procedure TProject.LoadOtherDefines(const Path: string); var Cnt, i: Integer; - s: String; + SubPath, s: String; begin - Cnt := FXMLConfig.GetValue(Path+'CustomDefines/Count', 0); + SubPath := 'OtherDefines/'; + if not FXMLConfig.HasPath(Path+SubPath, False) then + SubPath := 'CustomDefines/'; // Load from the old path name. + Cnt := FXMLConfig.GetValue(Path+SubPath+'Count', 0); for i := 0 to Cnt-1 do begin - s := FXMLConfig.GetValue(Path+'CustomDefines/Define'+IntToStr(i)+'/Value', ''); + s := FXMLConfig.GetValue(Path+SubPath+'Define'+IntToStr(i)+'/Value', ''); if s <> '' then - CustomDefines.Add(s); + OtherDefines.Add(s); end; end; @@ -2894,8 +2897,8 @@ begin RunParameterOptions.Load(FXMLConfig,Path,fPathDelimChanged); // load the Publish Options PublishOptions.LoadFromXMLConfig(FXMLConfig,Path+'PublishOptions/',fPathDelimChanged); - // load custom defines - LoadCustomDefines(Path); + // load defines used for custom options + LoadOtherDefines(Path); // load session info LoadSessionInfo(Path,false); // call hooks to read their info (e.g. DebugBoss) @@ -2919,8 +2922,8 @@ begin // load MacroValues and compiler options BuildModes.LoadSessionFromXMLConfig(FXMLConfig, Path, FLoadParts); - // load custom defines - LoadCustomDefines(Path); + // load defines used for custom options + LoadOtherDefines(Path); // load session info LoadSessionInfo(Path,true); @@ -3096,15 +3099,14 @@ begin FXMLConfig.SetDeleteValue(Path+'Units/Count',SaveUnitCount,0); end; -procedure TProject.SaveCustomDefines(const Path: string); +procedure TProject.SaveOtherDefines(const Path: string); var i: integer; begin - for i:=0 to FCustomDefines.Count-1 do begin - FXMLConfig.SetDeleteValue(Path+'CustomDefines/Define'+IntToStr(i)+'/Value', - FCustomDefines[i],''); - end; - FXMLConfig.SetDeleteValue(Path+'CustomDefines/Count',FCustomDefines.Count,0); + for i:=0 to FOtherDefines.Count-1 do + FXMLConfig.SetDeleteValue(Path+'OtherDefines/Define'+IntToStr(i)+'/Value', + FOtherDefines[i],''); + FXMLConfig.SetDeleteValue(Path+'OtherDefines/Count',FOtherDefines.Count,0); end; procedure TProject.SaveSessionInfo(const Path: string); @@ -3185,8 +3187,8 @@ begin SaveUnits(Path,FSaveSessionInLPI); if FSaveSessionInLPI then begin - // save custom defines - SaveCustomDefines(Path); + // save defines used for custom options + SaveOtherDefines(Path); // save session info SaveSessionInfo(Path); end; @@ -3221,8 +3223,8 @@ begin BuildModes.SaveSessionData(Path); // save all units SaveUnits(Path,true); - // save custom defines - SaveCustomDefines(Path); + // save defines used for custom options + SaveOtherDefines(Path); // save session info SaveSessionInfo(Path);