Changeset 218 for Docking/CoolDocking/Managers
- Timestamp:
- Mar 23, 2011, 12:22:26 PM (14 years ago)
- Location:
- Docking/CoolDocking/Managers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/Managers/UCDManagerRegions.pas
r217 r218 21 21 constructor Create; 22 22 destructor Destroy; override; 23 procedure SetControl(const AValue: TWinControl); override; 23 24 end; 24 25 … … 43 44 procedure PaintSite(DC: HDC); override; 44 45 procedure UpdateClientSize; override; 45 procedure DoSetVisible(const AValue: Boolean); override;46 procedure SetVisible(const AValue: Boolean); override; 46 47 procedure ChangeVisible(Control: TWinControl; Visible: Boolean); 47 48 property DockDirection: TCDDirection read FDockDirection … … 88 89 begin 89 90 PanelHeader := TCDPanelHeader.Create(nil); 90 PanelHeader.Header.ManagerItem := Self;91 // PanelHeader.Header.ManagerItem := Self; 91 92 PanelHeader.Header.OnMouseDown := DockPanelMouseDown; 92 93 PanelHeader.Header.Icon.OnMouseDown := DockPanelMouseDown; … … 109 110 Control.Parent := nil; 110 111 inherited Destroy; 112 end; 113 114 procedure TCDManagerRegionsItem.SetControl(const AValue: TWinControl); 115 begin 116 inherited SetControl(AValue); 117 PanelHeader.Header.Control := AValue; 111 118 end; 112 119 … … 175 182 NewItem.Control := TWinControl(Control); 176 183 Control.AddHandlerOnVisibleChanged(NewItem.VisibleChange); 184 Control.AddHandlerOnVisibleChanging(NewItem.VisibleChanging); 177 185 Control.Parent := NewItem.PanelHeader.ControlPanel; 178 186 Control.Align := alClient; … … 199 207 if (NewDirection <> FDockDirection) then begin 200 208 // Direction change, create conjoin form 201 NewConjoinDockForm := CreateCon tainer(InsertAt);209 NewConjoinDockForm := CreateConjoinForm; 202 210 try 203 211 FreeParentIfEmpty := False; … … 228 236 if Assigned(ManagerItem) then begin 229 237 Control.RemoveHandlerOnVisibleChanged(ManagerItem.VisibleChange); 238 Control.RemoveHandlerOnVisibleChanging(ManagerItem.VisibleChanging); 230 239 end; 231 240 … … 335 344 end; 336 345 337 procedure TCDManagerRegions. DoSetVisible(const AValue: Boolean);346 procedure TCDManagerRegions.SetVisible(const AValue: Boolean); 338 347 var 339 348 I: Integer; … … 341 350 inherited; 342 351 for I := 0 to DockItems.Count - 1 do 343 344 //Show;345 //ShowMessage(IntToStr(Control.Tag));346 352 with TCDManagerRegionsItem(DockItems[I]) do begin 347 353 if AValue and (not Control.Visible) and (Control.Tag = Integer(dhtTemporal)) then begin -
Docking/CoolDocking/Managers/UCDManagerTabs.pas
r217 r218 49 49 procedure TabControlChange(Sender: TObject); virtual; 50 50 procedure PaintSite(DC: HDC); override; 51 procedure DoSetVisible(const AValue: Boolean); override;52 procedure ChangeVisible(Control: TWinControl; Visible: Boolean); override;53 51 procedure Switch(Index: Integer); override; 54 52 procedure PopupMenuTabCloseClick(Sender: TObject); 53 procedure SetVisible(const AValue: Boolean); override; 55 54 property DockItems: TObjectList read FDockItems write FDockItems; 56 55 end; … … 82 81 with TCDManagerTabs(Manager) do begin 83 82 if TControl(Sender).Visible then begin 83 UpdateClientSize; 84 84 Switch(DockItems.IndexOf(FindControlInPanels(TControl(Sender)))); 85 TCDManagerTabsItem(DockItems[DockItems.IndexOf( FindControlInPanels(TControl(Sender)))]).HideType := dhtPermanent;86 end;87 UpdateClientSize;85 TCDManagerTabsItem(DockItems[DockItems.IndexOf( 86 FindControlInPanels(TControl(Sender)))]).HideType := dhtPermanent; 87 end else UpdateClientSize; 88 88 end; 89 89 90 90 // Show current dock clients in parent dock sites 91 91 if TControl(Sender).Visible then 92 if Assigned(TControl(Sender).HostDockSite) then 92 if Assigned(TControl(Sender).HostDockSite) then begin 93 //TControl(Sender).HostDockSite.DockManager.; 93 94 TControl(Sender).HostDockSite.Visible := True; 94 95 {Temp := TControl(Sender); 96 if Assigned(Control) then 97 begin 98 ControlVisible := TControl(Sender).Visible; 99 (*if Assigned(ClientAreaPanel) then 100 ClientAreaPanel.Visible := ControlVisible; 101 if Assigned(Splitter) then 102 Splitter.Visible := ControlVisible; 103 *) 104 // if Assigned(TCDManager(OwnerDockManager).DockStyleHandler) then 105 if Assigned(Manager) then 106 with TCDManagerTabs(Manager) do 107 begin 108 //UpdateClientSize; 109 if ControlVisible then 110 Switch(FDockItems.IndexOf(FindControlInPanels(TControl(Sender)))); 111 if not (Control is TWinControl) then raise Exception.Create('Not TWinControl'); 112 if not Assigned(Control) then raise Exception.Create('Control not assigned'); 113 ChangeVisible(TWinControl(Control), ControlVisible); 114 // Show parent control 115 Temp := TControl(Sender).HostDockSite; 116 117 if ControlVisible then 118 TControl(Sender).HostDockSite.Visible := ControlVisible; 119 end; 120 if csDestroying in Control.ComponentState then Control := nil; 121 end; 122 } 95 end; 123 96 end; 124 97 … … 141 114 if Assigned(PageControl.ActivePage) then 142 115 TCDManagerItem(DockItems[PageControl.TabIndex]).Control.Hide; 116 end; 117 118 procedure TCDManagerTabs.SetVisible(const AValue: Boolean); 119 begin 120 inherited; 121 if (PageControl.TabIndex >= 0) and (PageControl.TabIndex < DockItems.Count) then 122 with TCDManagerItem(DockItems[PageControl.TabIndex]) do begin 123 if AValue and (not Control.Visible) and (Control.Tag = Integer(dhtTemporal)) then begin 124 Control.Show; 125 Control.Tag := Integer(dhtPermanent); 126 end; 127 end; 143 128 end; 144 129 … … 255 240 256 241 NewItem.Control := TWinControl(Control); 242 //NewItem.HideType := dhtTemporal; 257 243 Control.AddHandlerOnVisibleChanged(NewItem.VisibleChange); 244 Control.AddHandlerOnVisibleChanging(NewItem.VisibleChanging); 258 245 //AControl.Parent := NewItem.ClientAreaPanel; 259 246 Control.Align := alClient; … … 272 259 if Assigned(ManagerItem) then begin 273 260 Control.RemoveHandlerOnVisibleChanged(ManagerItem.VisibleChange); 261 Control.RemoveHandlerOnVisibleChanging(ManagerItem.VisibleChanging); 274 262 end; //else raise Exception.Create(Format('Control %s not found in DockItems', [Control.Name])); 275 263 … … 388 376 end; 389 377 390 procedure TCDManagerTabs.DoSetVisible(const AValue: Boolean);391 begin392 inherited;393 if (PageControl.TabIndex >= 0) and (PageControl.TabIndex < DockItems.Count) then394 with TCDManagerItem(DockItems[PageControl.TabIndex]) do begin395 //Show;396 //ShowMessage(IntToStr(Control.Tag));397 if AValue and (not Control.Visible) and (Control.Tag = Integer(dhtTemporal)) then begin398 Control.Show;399 Control.Tag := Integer(dhtPermanent);400 end;401 //TabControl.Show;402 //ClientAreaPanel.Show;403 end;404 end;405 406 procedure TCDManagerTabs.ChangeVisible(Control: TWinControl; Visible: Boolean);407 var408 I: Integer;409 begin410 inherited;411 if not Visible then begin412 //if Assigned(TWinControl(Control).DockManager) then413 //with TCDManager(TWinControl(Control).DockManager) do414 begin415 // ShowMessage(IntToStr(TabControl.TabIndex) + ' ' + IntToStr(DockPanels.Count));416 // TabControl.Tabs[0].;417 // if (TabControl.TabIndex >= 0) and (TabControl.TabIndex < DockPanels.Count) then begin418 // TCDClientPanel(DockPanels[TabControl.TabIndex]).Show;419 // TCDClientPanel(DockPanels[TabControl.TabIndex]).Control.Show;420 // end;421 // ShowMessage(IntToStr(DockPanels.Count));422 //TabImageList.Delete(PageControl.Tabs.IndexOf(Control.Caption));423 424 I := DockItems.IndexOf(FindControlInPanels(Control));425 if Control.Tag = Integer(dhtPermanent) then426 if (I <> -1) and (I < PageControl.PageCount) then427 // Control.Hide;428 PageControl.Page[I].TabVisible := False;429 //Control.Tag := 0;430 // end;431 end;432 end else433 begin434 // if Assigned(TWinControl(Control).DockManager) then435 // with TCDManager(TWinControl(Control).DockManager) do436 begin437 // if Control.Tag = 0 then begin438 I := DockItems.IndexOf(FindControlInPanels(Control));439 //if then440 if I <> -1 then441 PageControl.Page[I].TabVisible := True;442 // TabImageList.Add(TCDClientPanel(TCDManager(Manager).FindControlInPanels(Control)).Header.Icon.Picture.Bitmap, nil);443 // TabControl.Tabs.Add(Control.Caption);444 445 // end;446 end;447 end;448 end;449 450 378 end. 451 379 -
Docking/CoolDocking/Managers/UCDManagerTabsPopup.pas
r217 r218 246 246 C.Align := alClient; 247 247 C.Parent := HeaderPanel.ControlPanel; 248 HeaderPanel.Header.Control := C; 248 249 //AutoHide.Control.Align := alCustom; 249 250 //Pos := DockSite.ClientToScreen(Pos);
Note:
See TracChangeset
for help on using the changeset viewer.