Changeset 195 for Docking/CoolDocking/Managers/UCDManagerTabs.pas
- Timestamp:
- Mar 11, 2011, 2:16:50 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/Managers/UCDManagerTabs.pas
r194 r195 11 11 12 12 type 13 TCDManagerTabsITem = class(TCDManagerItem) 14 13 14 { TCDManagerTabsItem } 15 16 TCDManagerTabsItem = class(TCDManagerItem) 17 Icon: TImage; 18 constructor Create; 19 destructor Destroy; override; 15 20 end; 16 21 … … 37 42 FTabsPos: THeaderPos; 38 43 function FindControlInPanels(Control: TControl): TCDManagerItem; override; 39 procedure InsertControlNoUpdate( AControl: TControl; InsertAt: TAlign);44 procedure InsertControlNoUpdate(Control: TControl; InsertAt: TAlign); 40 45 procedure RemoveControl(Control: TControl); override; 41 46 public … … 57 62 UCDClient; 58 63 64 { TCDManagerTabsItem } 65 66 constructor TCDManagerTabsItem.Create; 67 begin 68 Icon := TImage.Create(nil); 69 end; 70 71 destructor TCDManagerTabsItem.Destroy; 72 begin 73 Icon.Free; 74 inherited Destroy; 75 end; 76 59 77 { TCDManagerTabs } 60 78 … … 91 109 I: Integer; 92 110 begin 93 // Hide all clients 111 UpdateClientSize; 112 { // Hide all clients 94 113 for I := 0 to DockItems.Count - 1 do 95 114 if TCDManagerItem(DockItems[I]).Control.Visible … … 137 156 //TCDClientPanel(FDockPanels[TabControl.TabIndex]).Visible := True; 138 157 end; 139 MouseDownSkip := True; 158 MouseDownSkip := True; } 140 159 end; 141 160 … … 175 194 Parent := ADockSite; 176 195 Name := Self.DockSite.Name + 'TabControl'; 177 Visible := False;178 Align := alTop;196 Visible := True; 197 //Align := alTop; 179 198 //Height := 24; 180 199 Align := alClient; … … 193 212 //MoveDuration := 1000; // ms 194 213 195 PageControl.Visible := True;214 //PageControl.Visible := True; 196 215 //TabImageList.Clear; 197 for I := 0 to DockItems.Count - 1 do198 Self.InsertControlNoUpdate(TCDManagerItem(DockItems[I]).Control, alNone);216 for I := 0 to ADockSite.DockClientCount - 1 do 217 InsertControlNoUpdate(ADockSite.DockClients[I], alNone); 199 218 TabControlChange(Self); 219 //TCDManagerTabs(Self).TabControlChange(Self); 200 220 end; 201 221 … … 221 241 end; 222 242 223 procedure TCDManagerTabs.InsertControlNoUpdate( AControl: TControl; InsertAt: TAlign);243 procedure TCDManagerTabs.InsertControlNoUpdate(Control: TControl; InsertAt: TAlign); 224 244 var 225 245 NewTabSheet: TTabSheet; 226 New Panel: TCDManagerTabsItem;246 NewItem: TCDManagerTabsItem; 227 247 begin 228 248 inherited; 229 249 begin 230 New Panel:= TCDManagerTabsItem.Create;231 with New Paneldo begin250 NewItem := TCDManagerTabsItem.Create; 251 with NewItem do begin 232 252 //Panel.Parent := Self.DockSite; 233 253 Manager := Self; 234 if DockStyle = dsList then Visible := True;254 //if DockStyle = dsList then Visible := True; 235 255 //Align := alClient; 236 Header.PopupMenu := Self.PopupMenu;256 //Header.PopupMenu := Self.PopupMenu; 237 257 //PopupMenu.Parent := Self.DockSite; 238 258 end; 239 if ( AControl is TForm) and Assigned((AControl as TForm).Icon) then240 New Panel.Header.Icon.Picture.Assign((AControl as TForm).Icon);241 242 New Panel.Control := AControl;243 AControl.AddHandlerOnVisibleChanged(NewPanel.VisibleChange);244 //AControl.Parent := New Panel.ClientAreaPanel;245 AControl.Align := alClient;259 if (Control is TForm) and Assigned((Control as TForm).Icon) then 260 NewItem.Icon.Picture.Assign((Control as TForm).Icon); 261 262 NewItem.Control := Control; 263 Control.AddHandlerOnVisibleChanged(NewItem.VisibleChange); 264 //AControl.Parent := NewItem.ClientAreaPanel; 265 Control.Align := alClient; 246 266 if (InsertAt = alTop) or (InsertAt = alLeft) then 247 DockItems.Insert(0, NewPanel) 248 else DockItems.Add(NewPanel); 249 250 end; 251 252 if AControl.Visible then begin 267 DockItems.Insert(0, NewItem) 268 else DockItems.Add(NewItem); 269 270 end; 271 253 272 NewTabSheet := TTabSheet.Create(PageControl); 254 273 NewTabSheet.PageControl := PageControl; 255 NewTabSheet.Caption := AControl.Caption;274 NewTabSheet.Caption := Control.Caption; 256 275 NewTabSheet.ImageIndex := TabImageList.Count; 257 TabImageList.Add(NewPanel.Header.Icon.Picture.Bitmap, nil); 258 // if Assigned(NewPanel.Splitter) then 259 // NewPanel.Splitter.Visible := False; 260 // NewPanel.ClientAreaPanel.Visible := False; 261 // NewPanel.Visible := False; 262 //NewPanel.Parent := NewTabSheet; 263 end; 276 NewTabSheet.TabVisible := Control.Visible; 277 Control.Parent := NewTabSheet; 278 TabImageList.Add(NewItem.Icon.Picture.Bitmap, nil); 279 // if Assigned(NewItem.Splitter) then 280 // NewItem.Splitter.Visible := False; 281 // NewItem.ClientAreaPanel.Visible := False; 282 // NewItem.Visible := False; 283 //NewItem.Parent := NewTabSheet; 264 284 end; 265 285 … … 282 302 var 283 303 I: Integer; 304 NewTabSheet: TTabSheet; 284 305 begin 285 306 inherited UpdateClientSize; 286 for I := 0 to DockItems.Count - 1 do begin 307 for I := 0 to DockItems.Count - 1 do 308 with TCDManagerTabsItem(DockItems[I]) do begin 309 Control.Parent := PageControl.Pages[I]; 310 Control.Align := alClient; 311 287 312 //TCDClientPanel(DockPanels[I]).ClientAreaPanel.Width := DockSite.Width; 288 313 //TCDClientPanel(DockPanels[I]).ClientAreaPanel.Height := DockSite.Height - PageControl.Height;
Note:
See TracChangeset
for help on using the changeset viewer.