From b502da52e6e3ce5bff465ba9ef89ddbeec4a2d0d Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 3 Mar 2008 20:46:14 +0000 Subject: [PATCH] IDE: added anchordocking controls git-svn-id: trunk@14396 - --- ide/codeexplorer.pas | 12 +++++++++--- ide/fpdoceditwindow.pas | 10 ++++++++-- ide/main.pp | 7 +++++++ ide/mainbar.pas | 17 ++++++++++++++++- ide/msgview.pp | 12 +++++++++--- ide/projectinspector.pas | 16 +++++++++------- ide/uniteditor.pp | 7 +++++++ 7 files changed, 65 insertions(+), 16 deletions(-) diff --git a/ide/codeexplorer.pas b/ide/codeexplorer.pas index 987d3b71d5..80b865becf 100644 --- a/ide/codeexplorer.pas +++ b/ide/codeexplorer.pas @@ -40,12 +40,12 @@ interface uses // FCL+LCL Classes, SysUtils, LCLProc, LCLType, LResources, Forms, Controls, Graphics, - Dialogs, Buttons, ComCtrls, Menus, + Dialogs, Buttons, ComCtrls, Menus, LDockCtrl, // CodeTools CodeToolManager, CodeAtom, CodeCache, CodeTree, KeywordFuncLists, FindDeclarationTool, DirectivesTree, PascalParserTool, // IDE Intf - IDECommands, MenuIntf, + LazIDEIntf, IDECommands, MenuIntf, // IDE LazarusIDEStrConsts, EnvironmentOpts, IDEOptionDefs, InputHistory, IDEProcs, CodeExplOpts, StdCtrls, ExtCtrls; @@ -91,6 +91,7 @@ type RefreshSpeedButton: TSpeedButton; ModeSpeedButton: TSpeedButton; TreePopupmenu: TPopupMenu; + ControlDocker: TLazControlDocker; procedure CodeExplorerViewClose(Sender: TObject; var CloseAction: TCloseAction); procedure CodeExplorerViewCreate(Sender: TObject); @@ -310,7 +311,12 @@ begin Name:=NonModalIDEWindowNames[nmiwCodeExplorerName]; Caption := lisMenuViewCodeExplorer; EnvironmentOptions.IDEWindowLayoutList.Apply(Self,Name); - + ControlDocker:=TLazControlDocker.Create(Self); + ControlDocker.Name:='CodeExplorer'; + {$IFDEF EnableIDEDocking} + ControlDocker.Manager:=LazarusIDE.DockingManager; + {$ENDIF} + RefreshSpeedButton.Hint:=dlgUnitDepRefresh; OptionsSpeedButton.Hint:=dlgFROpts; CodeFilterEdit.Text:=lisCEFilter; diff --git a/ide/fpdoceditwindow.pas b/ide/fpdoceditwindow.pas index 444b5d9eb8..1fa6c594ae 100644 --- a/ide/fpdoceditwindow.pas +++ b/ide/fpdoceditwindow.pas @@ -34,14 +34,14 @@ uses Classes, SysUtils, StrUtils, // LCL LCLProc, LResources, StdCtrls, Buttons, ComCtrls, Controls, Dialogs, - ExtCtrls, Forms, Graphics, + LDockCtrl, ExtCtrls, Forms, Graphics, // Synedit SynEdit, // codetools FileProcs, CodeAtom, CodeCache, CodeToolManager, Laz_DOM, Laz_XMLRead, Laz_XMLWrite, // IDEIntf - IDEHelpIntf, LazHelpIntf, + LazIDEIntf, IDEHelpIntf, LazHelpIntf, // IDE IDEOptionDefs, EnvironmentOpts, IDEProcs, LazarusIDEStrConsts, FPDocSelectInherited, FPDocSelectLink, @@ -96,6 +96,7 @@ type InsertLinkSpeedButton: TSpeedButton; UnderlineFormatButton: TSpeedButton; SeeAlsoTabSheet: TTabSheet; + ControlDocker: TLazControlDocker; procedure AddLinkButtonClick(Sender: TObject); procedure AddLinkToInheritedButtonClick(Sender: TObject); procedure BrowseExampleButtonClick(Sender: TObject); @@ -280,6 +281,11 @@ begin Name := NonModalIDEWindowNames[nmiwFPDocEditorName]; EnvironmentOptions.IDEWindowLayoutList.Apply(Self, Name); + ControlDocker:=TLazControlDocker.Create(Self); + ControlDocker.Name:='FPDocEditor'; + {$IFDEF EnableIDEDocking} + ControlDocker.Manager:=LazarusIDE.DockingManager; + {$ENDIF} end; procedure TFPDocEditor.FormDestroy(Sender: TObject); diff --git a/ide/main.pp b/ide/main.pp index 5a96974266..972f2df98b 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -1605,6 +1605,8 @@ begin end; procedure TMainIDE.SetupObjectInspector; +var + OIControlDocker: TLazControlDocker; begin ObjectInspector1 := TObjectInspectorDlg.Create(OwningComponent); ObjectInspector1.BorderStyle:=bsSizeable; @@ -1621,6 +1623,11 @@ begin ObjectInspector1.OnShowOptions:=@OIOnShowOptions; ObjectInspector1.OnViewIssues:=@OIOnViewIssues; ObjectInspector1.OnDestroy:=@OIOnDestroy; + OIControlDocker:=TLazControlDocker.Create(ObjectInspector1); + OIControlDocker.Name:='ObjectInspector'; + {$IFDEF EnableIDEDocking} + OIControlDocker.Manager:=LazarusIDE.DockingManager; + {$ENDIF} IDECmdScopeObjectInspectorOnly.AddWindowClass(TObjectInspectorDlg); GlobalDesignHook:=TPropertyEditorHook.Create; diff --git a/ide/mainbar.pas b/ide/mainbar.pas index febb588fc8..303504f52e 100644 --- a/ide/mainbar.pas +++ b/ide/mainbar.pas @@ -40,7 +40,9 @@ uses MemCheck, {$ENDIF} Classes, StdCtrls, Forms, Controls, Buttons, Menus, ComCtrls, ExtCtrls, - Dialogs, MenuIntf; + Dialogs, LDockCtrl, + // IDEIntf + MenuIntf, LazIDEIntf; type { TMainIDEBar } @@ -335,6 +337,8 @@ type private FOldWindowState: TWindowState; public + ControlDocker: TLazControlDocker; + constructor Create(TheOwner: TComponent); override; procedure HideIDE; procedure UnhideIDE; end; @@ -346,6 +350,17 @@ implementation { TMainIDEBar } +constructor TMainIDEBar.Create(TheOwner: TComponent); +begin + inherited Create(TheOwner); + + ControlDocker:=TLazControlDocker.Create(Self); + ControlDocker.Name:='MainIDEBar'; + {$IFDEF EnableIDEDocking} + ControlDocker.Manager:=LazarusIDE.DockingManager; + {$ENDIF} +end; + procedure TMainIDEBar.HideIDE; begin if WindowState=wsMinimized then exit; diff --git a/ide/msgview.pp b/ide/msgview.pp index 0f6891f61a..04399b3dd1 100644 --- a/ide/msgview.pp +++ b/ide/msgview.pp @@ -41,8 +41,8 @@ interface uses Classes, SysUtils, AVL_Tree, LCLProc, LResources, ClipBrd, Controls, Dialogs, FileUtil, Forms, Menus, - StdCtrls, ComCtrls, - IDEExternToolIntf, IDECommands, MenuIntf, IDEMsgIntf, + StdCtrls, ComCtrls, LDockCtrl, + IDEExternToolIntf, IDECommands, MenuIntf, IDEMsgIntf, LazIDEIntf, DialogProcs, EnvironmentOpts, LazarusIDEStrConsts, IDEOptionDefs, IDEProcs, InputHistory, KeyMapping; @@ -110,6 +110,7 @@ type procedure UpdateMsgSrcPos(Line: TLazMessageLine); function GetLines(Index: integer): TIDEMessageLine; override; public + ControlDocker: TLazControlDocker; constructor Create(TheOwner: TComponent); override; destructor Destroy; override; procedure DeleteLine(Index: integer); @@ -302,7 +303,12 @@ begin MsgSaveAllToFileIDEMenuCommand.OnClick := @SaveAllToFileMenuItemClick; EnvironmentOptions.IDEWindowLayoutList.Apply(Self, Name); - + ControlDocker:=TLazControlDocker.Create(Self); + ControlDocker.Name:='Messages'; + {$IFDEF EnableIDEDocking} + ControlDocker.Manager:=LazarusIDE.DockingManager; + {$ENDIF} + FQuickFixItems:=TFPList.Create; end; diff --git a/ide/projectinspector.pas b/ide/projectinspector.pas index 31be646a4d..b66999d0fe 100644 --- a/ide/projectinspector.pas +++ b/ide/projectinspector.pas @@ -39,8 +39,8 @@ interface uses Classes, SysUtils, LCLProc, AvgLvlTree, LResources, Forms, Controls, Buttons, - ComCtrls, StdCtrls, Menus, Dialogs, Graphics, FileUtil, - IDECommands, + LDockCtrl, ComCtrls, StdCtrls, Menus, Dialogs, Graphics, FileUtil, + LazIDEIntf, IDECommands, LazarusIDEStrConsts, IDEProcs, IDEOptionDefs, EnvironmentOpts, Project, AddToProjectDlg, PackageSystem, PackageDefs; @@ -70,6 +70,7 @@ type OptionsBitBtn: TBitBtn; ItemsTreeView: TTreeView; ItemsPopupMenu: TPopupMenu; + ControlDocker: TLazControlDocker; procedure AddBitBtnClick(Sender: TObject); procedure ItemsPopupMenuPopup(Sender: TObject); procedure ItemsTreeViewDblClick(Sender: TObject); @@ -689,17 +690,18 @@ begin end; constructor TProjectInspectorForm.Create(TheOwner: TComponent); -var - ALayout: TIDEWindowLayout; begin inherited Create(TheOwner); Name:=NonModalIDEWindowNames[nmiwProjectInspector]; Caption:=lisMenuProjectInspector; KeyPreview:=true; - ALayout:=EnvironmentOptions.IDEWindowLayoutList.ItemByFormID(Name); - ALayout.Form:=TForm(Self); - ALayout.Apply; + EnvironmentOptions.IDEWindowLayoutList.Apply(Self,Name); + ControlDocker:=TLazControlDocker.Create(Self); + ControlDocker.Name:='ProjectInspector'; + {$IFDEF EnableIDEDocking} + ControlDocker.Manager:=LazarusIDE.DockingManager; + {$ENDIF} SetupComponents; KeyPreview:=true; diff --git a/ide/uniteditor.pp b/ide/uniteditor.pp index 1dc43cd601..75ee62893b 100644 --- a/ide/uniteditor.pp +++ b/ide/uniteditor.pp @@ -44,6 +44,7 @@ uses Classes, SysUtils, Math, Controls, LCLProc, LCLType, LResources, LCLIntf, FileUtil, Forms, Buttons, ComCtrls, Dialogs, StdCtrls, GraphType, Graphics, Translations, ClipBrd, TypInfo, Extctrls, Menus, HelpIntfs, LazHelpIntf, + LDockCtrl, // codetools CodeToolManager, CodeCache, SourceLog, // synedit @@ -612,6 +613,7 @@ type public FindReplaceDlgHistoryIndex: array[TFindDlgComponent] of integer; FindReplaceDlgUserText: array[TFindDlgComponent] of string; + ControlDocker: TLazControlDocker; constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -2969,6 +2971,11 @@ begin SourceEditorWindow:=Self; EnvironmentOptions.IDEWindowLayoutList.Apply(Self,Name); + ControlDocker:=TLazControlDocker.Create(Self); + ControlDocker.Name:='SourceEditor'; + {$IFDEF EnableIDEDocking} + ControlDocker.Manager:=LazarusIDE.DockingManager; + {$ENDIF} FSourceEditorList := TList.Create; FUnUsedEditorComponents := TList.Create;