Changeset 45 for DockManager/Lazarus/UCustomDockManager.pas
- Timestamp:
- Sep 17, 2010, 7:27:04 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DockManager/Lazarus/UCustomDockManager.pas
r44 r45 49 49 FDockPanels: TObjectList; // of TDockClientPanel 50 50 function FindControlInPanels(Control: TControl): TDockClientPanel; 51 procedure InsertControlPanel(Control: TControl; InsertAt: TAlign; 52 DropCtl: TControl); 51 53 public 52 54 constructor Create(ADockSite: TWinControl); override; … … 127 129 end; 128 130 129 procedure TCustomDockManager.InsertControl (Control: TControl; InsertAt: TAlign;131 procedure TCustomDockManager.InsertControlPanel(Control: TControl; InsertAt: TAlign; 130 132 DropCtl: TControl); 131 133 var … … 133 135 NewPanel: TDockClientPanel; 134 136 I: Integer; 135 NewConjoinDockForm: TConjoinDockForm; 136 begin 137 if (FDockSite is TForm) and (not Assigned(FDockSite.Parent)) then begin 138 NewConjoinDockForm := TConjoinDockForm.Create(nil); 139 NewConjoinDockForm.Visible := True; 140 Control.ManualDock(NewConjoinDockForm.Panel); 141 FDockSite.ManualDock(NewConjoinDockForm.Panel); 142 end else 143 if FDockSite is TPanel then begin 137 begin 144 138 if FDockSite.DockClientCount = 2 then begin 145 139 if (InsertAt = alTop) or (InsertAt = alBottom) then … … 149 143 FDockDirection := ddHorizontal 150 144 else FDockDirection := ddHorizontal; 151 end; 145 end;// else FDockSite.DockClientCount > 2 then begin 146 147 //end; 152 148 if FDockSite.DockClientCount > 1 then begin 153 149 NewSplitter := TSplitter.Create(nil); … … 190 186 FDockSite.DockClientCount; 191 187 end; 188 end; 189 190 procedure TCustomDockManager.InsertControl(Control: TControl; InsertAt: TAlign; 191 DropCtl: TControl); 192 var 193 NewSplitter: TSplitter; 194 NewDockPanel: TDockClientPanel; 195 NewPanel: TPanel; 196 I: Integer; 197 NewConjoinDockForm: TConjoinDockForm; 198 begin 199 if (FDockSite is TForm) then begin 200 if (not Assigned(FDockSite.Parent)) then begin 201 // Create conjointed form 202 NewConjoinDockForm := TConjoinDockForm.Create(nil); 203 NewConjoinDockForm.Visible := True; 204 Control.ManualDock(NewConjoinDockForm.Panel); 205 FDockSite.ManualDock(NewConjoinDockForm.Panel); 206 end else begin 207 NewPanel := TPanel.Create(nil); 208 NewPanel.Parent := FDockSite.Parent; 209 NewPanel.Visible := True; 210 NewPanel.Left := FDockSite.Left; 211 NewPanel.Top := FDockSite.Top; 212 NewPanel.Width := FDockSite.Width; 213 NewPanel.Height := FDockSite.Height; 214 NewPanel.UseDockManager := True; 215 NewPanel.DockSite := True; 216 NewPanel.Color := clGreen; 217 NewPanel.ManualDock(FDockSite.HostDockSite); 218 // FDockSite.Parent := nil; 219 Control.ManualDock(NewPanel); 220 FDockSite.ManualDock(NewPanel); 221 end; 222 end else 223 if FDockSite is TPanel then begin 224 InsertControlPanel(Control, InsertAt, DropCtl); 192 225 end; 193 226
Note:
See TracChangeset
for help on using the changeset viewer.