Changeset 186 for Docking/CoolDocking/UCoolDockLayout.pas
- Timestamp:
- Mar 10, 2011, 1:32:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/UCoolDockLayout.pas
r185 r186 7 7 uses 8 8 Classes, SysUtils, FileUtil, Contnrs, URectangle, Forms, UCoolDockCommon, 9 DOM, XMLWrite, XMLRead, Controls ;9 DOM, XMLWrite, XMLRead, Controls, Dialogs; 10 10 11 11 type … … 77 77 end; 78 78 79 function FindGlobalComponentDeep(Name: string): TComponent; 80 var 81 I: Integer; 82 begin 83 for I := 0 to Application.ComponentCount - 1 do begin 84 Result := Application.Components[I]; 85 if Result.Name = Name then Exit 86 else begin 87 Result := Result.FindComponent(Name); 88 if Assigned(Result) and (Result.Name = Name) then Exit; 89 end; 90 end; 91 end; 92 79 93 { TCoolDockLayoutList } 80 94 … … 346 360 else ParentName := ''; 347 361 if Assigned(Form.HostDockSite) then begin 348 if Assigned(Form.HostDockSite .Parent) and (Form.HostDockSite.Parent is TForm) then362 if Assigned(Form.HostDockSite) then 349 363 begin 350 HostDockSiteName := Form.HostDockSite. Parent.Name;364 HostDockSiteName := Form.HostDockSite.Name; 351 365 if not Assigned(Parent.FindByName(HostDockSiteName)) then begin 352 366 NewItem := TCoolDockLayoutItem.Create; 353 367 NewItem.Parent := Parent; 354 NewItem.DockStyle := TCoolDockManager(Form.HostDockSite. Parent.DockManager).DockStyle;368 NewItem.DockStyle := TCoolDockManager(Form.HostDockSite.DockManager).DockStyle; 355 369 Parent.Items.Add(NewItem); 356 NewItem.Store(Form.HostDockSite .Parent);370 NewItem.Store(Form.HostDockSite); 357 371 end; 358 372 end; … … 383 397 Form.Visible := Visible; 384 398 if HostDockSiteName <> '' then begin 385 ParentComponent := FindGlobalComponent (HostDockSiteName);399 ParentComponent := FindGlobalComponentDeep(HostDockSiteName); 386 400 if not Assigned(ParentComponent) then begin 387 401 ParentLayoutItem := Parent.FindByName(HostDockSiteName); … … 393 407 if FormClass = TCoolDockConjoinForm then begin 394 408 ParentComponent := TCoolDockManager(Form.DockManager).CreateContainer(alNone); 395 TCoolDockManager(TCoolDockConjoinForm(ParentComponent). Panel.DockManager).DockStyle := ParentLayoutItem.DockStyle;409 TCoolDockManager(TCoolDockConjoinForm(ParentComponent).DockManager).DockStyle := ParentLayoutItem.DockStyle; 396 410 ParentLayoutItem.Restore(TWinControl(ParentComponent)); 397 411 end; … … 400 414 end; 401 415 end; 402 if Assigned(ParentComponent) and (ParentComponent is T CoolDockConjoinForm) then403 Form.ManualDock(T CoolDockConjoinForm(ParentComponent).Panel);416 if Assigned(ParentComponent) and (ParentComponent is TWinControl) then 417 Form.ManualDock(TWinControl(ParentComponent)); 404 418 end; 405 419 Processed := True;
Note:
See TracChangeset
for help on using the changeset viewer.