Ignore:
Timestamp:
Sep 29, 2010, 9:34:34 AM (14 years ago)
Author:
george
Message:
  • Upraveno: Zamezení ihned startu kotvení záložky při pokliku na záložku.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/UCoolDocking.pas

    r61 r62  
    8484  TCoolDockManager = class(TDockManager)
    8585  private
     86    MouseDown: Boolean;
     87    MouseButton: TMouseButton;
    8688    FMaster: TCoolDockMaster;
    8789    FMoveDuration: Integer;
     
    105107    procedure SetMoveDuration(const AValue: Integer);
    106108    procedure SetTabsPos(const AValue: THeaderPos);
     109    procedure TabControlMouseLeave(Sender: TObject);
     110    procedure TabControlChange(Sender: TObject);
     111    procedure TabControlMouseDown(Sender: TObject; Button: TMouseButton;
     112      Shift: TShiftState; X, Y: Integer);
     113    procedure TabControlMouseUp(Sender: TObject; Button: TMouseButton;
     114      Shift: TShiftState; X, Y: Integer);
    107115    procedure UpdateClientSize;
    108     procedure TabControlChange(Sender: TObject);
    109116    procedure PopupMenuListClick(Sender: TObject);
    110117    procedure PopupMenuTabsClick(Sender: TObject);
     
    119126    procedure PopupMenuCustomizeClick(Sender: TObject);
    120127    procedure Timer1Timer(Sender: TObject);
    121     procedure TabControlMouseDown(Sender: TObject; Button: TMouseButton;
    122       Shift: TShiftState; X, Y: Integer);
    123128  public
    124129    constructor Create(ADockSite: TWinControl); override;
     
    290295end;
    291296
     297procedure TCoolDockManager.TabControlMouseLeave(Sender: TObject);
     298begin
     299  if MouseDown then
     300  if (TabControl.TabIndex <> -1) then begin
     301    TCoolDockClientPanel(FDockPanels[TabControl.TabIndex]).ClientAreaPanel.DockSite := False;
     302    DragManager.DragStart(TCoolDockClientPanel(FDockPanels[TabControl.TabIndex]).Control, False, 1);
     303  end;
     304  MouseDown := False;
     305end;
     306
    292307constructor TCoolDockManager.Create(ADockSite: TWinControl);
    293308var
     
    448463    OnChange := TabControlChange;
    449464    PopupMenu := PopupMenuTabs;
    450     //OnMouseDown := TabControlMouseDown;
     465    TTabControlNoteBookStrings(Tabs).NoteBook.OnMouseLeave := TabControlMouseLeave;
    451466    TTabControlNoteBookStrings(Tabs).NoteBook.OnMouseDown := TabControlMouseDown;
     467    TTabControlNoteBookStrings(Tabs).NoteBook.OnMouseUp := TabControlMouseUp;
    452468    Images := TabImageList;
    453469  end;
     
    901917      Shift: TShiftState; X, Y: Integer);
    902918begin
    903   if (Button = mbLeft) and (TabControl.TabIndex <> -1) then begin
    904     TCoolDockClientPanel(FDockPanels[TabControl.TabIndex]).ClientAreaPanel.DockSite := False;
    905     DragManager.DragStart(TCoolDockClientPanel(FDockPanels[TabControl.TabIndex]).Control, False, 1);
    906   end;
     919  MouseDown := True;
     920  MouseButton := Button;
     921end;
     922
     923procedure TCoolDockManager.TabControlMouseUp(Sender: TObject;
     924  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
     925begin
     926  MouseDown := False;
    907927end;
    908928
Note: See TracChangeset for help on using the changeset viewer.