Changeset 62


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.
Location:
Docking/CoolDocking
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/Demo/Demo.lpi

    r61 r62  
    5454        <ResourceBaseClass Value="Form"/>
    5555        <UnitName Value="UMainForm"/>
     56        <IsVisibleTab Value="True"/>
    5657        <EditorIndex Value="4"/>
    5758        <WindowIndex Value="0"/>
    58         <TopLine Value="79"/>
    59         <CursorPos X="19" Y="92"/>
     59        <TopLine Value="58"/>
     60        <CursorPos X="3" Y="71"/>
    6061        <UsageCount Value="126"/>
    6162        <Loaded Value="True"/>
     
    339340        <Filename Value="..\UCoolDocking.pas"/>
    340341        <UnitName Value="UCoolDocking"/>
    341         <IsVisibleTab Value="True"/>
    342342        <EditorIndex Value="1"/>
    343343        <WindowIndex Value="0"/>
    344344        <TopLine Value="899"/>
    345         <CursorPos X="76" Y="904"/>
     345        <CursorPos X="20" Y="912"/>
    346346        <UsageCount Value="53"/>
    347347        <Loaded Value="True"/>
     
    523523        <TopLine Value="126"/>
    524524        <CursorPos X="89" Y="147"/>
    525         <UsageCount Value="10"/>
     525        <UsageCount Value="11"/>
    526526        <Loaded Value="True"/>
    527527      </Unit53>
  • Docking/CoolDocking/Demo/UMainForm.pas

    r61 r62  
    6464begin
    6565  NewDockForm.ManualDock(Panel1);
    66  // NewDockForm.ManualDock(Panel1);
    67   //ConjoinedDockForm1 := TCoolDockManager(Panel1.DockManager).CreateContainer(alRight);
    68   //ConjoinedDockForm1.Name := 'Model';;
    69   //TCoolDockManager(ConjoinedDockForm1.Panel.DockManager).TabsPos := hpLeft;
    70   //ConjoinedDockForm1.ManualDock(Panel1);
    71   //TCoolDockManager(ConjoinedDockForm1.Panel.DockManager).DockStyle := dsTabs;
     66  NewDockForm.ManualDock(Panel1);
     67  ConjoinedDockForm1 := TCoolDockManager(Panel1.DockManager).CreateContainer(alRight);
     68  ConjoinedDockForm1.Name := 'Model';;
     69  TCoolDockManager(ConjoinedDockForm1.Panel.DockManager).TabsPos := hpLeft;
     70  ConjoinedDockForm1.ManualDock(Panel1);
     71  TCoolDockManager(ConjoinedDockForm1.Panel.DockManager).DockStyle := dsTabs;
    7272  (*NewDockForm.ManualDock(ConjoinedDockForm1.Panel);
    7373  NewDockForm.ManualDock(ConjoinedDockForm1.Panel);
  • 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.