Ignore:
Timestamp:
Jun 7, 2012, 9:45:29 AM (12 years ago)
Author:
chronos
Message:
  • Fixed: Associate PopupMenu in TCDManagerTabs only to PageControl tabs and not to page content area.
File:
1 edited

Legend:

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

    r365 r373  
    4040    function GetHeaderPos: THeaderPos; override;
    4141    function FindTabSheet(TabSheet: TTabSheet): TCDManagerTabsItem;
     42    procedure PageControlContextPopup(Sender: TObject; MousePos: TPoint;
     43      var Handled: Boolean);
    4244  public
    4345    MouseDownSkip: Boolean;
     
    189191    MultiLine := True;
    190192    AutoSize := True;
    191     PopupMenu := Self.PopupMenu;
     193    OnContextPopup := PageControlContextPopup;
    192194    OnMouseLeave := TabControlMouseLeave;
    193195    OnMouseDown := TabControlMouseDown;
     
    307309end;
    308310
     311procedure TCDManagerTabs.PageControlContextPopup(Sender: TObject;
     312  MousePos: TPoint; var Handled: Boolean);
     313var
     314  I: Integer;
     315  R: TRect;
     316begin
     317  with Sender as TPageControl do begin
     318    PopupMenu := nil;
     319    for I := 0 to PageControl.PageCount - 1 do begin
     320      R := PageControl.TabRect(I);
     321      if (MousePos.X >= R.Left) and (MousePos.Y >= R.Top) and
     322        (MousePos.X <= R.Right) and (MousePos.Y <= R.Bottom) then begin
     323          PopupMenu := Self.PopupMenu;
     324          Break;
     325        end;
     326    end;
     327  end;
     328end;
     329
    309330procedure TCDManagerTabs.BringToFront;
    310331begin
Note: See TracChangeset for help on using the changeset viewer.