Ignore:
Timestamp:
Mar 23, 2011, 12:22:26 PM (13 years ago)
Author:
george
Message:
  • Fixed: Parent manager tabs switching.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/UCDPopupMenu.pas

    r217 r218  
    208208  if PopupComponent is TCDHeader then
    209209  with TCDHeader(PopupComponent) do begin
    210     TForm(ManagerItem.Control).Close;
     210    TForm(Control).Close;
    211211  end;
    212212end;
     
    227227  if PopupComponent is TCDHeader then
    228228  with TCDHeader(PopupComponent) do begin
    229     Value := ManagerItem.Control.Caption;
     229    Value := Control.Caption;
    230230    if InputQuery(SRenameWindow, SEnterNewWindowName, False, Value) then begin
    231       ManagerItem.Control.Caption := Value;
     231      Control.Caption := Value;
    232232      Invalidate;
    233233    end;
     
    243243  if PopupComponent is TCDHeader then
    244244  with TCDHeader(PopupComponent) do begin
    245     TCDManager(TWinControl(ManagerItem.Control).DockManager).HeaderPos := hpTop;
     245    TCDManager(TWinControl(Control).DockManager).HeaderPos := hpTop;
    246246    Invalidate;
    247247  end;
     
    256256  if PopupComponent is TCDHeader then
    257257  with TCDHeader(PopupComponent) do begin
    258     TCDManager(TWinControl(ManagerItem.Control).DockManager).HeaderPos := hpLeft;
     258    TCDManager(TWinControl(Control).DockManager).HeaderPos := hpLeft;
    259259    Invalidate;
    260260  end;
     
    269269  if PopupComponent is TCDHeader then
    270270  with TCDHeader(PopupComponent) do begin
    271     TCDManager(TWinControl(ManagerItem.Control).DockManager).HeaderPos := hpRight;
     271    TCDManager(TWinControl(Control).DockManager).HeaderPos := hpRight;
    272272    Invalidate;
    273273  end;
     
    282282  if PopupComponent is TCDHeader then
    283283  with TCDHeader(PopupComponent) do begin
    284     TCDManager(TWinControl(ManagerItem.Control).DockManager).HeaderPos := hpTop;
     284    TCDManager(TWinControl(Control).DockManager).HeaderPos := hpTop;
    285285    Invalidate;
    286286  end;
     
    295295  if PopupComponent is TCDHeader then
    296296  with TCDHeader(PopupComponent) do begin
    297     TCDManager(TWinControl(ManagerItem.Control).DockManager).HeaderPos := hpBottom;
     297    TCDManager(TWinControl(Control).DockManager).HeaderPos := hpBottom;
    298298    Invalidate;
    299299  end;
     
    302302procedure TCDPopupMenu.PopupMenuUndockClick(Sender: TObject);
    303303var
    304   Control: TControl;
    305 begin
    306   if PopupComponent is TPageControl then
    307   with TPageControl(PopupComponent) do begin
    308     Control := TCDManagerTabsItem(TCDManagerTabs(Manager).DockItems[TabIndex]).Control;
    309   end else
    310   if PopupComponent is TCDHeader then
    311   with TCDHeader(PopupComponent) do begin
    312     Control := ManagerItem.Control;
    313   end else Control := nil;
    314   if Assigned(Control) then
    315     Control.ManualFloat(Control.BoundsRect);
     304  UndockControl: TControl;
     305begin
     306  if PopupComponent is TPageControl then
     307  with TPageControl(PopupComponent) do begin
     308    UndockControl := TCDManagerTabsItem(TCDManagerTabs(Manager).DockItems[TabIndex]).Control;
     309  end else
     310  if PopupComponent is TCDHeader then
     311  with TCDHeader(PopupComponent) do begin
     312    UndockControl := Control;
     313  end else UndockControl := nil;
     314  if Assigned(UndockControl) then
     315    UndockControl.ManualFloat(UndockControl.BoundsRect);
    316316end;
    317317
Note: See TracChangeset for help on using the changeset viewer.