Changeset 354 for Docking/CoolDocking/Managers/UCDManagerRegions.pas
- Timestamp:
- Apr 26, 2012, 9:12:02 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/Managers/UCDManagerRegions.pas
r218 r354 17 17 PanelHeader: TCDPanelHeader; 18 18 Splitter: TSplitter; 19 Align: TAlign; 19 20 procedure VisibleChange(Sender: TObject); override; 20 21 procedure Paint(Sender: TObject); override; … … 43 44 destructor Destroy; override; 44 45 procedure PaintSite(DC: HDC); override; 45 procedure Update ClientSize; override;46 procedure Update; override; 46 47 procedure SetVisible(const AValue: Boolean); override; 47 48 procedure ChangeVisible(Control: TWinControl; Visible: Boolean); … … 65 66 // TCDManagerRegionsItem(DockItems[DockItems.IndexOf(FindControlInPanels(TControl(Sender)))]).HideType := dhtPermanent; 66 67 //end; 67 UpdateClientSize; 68 Update; 69 70 // if any region is visible, show parent docksite 71 //if DockSite is TForm then 72 // DockSite.Visible := (DockSite.VisibleDockClientCount > 0); 68 73 end; 69 74 end; … … 130 135 inherited SetHeaderPos(AValue); 131 136 if Assigned(DockSite.Parent) then 132 TCDManager(DockSite.Parent.DockManager).Update ClientSize;137 TCDManager(DockSite.Parent.DockManager).Update; 133 138 (* case AValue of 134 139 hpBottom, hpTop: FDockDirection := ddVertical; … … 179 184 180 185 NewItem.PanelHeader.Parent := DockSite; 186 187 if DockItems.Count = 0 then NewItem.Align := alClient 188 else NewItem.Align := InsertAt; 181 189 182 190 NewItem.Control := TWinControl(Control); … … 219 227 Control.ManualDock(DockSite, nil, InsertAt); 220 228 NewConjoinDockForm.UpdateCaption; 221 Update ClientSize;229 Update; 222 230 Exit; 223 231 end; … … 225 233 InsertControlNoUpdate(Control, InsertAt); 226 234 end; 227 Update ClientSize;235 Update; 228 236 end; 229 237 … … 257 265 end; 258 266 inherited RemoveControl(Control); 259 if ClientCount > 1 then Update ClientSize;267 if ClientCount > 1 then Update; 260 268 end; 261 269 … … 271 279 for I := 0 to ADockSite.DockClientCount - 1 do 272 280 InsertControlNoUpdate(ADockSite.DockClients[I], alLeft); 273 Update ClientSize;281 Update; 274 282 end; 275 283 … … 291 299 end; 292 300 293 procedure TCDManagerRegions.Update ClientSize;301 procedure TCDManagerRegions.Update; 294 302 var 295 303 I: Integer; … … 299 307 VisibleControlsCount: Integer; 300 308 begin 301 inherited UpdateClientSize; 302 if FDockDirection = ddHorizontal then 303 BaseAlign := alLeft else BaseAlign := alTop; 304 305 SplitterLeft := 0; 306 SplitterTop := 0; 309 if FUpdateCount = 0 then begin 310 DebugLog('TCDManagerRegions.UpdateClientSize'); 311 inherited; 307 312 VisibleControlsCount := DockSite.VisibleDockClientCount; 308 313 if DockSite is TForm then 309 DockSite.Visible := VisibleControlsCount > 0;314 DockSite.Visible := (VisibleControlsCount > 0); 310 315 if VisibleControlsCount = 0 then VisibleControlsCount := 1; 311 316 … … 323 328 PanelHeader.Visible := Control.Visible; 324 329 Paint(Self); 325 if I < (DockItems.Count - 1) then PanelHeader.Align := BaseAlign 326 else PanelHeader.Align := alClient; 327 328 Inc(SplitterLeft, PanelHeader.Width); 329 Inc(SplitterTop, PanelHeader.Height); 330 if FDockDirection = ddHorizontal then 331 BaseAlign := alLeft else BaseAlign := alTop; 332 333 if I < Trunc((DockItems.Count - 1) / 2) then BaseAlign := BaseAlign 334 else if I = Trunc((DockItems.Count - 1) / 2) then BaseAlign := alClient 335 else if I > Trunc((DockItems.Count - 1) / 2) then begin 336 if BaseAlign = alTop then BaseAlign := alBottom 337 else if BaseAlign = alLeft then BaseAlign := alRight; 338 end; 339 PanelHeader.Align := BaseAlign; 340 341 Splitter.Align := BaseAlign; 342 SplitterLeft := PanelHeader.Left; 343 SplitterTop := PanelHeader.Top; 330 344 Splitter.Left := SplitterLeft; 331 345 Splitter.Top := SplitterTop; 332 346 Splitter.Parent := Self.DockSite; 333 Splitter.Align := BaseAlign; 334 Splitter.Visible := I < (DockItems.Count - 1); 347 Splitter.Visible := I <> (Trunc(DockItems.Count - 1) / 2); 335 348 Inc(SplitterLeft, Splitter.Width); 336 349 Inc(SplitterTop, Splitter.Height); 337 350 338 351 Paint(Self); 339 if I < (DockItems.Count - 1) then begin 340 if DockDirection = ddHorizontal then PanelHeader.Align := alLeft 341 else PanelHeader.Align := alTop; 342 end else PanelHeader.Align := alClient; 352 PanelHeader.Align := BaseAlign; 353 end; 343 354 end; 344 355 end; … … 349 360 begin 350 361 inherited; 351 for I := 0 to DockItems.Count - 1 do 362 try 363 BeginUpdate; 364 for I := 0 to DockItems.Count - 1 do 352 365 with TCDManagerRegionsItem(DockItems[I]) do begin 353 366 if AValue and (not Control.Visible) and (Control.Tag = Integer(dhtTemporal)) then begin … … 361 374 end; 362 375 //ClientAreaPanel.Show; 376 finally 377 EndUpdate; 378 end; 363 379 end; 364 380
Note:
See TracChangeset
for help on using the changeset viewer.