diff --git a/ide/basedebugmanager.pas b/ide/basedebugmanager.pas index ed51345951..06195c4167 100644 --- a/ide/basedebugmanager.pas +++ b/ide/basedebugmanager.pas @@ -53,6 +53,13 @@ type ); TDebugManagerStates = set of TDebugManagerState; + { TDebuggerOptions } + + TDebuggerOptions = class(TAbstractIDEOptions) + public + class function GetGroupCaption:string; override; + end; + TBaseDebugManager = class(TComponent) private function GetDebuggerClass(const AIndex: Integer): TDebuggerClass; @@ -170,8 +177,15 @@ begin Result := TDebuggerClass(MDebuggerClasses.Objects[AIndex]); end; +{ TDebuggerOptions } + +class function TDebuggerOptions.GetGroupCaption: string; +begin + Result := dlgGroupDebugger; +end; + initialization - RegisterIDEOptionsGroup(GroupDebugger, dlgGroupDebugger); + RegisterIDEOptionsGroup(GroupDebugger, TDebuggerOptions); DebugBoss := nil; MDebuggerClasses := TStringList.Create; MDebuggerClasses.Sorted := True; diff --git a/ide/codeexplopts.pas b/ide/codeexplopts.pas index 9cd2c9b5df..2dd637261b 100644 --- a/ide/codeexplopts.pas +++ b/ide/codeexplopts.pas @@ -152,6 +152,8 @@ type procedure SetObserveCharConst(const AValue: boolean); procedure SetObserverCategories(const AValue: TCEObserverCategories); procedure SetRefresh(const AValue: TCodeExplorerRefresh); + public + class function GetGroupCaption:string; override; public constructor Create; destructor Destroy; override; @@ -400,6 +402,11 @@ begin inherited Destroy; end; +class function TCodeExplorerOptions.GetGroupCaption: string; +begin + Result := dlgGroupCodeExplorer; +end; + procedure TCodeExplorerOptions.Clear; begin IncreaseChangeStep; @@ -830,6 +837,6 @@ begin end; initialization - RegisterIDEOptionsGroup(GroupCodeExplorer, dlgGroupCodeExplorer); + RegisterIDEOptionsGroup(GroupCodeExplorer, TCodeExplorerOptions); end. diff --git a/ide/codetoolsoptions.pas b/ide/codetoolsoptions.pas index e75035159c..dc75b012f9 100644 --- a/ide/codetoolsoptions.pas +++ b/ide/codetoolsoptions.pas @@ -90,6 +90,8 @@ type FUsesInsertPolicy: TUsesInsertPolicy; procedure SetFilename(const AValue: string); + public + class function GetGroupCaption:string; override; public constructor Create; destructor Destroy; override; @@ -276,6 +278,11 @@ begin inherited Destroy; end; +class function TCodeToolsOptions.GetGroupCaption: string; +begin + Result := dlgGroupCodetools; +end; + procedure TCodeToolsOptions.Load; var XMLConfig: TXMLConfig; @@ -742,6 +749,6 @@ begin end; initialization - RegisterIDEOptionsGroup(GroupCodetools, dlgGroupCodetools); + RegisterIDEOptionsGroup(GroupCodetools, TCodeToolsOptions); end. diff --git a/ide/editoroptions.pp b/ide/editoroptions.pp index 69afb597bd..8cfa2a7393 100644 --- a/ide/editoroptions.pp +++ b/ide/editoroptions.pp @@ -726,6 +726,8 @@ type // Code Folding FUseCodeFolding: Boolean; + public + class function GetGroupCaption:string; override; public constructor Create; destructor Destroy; override; @@ -2536,6 +2538,11 @@ begin end; end; +class function TEditorOptions.GetGroupCaption: string; +begin + Result := dlgGroupEditor; +end; + function TEditorOptions.GetSynEditOptionName(SynOption: TSynEditorOption ): string; begin @@ -3547,7 +3554,7 @@ begin end; initialization - RegisterIDEOptionsGroup(GroupEditor, dlgGroupEditor); + RegisterIDEOptionsGroup(GroupEditor, TEditorOptions); // register all built-in color schemes ColorSchemeFactory.RegisterScheme(DEFAULT_COLOR_SCHEME.Name, DEFAULT_COLOR_SCHEME); ColorSchemeFactory.RegisterScheme(TWILIGHT_COLOR_SCHEME.Name, TWILIGHT_COLOR_SCHEME); diff --git a/ide/environmentopts.pp b/ide/environmentopts.pp index bdd50eab19..e3946a281a 100644 --- a/ide/environmentopts.pp +++ b/ide/environmentopts.pp @@ -268,6 +268,8 @@ type function GetXMLCfg(CleanConfig: boolean): TXMLConfig; procedure FileUpdated; procedure SetTestBuildDirectory(const AValue: string); + public + class function GetGroupCaption:string; override; public constructor Create; destructor Destroy; override; @@ -732,6 +734,11 @@ begin inherited Destroy; end; +class function TEnvironmentOptions.GetGroupCaption: string; +begin + Result := dlgGroupEnvironment; +end; + procedure TEnvironmentOptions.SetLazarusDefaultFilename; var ConfFileName: string; @@ -1512,6 +1519,6 @@ begin end; initialization - RegisterIDEOptionsGroup(GroupEnvironment, dlgGroupEnvironment); + RegisterIDEOptionsGroup(GroupEnvironment, TEnvironmentOptions); end. diff --git a/ide/helpoptions.pas b/ide/helpoptions.pas index e44c84c220..10b0953545 100644 --- a/ide/helpoptions.pas +++ b/ide/helpoptions.pas @@ -49,6 +49,8 @@ type FFPCDocsHTMLDirectory: string; procedure SetFPCDocsHTMLDirectory(const AValue: string); procedure SetFilename(const AValue: string); + public + class function GetGroupCaption:string; override; public constructor Create; procedure Clear; @@ -93,6 +95,11 @@ begin Clear; end; +class function THelpOptions.GetGroupCaption: string; +begin + Result := dlgGroupHelp; +end; + procedure THelpOptions.Clear; begin FFPCDocsHTMLDirectory := ''; @@ -216,6 +223,6 @@ begin end; initialization - RegisterIDEOptionsGroup(GroupHelp, dlgGroupHelp); + RegisterIDEOptionsGroup(GroupHelp, THelpOptions); end. diff --git a/ide/ideoptionsdlg.pas b/ide/ideoptionsdlg.pas index b9055d895f..b074483d0d 100644 --- a/ide/ideoptionsdlg.pas +++ b/ide/ideoptionsdlg.pas @@ -266,6 +266,7 @@ var GroupNode, ItemNode, ItemParent: TTreeNode; i, j: integer; Rec: PIDEOptionsGroupRec; + ACaption: string; begin IDEEditorGroups.Resort; @@ -274,7 +275,11 @@ begin Rec := IDEEditorGroups[i]; if Rec^.Items <> nil then begin - GroupNode := CategoryTree.Items.AddChild(nil, Rec^.Caption); + if Rec^.GroupClass<>nil then + ACaption := Rec^.GroupClass.GetGroupCaption + else + ACaption := format('g<%d>',[i]); + GroupNode := CategoryTree.Items.AddChild(nil, ACaption); for j := 0 to Rec^.Items.Count - 1 do begin Instance := Rec^.Items[j]^.EditorClass.Create(Self); diff --git a/ideintf/ideoptionsintf.pas b/ideintf/ideoptionsintf.pas index 2305fa8365..315e0e2b6d 100644 --- a/ideintf/ideoptionsintf.pas +++ b/ideintf/ideoptionsintf.pas @@ -36,6 +36,8 @@ type // types TAbstractIDEOptions = class(TPersistent) + public + class function GetGroupCaption:string; virtual; abstract; end; TAbstractIDEOptionsClass = class of TAbstractIDEOptions; @@ -85,7 +87,7 @@ type TIDEOptionsGroupRec = record Index: Integer; - Caption: String; + GroupClass: TAbstractIDEOptionsClass; Items: TIDEOptionsEditorList; end; PIDEOptionsGroupRec = ^TIDEOptionsGroupRec; @@ -101,7 +103,7 @@ type function GetByIndex(AIndex: Integer): PIDEOptionsGroupRec; public procedure Resort; - procedure Add(AGroupIndex: Integer; ACaption: String); reintroduce; + procedure Add(AGroupIndex: Integer; AGroupClass: TAbstractIDEOptionsClass); reintroduce; property Items[AIndex: Integer]: PIDEOptionsGroupRec read GetItem write SetItem; default; end; @@ -110,7 +112,7 @@ type function FindEditor(AEditor: TAbstractIDEOptionsEditorClass): TAbstractIDEOptionsEditor; virtual; abstract; end; -procedure RegisterIDEOptionsGroup(AGroupIndex: Integer; ACaption: String); +procedure RegisterIDEOptionsGroup(AGroupIndex: Integer; AGroupClass: TAbstractIDEOptionsClass); procedure RegisterIDEOptionsEditor(AGroupIndex: Integer; AEditorClass: TAbstractIDEOptionsEditorClass; AIndex: Integer; AParent: Integer = NoParent); function IDEEditorGroups: TIDEOptionsGroupList; @@ -174,9 +176,9 @@ begin Result := FIDEEditorGroups; end; -procedure RegisterIDEOptionsGroup(AGroupIndex: Integer; ACaption: String); +procedure RegisterIDEOptionsGroup(AGroupIndex: Integer; AGroupClass:TAbstractIDEOptionsClass); begin - IDEEditorGroups.Add(AGroupIndex, ACaption); + IDEEditorGroups.Add(AGroupIndex, AGroupClass); end; procedure RegisterIDEOptionsEditor(AGroupIndex: Integer; AEditorClass: TAbstractIDEOptionsEditorClass; AIndex: Integer; AParent: Integer = NoParent); @@ -186,7 +188,7 @@ begin Rec := IDEEditorGroups.GetByIndex(AGroupIndex); if Rec = nil then begin - RegisterIDEOptionsGroup(AGroupIndex, IntToStr(AGroupIndex)); + RegisterIDEOptionsGroup(AGroupIndex, nil); Rec := IDEEditorGroups.GetByIndex(AGroupIndex); end; @@ -332,7 +334,7 @@ begin Items[i]^.Items.Resort; end; -procedure TIDEOptionsGroupList.Add(AGroupIndex: Integer; ACaption: String); +procedure TIDEOptionsGroupList.Add(AGroupIndex: Integer; AGroupClass: TAbstractIDEOptionsClass); var Rec: PIDEOptionsGroupRec; begin @@ -345,7 +347,7 @@ begin inherited Add(Rec); end; - Rec^.Caption := ACaption; + Rec^.GroupClass := AGroupClass; end; initialization