diff --git a/.gitattributes b/.gitattributes index 8a1291cd6b..3746fb1ea1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -605,6 +605,7 @@ components/anchordocking/anchordockoptionsdlg.pas svneol=native#text/plain components/anchordocking/anchordockpkg.pas svneol=native#text/plain components/anchordocking/anchordockstorage.pas svneol=native#text/plain components/anchordocking/anchordockstr.pas svneol=native#text/plain +components/anchordocking/design/ADLayoutDefault.lrs svneol=native#text/pascal components/anchordocking/design/ADLayoutDefault.xml svneol=native#text/plain components/anchordocking/design/anchordesktopoptions.pas svneol=native#text/pascal components/anchordocking/design/anchordockingdsgn.lpk svneol=native#text/plain diff --git a/components/anchordocking/design/ADLayoutDefault.lrs b/components/anchordocking/design/ADLayoutDefault.lrs new file mode 100644 index 0000000000..8320b28655 --- /dev/null +++ b/components/anchordocking/design/ADLayoutDefault.lrs @@ -0,0 +1,51 @@ +LazarusResources.Add('ADLayoutDefault','XML',[ + ''#13#10''#13#10' '#13#10' '#13#10' '#13#10' '#13#10' ' + +' '#13#10' '#13#10 + +' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13 + +#10' '#13#10'
'#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10 + +' '#13#10 + +' '#13#10 + +' '#13#10' '#13#10' '#13 + +#10' '#13#10' '#13 + +#10' '#13#10' <' + +'Bounds Width="932" Height="119"/>'#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' ' + +' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' ' + +' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13 + +#10' '#13#10' '#13 + +#10' '#13#10' ' + +' '#13#10' '#13#10' '#13#10' '#13#10' ' + +' '#13#10' ' + +' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' ' + +''#13#10' '#13#10' '#13#10' ' + +#13#10''#13#10 +]); diff --git a/components/anchordocking/design/ADLayoutDefault.xml b/components/anchordocking/design/ADLayoutDefault.xml index 68e6d569ce..2bf9be3daa 100644 --- a/components/anchordocking/design/ADLayoutDefault.xml +++ b/components/anchordocking/design/ADLayoutDefault.xml @@ -3,34 +3,69 @@ - + - + - - + + - - + +
- - + + - - - + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + diff --git a/components/anchordocking/design/anchordesktopoptions.pas b/components/anchordocking/design/anchordesktopoptions.pas index 1fc709d7cf..439fe6d281 100644 --- a/components/anchordocking/design/anchordesktopoptions.pas +++ b/components/anchordocking/design/anchordesktopoptions.pas @@ -6,7 +6,7 @@ interface uses Classes, SysUtils, - LCLProc, Forms, Controls, + LCLProc, Forms, Controls, LCLType, LResources, LazFileUtils, LazConfigStorage, Laz2_XMLCfg, IDEOptionsIntf, MacroIntf, LazIDEIntf, BaseIDEIntf, AnchorDocking, AnchorDockStorage; @@ -29,6 +29,7 @@ type procedure LoadLegacyAnchorDockOptions; procedure LoadLayoutFromConfig(Path: string; aXMLCfg: TRttiXMLConfig); procedure LoadLayoutFromFile(FileName: string); + procedure LoadLayoutFromRessource; procedure SaveMainLayoutToTree; procedure SaveLayoutToConfig(Path: string; aXMLCfg: TRttiXMLConfig); @@ -118,22 +119,13 @@ end; procedure TAnchorDesktopOpt.LoadDefaultLayout; var - BaseDir: String; Filename: String; begin Filename := AppendPathDelim(LazarusIDE.GetPrimaryConfigPath)+'anchordocklayout.xml'; if FileExistsUTF8(Filename) then//first load from anchordocklayout.xml -- backwards compatibility LoadLayoutFromFile(Filename) else - begin - BaseDir := '$PkgDir(AnchorDockingDsgn)'; - IDEMacros.SubstituteMacros(BaseDir); - if (BaseDir<>'') and DirectoryExistsUTF8(BaseDir) then begin - Filename:=AppendPathDelim(BaseDir)+'ADLayoutDefault.xml'; - if FileExistsUTF8(Filename) then - LoadLayoutFromFile(Filename); - end; - end; + LoadLayoutFromRessource; end; procedure TAnchorDesktopOpt.LoadDefaults; @@ -175,6 +167,25 @@ begin end; end; +procedure TAnchorDesktopOpt.LoadLayoutFromRessource; +var + Config: TRttiXMLConfig; + LayoutResource: TLazarusResourceStream; +begin + LayoutResource := TLazarusResourceStream.Create('ADLayoutDefault', nil); + try + Config := TRttiXMLConfig.Create(nil); + try + Config.ReadFromStream(LayoutResource); + LoadLayoutFromConfig('',Config); + finally + Config.Free; + end; + finally + LayoutResource.Free; + end; +end; + procedure TAnchorDesktopOpt.LoadLegacyAnchorDockOptions; var Config: TConfigStorage; @@ -282,5 +293,9 @@ begin Result := DockMaster.FullRestoreLayout(FTree,True); end; +initialization + +{$I ADLayoutDefault.lrs} + end.