Ignore:
Timestamp:
Mar 18, 2011, 1:24:37 PM (14 years ago)
Author:
george
Message:
  • Fixed: Controls docked in Popup Tabs Manager was not removed due wrong RemoveControl method inheritance.
  • Fixed: Tabs in Tabs manager was not update properly.
  • Added: HeaderPos stored in Layout.
File:
1 edited

Legend:

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

    r207 r208  
    6565    procedure UpdatePopupFormBounds;
    6666    procedure TabControlChange(Sender: TObject); override;
     67    procedure PopupFormMouseLeave(Sender: TObject);
    6768  public
    6869    AutoHideEnabled: Boolean;
     
    7172    HeaderPanel: TCDPanelHeader;
    7273    Splitter: TPanel;
     74    procedure RemoveControl(Control: TControl); override;
    7375    procedure SetHeaderPos(const AValue: THeaderPos); override;
    7476    procedure PinShowButtonClick(Sender: TObject);
     
    253255end;
    254256
     257procedure TCDManagerTabsPopup.PopupFormMouseLeave(Sender: TObject);
     258begin
     259  if PopupForm.Visible then AutoHide.Hide;
     260end;
     261
     262procedure TCDManagerTabsPopup.RemoveControl(Control: TControl);
     263begin
     264  if DockItems.Count <= 2 then
     265    PageControl.OnResize := nil;
     266  inherited;
     267end;
     268
    255269constructor TCDManagerTabsPopup.Create(ADockSite: TWinControl);
    256270var
     
    263277  PopupForm.Visible := True;
    264278  PopupForm.BorderStyle := bsNone;
     279  PopupForm.OnMouseLeave := PopupFormMouseLeave;
    265280  HeaderPanel := TCDPanelHeader.Create(nil);
    266281  HeaderPanel.Parent := PopupForm;
     
    276291  AutoHide.Control := PopupForm;
    277292  PageControl.OnResize := PageControlResize;
     293  HeaderVisible := False;
    278294
    279295  for I := 0 to DockItems.Count - 1 do begin
     
    288304  AutoHide.Free;
    289305  PopupForm.Free;
     306  Splitter.Free;
    290307  HeaderPanel.Free;
    291308  inherited Destroy;
     
    306323    NewItem := TCDManagerTabsPopupItem.Create;
    307324    with NewItem do begin
    308       //Panel.Parent := Self.DockSite;
    309325      Manager := Self;
    310       //if DockStyle = dsList then Visible := True;
    311       //Align := alClient;
    312       //Header.PopupMenu := Self.PopupMenu;
    313       //PopupMenu.Parent := Self.DockSite;
    314326    end;
    315327    if (Control is TForm) and Assigned((Control as TForm).Icon) then
    316       NewItem.Icon.Picture.Assign((Control as TForm).Icon);
     328      NewItem.IconImage.Picture.Assign((Control as TForm).Icon);
    317329
    318330    NewItem.Control := Control;
     
    323335      DockItems.Insert(0, NewItem)
    324336      else DockItems.Add(NewItem);
    325 
    326   end;
    327 
    328     NewTabSheet := TTabSheet.Create(PageControl);
    329     NewTabSheet.PageControl := PageControl;
    330     NewTabSheet.Caption := Control.Caption;
    331     NewTabSheet.ImageIndex := TabImageList.Count;
    332     NewTabSheet.TabVisible := Control.Visible;
    333     Control.Parent := NewTabSheet;
    334     TabImageList.Add(NewItem.Icon.Picture.Bitmap, nil);
    335 //    if Assigned(NewItem.Splitter) then
    336 //      NewItem.Splitter.Visible := False;
    337 //    NewItem.ClientAreaPanel.Visible := False;
    338 //    NewItem.Visible := False;
    339     //NewItem.Parent := NewTabSheet;
     337  end;
    340338end;
    341339
Note: See TracChangeset for help on using the changeset viewer.