mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-05 07:58:37 +01:00
IDE: New class and variable/property for desktop settings in environment options.
git-svn-id: trunk@49432 -
This commit is contained in:
parent
93d4d0fa6c
commit
5286b35a45
@ -829,7 +829,7 @@ end;
|
||||
|
||||
constructor TComponentPalette.Create;
|
||||
begin
|
||||
inherited Create(EnvironmentOptions.ComponentPaletteOptions);
|
||||
inherited Create(EnvironmentOptions.Desktop.ComponentPaletteOptions);
|
||||
fComponentButtons:=TComponentButtonMap.Create;
|
||||
fComponentButtons.Sorted:=True;
|
||||
OnComponentIsInvisible:=@CheckComponentDesignerVisible;
|
||||
|
||||
@ -1173,7 +1173,7 @@ begin
|
||||
if (FDebugger.State in [dsRun])
|
||||
then begin
|
||||
// hide IDE during run
|
||||
if EnvironmentOptions.HideIDEOnRun and (MainIDE.ToolStatus=itDebugger) and not FStepping
|
||||
if EnvironmentOptions.Desktop.HideIDEOnRun and (MainIDE.ToolStatus=itDebugger) and not FStepping
|
||||
then MainIDE.HideIDE;
|
||||
|
||||
if (FPrevShownWindow <> 0) and not FStepping then
|
||||
@ -1194,10 +1194,10 @@ begin
|
||||
if not FStepping then
|
||||
begin
|
||||
FPrevShownWindow := GetForegroundWindow;
|
||||
if EnvironmentOptions.HideIDEOnRun then
|
||||
if EnvironmentOptions.Desktop.HideIDEOnRun then
|
||||
MainIDE.UnhideIDE;
|
||||
if not EnvironmentOptions.SingleTaskBarButton and
|
||||
not EnvironmentOptions.HideIDEOnRun then
|
||||
if not EnvironmentOptions.Desktop.SingleTaskBarButton and
|
||||
not EnvironmentOptions.Desktop.HideIDEOnRun then
|
||||
Application.BringToFront;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -133,9 +133,9 @@ procedure ToggleToolbar (Sender:TObject);
|
||||
var
|
||||
ToolBarVisible: Boolean;
|
||||
begin
|
||||
ToolBarVisible := not EnvironmentOptions.EditorToolBarOptions.Visible;
|
||||
ToolBarVisible := not EnvironmentOptions.Desktop.EditorToolBarOptions.Visible;
|
||||
EditorMenuCommand.Checked := ToolBarVisible;
|
||||
EnvironmentOptions.EditorToolBarOptions.Visible := ToolBarVisible;
|
||||
EnvironmentOptions.Desktop.EditorToolBarOptions.Visible := ToolBarVisible;
|
||||
uAllEditorToolbars.ReloadAll;
|
||||
end;
|
||||
|
||||
@ -278,7 +278,7 @@ begin
|
||||
ETB := TEditorToolbar.Create(Sender as TSourceEditorWindowInterface, Self);
|
||||
i := FToolBars.Add(ETB);
|
||||
FToolBars[i].AddStaticItems;
|
||||
FToolBars[i].CopyFromOptions(EnvironmentOptions.EditorToolBarOptions);
|
||||
FToolBars[i].CopyFromOptions(EnvironmentOptions.Desktop.EditorToolBarOptions);
|
||||
end;
|
||||
|
||||
procedure TAllEditorToolbars.SourceWindowDestroyed(Sender: TObject);
|
||||
@ -312,7 +312,7 @@ begin
|
||||
begin
|
||||
FToolBars[i].ClearToolbar;
|
||||
FToolBars[i].AddStaticItems;
|
||||
FToolBars[i].CopyFromOptions(EnvironmentOptions.EditorToolBarOptions);
|
||||
FToolBars[i].CopyFromOptions(EnvironmentOptions.Desktop.EditorToolBarOptions);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -423,7 +423,7 @@ end;
|
||||
|
||||
procedure TEditorToolbar.SetTbPos;
|
||||
begin
|
||||
case EnvironmentOptions.EditorToolBarOptions.Position of
|
||||
case EnvironmentOptions.Desktop.EditorToolBarOptions.Position of
|
||||
'Top': begin
|
||||
TB.Align:= alTop;
|
||||
TB.Height:= 26;
|
||||
|
||||
@ -37,8 +37,8 @@ uses
|
||||
{$ifdef Windows}
|
||||
ShlObj,
|
||||
{$endif}
|
||||
Classes, SysUtils, TypInfo, strutils, Graphics, Controls, Forms, LCLProc,
|
||||
FileProcs, Dialogs, LazConfigStorage, Laz2_XMLCfg, LazUTF8,
|
||||
Classes, SysUtils, TypInfo, strutils, fgl, Graphics, Controls, Forms,
|
||||
LCLProc, FileProcs, Dialogs, LazConfigStorage, Laz2_XMLCfg, LazUTF8,
|
||||
// IDEIntf
|
||||
ProjectIntf, ObjectInspector, IDEWindowIntf, IDEOptionsIntf,
|
||||
ComponentReg, IDEExternToolIntf, MacroDefIntf,
|
||||
@ -252,6 +252,67 @@ type
|
||||
|
||||
type
|
||||
|
||||
{ TDesktopOpt }
|
||||
|
||||
TDesktopOpt = class
|
||||
private
|
||||
FXMLCfg: TRttiXMLConfig;
|
||||
FConfigStore: TXMLOptionsStorage;
|
||||
// window layout
|
||||
FIDEDialogLayoutList: TIDEDialogLayoutList;
|
||||
FSingleTaskBarButton: boolean;
|
||||
FHideIDEOnRun: boolean;
|
||||
FComponentPaletteVisible: boolean;
|
||||
FAutoAdjustIDEHeight: boolean;
|
||||
FAutoAdjustIDEHeightFullCompPal: boolean;
|
||||
// window menu
|
||||
FIDENameForDesignedFormList: boolean;
|
||||
// CompletionWindow
|
||||
FCompletionWindowWidth: Integer;
|
||||
FCompletionWindowHeight: Integer;
|
||||
// title
|
||||
FIDETitleStartsWithProject: boolean;
|
||||
FIDETitleIncludesBuildMode: boolean;
|
||||
FIDEProjectDirectoryInIdeTitle: boolean;
|
||||
// IDE Coolbar
|
||||
FIDECoolBarOptions: TIDECoolBarOptions;
|
||||
// Editor Toolbar
|
||||
FEditorToolBarOptions: TEditorToolBarOptions;
|
||||
// component palette
|
||||
FComponentPaletteOptions: TCompPaletteOptions;
|
||||
procedure InitLayoutList;
|
||||
procedure Load(Path: String);
|
||||
procedure Save(Path: String);
|
||||
public
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
|
||||
property IDEDialogLayoutList: TIDEDialogLayoutList read FIDEDialogLayoutList;
|
||||
property SingleTaskBarButton: boolean read FSingleTaskBarButton write FSingleTaskBarButton;
|
||||
property HideIDEOnRun: boolean read FHideIDEOnRun write FHideIDEOnRun;
|
||||
property ComponentPaletteVisible: boolean read FComponentPaletteVisible
|
||||
write FComponentPaletteVisible;
|
||||
property AutoAdjustIDEHeight: Boolean read FAutoAdjustIDEHeight write FAutoAdjustIDEHeight;
|
||||
property AutoAdjustIDEHeightFullCompPal: Boolean read FAutoAdjustIDEHeightFullCompPal
|
||||
write FAutoAdjustIDEHeightFullCompPal;
|
||||
property IDENameForDesignedFormList: boolean read FIDENameForDesignedFormList
|
||||
write FIDENameForDesignedFormList;
|
||||
property CompletionWindowWidth: Integer read FCompletionWindowWidth write FCompletionWindowWidth;
|
||||
property CompletionWindowHeight: Integer read FCompletionWindowHeight write FCompletionWindowHeight;
|
||||
property IDETitleStartsWithProject: boolean read FIDETitleStartsWithProject
|
||||
write FIDETitleStartsWithProject;
|
||||
property IDETitleIncludesBuildMode: boolean read FIDETitleIncludesBuildMode
|
||||
write FIDETitleIncludesBuildMode;
|
||||
property IDEProjectDirectoryInIdeTitle: boolean read FIDEProjectDirectoryInIdeTitle
|
||||
write FIDEProjectDirectoryInIdeTitle;
|
||||
property IDECoolBarOptions: TIDECoolBarOptions read FIDECoolBarOptions;
|
||||
property EditorToolBarOptions: TEditorToolBarOptions read FEditorToolBarOptions;
|
||||
property ComponentPaletteOptions: TCompPaletteOptions read FComponentPaletteOptions;
|
||||
|
||||
end;
|
||||
|
||||
TDesktopOptList = specialize TFPGObjectList<TDesktopOpt>;
|
||||
|
||||
{ TEnvironmentOptions - class for storing environment options }
|
||||
|
||||
TEnvironmentOptions = class(TAbstractIDEEnvironmentOptions)
|
||||
@ -401,29 +462,9 @@ type
|
||||
FNewUnitTemplate: string;
|
||||
FFileDialogFilter: string;
|
||||
|
||||
// --- The following is part of desktop settings ---
|
||||
// window layout
|
||||
FIDEDialogLayoutList: TIDEDialogLayoutList;
|
||||
FSingleTaskBarButton: boolean;
|
||||
FHideIDEOnRun: boolean;
|
||||
FComponentPaletteVisible: boolean;
|
||||
FAutoAdjustIDEHeight: boolean;
|
||||
FAutoAdjustIDEHeightFullCompPal: boolean;
|
||||
// window menu
|
||||
FIDENameForDesignedFormList: boolean;
|
||||
// CompletionWindow
|
||||
FCompletionWindowWidth: Integer;
|
||||
FCompletionWindowHeight: Integer;
|
||||
// title
|
||||
FIDETitleStartsWithProject: boolean;
|
||||
FIDETitleIncludesBuildMode: boolean;
|
||||
FIDEProjectDirectoryInIdeTitle: boolean;
|
||||
// IDE Coolbar
|
||||
FIDECoolBarOptions: TIDECoolBarOptions;
|
||||
// Editor Toolbar
|
||||
FEditorToolBarOptions: TEditorToolBarOptions;
|
||||
// component palette
|
||||
FComponentPaletteOptions: TCompPaletteOptions;
|
||||
// Desktop
|
||||
FDesktop: TDesktopOpt;
|
||||
//DesktopOptions: TDesktopOptList; // ToDo
|
||||
|
||||
function GetCompilerFilename: string;
|
||||
function GetCompilerMessagesFilename: string;
|
||||
@ -437,9 +478,7 @@ type
|
||||
function GetMsgColors(u: TMessageLineUrgency): TColor;
|
||||
function GetMsgViewColors(c: TMsgWndColor): TColor;
|
||||
function GetTestBuildDirectory: string;
|
||||
procedure LoadDesktop(Path: String);
|
||||
procedure LoadNonDesktop(Path: String);
|
||||
procedure SaveDesktop(Path: String);
|
||||
procedure SaveNonDesktop(Path: String);
|
||||
procedure SetCompilerFilename(const AValue: string);
|
||||
procedure SetCompilerMessagesFilename(AValue: string);
|
||||
@ -455,7 +494,6 @@ type
|
||||
procedure SetMsgViewColors(c: TMsgWndColor; AValue: TColor);
|
||||
procedure SetParseValue(o: TEnvOptParseType; const NewValue: string);
|
||||
|
||||
procedure InitLayoutList;
|
||||
procedure SetFileName(const NewFilename: string);
|
||||
function FileHasChangedOnDisk: boolean;
|
||||
procedure InitXMLCfg(CleanConfig: boolean);
|
||||
@ -512,36 +550,6 @@ type
|
||||
property AutoSaveProject: boolean read FAutoSaveProject write FAutoSaveProject;
|
||||
property AutoSaveIntervalInSecs: integer read FAutoSaveIntervalInSecs write FAutoSaveIntervalInSecs;
|
||||
|
||||
// window layouts
|
||||
property IDEDialogLayoutList: TIDEDialogLayoutList read FIDEDialogLayoutList;
|
||||
property SingleTaskBarButton: boolean read FSingleTaskBarButton
|
||||
write FSingleTaskBarButton;
|
||||
property HideIDEOnRun: boolean read FHideIDEOnRun write FHideIDEOnRun;
|
||||
property IDETitleStartsWithProject: boolean read FIDETitleStartsWithProject
|
||||
write FIDETitleStartsWithProject;
|
||||
property IDETitleIncludesBuildMode: boolean read FIDETitleIncludesBuildMode
|
||||
write FIDETitleIncludesBuildMode;
|
||||
property IDEProjectDirectoryInIdeTitle: boolean read FIDEProjectDirectoryInIdeTitle
|
||||
write FIDEProjectDirectoryInIdeTitle;
|
||||
property ComponentPaletteVisible: boolean read FComponentPaletteVisible
|
||||
write FComponentPaletteVisible;
|
||||
property AutoAdjustIDEHeight: Boolean read FAutoAdjustIDEHeight write FAutoAdjustIDEHeight;
|
||||
property AutoAdjustIDEHeightFullCompPal: Boolean read FAutoAdjustIDEHeightFullCompPal
|
||||
write FAutoAdjustIDEHeightFullCompPal;
|
||||
property CompletionWindowWidth: Integer read FCompletionWindowWidth
|
||||
write FCompletionWindowWidth;
|
||||
property CompletionWindowHeight: Integer read FCompletionWindowHeight
|
||||
write FCompletionWindowHeight;
|
||||
// window menu list
|
||||
property IDENameForDesignedFormList: boolean read FIDENameForDesignedFormList
|
||||
write FIDENameForDesignedFormList;
|
||||
// IDE Coolbar
|
||||
property IDECoolBarOptions: TIDECoolBarOptions read FIDECoolBarOptions;
|
||||
// Editor Toolbar
|
||||
property EditorToolBarOptions: TEditorToolBarOptions read FEditorToolBarOptions;
|
||||
// component palette
|
||||
property ComponentPaletteOptions: TCompPaletteOptions read FComponentPaletteOptions;
|
||||
|
||||
// form editor
|
||||
property ShowBorderSpacing: boolean read FShowBorderSpacing write FShowBorderSpacing;
|
||||
property ShowGrid: boolean read FShowGrid write FShowGrid;
|
||||
@ -585,15 +593,15 @@ type
|
||||
|
||||
// project inspector
|
||||
property ProjInspSortAlphabetically: boolean read FProjInspSortAlphabetically
|
||||
write FProjInspSortAlphabetically;
|
||||
write FProjInspSortAlphabetically;
|
||||
property ProjInspShowDirHierarchy: boolean read FProjInspShowDirHierarchy
|
||||
write FProjInspShowDirHierarchy;
|
||||
write FProjInspShowDirHierarchy;
|
||||
|
||||
// package editor
|
||||
property PackageEditorSortAlphabetically: boolean read FPackageEditorSortAlphabetically
|
||||
write FPackageEditorSortAlphabetically;
|
||||
write FPackageEditorSortAlphabetically;
|
||||
property PackageEditorShowDirHierarchy: boolean read FPackageEditorShowDirHierarchy
|
||||
write FPackageEditorShowDirHierarchy;
|
||||
write FPackageEditorShowDirHierarchy;
|
||||
|
||||
// hints
|
||||
property CheckDiskChangesWithLoading: boolean read FCheckDiskChangesWithLoading
|
||||
@ -604,33 +612,24 @@ type
|
||||
write FShowHintsForMainSpeedButtons;
|
||||
|
||||
// files
|
||||
property LazarusDirectory: string read GetLazarusDirectory
|
||||
write SetLazarusDirectory;
|
||||
property LazarusDirHistory: TStringList read FLazarusDirHistory
|
||||
write FLazarusDirHistory;
|
||||
property CompilerFilename: string read GetCompilerFilename
|
||||
write SetCompilerFilename;
|
||||
property CompilerFileHistory: TStringList read FCompilerFileHistory
|
||||
write FCompilerFileHistory;
|
||||
property FPCSourceDirectory: string read GetFPCSourceDirectory
|
||||
write SetFPCSourceDirectory;
|
||||
property LazarusDirectory: string read GetLazarusDirectory write SetLazarusDirectory;
|
||||
property LazarusDirHistory: TStringList read FLazarusDirHistory write FLazarusDirHistory;
|
||||
property CompilerFilename: string read GetCompilerFilename write SetCompilerFilename;
|
||||
property CompilerFileHistory: TStringList read FCompilerFileHistory write FCompilerFileHistory;
|
||||
property FPCSourceDirectory: string read GetFPCSourceDirectory write SetFPCSourceDirectory;
|
||||
property FPCSourceDirHistory: TStringList read FFPCSourceDirHistory;
|
||||
property MakeFilename: string read GetMakeFilename write SetMakeFilename;
|
||||
property MakeFileHistory: TStringList read FMakeFileHistory;
|
||||
property DebuggerFilename: string read GetDebuggerFilename write SetDebuggerFilename;
|
||||
property DebuggerFileHistory: TStringList read FDebuggerFileHistory;
|
||||
property DebuggerSearchPath: string read GetDebuggerSearchPath
|
||||
write SetDebuggerSearchPath;
|
||||
property DebuggerShowStopMessage: boolean read FDebuggerShowStopMessage
|
||||
write FDebuggerShowStopMessage;
|
||||
property DebuggerResetAfterRun: boolean read FDebuggerResetAfterRun
|
||||
write FDebuggerResetAfterRun;
|
||||
property DebuggerSearchPath: string read GetDebuggerSearchPath write SetDebuggerSearchPath;
|
||||
property DebuggerShowStopMessage: boolean read FDebuggerShowStopMessage write FDebuggerShowStopMessage;
|
||||
property DebuggerResetAfterRun: boolean read FDebuggerResetAfterRun write FDebuggerResetAfterRun;
|
||||
// ShowCompileDialog and AutoCloseCompileDialog are currently not used.
|
||||
// But maybe someone will implement them again. Keep them till 1.4.2
|
||||
property ShowCompileDialog: boolean read FShowCompileDialog write FShowCompileDialog;
|
||||
property AutoCloseCompileDialog: boolean read FAutoCloseCompileDialog write FAutoCloseCompileDialog;
|
||||
property TestBuildDirectory: string read GetTestBuildDirectory
|
||||
write SetTestBuildDirectory;
|
||||
property TestBuildDirectory: string read GetTestBuildDirectory write SetTestBuildDirectory;
|
||||
property TestBuildDirHistory: TStringList read FTestBuildDirHistory;
|
||||
property CompilerMessagesFilename: string read GetCompilerMessagesFilename
|
||||
write SetCompilerMessagesFilename; // non English translation file
|
||||
@ -740,6 +739,8 @@ type
|
||||
// default template for each 'new item' category: Name=Path, Value=TemplateName
|
||||
property NewUnitTemplate: string read FNewUnitTemplate write FNewUnitTemplate;
|
||||
property NewFormTemplate: string read FNewFormTemplate write FNewFormTemplate;
|
||||
// Desktop
|
||||
property Desktop: TDesktopOpt read FDesktop;
|
||||
end;
|
||||
|
||||
var
|
||||
@ -854,6 +855,126 @@ begin
|
||||
WriteStr(Result, u);
|
||||
end;
|
||||
|
||||
{ TDesktopOpt }
|
||||
|
||||
constructor TDesktopOpt.Create;
|
||||
begin
|
||||
FSingleTaskBarButton:=false;
|
||||
FHideIDEOnRun:=false;
|
||||
FComponentPaletteVisible:=true;
|
||||
FAutoAdjustIDEHeight:=true;
|
||||
FAutoAdjustIDEHeightFullCompPal := true;
|
||||
// window menu
|
||||
FIDENameForDesignedFormList:=false;
|
||||
// CompletionWindow
|
||||
FCompletionWindowWidth := 320;
|
||||
FCompletionWindowHeight := 6;
|
||||
// title
|
||||
FIDETitleStartsWithProject:=false;
|
||||
FIDETitleIncludesBuildMode:=false;
|
||||
FIDEProjectDirectoryInIdeTitle:=false;
|
||||
// IDE Coolbar
|
||||
FIDECoolBarOptions:=TIDECoolBarOptions.Create;
|
||||
// Editor Toolbar
|
||||
FEditorToolBarOptions:=TEditorToolBarOptions.Create;
|
||||
// component palette
|
||||
FComponentPaletteOptions:=TCompPaletteOptions.Create;
|
||||
// Windows layout
|
||||
InitLayoutList;
|
||||
FIDEDialogLayoutList:=TIDEDialogLayoutList.Create;
|
||||
if IDEWindowIntf.IDEDialogLayoutList=nil then
|
||||
IDEWindowIntf.IDEDialogLayoutList:=FIDEDialogLayoutList;
|
||||
end;
|
||||
|
||||
destructor TDesktopOpt.Destroy;
|
||||
begin
|
||||
if IDEWindowIntf.IDEDialogLayoutList=FIDEDialogLayoutList then
|
||||
IDEWindowIntf.IDEDialogLayoutList:=nil;
|
||||
FreeAndNil(FIDEDialogLayoutList);
|
||||
FreeAndNil(FComponentPaletteOptions);
|
||||
FreeAndNil(FEditorToolBarOptions);
|
||||
FreeAndNil(FIDECoolBarOptions);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TDesktopOpt.Load(Path: String);
|
||||
begin
|
||||
// Windows layout
|
||||
IDEWindowCreators.SimpleLayoutStorage.LoadFromConfig(FConfigStore,Path);
|
||||
FIDEDialogLayoutList.LoadFromConfig(FConfigStore, Path+'Dialogs/');
|
||||
|
||||
FSingleTaskBarButton:=FXMLCfg.GetValue(Path+'SingleTaskBarButton/Value', False);
|
||||
FHideIDEOnRun:=FXMLCfg.GetValue(Path+'HideIDEOnRun/Value',false);
|
||||
FComponentPaletteVisible:=FXMLCfg.GetValue(Path+'ComponentPaletteVisible/Value',true);
|
||||
FAutoAdjustIDEHeight:=FXMLCfg.GetValue(Path+'AutoAdjustIDEHeight/Value',true);
|
||||
FAutoAdjustIDEHeightFullCompPal:=FXMLCfg.GetValue(Path+'AutoAdjustIDEHeightFullComponentPalette/Value',true);
|
||||
// Window menu
|
||||
FIDENameForDesignedFormList:=FXMLCfg.GetValue(Path+'IDENameForDesignedFormList/Value',false);
|
||||
// title
|
||||
FIDETitleStartsWithProject:=FXMLCfg.GetValue(Path+'IDETitleStartsWithProject/Value',false);
|
||||
FIDETitleIncludesBuildMode:=FXMLCfg.GetValue(Path+'IDETitleIncludesBuildMode/Value',false);
|
||||
FIDEProjectDirectoryInIdeTitle:=FXMLCfg.GetValue(Path+'IDEProjectDirectoryInIdeTitle/Value',false);
|
||||
// CompletionWindow
|
||||
FCompletionWindowWidth:=FXMLCfg.GetValue(Path+'CompletionWindowWidth/Value', 320);
|
||||
FCompletionWindowHeight:=FXMLCfg.GetValue(Path+'CompletionWindowHeight/Value', 6);
|
||||
|
||||
if AnsiStartsStr('EnvironmentOptions', Path) then
|
||||
Path := ''; // Toolbars and palette were at the top level in XML.
|
||||
// IDE Coolbar
|
||||
FIDECoolBarOptions.Load(FXMLCfg, Path);
|
||||
// Editor Toolbar
|
||||
FEditorToolBarOptions.Load(FXMLCfg, Path);
|
||||
// component palette
|
||||
FComponentPaletteOptions.Load(FXMLCfg, Path);
|
||||
end;
|
||||
|
||||
procedure TDesktopOpt.Save(Path: String);
|
||||
begin
|
||||
// windows
|
||||
FXMLCfg.SetDeleteValue(Path+'Name', 'default', '');
|
||||
IDEWindowCreators.SimpleLayoutStorage.SaveToConfig(FConfigStore,Path);
|
||||
FIDEDialogLayoutList.SaveToConfig(FConfigStore,Path+'Dialogs/');
|
||||
|
||||
FXMLCfg.SetDeleteValue(Path+'SingleTaskBarButton/Value',FSingleTaskBarButton, False);
|
||||
FXMLCfg.SetDeleteValue(Path+'HideIDEOnRun/Value',FHideIDEOnRun,false);
|
||||
FXMLCfg.SetDeleteValue(Path+'ComponentPaletteVisible/Value',FComponentPaletteVisible,true);
|
||||
FXMLCfg.SetDeleteValue(Path+'AutoAdjustIDEHeight/Value',FAutoAdjustIDEHeight,true);
|
||||
FXMLCfg.SetDeleteValue(Path+'AutoAdjustIDEHeightFullComponentPalette/Value',
|
||||
FAutoAdjustIDEHeightFullCompPal,true);
|
||||
// Window menu
|
||||
FXMLCfg.SetDeleteValue(Path+'IDENameForDesignedFormList/Value',FIDENameForDesignedFormList,false);
|
||||
// title
|
||||
FXMLCfg.SetDeleteValue(Path+'IDETitleStartsWithProject/Value',FIDETitleStartsWithProject,false);
|
||||
FXMLCfg.SetDeleteValue(Path+'IDETitleIncludesBuildMode/Value',FIDETitleIncludesBuildMode,false);
|
||||
FXMLCfg.SetDeleteValue(Path+'IDEProjectDirectoryInIdeTitle/Value',FIDEProjectDirectoryInIdeTitle,false);
|
||||
// CompletionWindow
|
||||
FXMLCfg.SetDeleteValue(Path+'CompletionWindowWidth/Value',FCompletionWindowWidth, 320);
|
||||
FXMLCfg.SetDeleteValue(Path+'CompletionWindowHeight/Value',FCompletionWindowHeight, 6);
|
||||
// IDE Coolbar
|
||||
FIDECoolBarOptions.Save(FXMLCfg, Path);
|
||||
// Editor Toolbar
|
||||
FEditorToolBarOptions.Save(FXMLCfg, Path);
|
||||
// component palette
|
||||
FComponentPaletteOptions.Save(FXMLCfg, Path);
|
||||
end;
|
||||
|
||||
procedure InitLayoutHelper(const FormID: string);
|
||||
begin
|
||||
with IDEWindowCreators.SimpleLayoutStorage do
|
||||
if not Assigned(ItemByFormID(FormID)) then
|
||||
CreateWindowLayout(FormID);
|
||||
end;
|
||||
|
||||
procedure TDesktopOpt.InitLayoutList;
|
||||
var
|
||||
l: TNonModalIDEWindow;
|
||||
begin
|
||||
for l:=Low(TNonModalIDEWindow) to High(TNonModalIDEWindow) do
|
||||
if l<>nmiwNone then
|
||||
InitLayoutHelper(NonModalIDEWindowNames[l]);
|
||||
InitLayoutHelper(DefaultObjectInspectorName);
|
||||
end;
|
||||
|
||||
{ TEnvironmentOptions }
|
||||
|
||||
constructor TEnvironmentOptions.Create;
|
||||
@ -997,38 +1118,15 @@ begin
|
||||
// global build options
|
||||
FBuildMatrixOptions:=TBuildMatrixOptions.Create;
|
||||
|
||||
// --- The following is part of desktop settings ---
|
||||
// windows layout
|
||||
InitLayoutList;
|
||||
FIDEDialogLayoutList:=TIDEDialogLayoutList.Create;
|
||||
if IDEWindowIntf.IDEDialogLayoutList=nil then
|
||||
IDEWindowIntf.IDEDialogLayoutList:=FIDEDialogLayoutList;
|
||||
FSingleTaskBarButton:=false;
|
||||
FHideIDEOnRun:=false;
|
||||
FComponentPaletteVisible:=true;
|
||||
FAutoAdjustIDEHeight:=true;
|
||||
FAutoAdjustIDEHeightFullCompPal := true;
|
||||
// window menu
|
||||
FIDENameForDesignedFormList:=false;
|
||||
// CompletionWindow
|
||||
FCompletionWindowWidth := 320;
|
||||
FCompletionWindowHeight := 6;
|
||||
// title
|
||||
FIDETitleStartsWithProject:=false;
|
||||
FIDETitleIncludesBuildMode:=false;
|
||||
FIDEProjectDirectoryInIdeTitle:=false;
|
||||
// IDE Coolbar
|
||||
FIDECoolBarOptions:=TIDECoolBarOptions.Create;
|
||||
// Editor Toolbar
|
||||
FEditorToolBarOptions:=TEditorToolBarOptions.Create;
|
||||
// component palette
|
||||
FComponentPaletteOptions:=TCompPaletteOptions.Create;
|
||||
// Desktop
|
||||
FDesktop := TDesktopOpt.Create;
|
||||
end;
|
||||
|
||||
destructor TEnvironmentOptions.Destroy;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
FreeAndNil(FDesktop);
|
||||
FreeAndNil(FBuildMatrixOptions);
|
||||
FreeAndNil(FMsgViewFilters);
|
||||
FreeAndNil(fExternalUserTools);
|
||||
@ -1036,9 +1134,6 @@ begin
|
||||
FreeAndNil(FRecentProjectFiles);
|
||||
FreeAndNil(FRecentPackageFiles);
|
||||
FreeAndNil(FObjectInspectorOptions);
|
||||
FreeAndNil(FComponentPaletteOptions);
|
||||
FreeAndNil(FEditorToolBarOptions);
|
||||
FreeAndNil(FIDECoolBarOptions);
|
||||
FreeAndNil(FLazarusDirHistory);
|
||||
FreeAndNil(FCompilerFileHistory);
|
||||
FreeAndNil(FFPCSourceDirHistory);
|
||||
@ -1049,9 +1144,6 @@ begin
|
||||
FreeAndNil(FDebuggerProperties);
|
||||
FreeAndNil(FTestBuildDirHistory);
|
||||
FreeAndNil(FCompilerMessagesFileHistory);
|
||||
if IDEWindowIntf.IDEDialogLayoutList=FIDEDialogLayoutList then
|
||||
IDEWindowIntf.IDEDialogLayoutList:=nil;
|
||||
FreeAndNil(FIDEDialogLayoutList);
|
||||
FreeAndNil(FDebuggerConfig);
|
||||
FreeAndNil(FConfigStore);
|
||||
FreeAndNil(FDbgConfigStore);
|
||||
@ -1198,37 +1290,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TEnvironmentOptions.LoadDesktop(Path: String);
|
||||
begin
|
||||
// Windows layout
|
||||
IDEWindowCreators.SimpleLayoutStorage.LoadFromConfig(FConfigStore,Path);
|
||||
FIDEDialogLayoutList.LoadFromConfig(FConfigStore, Path+'Dialogs/');
|
||||
|
||||
FSingleTaskBarButton:=FXMLCfg.GetValue(Path+'SingleTaskBarButton/Value', False);
|
||||
FHideIDEOnRun:=FXMLCfg.GetValue(Path+'HideIDEOnRun/Value',false);
|
||||
FComponentPaletteVisible:=FXMLCfg.GetValue(Path+'ComponentPaletteVisible/Value',true);
|
||||
FAutoAdjustIDEHeight:=FXMLCfg.GetValue(Path+'AutoAdjustIDEHeight/Value',true);
|
||||
FAutoAdjustIDEHeightFullCompPal:=FXMLCfg.GetValue(Path+'AutoAdjustIDEHeightFullComponentPalette/Value',true);
|
||||
// Window menu
|
||||
FIDENameForDesignedFormList:=FXMLCfg.GetValue(Path+'IDENameForDesignedFormList/Value',false);
|
||||
// title
|
||||
FIDETitleStartsWithProject:=FXMLCfg.GetValue(Path+'IDETitleStartsWithProject/Value',false);
|
||||
FIDETitleIncludesBuildMode:=FXMLCfg.GetValue(Path+'IDETitleIncludesBuildMode/Value',false);
|
||||
FIDEProjectDirectoryInIdeTitle:=FXMLCfg.GetValue(Path+'IDEProjectDirectoryInIdeTitle/Value',false);
|
||||
// CompletionWindow
|
||||
FCompletionWindowWidth:=FXMLCfg.GetValue(Path+'CompletionWindowWidth/Value', 320);
|
||||
FCompletionWindowHeight:=FXMLCfg.GetValue(Path+'CompletionWindowHeight/Value', 6);
|
||||
|
||||
if AnsiStartsStr('EnvironmentOptions', Path) then
|
||||
Path := ''; // Toolbars and palette were at the top level in XML.
|
||||
// IDE Coolbar
|
||||
FIDECoolBarOptions.Load(FXMLCfg, Path);
|
||||
// Editor Toolbar
|
||||
FEditorToolBarOptions.Load(FXMLCfg, Path);
|
||||
// component palette
|
||||
FComponentPaletteOptions.Load(FXMLCfg, Path);
|
||||
end;
|
||||
|
||||
procedure TEnvironmentOptions.Load(OnlyDesktop:boolean);
|
||||
|
||||
procedure AddRecentProjectInitial(aProjPath, aProjFile: string);
|
||||
@ -1436,16 +1497,18 @@ begin
|
||||
end;
|
||||
|
||||
// The user can define many desktops. They are saved under path Desktops/.
|
||||
FDesktop.FXMLCfg := FXMLCfg;
|
||||
FDesktop.FConfigStore := FConfigStore;
|
||||
CurPath:='Desktops/';
|
||||
if FXMLCfg.HasPath(CurPath, True) then
|
||||
begin
|
||||
// New path under Desktops/.
|
||||
j := FXMLCfg.GetValue(CurPath+'Count/', 1);
|
||||
for i := 0 to j-1 do
|
||||
LoadDesktop(CurPath+'Desktop'+IntToStr(i+1)+'/');
|
||||
FDesktop.Load(CurPath+'Desktop'+IntToStr(i+1)+'/');
|
||||
end
|
||||
else // Old path was under EnvironmentOptions/.
|
||||
LoadDesktop(Path+'Desktop/');
|
||||
FDesktop.Load(Path+'Desktop/');
|
||||
|
||||
FileUpdated;
|
||||
except
|
||||
@ -1555,35 +1618,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TEnvironmentOptions.SaveDesktop(Path: String);
|
||||
begin
|
||||
// windows
|
||||
IDEWindowCreators.SimpleLayoutStorage.SaveToConfig(FConfigStore,Path);
|
||||
FIDEDialogLayoutList.SaveToConfig(FConfigStore,Path+'Dialogs/');
|
||||
|
||||
FXMLCfg.SetDeleteValue(Path+'SingleTaskBarButton/Value',FSingleTaskBarButton, False);
|
||||
FXMLCfg.SetDeleteValue(Path+'HideIDEOnRun/Value',FHideIDEOnRun,false);
|
||||
FXMLCfg.SetDeleteValue(Path+'ComponentPaletteVisible/Value',FComponentPaletteVisible,true);
|
||||
FXMLCfg.SetDeleteValue(Path+'AutoAdjustIDEHeight/Value',FAutoAdjustIDEHeight,true);
|
||||
FXMLCfg.SetDeleteValue(Path+'AutoAdjustIDEHeightFullComponentPalette/Value',
|
||||
FAutoAdjustIDEHeightFullCompPal,true);
|
||||
// Window menu
|
||||
FXMLCfg.SetDeleteValue(Path+'IDENameForDesignedFormList/Value',FIDENameForDesignedFormList,false);
|
||||
// title
|
||||
FXMLCfg.SetDeleteValue(Path+'IDETitleStartsWithProject/Value',FIDETitleStartsWithProject,false);
|
||||
FXMLCfg.SetDeleteValue(Path+'IDETitleIncludesBuildMode/Value',FIDETitleIncludesBuildMode,false);
|
||||
FXMLCfg.SetDeleteValue(Path+'IDEProjectDirectoryInIdeTitle/Value',FIDEProjectDirectoryInIdeTitle,false);
|
||||
// CompletionWindow
|
||||
FXMLCfg.SetDeleteValue(Path+'CompletionWindowWidth/Value',FCompletionWindowWidth, 320);
|
||||
FXMLCfg.SetDeleteValue(Path+'CompletionWindowHeight/Value',FCompletionWindowHeight, 6);
|
||||
// IDE Coolbar
|
||||
FIDECoolBarOptions.Save(FXMLCfg, Path);
|
||||
// Editor Toolbar
|
||||
FEditorToolBarOptions.Save(FXMLCfg, Path);
|
||||
// component palette
|
||||
FComponentPaletteOptions.Save(FXMLCfg, Path);
|
||||
end;
|
||||
|
||||
procedure TEnvironmentOptions.Save(OnlyDesktop: boolean);
|
||||
var
|
||||
Path, CurPath, NodeName: String;
|
||||
@ -1737,11 +1771,14 @@ begin
|
||||
end;
|
||||
|
||||
// The user can define many desktops. They are saved under path Desktops/.
|
||||
FDesktop.FXMLCfg := FXMLCfg;
|
||||
FDesktop.FConfigStore := FConfigStore;
|
||||
CurPath:='Desktops/';
|
||||
FXMLCfg.SetDeleteValue(CurPath+'Count', 1, 0); // ToDo: use count from collection.
|
||||
FXMLCfg.SetDeleteValue(CurPath+'Active', 'default', '');
|
||||
j := 1;
|
||||
for i := 0 to j-1 do // ToDo: iterate collection.
|
||||
SaveDesktop(CurPath+'Desktop'+IntToStr(i+1)+'/');
|
||||
FDesktop.Save(CurPath+'Desktop'+IntToStr(i+1)+'/');
|
||||
|
||||
FXMLCfg.Flush;
|
||||
FileUpdated;
|
||||
@ -1776,36 +1813,17 @@ begin
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
procedure TEnvironmentOptions.RemoveFromRecentProjectFiles(
|
||||
const AFilename: string);
|
||||
procedure TEnvironmentOptions.RemoveFromRecentProjectFiles(const AFilename: string);
|
||||
begin
|
||||
RemoveFromRecentList(AFilename,FRecentProjectFiles,rltFile);
|
||||
end;
|
||||
|
||||
procedure InitLayoutHelper(const FormID: string);
|
||||
begin
|
||||
with IDEWindowCreators.SimpleLayoutStorage do
|
||||
if not Assigned(ItemByFormID(FormID)) then
|
||||
CreateWindowLayout(FormID);
|
||||
end;
|
||||
|
||||
procedure TEnvironmentOptions.InitLayoutList;
|
||||
var
|
||||
l: TNonModalIDEWindow;
|
||||
begin
|
||||
for l:=Low(TNonModalIDEWindow) to High(TNonModalIDEWindow) do
|
||||
if l<>nmiwNone then
|
||||
InitLayoutHelper(NonModalIDEWindowNames[l]);
|
||||
InitLayoutHelper(DefaultObjectInspectorName);
|
||||
end;
|
||||
|
||||
function TEnvironmentOptions.GetParsedTestBuildDirectory: string;
|
||||
begin
|
||||
Result:=GetParsedValue(eopTestBuildDirectory);
|
||||
end;
|
||||
|
||||
function TEnvironmentOptions.GetParsedFPCSourceDirectory(FPCVer: string
|
||||
): string;
|
||||
function TEnvironmentOptions.GetParsedFPCSourceDirectory(FPCVer: string): string;
|
||||
var
|
||||
s: String;
|
||||
begin
|
||||
|
||||
@ -186,7 +186,7 @@ end;
|
||||
|
||||
procedure TCompPaletteOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
fLocalOptions.Assign((AOptions as TEnvironmentOptions).ComponentPaletteOptions);
|
||||
fLocalOptions.Assign((AOptions as TEnvironmentOptions).Desktop.ComponentPaletteOptions);
|
||||
fLocalUserOrder.Options:=fLocalOptions;
|
||||
ActualReadSettings;
|
||||
end;
|
||||
@ -204,7 +204,7 @@ end;
|
||||
procedure TCompPaletteOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
if not fConfigChanged then Exit;
|
||||
ActualWriteSettings((AOptions as TEnvironmentOptions).ComponentPaletteOptions);
|
||||
ActualWriteSettings((AOptions as TEnvironmentOptions).Desktop.ComponentPaletteOptions);
|
||||
IDEComponentPalette.IncChangeStamp;
|
||||
end;
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@ procedure TEditorToolbarOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions)
|
||||
var
|
||||
Opts: TEditorToolBarOptions;
|
||||
begin
|
||||
Opts := (AOptions as TEnvironmentOptions).EditorToolBarOptions;
|
||||
Opts := (AOptions as TEnvironmentOptions).Desktop.EditorToolBarOptions;
|
||||
cbCoolBarVisible.Checked := Opts.Visible;
|
||||
cbPos.ItemIndex := IndexFromEnglish(Opts.Position);
|
||||
// Disable controls when toolbar is hidden.
|
||||
@ -125,7 +125,7 @@ procedure TEditorToolbarOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions
|
||||
var
|
||||
Opts: TEditorToolBarOptions;
|
||||
begin
|
||||
Opts := (AOptions as TEnvironmentOptions).EditorToolBarOptions;
|
||||
Opts := (AOptions as TEnvironmentOptions).Desktop.EditorToolBarOptions;
|
||||
Opts.Assign(FLocalOptions);
|
||||
uAllEditorToolbars.ReloadAll;
|
||||
end;
|
||||
|
||||
@ -138,7 +138,7 @@ procedure TIdeCoolbarOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
var
|
||||
Opts: TIDECoolBarOptions;
|
||||
begin
|
||||
Opts := (AOptions as TEnvironmentOptions).IDECoolBarOptions;
|
||||
Opts := (AOptions as TEnvironmentOptions).Desktop.IDECoolBarOptions;
|
||||
cbCoolBarVisible.Checked := Opts.IDECoolBarVisible;
|
||||
FTempCoolBar.IsVisible := Opts.IDECoolBarVisible;
|
||||
|
||||
@ -176,7 +176,7 @@ var
|
||||
ToolBar: TToolBar;
|
||||
Opts: TIDECoolBarOptions;
|
||||
begin
|
||||
Opts := (AOptions as TEnvironmentOptions).IDECoolBarOptions;
|
||||
Opts := (AOptions as TEnvironmentOptions).Desktop.IDECoolBarOptions;
|
||||
for I := 0 to Coolbar.Bands.Count - 1 do
|
||||
begin
|
||||
if Coolbar.Bands[I].Control = nil then
|
||||
|
||||
@ -137,7 +137,7 @@ var
|
||||
Creator: TIDEWindowCreator;
|
||||
i, j: Integer;
|
||||
begin
|
||||
with AOptions as TEnvironmentOptions do
|
||||
with (AOptions as TEnvironmentOptions).Desktop do
|
||||
begin
|
||||
// window minimizing and hiding
|
||||
SingleTaskBarButtonCheckBox.Checked := SingleTaskBarButton;
|
||||
@ -219,7 +219,7 @@ begin
|
||||
SaveLayout;
|
||||
IDEWindowCreators.SimpleLayoutStorage.Assign(FLayouts);
|
||||
|
||||
with AOptions as TEnvironmentOptions do
|
||||
with (AOptions as TEnvironmentOptions).Desktop do
|
||||
begin
|
||||
// window minimizing
|
||||
SingleTaskBarButton := SingleTaskBarButtonCheckBox.Checked;
|
||||
|
||||
34
ide/main.pp
34
ide/main.pp
@ -1435,7 +1435,7 @@ begin
|
||||
LoadGlobalOptions;
|
||||
if Application.Terminated then exit;
|
||||
|
||||
if EnvironmentOptions.SingleTaskBarButton then
|
||||
if EnvironmentOptions.Desktop.SingleTaskBarButton then
|
||||
Application.TaskBarBehavior := tbSingleButton;
|
||||
|
||||
// setup code templates
|
||||
@ -2011,17 +2011,17 @@ begin
|
||||
|
||||
MainIDEBar.CoolBar := TCoolBar.Create(OwningComponent);
|
||||
MainIDEBar.CoolBar.Parent := MainIDEBar;
|
||||
if EnvironmentOptions.ComponentPaletteVisible then
|
||||
if EnvironmentOptions.Desktop.ComponentPaletteVisible then
|
||||
begin
|
||||
MainIDEBar.CoolBar.Align := alLeft;
|
||||
MainIDEBar.CoolBar.Width := EnvironmentOptions.IDECoolBarOptions.IDECoolBarWidth;
|
||||
MainIDEBar.CoolBar.Width := EnvironmentOptions.Desktop.IDECoolBarOptions.IDECoolBarWidth;
|
||||
end
|
||||
else
|
||||
MainIDEBar.CoolBar.Align := alClient;
|
||||
|
||||
// IDE Coolbar object wraps MainIDEBar.CoolBar.
|
||||
IDECoolBar := TIDECoolBar.Create(MainIDEBar.CoolBar);
|
||||
IDECoolBar.IsVisible := EnvironmentOptions.IDECoolBarOptions.IDECoolBarVisible;;
|
||||
IDECoolBar.IsVisible := EnvironmentOptions.Desktop.IDECoolBarOptions.IDECoolBarVisible;;
|
||||
MainIDEBar.CoolBar.OnChange := @MainIDEBar.CoolBarOnChange;
|
||||
|
||||
MainIDEBar.CreatePopupMenus(OwningComponent);
|
||||
@ -2049,7 +2049,7 @@ begin
|
||||
with MainIDEBar.ComponentPageControl do begin
|
||||
Name := 'ComponentPageControl';
|
||||
Align := alClient;
|
||||
Visible:=EnvironmentOptions.ComponentPaletteVisible;
|
||||
Visible:=EnvironmentOptions.Desktop.ComponentPaletteVisible;
|
||||
Parent := MainIDEBar;
|
||||
end;
|
||||
end;
|
||||
@ -3696,13 +3696,13 @@ begin
|
||||
ComponentPaletteVisible:=not MainIDEBar.ComponentPageControl.Visible;
|
||||
MainIDEBar.itmViewComponentPalette.Checked:=ComponentPaletteVisible;
|
||||
MainIDEBar.ComponentPageControl.Visible:=ComponentPaletteVisible;
|
||||
EnvironmentOptions.ComponentPaletteVisible:=ComponentPaletteVisible;
|
||||
EnvironmentOptions.Desktop.ComponentPaletteVisible:=ComponentPaletteVisible;
|
||||
if ComponentPaletteVisible then
|
||||
begin
|
||||
if MainIDEBar.CoolBar.Align = alClient then
|
||||
begin
|
||||
MainIDEBar.CoolBar.Width := 230;
|
||||
EnvironmentOptions.IDECoolBarOptions.IDECoolBarWidth := 230;
|
||||
EnvironmentOptions.Desktop.IDECoolBarOptions.IDECoolBarWidth := 230;
|
||||
end;
|
||||
MainIDEBar.CoolBar.Align := alLeft;
|
||||
MainIDEBar.CoolBar.Vertical := False;
|
||||
@ -3726,7 +3726,7 @@ begin
|
||||
MainIDEBar.itmViewIDESpeedButtons.Checked := SpeedButtonsVisible;
|
||||
MainIDEBar.CoolBar.Visible := SpeedButtonsVisible;
|
||||
MainIDEBar.MainSplitter.Visible := SpeedButtonsVisible;
|
||||
EnvironmentOptions.IDECoolBarOptions.IDECoolBarVisible := SpeedButtonsVisible;
|
||||
EnvironmentOptions.Desktop.IDECoolBarOptions.IDECoolBarVisible := SpeedButtonsVisible;
|
||||
MainIDEBar.MainSplitter.Visible := MainIDEBar.Coolbar.Visible and
|
||||
MainIDEBar.ComponentPageControl.Visible;
|
||||
MainIDEBar.SetMainIDEHeight;
|
||||
@ -4738,7 +4738,7 @@ begin
|
||||
if Assigned(PaletteOpt) and PaletteOpt.ConfigChanged then
|
||||
IDEComponentPalette.Update(True);
|
||||
// Update TaskBarBehavior immediately.
|
||||
if EnvironmentOptions.SingleTaskBarButton then
|
||||
if EnvironmentOptions.Desktop.SingleTaskBarButton then
|
||||
Application.TaskBarBehavior := tbSingleButton
|
||||
else
|
||||
Application.TaskBarBehavior := tbDefault;
|
||||
@ -4855,7 +4855,7 @@ begin
|
||||
SetupHints;
|
||||
Application.ShowButtonGlyphs := EnvironmentOptions.ShowButtonGlyphs;
|
||||
Application.ShowMenuGlyphs := EnvironmentOptions.ShowMenuGlyphs;
|
||||
if EnvironmentOptions.SingleTaskBarButton then
|
||||
if EnvironmentOptions.Desktop.SingleTaskBarButton then
|
||||
Application.TaskBarBehavior := tbSingleButton
|
||||
else
|
||||
Application.TaskBarBehavior := tbDefault;
|
||||
@ -7918,7 +7918,7 @@ procedure TMainIDE.UpdateCaption;
|
||||
|
||||
function AddToCaption(const CurrentCaption, CaptAddition: string): String;
|
||||
begin
|
||||
if EnvironmentOptions.IDETitleStartsWithProject then
|
||||
if EnvironmentOptions.Desktop.IDETitleStartsWithProject then
|
||||
Result := CaptAddition + ' - ' + CurrentCaption
|
||||
else
|
||||
Result := CurrentCaption + ' - ' + CaptAddition;
|
||||
@ -7940,7 +7940,7 @@ begin
|
||||
ProjectName := Project1.GetTitleOrName;
|
||||
if ProjectName <> '' then
|
||||
begin
|
||||
if EnvironmentOptions.IDEProjectDirectoryInIdeTitle then
|
||||
if EnvironmentOptions.Desktop.IDEProjectDirectoryInIdeTitle then
|
||||
begin
|
||||
DirName := ExtractFileDir(Project1.ProjectInfoFile);
|
||||
if DirName <> '' then
|
||||
@ -7950,8 +7950,8 @@ begin
|
||||
else
|
||||
ProjectName := lisnewProject;
|
||||
NewTitle := AddToCaption(NewCaption, ProjectName);
|
||||
if EnvironmentOptions.IDETitleIncludesBuildMode and (Project1.BuildModes.Count > 1)
|
||||
then
|
||||
if EnvironmentOptions.Desktop.IDETitleIncludesBuildMode
|
||||
and (Project1.BuildModes.Count > 1) then
|
||||
ProjectName:= ProjectName + ' - ' +Project1.ActiveBuildMode.GetCaption;
|
||||
NewCaption := AddToCaption(NewCaption, ProjectName);
|
||||
end;
|
||||
@ -11429,8 +11429,8 @@ var
|
||||
i: Integer;
|
||||
AForm: TCustomForm;
|
||||
begin
|
||||
if EnvironmentOptions.SingleTaskBarButton and FApplicationIsActivate
|
||||
and (MainIDEBar.WindowState=wsNormal) then
|
||||
if EnvironmentOptions.Desktop.SingleTaskBarButton and FApplicationIsActivate
|
||||
and (MainIDEBar.WindowState=wsNormal) then
|
||||
begin
|
||||
for i:=Screen.CustomFormCount-1 downto 0 do
|
||||
begin
|
||||
@ -11449,7 +11449,7 @@ var
|
||||
i, FormCount: integer;
|
||||
AForm: TCustomForm;
|
||||
begin
|
||||
if EnvironmentOptions.SingleTaskBarButton and not FApplicationIsActivate
|
||||
if EnvironmentOptions.Desktop.SingleTaskBarButton and not FApplicationIsActivate
|
||||
and (MainIDEBar.WindowState=wsNormal) then
|
||||
begin
|
||||
FApplicationIsActivate:=true;
|
||||
|
||||
@ -495,13 +495,13 @@ begin
|
||||
|
||||
if Assigned(IDEDockMaster) then
|
||||
begin
|
||||
if EnvironmentOptions.AutoAdjustIDEHeight then
|
||||
if EnvironmentOptions.Desktop.AutoAdjustIDEHeight then
|
||||
IDEDockMaster.AdjustMainIDEWindowHeight(Self, True, ANewHeight)
|
||||
else
|
||||
IDEDockMaster.AdjustMainIDEWindowHeight(Self, False, 0);
|
||||
end else
|
||||
begin
|
||||
if (AIDEIsMaximized or EnvironmentOptions.AutoAdjustIDEHeight) then
|
||||
if (AIDEIsMaximized or EnvironmentOptions.Desktop.AutoAdjustIDEHeight) then
|
||||
begin
|
||||
ANewHeight := ANewHeight + CalcNonClientHeight;
|
||||
if ANewHeight <> Constraints.MaxHeight then
|
||||
@ -651,7 +651,7 @@ var
|
||||
CoolBand: TCoolBand;
|
||||
CoolBarOpts: TIDECoolBarOptions;
|
||||
begin
|
||||
CoolBarOpts := EnvironmentOptions.IDECoolBarOptions;
|
||||
CoolBarOpts := EnvironmentOptions.Desktop.IDECoolBarOptions;
|
||||
//read general settings
|
||||
if not (CoolBarOpts.IDECoolBarGrabStyle in [0..5]) then
|
||||
CoolBarOpts.IDECoolBarGrabStyle := 4;
|
||||
@ -697,7 +697,7 @@ end;
|
||||
|
||||
procedure TMainIDEBar.MainSplitterMoved(Sender: TObject);
|
||||
begin
|
||||
EnvironmentOptions.IDECoolBarOptions.IDECoolBarWidth := CoolBar.Width;
|
||||
EnvironmentOptions.Desktop.IDECoolBarOptions.IDECoolBarWidth := CoolBar.Width;
|
||||
SetMainIDEHeight;
|
||||
end;
|
||||
|
||||
@ -712,7 +712,7 @@ begin
|
||||
if not (Assigned(EnvironmentOptions) and Assigned(CoolBar) and Assigned(ComponentPageControl)) then
|
||||
Exit;
|
||||
|
||||
if EnvironmentOptions.IDECoolBarOptions.IDECoolBarVisible then
|
||||
if EnvironmentOptions.Desktop.IDECoolBarOptions.IDECoolBarVisible then
|
||||
begin
|
||||
for I := 0 to CoolBar.Bands.Count-1 do
|
||||
begin
|
||||
@ -721,7 +721,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
if EnvironmentOptions.ComponentPaletteVisible and Assigned(ComponentPageControl.ActivePage) then
|
||||
if EnvironmentOptions.Desktop.ComponentPaletteVisible and Assigned(ComponentPageControl.ActivePage) then
|
||||
begin
|
||||
ComponentScrollBox := nil;
|
||||
for I := 0 to ComponentPageControl.ActivePage.ControlCount-1 do
|
||||
@ -740,7 +740,7 @@ begin
|
||||
ComponentPageControl.Height - ComponentScrollBox.ClientHeight; //page control non-client height (tabs, borders).
|
||||
Result := Max(Result, NewHeight);
|
||||
|
||||
if not EnvironmentOptions.AutoAdjustIDEHeightFullCompPal then
|
||||
if not EnvironmentOptions.Desktop.AutoAdjustIDEHeightFullCompPal then
|
||||
Break; //we need only one button (we calculate one line only)
|
||||
end;
|
||||
end;
|
||||
@ -764,7 +764,7 @@ begin
|
||||
end
|
||||
end;
|
||||
IDECoolBar.Sort;
|
||||
IDECoolBar.CopyToOptions(EnvironmentOptions.IDECoolBarOptions);
|
||||
IDECoolBar.CopyToOptions(EnvironmentOptions.Desktop.IDECoolBarOptions);
|
||||
SetMainIDEHeight;
|
||||
end;
|
||||
|
||||
|
||||
@ -227,12 +227,14 @@ procedure TMainIDEBase.mnuWindowItemClick(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
Form: TCustomForm;
|
||||
nfd: Boolean;
|
||||
begin
|
||||
i:=Screen.CustomFormCount-1;
|
||||
while (i>=0) do begin
|
||||
Form:=Screen.CustomForms[i];
|
||||
if (EnvironmentOptions.IDENameForDesignedFormList and (Form.Name=(Sender as TIDEMenuCommand).Caption)) or
|
||||
((not EnvironmentOptions.IDENameForDesignedFormList) and (Form.Caption=(Sender as TIDEMenuCommand).Caption)) then
|
||||
nfd := EnvironmentOptions.Desktop.IDENameForDesignedFormList;
|
||||
if (nfd and (Form.Name=(Sender as TIDEMenuCommand).Caption))
|
||||
or ((not nfd) and (Form.Caption=(Sender as TIDEMenuCommand).Caption)) then
|
||||
begin
|
||||
IDEWindowCreators.ShowForm(Form,true);
|
||||
break;
|
||||
@ -246,12 +248,14 @@ var
|
||||
i: Integer;
|
||||
Form: TCustomForm;
|
||||
r, NewBounds: TRect;
|
||||
nfd: Boolean;
|
||||
begin
|
||||
i:=Screen.CustomFormCount-1;
|
||||
while (i>=0) do begin
|
||||
Form:=Screen.CustomForms[i];
|
||||
if (EnvironmentOptions.IDENameForDesignedFormList and (Form.Name=(Sender as TIDEMenuCommand).Caption)) or
|
||||
((not EnvironmentOptions.IDENameForDesignedFormList) and (Form.Caption=(Sender as TIDEMenuCommand).Caption)) then
|
||||
nfd := EnvironmentOptions.Desktop.IDENameForDesignedFormList;
|
||||
if (nfd and (Form.Name=(Sender as TIDEMenuCommand).Caption))
|
||||
or ((not nfd) and (Form.Caption=(Sender as TIDEMenuCommand).Caption)) then
|
||||
begin
|
||||
// show
|
||||
if not Form.IsVisible then
|
||||
@ -779,9 +783,9 @@ begin
|
||||
{$ENDIF}
|
||||
end;
|
||||
CreateMenuItem(ParentMI,itmViewComponentPalette,'itmViewComponentPalette',lisMenuViewComponentPalette, '',
|
||||
true, EnvironmentOptions.ComponentPaletteVisible);
|
||||
true, EnvironmentOptions.Desktop.ComponentPaletteVisible);
|
||||
CreateMenuItem(ParentMI,itmViewIDESpeedButtons,'itmViewIDESpeedButtons',lisMenuViewIDESpeedButtons, '',
|
||||
true, EnvironmentOptions.IDECoolBarOptions.IDECoolBarVisible);
|
||||
true, EnvironmentOptions.Desktop.IDECoolBarOptions.IDECoolBarVisible);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1389,7 +1393,8 @@ begin
|
||||
begin
|
||||
// in the 'bring to front' list
|
||||
CurMenuItem := GetMenuItem(i, itmWindowLists);
|
||||
if EnvironmentOptions.IDENameForDesignedFormList and (TCustomForm(WindowsList[i]).Designer<>nil) then
|
||||
if EnvironmentOptions.Desktop.IDENameForDesignedFormList
|
||||
and (TCustomForm(WindowsList[i]).Designer<>nil) then
|
||||
CurMenuItem.Caption:=TCustomForm(WindowsList[i]).Name
|
||||
else
|
||||
CurMenuItem.Caption:=TCustomForm(WindowsList[i]).Caption;
|
||||
@ -1397,7 +1402,8 @@ begin
|
||||
CurMenuItem.OnClick:=@mnuWindowItemClick;
|
||||
// in the 'center' list
|
||||
CurMenuItem := GetMenuItem(i, itmCenterWindowLists);
|
||||
if EnvironmentOptions.IDENameForDesignedFormList and (TCustomForm(WindowsList[i]).Designer<>nil) then
|
||||
if EnvironmentOptions.Desktop.IDENameForDesignedFormList
|
||||
and (TCustomForm(WindowsList[i]).Designer<>nil) then
|
||||
CurMenuItem.Caption:=TCustomForm(WindowsList[i]).Name
|
||||
else
|
||||
CurMenuItem.Caption:=TCustomForm(WindowsList[i]).Caption;
|
||||
|
||||
@ -1662,8 +1662,8 @@ end;
|
||||
|
||||
procedure TSourceEditCompletion.CompletionFormResized(Sender: TObject);
|
||||
begin
|
||||
EnvironmentOptions.CompletionWindowWidth := TheForm.Width;
|
||||
EnvironmentOptions.CompletionWindowHeight := TheForm.NbLinesInWindow;
|
||||
EnvironmentOptions.Desktop.CompletionWindowWidth := TheForm.Width;
|
||||
EnvironmentOptions.Desktop.CompletionWindowHeight := TheForm.NbLinesInWindow;
|
||||
end;
|
||||
|
||||
procedure TSourceEditCompletion.ccExecute(Sender: TObject);
|
||||
@ -2257,8 +2257,8 @@ begin
|
||||
OnPositionChanged:=@OnSynCompletionPositionChanged;
|
||||
ShortCut:=Menus.ShortCut(VK_UNKNOWN,[]);
|
||||
TheForm.ShowSizeDrag := True;
|
||||
TheForm.Width := Max(50, EnvironmentOptions.CompletionWindowWidth);
|
||||
TheForm.NbLinesInWindow := Max(3, EnvironmentOptions.CompletionWindowHeight);
|
||||
TheForm.Width := Max(50, EnvironmentOptions.Desktop.CompletionWindowWidth);
|
||||
TheForm.NbLinesInWindow := Max(3, EnvironmentOptions.Desktop.CompletionWindowHeight);
|
||||
TheForm.OnDragResized := @CompletionFormResized;
|
||||
end;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user