mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 06:09:14 +02:00
IDE: refactor, rename confusing method OnLoadIDEOptions -> DoLoadIDEOptions. Move some methods to private.
git-svn-id: trunk@49486 -
This commit is contained in:
parent
4d49e9606d
commit
feba10ae91
75
ide/main.pp
75
ide/main.pp
@ -413,8 +413,8 @@ type
|
|||||||
const HelpKeyword: string): Integer;
|
const HelpKeyword: string): Integer;
|
||||||
|
|
||||||
// Environment options dialog events
|
// Environment options dialog events
|
||||||
procedure OnLoadIDEOptions(Sender: TObject; AOptions: TAbstractIDEOptions);
|
procedure DoLoadIDEOptions(Sender: TObject; AOptions: TAbstractIDEOptions);
|
||||||
procedure OnSaveIDEOptions(Sender: TObject; AOptions: TAbstractIDEOptions);
|
procedure DoSaveIDEOptions(Sender: TObject; AOptions: TAbstractIDEOptions);
|
||||||
procedure DoOpenIDEOptions(AEditor: TAbstractIDEOptionsEditorClass;
|
procedure DoOpenIDEOptions(AEditor: TAbstractIDEOptionsEditorClass;
|
||||||
ACaption: String; AOptionsFilter: array of TAbstractIDEOptionsClass;
|
ACaption: String; AOptionsFilter: array of TAbstractIDEOptionsClass;
|
||||||
ASettings: TIDEOptionsEditorSettings); override;
|
ASettings: TIDEOptionsEditorSettings); override;
|
||||||
@ -643,6 +643,20 @@ type
|
|||||||
|
|
||||||
procedure RenameInheritedMethods(AnUnitInfo: TUnitInfo; List: TStrings);
|
procedure RenameInheritedMethods(AnUnitInfo: TUnitInfo; List: TStrings);
|
||||||
function OIHelpProvider: TAbstractIDEHTMLProvider;
|
function OIHelpProvider: TAbstractIDEHTMLProvider;
|
||||||
|
// form editor and designer
|
||||||
|
procedure DoBringToFrontFormOrUnit;
|
||||||
|
procedure DoBringToFrontFormOrInspector(ForceInspector: boolean);
|
||||||
|
procedure DoShowSourceOfActiveDesignerForm;
|
||||||
|
procedure SetDesigning(AComponent: TComponent; Value: Boolean);
|
||||||
|
procedure SetDesignInstance(AComponent: TComponent; Value: Boolean);
|
||||||
|
procedure InvalidateAllDesignerForms;
|
||||||
|
procedure UpdateIDEComponentPalette(IfFormChanged: boolean);
|
||||||
|
procedure ShowDesignerForm(AForm: TCustomForm);
|
||||||
|
procedure DoViewAnchorEditor(State: TIWGetFormState = iwgfShowOnTop);
|
||||||
|
procedure DoViewTabOrderEditor(State: TIWGetFormState = iwgfShowOnTop);
|
||||||
|
// editor and environment options
|
||||||
|
procedure LoadDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions);
|
||||||
|
procedure SaveDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions);
|
||||||
protected
|
protected
|
||||||
procedure SetToolStatus(const AValue: TIDEToolStatus); override;
|
procedure SetToolStatus(const AValue: TIDEToolStatus); override;
|
||||||
procedure Notification(AComponent: TComponent;
|
procedure Notification(AComponent: TComponent;
|
||||||
@ -915,24 +929,11 @@ type
|
|||||||
procedure DoShowSearchResultsView(State: TIWGetFormState = iwgfShowOnTop); override;
|
procedure DoShowSearchResultsView(State: TIWGetFormState = iwgfShowOnTop); override;
|
||||||
|
|
||||||
// form editor and designer
|
// form editor and designer
|
||||||
procedure DoBringToFrontFormOrUnit;
|
|
||||||
procedure DoBringToFrontFormOrInspector(ForceInspector: boolean);
|
|
||||||
procedure DoShowDesignerFormOfCurrentSrc; override;
|
procedure DoShowDesignerFormOfCurrentSrc; override;
|
||||||
procedure DoShowSourceOfActiveDesignerForm;
|
|
||||||
procedure SetDesigning(AComponent: TComponent; Value: Boolean);
|
|
||||||
procedure SetDesignInstance(AComponent: TComponent; Value: Boolean);
|
|
||||||
function CreateDesignerForComponent(AnUnitInfo: TUnitInfo;
|
function CreateDesignerForComponent(AnUnitInfo: TUnitInfo;
|
||||||
AComponent: TComponent): TCustomForm; override;
|
AComponent: TComponent): TCustomForm; override;
|
||||||
procedure InvalidateAllDesignerForms;
|
|
||||||
procedure UpdateIDEComponentPalette(IfFormChanged: boolean);
|
|
||||||
procedure ShowDesignerForm(AForm: TCustomForm);
|
|
||||||
procedure DoViewAnchorEditor(State: TIWGetFormState = iwgfShowOnTop);
|
|
||||||
procedure DoViewTabOrderEditor(State: TIWGetFormState = iwgfShowOnTop);
|
|
||||||
|
|
||||||
// editor and environment options
|
// editor and environment options
|
||||||
procedure SaveEnvironment(Immediately: boolean = false); override;
|
procedure SaveEnvironment(Immediately: boolean = false); override;
|
||||||
procedure LoadDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions);
|
|
||||||
procedure SaveDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions);
|
|
||||||
procedure PackageTranslated(APackage: TLazPackage); override;
|
procedure PackageTranslated(APackage: TLazPackage); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -4566,9 +4567,19 @@ end;
|
|||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
procedure TMainIDE.LoadDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions);
|
||||||
|
begin
|
||||||
|
DebugLn(['* TMainIDE.LoadDesktopSettings']);
|
||||||
|
if ObjectInspector1<>nil then
|
||||||
|
TheEnvironmentOptions.ObjectInspectorOptions.AssignTo(ObjectInspector1);
|
||||||
|
if MessagesView<>nil then
|
||||||
|
MessagesView.ApplyIDEOptions;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.SaveDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions);
|
procedure TMainIDE.SaveDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions);
|
||||||
// Called also before reading EnvironmentOptions
|
// Called also before reading EnvironmentOptions
|
||||||
begin
|
begin
|
||||||
|
DebugLn(['* TMainIDE.SaveDesktopSettings']);
|
||||||
IDEWindowCreators.SimpleLayoutStorage.StoreWindowPositions;
|
IDEWindowCreators.SimpleLayoutStorage.StoreWindowPositions;
|
||||||
// do not auto show the search results view
|
// do not auto show the search results view
|
||||||
IDEWindowCreators.SimpleLayoutStorage.ItemByFormID(
|
IDEWindowCreators.SimpleLayoutStorage.ItemByFormID(
|
||||||
@ -4578,29 +4589,18 @@ begin
|
|||||||
TheEnvironmentOptions.ObjectInspectorOptions.Assign(ObjectInspector1);
|
TheEnvironmentOptions.ObjectInspectorOptions.Assign(ObjectInspector1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.PackageTranslated(APackage: TLazPackage);
|
procedure TMainIDE.DoLoadIDEOptions(Sender: TObject; AOptions: TAbstractIDEOptions);
|
||||||
begin
|
|
||||||
if APackage=PackageGraph.SynEditPackage then begin
|
|
||||||
EditorOpts.TranslateResourceStrings;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMainIDE.LoadDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions);
|
|
||||||
begin
|
|
||||||
if ObjectInspector1<>nil then
|
|
||||||
TheEnvironmentOptions.ObjectInspectorOptions.AssignTo(ObjectInspector1);
|
|
||||||
if MessagesView<>nil then
|
|
||||||
MessagesView.ApplyIDEOptions;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMainIDE.OnLoadIDEOptions(Sender: TObject; AOptions: TAbstractIDEOptions);
|
|
||||||
begin
|
begin
|
||||||
|
DebugLn(['** TMainIDE.OnLoadIDEOptions: ', AOptions.ClassName]);
|
||||||
|
// ToDo: Figure out why this is not called.
|
||||||
if AOptions is TEnvironmentOptions then
|
if AOptions is TEnvironmentOptions then
|
||||||
LoadDesktopSettings(AOptions as TEnvironmentOptions);
|
LoadDesktopSettings(AOptions as TEnvironmentOptions);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.OnSaveIDEOptions(Sender: TObject; AOptions: TAbstractIDEOptions);
|
procedure TMainIDE.DoSaveIDEOptions(Sender: TObject; AOptions: TAbstractIDEOptions);
|
||||||
begin
|
begin
|
||||||
|
DebugLn(['** TMainIDE.OnSaveIDEOptions: ', AOptions.ClassName]);
|
||||||
|
// ToDo: Figure out why this is not called.
|
||||||
if AOptions is TEnvironmentOptions then
|
if AOptions is TEnvironmentOptions then
|
||||||
SaveDesktopSettings(AOptions as TEnvironmentOptions);
|
SaveDesktopSettings(AOptions as TEnvironmentOptions);
|
||||||
end;
|
end;
|
||||||
@ -4635,11 +4635,12 @@ begin
|
|||||||
IDEOptionsDialog.OptionsFilter := OptionsFilter;
|
IDEOptionsDialog.OptionsFilter := OptionsFilter;
|
||||||
IDEOptionsDialog.Settings := ASettings;
|
IDEOptionsDialog.Settings := ASettings;
|
||||||
IDEOptionsDialog.OpenEditor(AEditor);
|
IDEOptionsDialog.OpenEditor(AEditor);
|
||||||
IDEOptionsDialog.OnLoadIDEOptionsHook:=@Self.OnLoadIDEOptions;
|
IDEOptionsDialog.OnLoadIDEOptionsHook:=@DoLoadIDEOptions;
|
||||||
IDEOptionsDialog.OnSaveIDEOptionsHook:=@Self.OnSaveIDEOptions;
|
IDEOptionsDialog.OnSaveIDEOptionsHook:=@DoSaveIDEOptions;
|
||||||
IDEOptionsDialog.ReadAll;
|
IDEOptionsDialog.ReadAll;
|
||||||
if IDEOptionsDialog.ShowModal = mrOk then begin
|
if IDEOptionsDialog.ShowModal = mrOk then begin
|
||||||
IDEOptionsDialog.WriteAll(false);
|
IDEOptionsDialog.WriteAll(false);
|
||||||
|
DebugLn(['TMainIDE.DoOpenIDEOptions: Options saved, updating Palette and TaskBar.']);
|
||||||
// Update component palette only when needed.
|
// Update component palette only when needed.
|
||||||
PaletteOpt := TCompPaletteOptionsFrame(IDEOptionsDialog.FindEditor(TCompPaletteOptionsFrame));
|
PaletteOpt := TCompPaletteOptionsFrame(IDEOptionsDialog.FindEditor(TCompPaletteOptionsFrame));
|
||||||
if Assigned(PaletteOpt) and PaletteOpt.ConfigChanged then
|
if Assigned(PaletteOpt) and PaletteOpt.ConfigChanged then
|
||||||
@ -5038,6 +5039,12 @@ begin
|
|||||||
SaveOIFavoriteProperties(ObjectInspector1.Favorites);
|
SaveOIFavoriteProperties(ObjectInspector1.Favorites);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainIDE.PackageTranslated(APackage: TLazPackage);
|
||||||
|
begin
|
||||||
|
if APackage=PackageGraph.SynEditPackage then
|
||||||
|
EditorOpts.TranslateResourceStrings;
|
||||||
|
end;
|
||||||
|
|
||||||
function TMainIDE.DoOpenComponent(const UnitFilename: string;
|
function TMainIDE.DoOpenComponent(const UnitFilename: string;
|
||||||
OpenFlags: TOpenFlags; CloseFlags: TCloseFlags; out Component: TComponent): TModalResult;
|
OpenFlags: TOpenFlags; CloseFlags: TCloseFlags; out Component: TComponent): TModalResult;
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user