Ignore:
Timestamp:
Mar 22, 2011, 11:32:28 AM (14 years ago)
Author:
george
Message:
  • Fixed: If control docked to panel owned by main form then it was possible to redock main form to conjoin form.
  • Modified: Header title is now painted to canvas instead of use of TLabel. This will be necessary to draw rotated text later.
  • Added: Length of header title is now reduced to not overlap to header buttons area.
Location:
Docking/CoolDocking/Managers
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/Managers/UCDManagerRegions.pas

    r216 r217  
    9090  PanelHeader.Header.ManagerItem := Self;
    9191  PanelHeader.Header.OnMouseDown := DockPanelMouseDown;
    92   PanelHeader.Header.Title.OnMouseDown := DockPanelMouseDown;
    9392  PanelHeader.Header.Icon.OnMouseDown := DockPanelMouseDown;
    9493
     
    123122begin
    124123  inherited SetHeaderPos(AValue);
    125   case AValue of
     124  if Assigned(DockSite.Parent) then
     125    TCDManager(DockSite.Parent.DockManager).UpdateClientSize;
     126(*  case AValue of
    126127    hpBottom, hpTop: FDockDirection := ddVertical;
    127128    hpLeft, hpRight: FDockDirection := ddHorizontal;
    128   end;
     129  end;*)
    129130end;
    130131
     
    172173  NewItem.PanelHeader.Parent := DockSite;
    173174
    174   NewItem.Control := Control;
     175  NewItem.Control := TWinControl(Control);
    175176  Control.AddHandlerOnVisibleChanged(NewItem.VisibleChange);
    176177  Control.Parent := NewItem.PanelHeader.ControlPanel;
     
    199200        // Direction change, create conjoin form
    200201        NewConjoinDockForm := CreateContainer(InsertAt);
    201         FreeParentIfEmpty := False;
    202         for I := DockSite.DockClientCount - 1 downto 0 do begin
    203           DockSite.DockClients[I].ManualDock(NewConjoinDockForm);
     202        try
     203          FreeParentIfEmpty := False;
     204          for I := DockSite.DockClientCount - 1 downto 0 do begin
     205            DockSite.DockClients[I].ManualDock(NewConjoinDockForm);
     206          end;
     207        finally
     208          FreeParentIfEmpty := True;
    204209        end;
    205         FreeParentIfEmpty := True;
    206210        NewConjoinDockForm.ManualDock(DockSite);
    207211        Control.ManualDock(DockSite, nil, InsertAt);
     
    308312    if Assigned(TWinControl(Control).DockManager) then
    309313      PanelHeader.Header.Visible := TCDManager(TWinControl(Control).DockManager).HeaderVisible;
    310     PanelHeader.Header.Title.Caption := TForm(Control).Caption;
    311314    PanelHeader.Visible := Control.Visible;
    312315    Paint(Self);
  • Docking/CoolDocking/Managers/UCDManagerTabs.pas

    r216 r217  
    254254      NewItem.IconImage.Picture.Assign((Control as TForm).Icon);
    255255
    256     NewItem.Control := Control;
     256    NewItem.Control := TWinControl(Control);
    257257    Control.AddHandlerOnVisibleChanged(NewItem.VisibleChange);
    258258    //AControl.Parent := NewItem.ClientAreaPanel;
     
    272272  if Assigned(ManagerItem) then begin
    273273    Control.RemoveHandlerOnVisibleChanged(ManagerItem.VisibleChange);
    274   end else raise Exception.Create(Format('Control %s not found in DockItems', [Control.Name]));
     274  end; //else raise Exception.Create(Format('Control %s not found in DockItems', [Control.Name]));
    275275
    276276  DockItems.Remove(ManagerItem);
  • Docking/CoolDocking/Managers/UCDManagerTabsPopup.pas

    r208 r217  
    246246    C.Align := alClient;
    247247    C.Parent := HeaderPanel.ControlPanel;
    248     HeaderPanel.Header.Title.Caption := C.Caption;
    249248    //AutoHide.Control.Align := alCustom;
    250249    //Pos := DockSite.ClientToScreen(Pos);
     
    328327      NewItem.IconImage.Picture.Assign((Control as TForm).Icon);
    329328
    330     NewItem.Control := Control;
     329    NewItem.Control := TWinControl(Control);
    331330    Control.AddHandlerOnVisibleChanged(NewItem.VisibleChange);
    332331    //AControl.Parent := NewItem.ClientAreaPanel;
Note: See TracChangeset for help on using the changeset viewer.