anchordocking: comments

git-svn-id: trunk@26062 -
This commit is contained in:
mattias 2010-06-12 17:04:32 +00:00
parent 9e959c5e20
commit 627414f637
2 changed files with 13 additions and 3 deletions

View File

@ -62,6 +62,8 @@
- dock site: MakeDockSite for forms, that should be able to dock other sites,
but should not be docked themselves. Their Parent is always nil.
- design time package for IDE
- dnd move page index
- dnd move page to another pagecontrol
ToDo:
- popup menu
@ -73,8 +75,6 @@
example how to dock in code
step by step how to use it in applications
- simple way to make forms dockable at designtime
- dnd move page index
- dnd move page to another pagecontrol
- minimize button and Hide => show in header
- on close button: save a default layout
- on show again: restore a default layout

View File

@ -81,12 +81,17 @@ procedure TMainIDE.DockMasterCreateControl(Sender: TObject; aName: string; var
end;
begin
// first check if the form already exists
// the LCL Screen has a list of all existing forms.
// Note: Remember that the LCL allows as form names only standard
// pascal identifiers and compares them case insensitive
AControl:=Screen.FindForm(aName);
if AControl<>nil then begin
// if it already exists, just disable autosizing if requested
if DoDisableAutoSizing then
AControl.DisableAutoSizing;
exit;
end;
// if the form does not yet exist, create it
if aName='CodeExplorer' then
CreateForm('Code Explorer',Bounds(700,230,100,250))
else if aName='FPDocEditor' then
@ -194,8 +199,10 @@ var
XMLConfig: TXMLConfigStorage;
begin
try
// create a new xml config file
XMLConfig:=TXMLConfigStorage.Create(Filename,false);
try
// save the current layout of all forms
DockMaster.SaveLayoutToConfig(XMLConfig);
XMLConfig.WriteToDisk;
finally
@ -215,8 +222,11 @@ var
XMLConfig: TXMLConfigStorage;
begin
try
// load the xml config file
XMLConfig:=TXMLConfigStorage.Create(Filename,True);
try
// restore the layout
// this will close unneeded forms and call OnCreateControl for all needed
DockMaster.LoadLayoutFromConfig(XMLConfig);
finally
XMLConfig.Free;