Changeset 359
- Timestamp:
- May 4, 2012, 12:27:25 PM (13 years ago)
- Location:
- Docking/CoolDocking
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/Demo/Testing/Demo.lpi
r355 r359 38 38 </Item2> 39 39 </RequiredPackages> 40 <Units Count="11 4">40 <Units Count="115"> 41 41 <Unit0> 42 42 <Filename Value="Demo.lpr"/> … … 56 56 <ResourceBaseClass Value="Form"/> 57 57 <UnitName Value="UMainForm"/> 58 <IsVisibleTab Value="True"/> 59 <EditorIndex Value="3"/> 60 <WindowIndex Value="0"/> 61 <TopLine Value="103"/> 62 <CursorPos X="1" Y="114"/> 58 <EditorIndex Value="2"/> 59 <WindowIndex Value="0"/> 60 <TopLine Value="119"/> 61 <CursorPos X="29" Y="132"/> 63 62 <UsageCount Value="201"/> 64 63 <Loaded Value="True"/> … … 134 133 <EditorIndex Value="0"/> 135 134 <WindowIndex Value="0"/> 136 <TopLine Value="1 "/>137 <CursorPos X=" 32" Y="7"/>135 <TopLine Value="17"/> 136 <CursorPos X="75" Y="3"/> 138 137 <UsageCount Value="200"/> 139 138 <Loaded Value="True"/> … … 335 334 <ResourceBaseClass Value="Form"/> 336 335 <UnitName Value="SampleDockableForm"/> 337 <EditorIndex Value="2"/>338 336 <WindowIndex Value="0"/> 339 337 <TopLine Value="1"/> 340 338 <CursorPos X="22" Y="17"/> 341 <UsageCount Value="155"/> 342 <Loaded Value="True"/> 339 <UsageCount Value="159"/> 343 340 <DefaultSyntaxHighlighter Value="Delphi"/> 344 341 </Unit31> … … 450 447 <TopLine Value="1"/> 451 448 <CursorPos X="44" Y="45"/> 452 <UsageCount Value="1 07"/>449 <UsageCount Value="111"/> 453 450 <Loaded Value="True"/> 454 451 <DefaultSyntaxHighlighter Value="Delphi"/> … … 768 765 <Filename Value="..\..\UCDConjoinForm.pas"/> 769 766 <UnitName Value="UCDConjoinForm"/> 770 <EditorIndex Value=" 7"/>767 <EditorIndex Value="6"/> 771 768 <WindowIndex Value="0"/> 772 769 <TopLine Value="49"/> 773 770 <CursorPos X="1" Y="55"/> 774 <UsageCount Value="1 3"/>771 <UsageCount Value="15"/> 775 772 <Loaded Value="True"/> 776 773 </Unit82> … … 778 775 <Filename Value="..\..\UCDCommon.pas"/> 779 776 <UnitName Value="UCDCommon"/> 780 <EditorIndex Value=" 8"/>777 <EditorIndex Value="7"/> 781 778 <WindowIndex Value="0"/> 782 779 <TopLine Value="85"/> 783 780 <CursorPos X="44" Y="88"/> 784 <UsageCount Value="1 3"/>781 <UsageCount Value="15"/> 785 782 <Loaded Value="True"/> 786 783 </Unit83> … … 788 785 <Filename Value="..\..\UCDManager.pas"/> 789 786 <UnitName Value="UCDManager"/> 790 <EditorIndex Value=" 4"/>791 <WindowIndex Value="0"/> 792 <TopLine Value=" 354"/>793 <CursorPos X=" 1" Y="362"/>794 <UsageCount Value="1 3"/>787 <EditorIndex Value="5"/> 788 <WindowIndex Value="0"/> 789 <TopLine Value="75"/> 790 <CursorPos X="65" Y="90"/> 791 <UsageCount Value="15"/> 795 792 <Loaded Value="True"/> 796 793 </Unit84> … … 806 803 <Filename Value="..\..\Managers\UCDManagerTabs.pas"/> 807 804 <UnitName Value="UCDManagerTabs"/> 808 <EditorIndex Value="6"/> 809 <WindowIndex Value="0"/> 810 <TopLine Value="388"/> 805 <WindowIndex Value="0"/> 806 <TopLine Value="382"/> 811 807 <CursorPos X="57" Y="396"/> 812 <UsageCount Value="13"/> 813 <Loaded Value="True"/> 808 <UsageCount Value="14"/> 814 809 </Unit86> 815 810 <Unit87> … … 952 947 <Filename Value="..\..\UCDMaster.pas"/> 953 948 <UnitName Value="UCDMaster"/> 954 <EditorIndex Value=" 9"/>949 <EditorIndex Value="8"/> 955 950 <WindowIndex Value="0"/> 956 951 <TopLine Value="4"/> 957 952 <CursorPos X="66" Y="11"/> 958 <UsageCount Value="1 2"/>953 <UsageCount Value="14"/> 959 954 <Loaded Value="True"/> 960 955 </Unit103> … … 962 957 <Filename Value="..\..\UCDClient.pas"/> 963 958 <UnitName Value="UCDClient"/> 964 <EditorIndex Value=" 10"/>959 <EditorIndex Value="9"/> 965 960 <WindowIndex Value="0"/> 966 961 <TopLine Value="91"/> 967 962 <CursorPos X="1" Y="108"/> 968 <UsageCount Value="1 2"/>963 <UsageCount Value="14"/> 969 964 <Loaded Value="True"/> 970 965 </Unit104> … … 972 967 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 973 968 <UnitName Value="UCDManagerRegions"/> 974 <EditorIndex Value="5"/> 975 <WindowIndex Value="0"/> 976 <TopLine Value="301"/> 977 <CursorPos X="1" Y="314"/> 978 <UsageCount Value="11"/> 969 <IsVisibleTab Value="True"/> 970 <EditorIndex Value="4"/> 971 <WindowIndex Value="0"/> 972 <TopLine Value="77"/> 973 <CursorPos X="13" Y="86"/> 974 <UsageCount Value="13"/> 979 975 <Loaded Value="True"/> 980 976 </Unit105> … … 1038 1034 <UsageCount Value="10"/> 1039 1035 </Unit113> 1036 <Unit114> 1037 <Filename Value="..\..\UCDWindowList.pas"/> 1038 <UnitName Value="UCDWindowList"/> 1039 <EditorIndex Value="3"/> 1040 <WindowIndex Value="0"/> 1041 <TopLine Value="65"/> 1042 <CursorPos X="51" Y="79"/> 1043 <UsageCount Value="10"/> 1044 <Loaded Value="True"/> 1045 </Unit114> 1040 1046 </Units> 1041 1047 <JumpHistory Count="30" HistoryIndex="29"> 1042 1048 <Position1> 1043 <Filename Value=" UMainForm.pas"/>1044 <Caret Line=" 135" Column="14" TopLine="114"/>1049 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1050 <Caret Line="389" Column="35" TopLine="381"/> 1045 1051 </Position1> 1046 1052 <Position2> 1047 <Filename Value=" UMainForm.pas"/>1048 <Caret Line=" 134" Column="14" TopLine="113"/>1053 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1054 <Caret Line="46" Column="13" TopLine="20"/> 1049 1055 </Position2> 1050 1056 <Position3> 1051 <Filename Value=" UMainForm.pas"/>1052 <Caret Line=" 140" Column="3" TopLine="124"/>1057 <Filename Value="..\..\UCDManager.pas"/> 1058 <Caret Line="93" Column="21" TopLine="80"/> 1053 1059 </Position3> 1054 1060 <Position4> 1055 1061 <Filename Value="..\..\UCDManager.pas"/> 1056 <Caret Line=" 362" Column="20" TopLine="354"/>1062 <Caret Line="151" Column="60" TopLine="130"/> 1057 1063 </Position4> 1058 1064 <Position5> 1059 <Filename Value=" UMainForm.pas"/>1060 <Caret Line=" 116" Column="1" TopLine="103"/>1065 <Filename Value="..\..\UCDManager.pas"/> 1066 <Caret Line="357" Column="22" TopLine="336"/> 1061 1067 </Position5> 1062 1068 <Position6> 1063 <Filename Value=" UMainForm.pas"/>1064 <Caret Line=" 118" Column="1" TopLine="103"/>1069 <Filename Value="..\..\UCDManager.pas"/> 1070 <Caret Line="361" Column="16" TopLine="343"/> 1065 1071 </Position6> 1066 1072 <Position7> 1067 <Filename Value=" UMainForm.pas"/>1068 <Caret Line=" 110" Column="1" TopLine="103"/>1073 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1074 <Caret Line="42" Column="37" TopLine="23"/> 1069 1075 </Position7> 1070 1076 <Position8> 1071 <Filename Value=" UMainForm.pas"/>1072 <Caret Line=" 112" Column="1" TopLine="103"/>1077 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1078 <Caret Line="413" Column="40" TopLine="401"/> 1073 1079 </Position8> 1074 1080 <Position9> 1075 <Filename Value=" UMainForm.pas"/>1076 <Caret Line=" 116" Column="1" TopLine="103"/>1081 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1082 <Caret Line="427" Column="49" TopLine="405"/> 1077 1083 </Position9> 1078 1084 <Position10> 1079 <Filename Value=" UMainForm.pas"/>1080 <Caret Line=" 110" Column="1" TopLine="103"/>1085 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1086 <Caret Line="413" Column="1" TopLine="405"/> 1081 1087 </Position10> 1082 1088 <Position11> 1083 1089 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1084 <Caret Line=" 368" Column="1" TopLine="355"/>1090 <Caret Line="414" Column="1" TopLine="405"/> 1085 1091 </Position11> 1086 1092 <Position12> 1087 <Filename Value="..\..\ UCDManager.pas"/>1088 <Caret Line=" 362" Column="1" TopLine="354"/>1093 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1094 <Caret Line="417" Column="1" TopLine="405"/> 1089 1095 </Position12> 1090 1096 <Position13> 1091 1097 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1092 <Caret Line=" 368" Column="1" TopLine="355"/>1098 <Caret Line="419" Column="1" TopLine="405"/> 1093 1099 </Position13> 1094 1100 <Position14> 1095 1101 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1096 <Caret Line=" 176" Column="1" TopLine="163"/>1102 <Caret Line="420" Column="1" TopLine="405"/> 1097 1103 </Position14> 1098 1104 <Position15> 1099 <Filename Value=" UMainForm.pas"/>1100 <Caret Line=" 116" Column="1" TopLine="103"/>1105 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1106 <Caret Line="421" Column="1" TopLine="405"/> 1101 1107 </Position15> 1102 1108 <Position16> 1103 <Filename Value="..\..\ UCDManager.pas"/>1104 <Caret Line=" 360" Column="1" TopLine="354"/>1109 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1110 <Caret Line="422" Column="1" TopLine="405"/> 1105 1111 </Position16> 1106 1112 <Position17> 1107 1113 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1108 <Caret Line=" 314" Column="1" TopLine="301"/>1114 <Caret Line="423" Column="1" TopLine="405"/> 1109 1115 </Position17> 1110 1116 <Position18> 1111 <Filename Value=" UMainForm.pas"/>1112 <Caret Line=" 108" Column="9" TopLine="103"/>1117 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1118 <Caret Line="425" Column="1" TopLine="405"/> 1113 1119 </Position18> 1114 1120 <Position19> 1115 <Filename Value=" UMainForm.pas"/>1116 <Caret Line=" 115" Column="1" TopLine="103"/>1121 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1122 <Caret Line="426" Column="1" TopLine="405"/> 1117 1123 </Position19> 1118 1124 <Position20> 1119 <Filename Value=" UMainForm.pas"/>1120 <Caret Line=" 116" Column="1" TopLine="103"/>1125 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1126 <Caret Line="427" Column="28" TopLine="406"/> 1121 1127 </Position20> 1122 1128 <Position21> 1123 <Filename Value=" UMainForm.pas"/>1124 <Caret Line=" 109" Column="1" TopLine="103"/>1129 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1130 <Caret Line="411" Column="3" TopLine="447"/> 1125 1131 </Position21> 1126 1132 <Position22> 1127 <Filename Value=" UMainForm.pas"/>1128 <Caret Line=" 110" Column="1" TopLine="103"/>1133 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1134 <Caret Line="48" Column="1" TopLine="36"/> 1129 1135 </Position22> 1130 1136 <Position23> 1131 <Filename Value=" UMainForm.pas"/>1132 <Caret Line=" 115" Column="1" TopLine="103"/>1137 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1138 <Caret Line="413" Column="1" TopLine="409"/> 1133 1139 </Position23> 1134 1140 <Position24> 1135 <Filename Value="..\..\ UCDManager.pas"/>1136 <Caret Line=" 360" Column="1" TopLine="354"/>1141 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1142 <Caret Line="427" Column="1" TopLine="409"/> 1137 1143 </Position24> 1138 1144 <Position25> 1139 1145 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1140 <Caret Line=" 314" Column="1" TopLine="301"/>1146 <Caret Line="428" Column="1" TopLine="409"/> 1141 1147 </Position25> 1142 1148 <Position26> 1143 <Filename Value=" UMainForm.pas"/>1144 <Caret Line=" 109" Column="1" TopLine="103"/>1149 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1150 <Caret Line="417" Column="56" TopLine="409"/> 1145 1151 </Position26> 1146 1152 <Position27> 1147 <Filename Value="..\..\ UCDManager.pas"/>1148 <Caret Line=" 362" Column="1" TopLine="354"/>1153 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 1154 <Caret Line="84" Column="33" TopLine="71"/> 1149 1155 </Position27> 1150 1156 <Position28> 1151 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>1152 <Caret Line=" 368" Column="1" TopLine="355"/>1157 <Filename Value="..\..\UCDManager.pas"/> 1158 <Caret Line="90" Column="65" TopLine="75"/> 1153 1159 </Position28> 1154 1160 <Position29> 1155 1161 <Filename Value="UMainForm.pas"/> 1156 <Caret Line="1 15" Column="1" TopLine="103"/>1162 <Caret Line="144" Column="5" TopLine="129"/> 1157 1163 </Position29> 1158 1164 <Position30> 1159 <Filename Value=" ..\..\Managers\UCDManagerRegions.pas"/>1160 <Caret Line=" 314" Column="1" TopLine="301"/>1165 <Filename Value="UMainForm.pas"/> 1166 <Caret Line="109" Column="25" TopLine="107"/> 1161 1167 </Position30> 1162 1168 </JumpHistory> -
Docking/CoolDocking/Demo/Testing/UMainForm.pas
r355 r359 9 9 ComCtrls, ExtCtrls, Buttons, Menus, UCDMaster, UCDCustomize, UCDClient, 10 10 UDockForm, UComponentTree, UCDWindowList, UCDConjoinForm, UCDManager, 11 UCDCommon ;11 UCDCommon, UCDManagerRegions; 12 12 13 13 type … … 69 69 ConjoinedDockForm2: TCDConjoinForm; 70 70 Form1: TDockForm; 71 Form2: TDockForm; 72 Form3: TDockForm; 71 73 begin 72 NewDockForm.ManualDock(Panel1);73 74 Form1 := NewDockForm; 74 Form1.ManualDock(Panel1); 75 NewDockForm.ManualDock(Form1); 76 TCDManager(Panel1.DockManager).DockStyle := dsTabs; 77 NewDockForm.ManualDock(Panel1); 75 Form1.ManualDock(Panel1, nil, alRight); 76 Form2 := NewDockForm; 77 Form2.ManualDock(Panel1, nil, alRight); 78 Form3 := NewDockForm; 79 Form3.ManualDock(Panel1, nil, alRight); 80 TCDManagerRegionsItem(TCDPanelHeader(Form2.Parent.Parent).DockItem).SetCenter; 81 82 //Form1 := NewDockForm; 83 //Form1.ManualDock(Panel1); 84 //NewDockForm.ManualDock(Form1); 85 //TCDManager(Panel1.DockManager).DockStyle := dsTabs; 86 //NewDockForm.ManualDock(Panel1); 78 87 (* ConjoinedDockForm1 := TCDManager(Panel1.DockManager).CreateConjoinForm; 79 88 ConjoinedDockForm1.Name := 'Model';; -
Docking/CoolDocking/Managers/UCDManagerRegions.pas
r355 r359 15 15 16 16 TCDManagerRegionsItem = class(TCDManagerItem) 17 private 18 public 17 19 PanelHeader: TCDPanelHeader; 18 20 Splitter: TSplitter; 19 Align: TAlign;20 21 procedure VisibleChange(Sender: TObject); override; 21 22 procedure Paint(Sender: TObject); override; 23 procedure PanelResize(Sender: TObject); 22 24 constructor Create; 23 25 destructor Destroy; override; 24 26 procedure SetControl(const AValue: TWinControl); override; 27 procedure SetCenter; 25 28 end; 26 29 … … 30 33 private 31 34 FDockItems: TObjectList; // TList<TCDManagerRegionsItem> 35 FLastVisibleItemsCount: Integer; 32 36 function GetHeaderPos: THeaderPos; override; 33 37 procedure SetHeaderPos(const AValue: THeaderPos); override; 34 38 function GetDirection(InsertAt: TAlign): TCDDirection; 39 procedure ResizePanels; 40 procedure ClearItemsAlignment; 41 procedure UpdateItemsAlignment; 42 function PanelsVisible: Integer; 43 protected 44 FDockDirection: TCDDirection; 35 45 public 36 FDockDirection: TCDDirection;37 46 //Panels: TObjectList; // TObjectList<TCDStyleRegionsPanel> 38 47 function FindControlInPanels(Control: TControl): TCDManagerItem; override; … … 59 68 { TCDManagerRegionsItem } 60 69 70 procedure TCDManagerRegionsItem.SetCenter; 71 begin 72 TCDManagerRegions(Manager).ClearItemsAlignment; 73 PanelHeader.Align := alClient; 74 Manager.Update; 75 end; 76 61 77 procedure TCDManagerRegionsItem.VisibleChange(Sender: TObject); 62 78 begin … … 66 82 // TCDManagerRegionsItem(DockItems[DockItems.IndexOf(FindControlInPanels(TControl(Sender)))]).HideType := dhtPermanent; 67 83 //end; 84 PanelHeader.Visible := Control.Visible; 68 85 Update; 69 86 … … 91 108 end; 92 109 110 procedure TCDManagerRegionsItem.PanelResize(Sender: TObject); 111 begin 112 TCDManagerRegions(Manager).ResizePanels; 113 end; 114 93 115 constructor TCDManagerRegionsItem.Create; 94 116 begin … … 97 119 PanelHeader.Header.OnMouseDown := DockPanelMouseDown; 98 120 PanelHeader.Header.Icon.OnMouseDown := DockPanelMouseDown; 121 PanelHeader.OnResize := PanelResize; 99 122 100 123 Splitter := TSplitter.Create(nil); … … 113 136 Splitter.Parent := nil; 114 137 Splitter.Free; 115 Control.Parent := nil;138 if Assigned(Control) then Control.Parent := nil; 116 139 inherited Destroy; 117 140 end; … … 153 176 end; 154 177 178 procedure TCDManagerRegions.ResizePanels; 179 var 180 I: Integer; 181 CenterPanelSize: TPoint; 182 Zoom: Real; 183 const 184 MinSize = 30; 185 begin 186 I := 0; 187 while (I < DockItems.Count) and 188 (TCDManagerRegionsItem(DockItems[I]).PanelHeader.Align <> alClient) do 189 Inc(I); 190 if I < DockItems.Count then begin 191 CenterPanelSize.X := TCDManagerRegionsItem(DockItems[I]).PanelHeader.Width; 192 CenterPanelSize.Y := TCDManagerRegionsItem(DockItems[I]).PanelHeader.Height; 193 end else Exit; 194 if (CenterPanelSize.X < MinSize) and (FDockDirection = ddHorizontal) then begin 195 Zoom := CenterPanelSize.X / MinSize; 196 for I := 0 to DockItems.Count - 1 do 197 with TCDManagerRegionsItem(DockItems[I]).PanelHeader do 198 if Align <> alClient then Width := Round(Width * Zoom); 199 end; 200 if (CenterPanelSize.Y < MinSize) and (FDockDirection = ddVertical) then begin 201 Zoom := CenterPanelSize.Y / MinSize; 202 for I := 0 to DockItems.Count - 1 do 203 with TCDManagerRegionsItem(DockItems[I]).PanelHeader do 204 if Align <> alClient then Height := Round(Height * Zoom); 205 end; 206 end; 207 208 procedure TCDManagerRegions.ClearItemsAlignment; 209 var 210 I: Integer; 211 begin 212 for I := 0 to FDockItems.Count - 1 do 213 with TCDManagerRegionsItem(FDockItems[I]) do begin 214 PanelHeader.Align := alNone; 215 Splitter.Align := alNone; 216 end; 217 end; 218 219 procedure TCDManagerRegions.UpdateItemsAlignment; 220 var 221 I: Integer; 222 ClientPanelIndex: Integer; 223 begin 224 // Find alClient panel item index 225 I := 0; 226 while (I < FDockItems.Count) and 227 (TCDManagerRegionsItem(FDockItems[I]).PanelHeader.Align <> alClient) do Inc(I); 228 if I < FDockItems.Count then ClientPanelIndex := I 229 else ClientPanelIndex := FDockItems.Count div 2; 230 231 // Normalize alignment 232 for I := 0 to FDockItems.Count - 1 do 233 with TCDManagerRegionsItem(FDockItems[I]) do begin 234 if FDockDirection = ddHorizontal then begin 235 if I < ClientPanelIndex then PanelHeader.Align := alLeft 236 else if I = ClientPanelIndex then PanelHeader.Align := alClient 237 else if I > ClientPanelIndex then PanelHeader.Align := alRight; 238 end; 239 if FDockDirection = ddVertical then begin 240 if I < ClientPanelIndex then PanelHeader.Align := alTop 241 else if I = ClientPanelIndex then PanelHeader.Align := alClient 242 else if I > ClientPanelIndex then PanelHeader.Align := alBottom; 243 end; 244 end; 245 end; 246 247 function TCDManagerRegions.PanelsVisible: Integer; 248 var 249 I: Integer; 250 begin 251 Result := 0; 252 for I := 0 to FDockItems.Count - 1 do 253 with TCDManagerRegionsItem(FDockItems[I]) do begin 254 if PanelHeader.Visible then Inc(Result); 255 end; 256 end; 257 155 258 function TCDManagerRegions.FindControlInPanels(Control: TControl 156 259 ): TCDManagerItem; … … 172 275 NewItem := TCDManagerRegionsItem.Create; 173 276 with NewItem do begin 277 PanelHeader.DockItem := NewItem; 174 278 PanelHeader.Parent := Self.DockSite; 175 279 Manager := Self; … … 184 288 185 289 NewItem.PanelHeader.Parent := DockSite; 186 187 if DockItems.Count = 0 then NewItem.Align := alClient188 else NewItem.Align := InsertAt;189 290 190 291 NewItem.Control := TWinControl(Control); … … 302 403 var 303 404 I: Integer; 304 SplitterLeft: Integer; 305 SplitterTop: Integer; 306 BaseAlign: TAlign; 405 PositionLeft: Integer; 406 PositionTop: Integer; 307 407 VisibleControlsCount: Integer; 408 const 409 MinSize = 30; 308 410 begin 309 411 inherited; 310 412 if FUpdateCount = 0 then begin 311 413 DebugLog('TCDManagerRegions.UpdateClientSize'); 312 VisibleControlsCount := DockSite.VisibleDockClientCount;414 VisibleControlsCount := PanelsVisible; 313 415 if DockSite is TForm then begin 314 DockSiteVisible := VisibleControlsCount > 0;416 //DockSiteVisible := VisibleControlsCount > 0; 315 417 end; 316 418 if VisibleControlsCount = 0 then VisibleControlsCount := 1; 317 419 420 PositionLeft := 0; 421 PositionTop := 0; 422 UpdateItemsAlignment; 318 423 for I := 0 to DockItems.Count - 1 do 319 424 with TCDManagerRegionsItem(DockItems[I]) do 320 425 begin 321 PanelHeader.Left := SplitterLeft; 322 PanelHeader.Top := SplitterTop; 323 PanelHeader.Height := Self.DockSite.Height div 324 VisibleControlsCount; 325 PanelHeader.Width := Self.DockSite.Width div 326 VisibleControlsCount; 426 PanelHeader.Left := PositionLeft; 427 PanelHeader.Top := PositionTop; 428 if (FLastVisibleItemsCount <> VisibleControlsCount) then begin 429 PanelHeader.Height := Self.DockSite.Height div 430 VisibleControlsCount; 431 PanelHeader.Width := Self.DockSite.Width div 432 VisibleControlsCount; 433 end; 434 if PanelHeader.Height < MinSize then PanelHeader.Height := MinSize; 435 if PanelHeader.Width < MinSize then PanelHeader.Width := MinSize; 436 327 437 if Assigned(TWinControl(Control).DockManager) then 328 438 PanelHeader.Header.Visible := TCDManager(TWinControl(Control).DockManager).HeaderVisible; 329 439 PanelHeader.Visible := Control.Visible; 330 440 Paint(Self); 331 if FDockDirection = ddHorizontal then 332 BaseAlign := alLeft else BaseAlign := alTop; 333 334 if I < Trunc((DockItems.Count - 1) / 2) then BaseAlign := BaseAlign 335 else if I = Trunc((DockItems.Count - 1) / 2) then BaseAlign := alClient 336 else if I > Trunc((DockItems.Count - 1) / 2) then begin 337 if BaseAlign = alTop then BaseAlign := alBottom 338 else if BaseAlign = alLeft then BaseAlign := alRight; 339 end; 340 PanelHeader.Align := BaseAlign; 341 342 Splitter.Align := BaseAlign; 343 SplitterLeft := PanelHeader.Left; 344 SplitterTop := PanelHeader.Top; 345 Splitter.Left := SplitterLeft; 346 Splitter.Top := SplitterTop; 441 442 //PositionLeft := PanelHeader.Left; 443 //PositionTop := PanelHeader.Top; 444 if PanelHeader.Align = alLeft then Splitter.Left := PositionLeft + PanelHeader.Width + 1; 445 if PanelHeader.Align = alRight then Splitter.Left := PositionLeft - 1; 446 if PanelHeader.Align = alTop then Splitter.Top := PositionTop + PanelHeader.Height + 1; 447 if PanelHeader.Align = alBottom then Splitter.Top := PositionTop - 1; 448 Splitter.Align := PanelHeader.Align; 347 449 Splitter.Parent := Self.DockSite; 348 Splitter.Visible := I <> (Trunc(DockItems.Count - 1) / 2); 349 Inc(SplitterLeft, Splitter.Width); 350 Inc(SplitterTop, Splitter.Height); 450 Splitter.Visible := PanelHeader.Visible and (PanelHeader.Align <> alClient); 451 Splitter.Width := 3; 452 Splitter.Height := 3; 453 Inc(PositionLeft, Splitter.Width + PanelHeader.Width); 454 Inc(PositionTop, Splitter.Height + PanelHeader.Height); 351 455 352 456 Paint(Self); 353 PanelHeader.Align := BaseAlign; 354 end; 457 //PanelHeader.Align := BaseAlign; 458 end; 459 FLastVisibleItemsCount := VisibleControlsCount; 355 460 end; 356 461 end; … … 362 467 inherited; 363 468 //if DockSite.Visible <> AValue then 469 if DockItems.Count > 0 then 364 470 try 365 471 BeginUpdate; -
Docking/CoolDocking/UCDClient.pas
r355 r359 95 95 begin 96 96 inherited Create(AOwner); 97 FDockable := False;97 FDockable := True; 98 98 if not (AOwner is TForm) then 99 99 raise Exception.Create(SWrongOwner); 100 100 with (AOwner as TForm) do begin 101 101 if not (csDesigning in ComponentState) then begin 102 (*if Dockable then begin102 if Dockable then begin 103 103 DragKind := dkDock; 104 104 DragMode := dmAutomatic; 105 105 DockSite := True; 106 106 end; 107 *)UseDockManager := True;107 UseDockManager := True; 108 108 DockManager := TCDManagerRegions.Create(TWinControl(AOwner)); 109 109 //FormStyle := fsStayOnTop; -
Docking/CoolDocking/UCDManager.pas
r355 r359 8 8 Classes, SysUtils, UCDCommon, Controls, Contnrs, Dialogs, 9 9 UCDPopupMenu, LCLType, LCLIntf, LMessages, Graphics, Buttons, 10 UCDConjoinForm, Menus, StdCtrls,ExtCtrls, Forms;10 UCDConjoinForm, Menus, ExtCtrls, Forms; 11 11 12 12 const … … 57 57 Header: TCDHeader; 58 58 ControlPanel: TPanel; 59 DockItem: TCDManagerItem; 59 60 property HeaderPos: THeaderPos read FHeaderPos write SetHeaderPos; 60 61 property HeaderVisible: Boolean read GetHeaderVisible write SetHeaderVisible; … … 357 358 FDockSiteVisible := AValue; 358 359 SetVisible(FDockSiteVisible); 359 if Assigned(FOnDockSiteHide) and not AValuethen360 if Assigned(FOnDockSiteHide) and (not FDockSiteVisible) then 360 361 FOnDockSiteHide(Self); 361 if Assigned(FOnDockSiteShow) and AValue then362 if Assigned(FOnDockSiteShow) and FDockSiteVisible then 362 363 FOnDockSiteShow(Self); 363 364 end;
Note:
See TracChangeset
for help on using the changeset viewer.