mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 18:59:06 +02:00
dockmanager example: improved notebook behavior
git-svn-id: trunk@22683 -
This commit is contained in:
parent
ebd7b6e721
commit
6bbef2ef01
@ -8,7 +8,7 @@
|
|||||||
<TargetFileExt Value=".exe"/>
|
<TargetFileExt Value=".exe"/>
|
||||||
<Icon Value="0"/>
|
<Icon Value="0"/>
|
||||||
<UseXPManifest Value="True"/>
|
<UseXPManifest Value="True"/>
|
||||||
<ActiveEditorIndexAtStart Value="2"/>
|
<ActiveEditorIndexAtStart Value="5"/>
|
||||||
</General>
|
</General>
|
||||||
<VersionInfo>
|
<VersionInfo>
|
||||||
<ProjectVersion Value=""/>
|
<ProjectVersion Value=""/>
|
||||||
@ -33,16 +33,14 @@
|
|||||||
<PackageName Value="LCL"/>
|
<PackageName Value="LCL"/>
|
||||||
</Item2>
|
</Item2>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="19">
|
<Units Count="32">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="MakeSite.lpr"/>
|
<Filename Value="MakeSite.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="MakeSite"/>
|
<UnitName Value="MakeSite"/>
|
||||||
<CursorPos X="51" Y="18"/>
|
<CursorPos X="51" Y="18"/>
|
||||||
<TopLine Value="1"/>
|
<TopLine Value="1"/>
|
||||||
<EditorIndex Value="5"/>
|
<UsageCount Value="65"/>
|
||||||
<UsageCount Value="28"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="fmastersite.pas"/>
|
<Filename Value="fmastersite.pas"/>
|
||||||
@ -50,29 +48,29 @@
|
|||||||
<ComponentName Value="MasterSite"/>
|
<ComponentName Value="MasterSite"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="fMasterSite"/>
|
<UnitName Value="fMasterSite"/>
|
||||||
<CursorPos X="24" Y="35"/>
|
<CursorPos X="1" Y="43"/>
|
||||||
<TopLine Value="9"/>
|
<TopLine Value="1"/>
|
||||||
<EditorIndex Value="0"/>
|
<EditorIndex Value="0"/>
|
||||||
<UsageCount Value="28"/>
|
<UsageCount Value="65"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\package\umakesite.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="uMakeSite"/>
|
<UnitName Value="uMakeSite"/>
|
||||||
<CursorPos X="34" Y="212"/>
|
<CursorPos X="32" Y="225"/>
|
||||||
<TopLine Value="196"/>
|
<TopLine Value="195"/>
|
||||||
<EditorIndex Value="2"/>
|
<EditorIndex Value="2"/>
|
||||||
<UsageCount Value="28"/>
|
<UsageCount Value="65"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit2>
|
</Unit2>
|
||||||
<Unit3>
|
<Unit3>
|
||||||
<Filename Value="..\..\..\lcl\controls.pp"/>
|
<Filename Value="..\..\..\lcl\controls.pp"/>
|
||||||
<UnitName Value="Controls"/>
|
<UnitName Value="Controls"/>
|
||||||
<CursorPos X="27" Y="1221"/>
|
<CursorPos X="15" Y="1773"/>
|
||||||
<TopLine Value="1198"/>
|
<TopLine Value="1750"/>
|
||||||
<EditorIndex Value="12"/>
|
<EditorIndex Value="9"/>
|
||||||
<UsageCount Value="14"/>
|
<UsageCount Value="32"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit3>
|
</Unit3>
|
||||||
<Unit4>
|
<Unit4>
|
||||||
@ -80,7 +78,7 @@
|
|||||||
<UnitName Value="ExtCtrls"/>
|
<UnitName Value="ExtCtrls"/>
|
||||||
<CursorPos X="24" Y="1109"/>
|
<CursorPos X="24" Y="1109"/>
|
||||||
<TopLine Value="1086"/>
|
<TopLine Value="1086"/>
|
||||||
<UsageCount Value="13"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit4>
|
</Unit4>
|
||||||
<Unit5>
|
<Unit5>
|
||||||
<Filename Value="..\package\felasticsite.pas"/>
|
<Filename Value="..\package\felasticsite.pas"/>
|
||||||
@ -90,14 +88,12 @@
|
|||||||
<UnitName Value="fElasticSite"/>
|
<UnitName Value="fElasticSite"/>
|
||||||
<CursorPos X="1" Y="82"/>
|
<CursorPos X="1" Y="82"/>
|
||||||
<TopLine Value="63"/>
|
<TopLine Value="63"/>
|
||||||
<EditorIndex Value="8"/>
|
<UsageCount Value="24"/>
|
||||||
<UsageCount Value="14"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit5>
|
</Unit5>
|
||||||
<Unit6>
|
<Unit6>
|
||||||
<Filename Value="..\..\..\..\..\lazarus\fpc\2.2.4\source\rtl\objpas\classes\classesh.inc"/>
|
<Filename Value="..\..\..\..\..\lazarus\fpc\2.2.4\source\rtl\objpas\classes\classesh.inc"/>
|
||||||
<CursorPos X="10" Y="1775"/>
|
<CursorPos X="15" Y="1515"/>
|
||||||
<TopLine Value="1752"/>
|
<TopLine Value="1492"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit6>
|
</Unit6>
|
||||||
<Unit7>
|
<Unit7>
|
||||||
@ -107,86 +103,83 @@
|
|||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="fClientForm"/>
|
<UnitName Value="fClientForm"/>
|
||||||
<CursorPos X="1" Y="57"/>
|
<CursorPos X="10" Y="38"/>
|
||||||
<TopLine Value="27"/>
|
<TopLine Value="12"/>
|
||||||
<EditorIndex Value="6"/>
|
<EditorIndex Value="8"/>
|
||||||
<UsageCount Value="28"/>
|
<UsageCount Value="65"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit7>
|
</Unit7>
|
||||||
<Unit8>
|
<Unit8>
|
||||||
<Filename Value="..\..\..\lcl\include\winapih.inc"/>
|
<Filename Value="..\..\..\lcl\include\winapih.inc"/>
|
||||||
<CursorPos X="10" Y="287"/>
|
<CursorPos X="10" Y="287"/>
|
||||||
<TopLine Value="263"/>
|
<TopLine Value="263"/>
|
||||||
<EditorIndex Value="9"/>
|
<UsageCount Value="16"/>
|
||||||
<UsageCount Value="14"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit8>
|
</Unit8>
|
||||||
<Unit9>
|
<Unit9>
|
||||||
<Filename Value="..\..\..\lcl\include\intfbaselcl.inc"/>
|
<Filename Value="..\..\..\lcl\include\intfbaselcl.inc"/>
|
||||||
<CursorPos X="3" Y="32"/>
|
<CursorPos X="3" Y="32"/>
|
||||||
<TopLine Value="29"/>
|
<TopLine Value="29"/>
|
||||||
<EditorIndex Value="10"/>
|
<UsageCount Value="16"/>
|
||||||
<UsageCount Value="14"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit9>
|
</Unit9>
|
||||||
<Unit10>
|
<Unit10>
|
||||||
<Filename Value="..\..\..\lcl\include\lclintfh.inc"/>
|
<Filename Value="..\..\..\lcl\include\lclintfh.inc"/>
|
||||||
<CursorPos X="10" Y="40"/>
|
<CursorPos X="10" Y="40"/>
|
||||||
<TopLine Value="16"/>
|
<TopLine Value="16"/>
|
||||||
<EditorIndex Value="11"/>
|
<UsageCount Value="16"/>
|
||||||
<UsageCount Value="14"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit10>
|
</Unit10>
|
||||||
<Unit11>
|
<Unit11>
|
||||||
<Filename Value="..\package\easydocksite.pas"/>
|
<Filename Value="..\package\easydocksite.pas"/>
|
||||||
<UnitName Value="EasyDockSite"/>
|
<UnitName Value="EasyDockSite"/>
|
||||||
<CursorPos X="1" Y="924"/>
|
<CursorPos X="21" Y="288"/>
|
||||||
<TopLine Value="920"/>
|
<TopLine Value="265"/>
|
||||||
<EditorIndex Value="4"/>
|
<EditorIndex Value="4"/>
|
||||||
<UsageCount Value="13"/>
|
<UsageCount Value="31"/>
|
||||||
|
<Bookmarks Count="1">
|
||||||
|
<Item0 X="1" Y="1537" ID="2"/>
|
||||||
|
</Bookmarks>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit11>
|
</Unit11>
|
||||||
<Unit12>
|
<Unit12>
|
||||||
<Filename Value="..\..\..\lcl\forms.pp"/>
|
<Filename Value="..\..\..\lcl\forms.pp"/>
|
||||||
<UnitName Value="Forms"/>
|
<UnitName Value="Forms"/>
|
||||||
<CursorPos X="19" Y="692"/>
|
<CursorPos X="15" Y="577"/>
|
||||||
<TopLine Value="669"/>
|
<TopLine Value="553"/>
|
||||||
<EditorIndex Value="3"/>
|
<EditorIndex Value="3"/>
|
||||||
<UsageCount Value="11"/>
|
<UsageCount Value="29"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit12>
|
</Unit12>
|
||||||
<Unit13>
|
<Unit13>
|
||||||
<Filename Value="..\..\..\lcl\include\customform.inc"/>
|
<Filename Value="..\..\..\lcl\include\customform.inc"/>
|
||||||
<CursorPos X="16" Y="1574"/>
|
<CursorPos X="16" Y="2424"/>
|
||||||
<TopLine Value="1559"/>
|
<TopLine Value="2422"/>
|
||||||
<UsageCount Value="11"/>
|
<EditorIndex Value="13"/>
|
||||||
|
<UsageCount Value="12"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
</Unit13>
|
</Unit13>
|
||||||
<Unit14>
|
<Unit14>
|
||||||
<Filename Value="..\..\..\..\..\lazarus\fpc\2.2.4\source\rtl\inc\objpash.inc"/>
|
<Filename Value="..\..\..\..\..\lazarus\fpc\2.2.4\source\rtl\inc\objpash.inc"/>
|
||||||
<CursorPos X="23" Y="151"/>
|
<CursorPos X="23" Y="151"/>
|
||||||
<TopLine Value="128"/>
|
<TopLine Value="128"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="7"/>
|
||||||
</Unit14>
|
</Unit14>
|
||||||
<Unit15>
|
<Unit15>
|
||||||
<Filename Value="..\..\..\..\..\lazarus\fpc\2.2.4\source\rtl\objpas\classes\cregist.inc"/>
|
<Filename Value="..\..\..\..\..\lazarus\fpc\2.2.4\source\rtl\objpas\classes\cregist.inc"/>
|
||||||
<CursorPos X="3" Y="92"/>
|
<CursorPos X="3" Y="92"/>
|
||||||
<TopLine Value="88"/>
|
<TopLine Value="88"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="7"/>
|
||||||
</Unit15>
|
</Unit15>
|
||||||
<Unit16>
|
<Unit16>
|
||||||
<Filename Value="..\package\dockhandle.pas"/>
|
<Filename Value="..\package\dockhandle.pas"/>
|
||||||
<UnitName Value="DockHandle"/>
|
<UnitName Value="DockHandle"/>
|
||||||
<CursorPos X="20" Y="22"/>
|
<CursorPos X="20" Y="22"/>
|
||||||
<TopLine Value="1"/>
|
<TopLine Value="1"/>
|
||||||
<EditorIndex Value="7"/>
|
<UsageCount Value="20"/>
|
||||||
<UsageCount Value="12"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit16>
|
</Unit16>
|
||||||
<Unit17>
|
<Unit17>
|
||||||
<Filename Value="..\..\..\lcl\include\customimage.inc"/>
|
<Filename Value="..\..\..\lcl\include\customimage.inc"/>
|
||||||
<CursorPos X="1" Y="1"/>
|
<CursorPos X="1" Y="1"/>
|
||||||
<TopLine Value="213"/>
|
<TopLine Value="213"/>
|
||||||
<UsageCount Value="11"/>
|
<UsageCount Value="8"/>
|
||||||
</Unit17>
|
</Unit17>
|
||||||
<Unit18>
|
<Unit18>
|
||||||
<Filename Value="..\package\ffloatingsite.pas"/>
|
<Filename Value="..\package\ffloatingsite.pas"/>
|
||||||
@ -194,130 +187,244 @@
|
|||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="fFloatingSite"/>
|
<UnitName Value="fFloatingSite"/>
|
||||||
<CursorPos X="1" Y="1"/>
|
<CursorPos X="9" Y="24"/>
|
||||||
<TopLine Value="1"/>
|
<TopLine Value="4"/>
|
||||||
<EditorIndex Value="1"/>
|
<EditorIndex Value="1"/>
|
||||||
<UsageCount Value="11"/>
|
<UsageCount Value="29"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit18>
|
</Unit18>
|
||||||
|
<Unit19>
|
||||||
|
<Filename Value="..\package\fdockbook.pas"/>
|
||||||
|
<ComponentName Value="EasyDockBook"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="fDockBook"/>
|
||||||
|
<CursorPos X="5" Y="96"/>
|
||||||
|
<TopLine Value="73"/>
|
||||||
|
<EditorIndex Value="5"/>
|
||||||
|
<UsageCount Value="27"/>
|
||||||
|
<Bookmarks Count="1">
|
||||||
|
<Item0 X="1" Y="203" ID="1"/>
|
||||||
|
</Bookmarks>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit19>
|
||||||
|
<Unit20>
|
||||||
|
<Filename Value="..\package\easydockmgr.pas"/>
|
||||||
|
<UnitName Value="EasyDockMgr"/>
|
||||||
|
<CursorPos X="7" Y="10"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="7"/>
|
||||||
|
<UsageCount Value="27"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit20>
|
||||||
|
<Unit21>
|
||||||
|
<Filename Value="..\package\fpageframe.pas"/>
|
||||||
|
<ComponentName Value="PageFrame"/>
|
||||||
|
<ResourceBaseClass Value="Frame"/>
|
||||||
|
<UnitName Value="fPageFrame"/>
|
||||||
|
<CursorPos X="1" Y="311"/>
|
||||||
|
<TopLine Value="271"/>
|
||||||
|
<UsageCount Value="16"/>
|
||||||
|
<Bookmarks Count="1">
|
||||||
|
<Item0 X="1" Y="128" ID="1"/>
|
||||||
|
</Bookmarks>
|
||||||
|
</Unit21>
|
||||||
|
<Unit22>
|
||||||
|
<Filename Value="..\..\..\lcl\include\customframe.inc"/>
|
||||||
|
<CursorPos X="3" Y="177"/>
|
||||||
|
<TopLine Value="135"/>
|
||||||
|
<UsageCount Value="16"/>
|
||||||
|
</Unit22>
|
||||||
|
<Unit23>
|
||||||
|
<Filename Value="..\..\..\lcl\lcltype.pp"/>
|
||||||
|
<UnitName Value="LCLType"/>
|
||||||
|
<CursorPos X="3" Y="118"/>
|
||||||
|
<TopLine Value="95"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit23>
|
||||||
|
<Unit24>
|
||||||
|
<Filename Value="..\..\..\lcl\lmessages.pp"/>
|
||||||
|
<UnitName Value="LMessages"/>
|
||||||
|
<CursorPos X="3" Y="769"/>
|
||||||
|
<TopLine Value="746"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit24>
|
||||||
|
<Unit25>
|
||||||
|
<Filename Value="..\..\..\..\..\lazarus\fpc\2.2.4\source\rtl\objpas\classes\compon.inc"/>
|
||||||
|
<CursorPos X="3" Y="538"/>
|
||||||
|
<TopLine Value="535"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit25>
|
||||||
|
<Unit26>
|
||||||
|
<Filename Value="..\..\..\lcl\include\control.inc"/>
|
||||||
|
<CursorPos X="48" Y="3878"/>
|
||||||
|
<TopLine Value="3844"/>
|
||||||
|
<EditorIndex Value="12"/>
|
||||||
|
<UsageCount Value="17"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit26>
|
||||||
|
<Unit27>
|
||||||
|
<Filename Value="..\..\..\lcl\include\wincontrol.inc"/>
|
||||||
|
<CursorPos X="3" Y="5101"/>
|
||||||
|
<TopLine Value="5096"/>
|
||||||
|
<EditorIndex Value="10"/>
|
||||||
|
<UsageCount Value="17"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit27>
|
||||||
|
<Unit28>
|
||||||
|
<Filename Value="..\..\..\lcl\include\dragdock.inc"/>
|
||||||
|
<CursorPos X="10" Y="21"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="15"/>
|
||||||
|
<UsageCount Value="17"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit28>
|
||||||
|
<Unit29>
|
||||||
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
|
<CursorPos X="1" Y="730"/>
|
||||||
|
<TopLine Value="687"/>
|
||||||
|
<EditorIndex Value="11"/>
|
||||||
|
<UsageCount Value="12"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit29>
|
||||||
|
<Unit30>
|
||||||
|
<Filename Value="..\..\..\lcl\include\application.inc"/>
|
||||||
|
<CursorPos X="1" Y="2074"/>
|
||||||
|
<TopLine Value="2051"/>
|
||||||
|
<EditorIndex Value="14"/>
|
||||||
|
<UsageCount Value="12"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit30>
|
||||||
|
<Unit31>
|
||||||
|
<Filename Value="..\..\..\lcl\include\toolbutton.inc"/>
|
||||||
|
<CursorPos X="1" Y="700"/>
|
||||||
|
<TopLine Value="677"/>
|
||||||
|
<EditorIndex Value="6"/>
|
||||||
|
<UsageCount Value="12"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit31>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="29" HistoryIndex="28">
|
<JumpHistory Count="30" HistoryIndex="29">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="135" Column="1" TopLine="112"/>
|
<Caret Line="518" Column="1" TopLine="495"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="136" Column="1" TopLine="113"/>
|
<Caret Line="527" Column="1" TopLine="504"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
<Position3>
|
||||||
<Filename Value="fmastersite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="36" Column="5" TopLine="1"/>
|
<Caret Line="528" Column="1" TopLine="505"/>
|
||||||
</Position3>
|
</Position3>
|
||||||
<Position4>
|
<Position4>
|
||||||
<Filename Value="fmastersite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="37" Column="1" TopLine="1"/>
|
<Caret Line="117" Column="1" TopLine="94"/>
|
||||||
</Position4>
|
</Position4>
|
||||||
<Position5>
|
<Position5>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="129" Column="1" TopLine="106"/>
|
<Caret Line="118" Column="1" TopLine="95"/>
|
||||||
</Position5>
|
</Position5>
|
||||||
<Position6>
|
<Position6>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="131" Column="1" TopLine="108"/>
|
<Caret Line="119" Column="1" TopLine="96"/>
|
||||||
</Position6>
|
</Position6>
|
||||||
<Position7>
|
<Position7>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="132" Column="1" TopLine="109"/>
|
<Caret Line="120" Column="1" TopLine="97"/>
|
||||||
</Position7>
|
</Position7>
|
||||||
<Position8>
|
<Position8>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="133" Column="1" TopLine="110"/>
|
<Caret Line="121" Column="1" TopLine="98"/>
|
||||||
</Position8>
|
</Position8>
|
||||||
<Position9>
|
<Position9>
|
||||||
<Filename Value="fmastersite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="36" Column="43" TopLine="1"/>
|
<Caret Line="531" Column="1" TopLine="508"/>
|
||||||
</Position9>
|
</Position9>
|
||||||
<Position10>
|
<Position10>
|
||||||
<Filename Value="fmastersite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="14" Column="16" TopLine="1"/>
|
<Caret Line="533" Column="1" TopLine="510"/>
|
||||||
</Position10>
|
</Position10>
|
||||||
<Position11>
|
<Position11>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="148" Column="11" TopLine="127"/>
|
<Caret Line="535" Column="1" TopLine="512"/>
|
||||||
</Position11>
|
</Position11>
|
||||||
<Position12>
|
<Position12>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="155" Column="25" TopLine="117"/>
|
<Caret Line="536" Column="1" TopLine="513"/>
|
||||||
</Position12>
|
</Position12>
|
||||||
<Position13>
|
<Position13>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="140" Column="21" TopLine="117"/>
|
<Caret Line="538" Column="1" TopLine="467"/>
|
||||||
</Position13>
|
</Position13>
|
||||||
<Position14>
|
<Position14>
|
||||||
<Filename Value="fclientform.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="20" Column="3" TopLine="1"/>
|
<Caret Line="619" Column="1" TopLine="596"/>
|
||||||
</Position14>
|
</Position14>
|
||||||
<Position15>
|
<Position15>
|
||||||
<Filename Value="fmastersite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="14" Column="16" TopLine="1"/>
|
<Caret Line="620" Column="1" TopLine="597"/>
|
||||||
</Position15>
|
</Position15>
|
||||||
<Position16>
|
<Position16>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="31" Column="1" TopLine="9"/>
|
<Caret Line="623" Column="1" TopLine="600"/>
|
||||||
</Position16>
|
</Position16>
|
||||||
<Position17>
|
<Position17>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<Caret Line="33" Column="1" TopLine="12"/>
|
<Caret Line="730" Column="1" TopLine="687"/>
|
||||||
</Position17>
|
</Position17>
|
||||||
<Position18>
|
<Position18>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\control.inc"/>
|
||||||
<Caret Line="134" Column="1" TopLine="134"/>
|
<Caret Line="3652" Column="1" TopLine="3629"/>
|
||||||
</Position18>
|
</Position18>
|
||||||
<Position19>
|
<Position19>
|
||||||
<Filename Value="fmastersite.pas"/>
|
<Filename Value="..\..\..\lcl\include\control.inc"/>
|
||||||
<Caret Line="32" Column="1" TopLine="1"/>
|
<Caret Line="667" Column="1" TopLine="644"/>
|
||||||
</Position19>
|
</Position19>
|
||||||
<Position20>
|
<Position20>
|
||||||
<Filename Value="..\package\ffloatingsite.pas"/>
|
<Filename Value="..\..\..\lcl\include\control.inc"/>
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
<Caret Line="658" Column="1" TopLine="635"/>
|
||||||
</Position20>
|
</Position20>
|
||||||
<Position21>
|
<Position21>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\control.inc"/>
|
||||||
<Caret Line="44" Column="3" TopLine="17"/>
|
<Caret Line="1644" Column="1" TopLine="1621"/>
|
||||||
</Position21>
|
</Position21>
|
||||||
<Position22>
|
<Position22>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\wincontrol.inc"/>
|
||||||
<Caret Line="48" Column="71" TopLine="46"/>
|
<Caret Line="5086" Column="1" TopLine="5063"/>
|
||||||
</Position22>
|
</Position22>
|
||||||
<Position23>
|
<Position23>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\customform.inc"/>
|
||||||
<Caret Line="66" Column="24" TopLine="43"/>
|
<Caret Line="1087" Column="1" TopLine="1064"/>
|
||||||
</Position23>
|
</Position23>
|
||||||
<Position24>
|
<Position24>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\package\fdockbook.pas"/>
|
||||||
<Caret Line="156" Column="26" TopLine="131"/>
|
<Caret Line="204" Column="1" TopLine="180"/>
|
||||||
</Position24>
|
</Position24>
|
||||||
<Position25>
|
<Position25>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\package\fdockbook.pas"/>
|
||||||
<Caret Line="157" Column="17" TopLine="134"/>
|
<Caret Line="205" Column="9" TopLine="180"/>
|
||||||
</Position25>
|
</Position25>
|
||||||
<Position26>
|
<Position26>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\customform.inc"/>
|
||||||
<Caret Line="178" Column="15" TopLine="134"/>
|
<Caret Line="2424" Column="16" TopLine="2422"/>
|
||||||
</Position26>
|
</Position26>
|
||||||
<Position27>
|
<Position27>
|
||||||
<Filename Value="..\package\umakesite.pas"/>
|
<Filename Value="..\..\..\lcl\include\control.inc"/>
|
||||||
<Caret Line="37" Column="25" TopLine="13"/>
|
<Caret Line="3879" Column="57" TopLine="3844"/>
|
||||||
</Position27>
|
</Position27>
|
||||||
<Position28>
|
<Position28>
|
||||||
<Filename Value="fmastersite.pas"/>
|
<Filename Value="..\..\..\lcl\include\control.inc"/>
|
||||||
<Caret Line="36" Column="1" TopLine="1"/>
|
<Caret Line="3878" Column="48" TopLine="3844"/>
|
||||||
</Position28>
|
</Position28>
|
||||||
<Position29>
|
<Position29>
|
||||||
<Filename Value="fmastersite.pas"/>
|
<Filename Value="..\package\fdockbook.pas"/>
|
||||||
<Caret Line="43" Column="1" TopLine="1"/>
|
<Caret Line="209" Column="1" TopLine="180"/>
|
||||||
</Position29>
|
</Position29>
|
||||||
|
<Position30>
|
||||||
|
<Filename Value="..\package\fdockbook.pas"/>
|
||||||
|
<Caret Line="208" Column="16" TopLine="184"/>
|
||||||
|
</Position30>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
{ This is an automatically generated lazarus resource file }
|
||||||
|
|
||||||
LazarusResources.Add('TEditorSite','FORMDATA',[
|
LazarusResources.Add('TEditorSite','FORMDATA',[
|
||||||
'TPF0'#241#11'TEditorSite'#10'EditorSite'#4'Left'#3'b'#1#6'Height'#3','#1#5'W'
|
'TPF0'#241#11'TEditorSite'#10'EditorSite'#4'Left'#3'b'#1#6'Height'#3','#1#5'W'
|
||||||
+'idth'#3#144#1#7'Caption'#6#10'EditorSite'#12'ClientHeight'#3#25#1#11'Client'
|
+'idth'#3#144#1#7'Caption'#6#10'EditorSite'#12'ClientHeight'#3#25#1#11'Client'
|
||||||
|
@ -106,6 +106,7 @@ begin
|
|||||||
FEdit.Parent := self;
|
FEdit.Parent := self;
|
||||||
FEdit.Visible := True;
|
FEdit.Visible := True;
|
||||||
FEdit.DragMode := dmManual; //disallow undocking
|
FEdit.DragMode := dmManual; //disallow undocking
|
||||||
|
FEdit.StayDocked := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TEditorSite.CreateDockable(const cap: string): TWinControl;
|
function TEditorSite.CreateDockable(const cap: string): TWinControl;
|
||||||
|
@ -58,6 +58,7 @@ LCL TODO:
|
|||||||
|
|
||||||
//depending on widgetset or patched LCL
|
//depending on widgetset or patched LCL
|
||||||
{.$DEFINE NoDrop} //applied DoDiPatch1?
|
{.$DEFINE NoDrop} //applied DoDiPatch1?
|
||||||
|
{.$DEFINE PageFrame} //problem: notebook frame cannot Release itself
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@ -166,36 +167,54 @@ type
|
|||||||
property Top: integer read GetTop;
|
property Top: integer read GetTop;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
(* TEasyDockManager implements some of the abstract methods of TDockManager.
|
||||||
|
*)
|
||||||
|
TEasyDockManager = class(TDockManager)
|
||||||
|
protected
|
||||||
|
FDockSite: TWinControl;
|
||||||
|
FUpdateCount: integer;
|
||||||
|
procedure BeginUpdate; override;
|
||||||
|
procedure EndUpdate; override;
|
||||||
|
procedure Update; virtual;
|
||||||
|
procedure SetReplacingControl(Control: TControl); override; //unused
|
||||||
|
property DockSite: TWinControl read FDockSite;
|
||||||
|
public
|
||||||
|
constructor Create(ADockSite: TWinControl); override;
|
||||||
|
class function DetectAlign(ZoneRect: TRect; MousePos: TPoint): TAlign;
|
||||||
|
procedure PositionDockRect(Client, DropCtl: TControl; DropAlign: TAlign;
|
||||||
|
var DockRect: TRect); override;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TEasyTree }
|
{ TEasyTree }
|
||||||
|
|
||||||
TEasyTree = class(TDockManager)
|
TEasyTree = class(TEasyDockManager)
|
||||||
private
|
private
|
||||||
FDockSite: TWinControl;
|
|
||||||
FReplacingControl: TControl;
|
FReplacingControl: TControl;
|
||||||
FTopZone: TEasyZone;
|
FTopZone: TEasyZone;
|
||||||
FSiteRect: TRect; //to detect changed site extent
|
FSiteRect: TRect; //to detect changed site extent
|
||||||
FUpdateCount: integer;
|
|
||||||
procedure UpdateTree;
|
procedure UpdateTree;
|
||||||
protected
|
protected
|
||||||
|
{$IFDEF old}
|
||||||
procedure BeginUpdate; override;
|
procedure BeginUpdate; override;
|
||||||
procedure EndUpdate; override;
|
procedure EndUpdate; override;
|
||||||
|
procedure PositionDockRect(Client, DropCtl: TControl; DropAlign: TAlign;
|
||||||
|
var DockRect: TRect); override;
|
||||||
|
procedure SetReplacingControl(Control: TControl); override; //unused
|
||||||
|
{$ELSE}
|
||||||
|
//in base class
|
||||||
|
{$ENDIF}
|
||||||
//extended interface
|
//extended interface
|
||||||
//procedure ControlVisibilityChanged(Control: TControl; Visible: Boolean); override;
|
//procedure ControlVisibilityChanged(Control: TControl; Visible: Boolean); override;
|
||||||
function ZoneFromPoint(SitePos: TPoint): TEasyZone;
|
function ZoneFromPoint(SitePos: TPoint): TEasyZone;
|
||||||
procedure GetControlBounds(Control: TControl; out CtlBounds: TRect); override;
|
procedure GetControlBounds(Control: TControl; out CtlBounds: TRect); override;
|
||||||
procedure InsertControl(Control: TControl; InsertAt: TAlign;
|
procedure InsertControl(Control: TControl; InsertAt: TAlign;
|
||||||
DropCtl: TControl); override;
|
DropCtl: TControl); override;
|
||||||
procedure PositionDockRect(Client, DropCtl: TControl; DropAlign: TAlign;
|
|
||||||
var DockRect: TRect); override;
|
|
||||||
procedure RemoveControl(Control: TControl); override;
|
procedure RemoveControl(Control: TControl); override;
|
||||||
procedure ResetBounds(Force: Boolean); override; //site resized
|
procedure ResetBounds(Force: Boolean); override; //site resized
|
||||||
procedure SetReplacingControl(Control: TControl); override; //unused
|
|
||||||
procedure LoadFromStream(Stream: TStream); override;
|
procedure LoadFromStream(Stream: TStream); override;
|
||||||
procedure SaveToStream(Stream: TStream); override;
|
procedure SaveToStream(Stream: TStream); override;
|
||||||
protected //added
|
protected //added
|
||||||
procedure PositionDockRect(ADockObject: TDragDockObject); override;
|
procedure PositionDockRect(ADockObject: TDragDockObject); override;
|
||||||
property DockSite: TWinControl read FDockSite;
|
|
||||||
function FindControlZone(zone: TEasyZone; Control: TControl): TEasyZone;
|
function FindControlZone(zone: TEasyZone; Control: TControl): TEasyZone;
|
||||||
procedure RemoveZone(Zone: TEasyZone);
|
procedure RemoveZone(Zone: TEasyZone);
|
||||||
//Lazarus extension
|
//Lazarus extension
|
||||||
@ -215,7 +234,6 @@ type
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
constructor Create(ADockSite: TWinControl); override;
|
constructor Create(ADockSite: TWinControl); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function DetectAlign(ZoneRect: TRect; MousePos: TPoint): TAlign;
|
|
||||||
procedure PaintSite(DC: HDC); override;
|
procedure PaintSite(DC: HDC); override;
|
||||||
procedure SetStyle(NewStyle: TEasyHeaderStyle);
|
procedure SetStyle(NewStyle: TEasyHeaderStyle);
|
||||||
function GetEffectiveStyle: TEasyHeaderStyle;
|
function GetEffectiveStyle: TEasyHeaderStyle;
|
||||||
@ -248,7 +266,11 @@ implementation
|
|||||||
uses
|
uses
|
||||||
SysUtils, Types,
|
SysUtils, Types,
|
||||||
math,
|
math,
|
||||||
|
{$IFDEF PageFrame}
|
||||||
|
fPageFrame,
|
||||||
|
{$ELSE}
|
||||||
fDockBook,
|
fDockBook,
|
||||||
|
{$ENDIF}
|
||||||
Themes, LResources,
|
Themes, LResources,
|
||||||
LCLproc; //debugging
|
LCLproc; //debugging
|
||||||
|
|
||||||
@ -260,11 +282,15 @@ const
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
type
|
type
|
||||||
|
{$IFDEF PageFrame}
|
||||||
|
TEasyBook = TPageFrame;
|
||||||
|
{$ELSE}
|
||||||
TEasyBook = TEasyDockBook;
|
TEasyBook = TEasyDockBook;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
function NoteBookCreate(AOwner: TWinControl): TEasyBook; inline;
|
function NoteBookCreate(AOwner: TWinControl): TEasyBook; inline;
|
||||||
begin
|
begin
|
||||||
Result := TEasyDockBook.Create(AOwner);
|
Result := TEasyBook.Create(AOwner);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure NoteBookAdd(ABook: TEasyBook; AItem: TControl); inline;
|
procedure NoteBookAdd(ABook: TEasyBook; AItem: TControl); inline;
|
||||||
@ -318,14 +344,7 @@ constructor TEasyTree.Create(ADockSite: TWinControl);
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
FDockSite := ADockSite;
|
inherited Create(ADockSite);
|
||||||
//reset inappropriate docking defaults - should be fixed in Controls/DragManager!
|
|
||||||
DragManager.DragImmediate := False;
|
|
||||||
//workaround: check for already assigned docking manager
|
|
||||||
//FreeAndNil(DockSite.DockManager); - seems to be fixed
|
|
||||||
DockSite.DockManager := self;
|
|
||||||
//init node class - impossible due to visibility restrictions!
|
|
||||||
inherited Create(DockSite);
|
|
||||||
{$IFDEF singleTab}
|
{$IFDEF singleTab}
|
||||||
//test: notebook with 1 tab in root zone
|
//test: notebook with 1 tab in root zone
|
||||||
SingleTab := True;
|
SingleTab := True;
|
||||||
@ -359,6 +378,7 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFDEF old}
|
||||||
procedure TEasyTree.BeginUpdate;
|
procedure TEasyTree.BeginUpdate;
|
||||||
begin
|
begin
|
||||||
inc(FUpdateCount);
|
inc(FUpdateCount);
|
||||||
@ -372,6 +392,8 @@ begin
|
|||||||
UpdateTree;
|
UpdateTree;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$ELSE}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
function TEasyTree.ZoneFromPoint(SitePos: TPoint): TEasyZone;
|
function TEasyTree.ZoneFromPoint(SitePos: TPoint): TEasyZone;
|
||||||
var
|
var
|
||||||
@ -591,54 +613,6 @@ begin
|
|||||||
ResetBounds(True); //splitters may have to be inserted
|
ResetBounds(True); //splitters may have to be inserted
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TEasyTree.DetectAlign(ZoneRect: TRect; MousePos: TPoint): TAlign;
|
|
||||||
var
|
|
||||||
w, h, zphi: integer;
|
|
||||||
cx, cy: integer;
|
|
||||||
dx, dy: integer;
|
|
||||||
phi: double;
|
|
||||||
izone: integer;
|
|
||||||
dir: TAlign;
|
|
||||||
const
|
|
||||||
k = 5; //matrix dimension
|
|
||||||
//mapping octants into aligns, assuming k=5
|
|
||||||
cDir: array[-4..4] of TAlign = (
|
|
||||||
alLeft, alLeft, alTop, alTop, alRight, alBottom, alBottom, alLeft, alLeft
|
|
||||||
);
|
|
||||||
begin
|
|
||||||
(* Determine alignment from the location of the mouse within ZoneRect.
|
|
||||||
ZoneRect in screen TLBR coordinates, MousePos in screen coordinates.
|
|
||||||
*)
|
|
||||||
//center and extent of dock zone
|
|
||||||
cx := (ZoneRect.Right + ZoneRect.Left) div 2;
|
|
||||||
cy := (ZoneRect.Top + ZoneRect.Bottom) div 2;
|
|
||||||
w := ZoneRect.Right - ZoneRect.Left;
|
|
||||||
h := ZoneRect.Bottom - ZoneRect.Top;
|
|
||||||
if (w > 0) and (h > 0) then begin
|
|
||||||
//mouse position within k*k rectangles (squares)
|
|
||||||
dx := trunc((MousePos.x - cx) / w * k);
|
|
||||||
dy := trunc((MousePos.y - cy) / h * k);
|
|
||||||
izone := max(abs(dx), abs(dy)); //0..k
|
|
||||||
//map into 0=innermost (custom), 1=inner, 2=outer
|
|
||||||
if izone = 0 then begin
|
|
||||||
//zone := zInnermost;
|
|
||||||
dir := alCustom; //pages
|
|
||||||
end else begin
|
|
||||||
{ not yet: outer zones, meaning docking into parent zone
|
|
||||||
if izone >= k-1 then
|
|
||||||
zone := zOuter
|
|
||||||
else //if izone > 0 then
|
|
||||||
zone := zInner;
|
|
||||||
}
|
|
||||||
phi := arctan2(dy, dx);
|
|
||||||
zphi := trunc(radtodeg(phi)) div 45;
|
|
||||||
dir := cDir[zphi];
|
|
||||||
end;
|
|
||||||
end else
|
|
||||||
dir := alClient;
|
|
||||||
Result := dir;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TEasyTree.PositionDockRect(ADockObject: TDragDockObject);
|
procedure TEasyTree.PositionDockRect(ADockObject: TDragDockObject);
|
||||||
var
|
var
|
||||||
zone: TEasyZone;
|
zone: TEasyZone;
|
||||||
@ -705,6 +679,7 @@ Signal results:
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFDEF old}
|
||||||
procedure TEasyTree.PositionDockRect(Client, DropCtl: TControl;
|
procedure TEasyTree.PositionDockRect(Client, DropCtl: TControl;
|
||||||
DropAlign: TAlign; var DockRect: TRect);
|
DropAlign: TAlign; var DockRect: TRect);
|
||||||
var
|
var
|
||||||
@ -736,6 +711,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$ELSE}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
procedure TEasyTree.LoadFromStream(Stream: TStream);
|
procedure TEasyTree.LoadFromStream(Stream: TStream);
|
||||||
begin
|
begin
|
||||||
@ -1008,10 +985,13 @@ begin
|
|||||||
WriteZone(FTopZone, 0);
|
WriteZone(FTopZone, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFDEF old}
|
||||||
procedure TEasyTree.SetReplacingControl(Control: TControl);
|
procedure TEasyTree.SetReplacingControl(Control: TControl);
|
||||||
begin
|
begin
|
||||||
//FReplacingControl := Control;
|
//FReplacingControl := Control;
|
||||||
end;
|
end;
|
||||||
|
{$ELSE}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
procedure TEasyTree.SetSingleCaption(Value: boolean);
|
procedure TEasyTree.SetSingleCaption(Value: boolean);
|
||||||
begin
|
begin
|
||||||
@ -1482,6 +1462,117 @@ begin
|
|||||||
end; //else empty root zone?
|
end; //else empty root zone?
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TEasyDockManager }
|
||||||
|
|
||||||
|
procedure TEasyDockManager.BeginUpdate;
|
||||||
|
begin
|
||||||
|
//inherited BeginUpdate;
|
||||||
|
inc(FUpdateCount);
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TEasyDockManager.Create(ADockSite: TWinControl);
|
||||||
|
begin
|
||||||
|
(* Init DockSite and DragManager.
|
||||||
|
*)
|
||||||
|
FDockSite := ADockSite;
|
||||||
|
ADockSite.DockManager := self;
|
||||||
|
//reset inappropriate docking defaults - should be fixed in Controls/DragManager!
|
||||||
|
DragManager.DragImmediate := False;
|
||||||
|
inherited Create(ADockSite);
|
||||||
|
end;
|
||||||
|
|
||||||
|
class function TEasyDockManager.DetectAlign(ZoneRect: TRect;
|
||||||
|
MousePos: TPoint): TAlign;
|
||||||
|
var
|
||||||
|
w, h, zphi: integer;
|
||||||
|
cx, cy: integer;
|
||||||
|
dx, dy: integer;
|
||||||
|
phi: double;
|
||||||
|
izone: integer;
|
||||||
|
dir: TAlign;
|
||||||
|
const
|
||||||
|
k = 5; //matrix dimension
|
||||||
|
//mapping octants into aligns, assuming k=5
|
||||||
|
cDir: array[-4..4] of TAlign = (
|
||||||
|
alLeft, alLeft, alTop, alTop, alRight, alBottom, alBottom, alLeft, alLeft
|
||||||
|
);
|
||||||
|
begin
|
||||||
|
(* Determine alignment from the location of the mouse within ZoneRect.
|
||||||
|
ZoneRect in screen TLBR coordinates, MousePos in screen coordinates.
|
||||||
|
*)
|
||||||
|
//center and extent of dock zone
|
||||||
|
cx := (ZoneRect.Right + ZoneRect.Left) div 2;
|
||||||
|
cy := (ZoneRect.Top + ZoneRect.Bottom) div 2;
|
||||||
|
w := ZoneRect.Right - ZoneRect.Left;
|
||||||
|
h := ZoneRect.Bottom - ZoneRect.Top;
|
||||||
|
if (w > 0) and (h > 0) then begin
|
||||||
|
//mouse position within k*k rectangles (squares)
|
||||||
|
dx := trunc((MousePos.x - cx) / w * k);
|
||||||
|
dy := trunc((MousePos.y - cy) / h * k);
|
||||||
|
izone := max(abs(dx), abs(dy)); //0..k
|
||||||
|
//map into 0=innermost (custom), 1=inner, 2=outer
|
||||||
|
if izone = 0 then begin
|
||||||
|
//zone := zInnermost;
|
||||||
|
dir := alCustom; //pages
|
||||||
|
end else begin
|
||||||
|
phi := arctan2(dy, dx);
|
||||||
|
zphi := trunc(radtodeg(phi)) div 45;
|
||||||
|
dir := cDir[zphi];
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
dir := alClient;
|
||||||
|
Result := dir;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TEasyDockManager.EndUpdate;
|
||||||
|
begin
|
||||||
|
//inherited EndUpdate;
|
||||||
|
dec(FUpdateCount);
|
||||||
|
if FUpdateCount = 0 then
|
||||||
|
Update;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TEasyDockManager.PositionDockRect(Client, DropCtl: TControl;
|
||||||
|
DropAlign: TAlign; var DockRect: TRect);
|
||||||
|
var
|
||||||
|
wh: integer;
|
||||||
|
begin
|
||||||
|
(* DockRect is initialized to the screen rect of the dock site by TControl,
|
||||||
|
or to the zone rect by TEasyTree.
|
||||||
|
*)
|
||||||
|
if (DropCtl = nil) {$IFDEF singleTab} and not SingleTab {$ENDIF} then
|
||||||
|
//if (DropCtl = nil) then
|
||||||
|
exit; //entire dock site
|
||||||
|
|
||||||
|
case DropAlign of
|
||||||
|
//alClient: as is
|
||||||
|
alTop: DockRect.Bottom := (DockRect.Top + DockRect.Bottom) div 2;
|
||||||
|
alBottom: DockRect.Top := (DockRect.Top + DockRect.Bottom) div 2;
|
||||||
|
alLeft: DockRect.Right := (DockRect.Left + DockRect.Right) div 2;
|
||||||
|
alRight: DockRect.Left := (DockRect.Left + DockRect.Right) div 2;
|
||||||
|
alCustom: //pages
|
||||||
|
begin
|
||||||
|
wh := (DockRect.Right - DockRect.Left) div 3;
|
||||||
|
inc(DockRect.Left, wh);
|
||||||
|
dec(DockRect.Right, wh);
|
||||||
|
wh := (DockRect.Bottom - DockRect.Top) div 3;
|
||||||
|
inc(DockRect.Top, wh);
|
||||||
|
dec(DockRect.Bottom, wh);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TEasyDockManager.SetReplacingControl(Control: TControl);
|
||||||
|
begin
|
||||||
|
//nop
|
||||||
|
//inherited SetReplacingControl(Control);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TEasyDockManager.Update;
|
||||||
|
begin
|
||||||
|
//nop
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
{$I easy_dock_images.lrs}
|
{$I easy_dock_images.lrs}
|
||||||
CreateDockHeaderImages;
|
CreateDockHeaderImages;
|
||||||
|
@ -32,6 +32,26 @@ Problem:
|
|||||||
Disallow undocking/floating of a NOT docked dockbook.
|
Disallow undocking/floating of a NOT docked dockbook.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
|
(* Applications
|
||||||
|
Stand alone form (not recommended)
|
||||||
|
Parent=Nil, HostDockSite=Nil
|
||||||
|
|
||||||
|
Not-docked part of a form (Editor)
|
||||||
|
The form should never close itself.
|
||||||
|
Parent<>Nil, HostDockSite=Nil
|
||||||
|
|
||||||
|
Part of an dock tree
|
||||||
|
The form is automatically created and docked by the EasyTree.
|
||||||
|
It must notify the tree (HostDockSite) when it has 1 client left,
|
||||||
|
for replacement by that client.
|
||||||
|
It also should notify the HostDockSite of any un/dock, to update the caption.
|
||||||
|
Parent=HostDockSite (<>Nil)
|
||||||
|
|
||||||
|
Suggested methods:
|
||||||
|
HostDockSite.ReplaceDockedControl (self by last client)
|
||||||
|
HostDockSite.UpdateDockCaption (provide composed dock caption)
|
||||||
|
*)
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
@ -75,6 +95,8 @@ type
|
|||||||
protected
|
protected
|
||||||
function GetDefaultDockCaption: string; override;
|
function GetDefaultDockCaption: string; override;
|
||||||
function GetControlTab(AControl: TControl): TTabButton;
|
function GetControlTab(AControl: TControl): TTabButton;
|
||||||
|
public
|
||||||
|
StayDocked: boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//procedure Register;
|
//procedure Register;
|
||||||
@ -82,6 +104,8 @@ type
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
fFloatingSite,
|
||||||
|
Windows, //PostMessage
|
||||||
LCLProc; //debug only
|
LCLProc; //debug only
|
||||||
|
|
||||||
procedure Register;
|
procedure Register;
|
||||||
@ -108,6 +132,7 @@ begin
|
|||||||
btn := TTabButton.Create(Tabs);
|
btn := TTabButton.Create(Tabs);
|
||||||
btn.Control := Source.Control;
|
btn.Control := Source.Control;
|
||||||
btn.Control.Align := alClient;
|
btn.Control.Align := alClient;
|
||||||
|
btn.Control.DockOrientation := doPages;
|
||||||
btn.Caption := GetDockCaption(btn.Control);
|
btn.Caption := GetDockCaption(btn.Control);
|
||||||
btn.OnClick := @ToolButton1Click;
|
btn.OnClick := @ToolButton1Click;
|
||||||
btn.Down := True;
|
btn.Down := True;
|
||||||
@ -172,15 +197,19 @@ begin
|
|||||||
CurTab.Down := True;
|
CurTab.Down := True;
|
||||||
CurTab.Click;
|
CurTab.Click;
|
||||||
end;
|
end;
|
||||||
end else begin
|
Caption := GetDefaultDockCaption;
|
||||||
//last tab removed - close ONLY if we are docked
|
end else if not StayDocked then begin
|
||||||
//if (HostDockSite <> nil) or Floating then begin - Floating doesn't work
|
//last tab removed - close ONLY if we are docked or floating
|
||||||
if Parent = nil then begin //seems to be a good indicator for floating state
|
if (HostDockSite <> nil) then begin //may be cleared already???
|
||||||
if (HostDockSite <> nil) then //may be cleared already???
|
|
||||||
ManualDock(nil); //undock before closing
|
ManualDock(nil); //undock before closing
|
||||||
Release; //Close;
|
//DoUnDock(nil, nil);
|
||||||
|
//Dock(nil);
|
||||||
end;
|
end;
|
||||||
|
//Release; //Close;
|
||||||
|
PostMessage(Self.Handle, WM_CLOSE, 0, 0);
|
||||||
end;
|
end;
|
||||||
|
if (HostDockSite is TFloatingSite) then
|
||||||
|
TFloatingSite(HostDockSite).UpdateCaption(nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TEasyDockBook.GetControlTab(AControl: TControl): TTabButton;
|
function TEasyDockBook.GetControlTab(AControl: TControl): TTabButton;
|
||||||
|
@ -25,12 +25,10 @@ type
|
|||||||
X, Y: Integer);
|
X, Y: Integer);
|
||||||
procedure FormUnDock(Sender: TObject; Client: TControl;
|
procedure FormUnDock(Sender: TObject; Client: TControl;
|
||||||
NewTarget: TWinControl; var Allow: Boolean);
|
NewTarget: TWinControl; var Allow: Boolean);
|
||||||
private
|
|
||||||
procedure AdjustCaption(without: TControl);
|
|
||||||
protected
|
protected
|
||||||
procedure Loaded; override;
|
procedure Loaded; override;
|
||||||
public
|
public
|
||||||
{ public declarations }
|
procedure UpdateCaption(without: TControl);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -44,7 +42,7 @@ uses
|
|||||||
|
|
||||||
{ TFloatingSite }
|
{ TFloatingSite }
|
||||||
|
|
||||||
procedure TFloatingSite.AdjustCaption(without: TControl);
|
procedure TFloatingSite.UpdateCaption(without: TControl);
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
s: string;
|
s: string;
|
||||||
@ -68,7 +66,7 @@ procedure TFloatingSite.FormDockDrop(Sender: TObject; Source: TDragDockObject;
|
|||||||
begin
|
begin
|
||||||
(* Update the caption.
|
(* Update the caption.
|
||||||
*)
|
*)
|
||||||
AdjustCaption(nil);
|
UpdateCaption(nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFloatingSite.FormUnDock(Sender: TObject; Client: TControl;
|
procedure TFloatingSite.FormUnDock(Sender: TObject; Client: TControl;
|
||||||
@ -92,7 +90,7 @@ Fix: disallow TControls to become floating.
|
|||||||
if DockClientCount <= 1 then begin
|
if DockClientCount <= 1 then begin
|
||||||
Release; //destroy empty site
|
Release; //destroy empty site
|
||||||
end else begin
|
end else begin
|
||||||
AdjustCaption(Client); //update caption, excluding removed client
|
UpdateCaption(Client); //update caption, excluding removed client
|
||||||
DockManager.ResetBounds(True); //required with gtk2!?
|
DockManager.ResetBounds(True); //required with gtk2!?
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -199,18 +199,44 @@ var
|
|||||||
Site: TWinControl;
|
Site: TWinControl;
|
||||||
ctl: TControl;
|
ctl: TControl;
|
||||||
cmp: TComponent;
|
cmp: TComponent;
|
||||||
|
n, s: string;
|
||||||
|
const
|
||||||
|
OrientString: array[TDockOrientation] of char = (
|
||||||
|
'N','H','V' {$IFDEF FPC} ,'P' {$ENDIF}
|
||||||
|
);
|
||||||
|
AlignString: array[TAlign] of char = (
|
||||||
|
//(alNone, alTop, alBottom, alLeft, alRight, alClient, alCustom);
|
||||||
|
'n', 't', 'B', 'L', 'R', 'C', 'c'
|
||||||
|
);
|
||||||
begin
|
begin
|
||||||
(* Dump registered docking sites.
|
(* Dump registered docking sites.
|
||||||
|
Elastic panels have no name.
|
||||||
|
Dump of docked clients by DockManager (structural info!)
|
||||||
|
Notebooks are docked, i.e. HostDockSite<>nil.
|
||||||
|
Pages are DockSites???
|
||||||
|
EditPages contain Files -> include (full?) filename
|
||||||
|
--> dump-levels
|
||||||
|
dock sites[] and clients[]
|
||||||
|
contents[]
|
||||||
*)
|
*)
|
||||||
for i := 0 to ComponentCount - 1 do begin
|
for i := 0 to ComponentCount - 1 do begin
|
||||||
cmp := Components[i];
|
cmp := Components[i];
|
||||||
if cmp is TWinControl then begin
|
if cmp is TWinControl then begin
|
||||||
Site := TWinControl(cmp);
|
Site := TWinControl(cmp);
|
||||||
DebugLn('Site=%s (%d,%d)[%d,%d]', [Site.Name,
|
if Site.Parent <> nil then begin
|
||||||
site.Top, site.Left, site.Width, site.Height]);
|
s := Site.Parent.Name;
|
||||||
|
if s = '' then
|
||||||
|
s := Site.Parent.ClassName;
|
||||||
|
s := ' in ' + s + '@';
|
||||||
|
s := s + AlignString[Site.Align];
|
||||||
|
end else
|
||||||
|
s := '';
|
||||||
|
DebugLn('Site=%s (%d,%d)[%d,%d] %s', [Site.Name,
|
||||||
|
site.Top, site.Left, site.Width, site.Height, s]);
|
||||||
for j := 0 to site.DockClientCount - 1 do begin
|
for j := 0 to site.DockClientCount - 1 do begin
|
||||||
ctl := site.DockClients[j];
|
ctl := site.DockClients[j];
|
||||||
DebugLn(' Client=%s (%d,%d)[%d,%d]', [ctl.Name,
|
s := OrientString[ctl.DockOrientation];
|
||||||
|
DebugLn(' Client=%s@%s (%d,%d)[%d,%d]', [ctl.Name, s,
|
||||||
ctl.Top, ctl.Left, ctl.Width, ctl.Height]);
|
ctl.Top, ctl.Left, ctl.Width, ctl.Height]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user