Changeset 183 for Docking/CoolDocking/UCoolDockStyleTabs.pas
- Timestamp:
- Mar 10, 2011, 7:55:48 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/UCoolDockStyleTabs.pas
r182 r183 25 25 procedure TabControlMouseUp(Sender: TObject; Button: TMouseButton; 26 26 Shift: TShiftState; X, Y: Integer); 27 procedure InsertControl(NewPanel: TCoolDockClientPanel; 28 AControl: TControl; InsertAt: TAlign); override; 27 procedure InsertControl(AControl: TControl; InsertAt: TAlign); override; 29 28 procedure UpdateClientSize; override; 30 29 private 31 30 FTabsPos: THeaderPos; 32 procedure InsertControlNoUpdate( NewPanel: TCoolDockClientPanel;33 AControl: TControl; InsertAt: TAlign);31 procedure InsertControlNoUpdate(AControl: TControl; InsertAt: TAlign); 32 procedure RemoveControl(Control: TControl); override; 34 33 public 35 34 constructor Create(AManager: TCoolDockManagerBase); … … 162 161 MultiLine := True; 163 162 PopupMenu := TCoolDockManager(Manager).PopupMenu; 163 OnMouseLeave := TabControlMouseLeave; 164 OnMouseDown := TabControlMouseDown; 164 165 //TTabControlNoteBookStrings(Tabs).NoteBook.OnMouseLeave := TabControlMouseLeave; 165 166 //TTabControlNoteBookStrings(Tabs).NoteBook.OnMouseDown := TabControlMouseDown; … … 175 176 with TCoolDockManager(Manager) do 176 177 for I := 0 to DockPanels.Count - 1 do 177 Self.InsertControlNoUpdate(TCoolDockClientPanel(DockPanels[I]), 178 TCoolDockClientPanel(DockPanels[I]).Control, alNone); 178 Self.InsertControlNoUpdate(TCoolDockClientPanel(DockPanels[I]).Control, alNone); 179 179 TabControlChange(Self); 180 180 end; … … 193 193 end; 194 194 195 procedure TCoolDockStyleTabs.InsertControlNoUpdate(NewPanel: TCoolDockClientPanel; 196 AControl: TControl; InsertAt: TAlign); 195 procedure TCoolDockStyleTabs.InsertControlNoUpdate(AControl: TControl; InsertAt: TAlign); 197 196 var 198 197 NewTabSheet: TTabSheet; 198 NewPanel: TCoolDockClientPanel; 199 199 begin 200 200 inherited; 201 with TCoolDockManager(Manager) do begin 202 NewPanel := TCoolDockClientPanel.Create(nil); 203 with NewPanel do begin 204 Parent := TCoolDockManager(Manager).DockSite; 205 OwnerDockManager := Self; 206 if DockStyle = dsList then Visible := True; 207 Align := alClient; 208 Header.PopupMenu := TCoolDockManager(Manager).PopupMenu; 209 //PopupMenu.Parent := Self.DockSite; 210 end; 211 if (AControl is TForm) and Assigned((AControl as TForm).Icon) then 212 NewPanel.Header.Icon.Picture.Assign((AControl as TForm).Icon); 213 214 NewPanel.Control := AControl; 215 AControl.AddHandlerOnVisibleChanged(NewPanel.VisibleChange); 216 AControl.Parent := NewPanel.ClientAreaPanel; 217 AControl.Align := alClient; 218 if (InsertAt = alTop) or (InsertAt = alLeft) then 219 DockPanels.Insert(0, NewPanel) 220 else DockPanels.Add(NewPanel); 221 222 end; 223 201 224 if AControl.Visible then begin 202 225 NewTabSheet := TTabSheet.Create(PageControl); … … 213 236 end; 214 237 215 procedure TCoolDockStyleTabs.InsertControl(NewPanel: TCoolDockClientPanel; 216 AControl: TControl; InsertAt: TAlign); 238 procedure TCoolDockStyleTabs.RemoveControl(Control: TControl); 239 begin 240 inherited RemoveControl(Control); 241 end; 242 243 procedure TCoolDockStyleTabs.InsertControl(AControl: TControl; InsertAt: TAlign); 217 244 var 218 245 NewTabSheet: TTabSheet; 219 246 begin 220 247 inherited; 221 InsertControlNoUpdate( NewPanel,AControl, InsertAt);248 InsertControlNoUpdate(AControl, InsertAt); 222 249 TabControlChange(Self); 223 250 end;
Note:
See TracChangeset
for help on using the changeset viewer.