Ignore:
Timestamp:
Sep 24, 2010, 10:13:50 AM (14 years ago)
Author:
george
Message:
  • Opraveno: Aktualizace ikony při ukotvení nové záložky.
  • Opraveno: Obsluha události OnMouseDown pro záložky a opětovné umožnění uchopení oken přes záložky.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/UCoolDocking.pas

    r59 r60  
    9595    FDockPanels: TObjectList; // of TCoolDockClientPanel
    9696    function FindControlInPanels(Control: TControl): TCoolDockClientPanel;
     97    function GetDockSite: TWinControl;
    9798    procedure InsertControlPanel(Control: TControl; InsertAt: TAlign;
    9899      DropCtl: TControl);
     
    148149    property TabsPos: THeaderPos read FTabsPos write SetTabsPos;
    149150    property Master: TCoolDockMaster read FMaster write SetMaster;
     151    property DockSite: TWinControl read GetDockSite;
    150152  end;
    151153
     
    186188  private
    187189    FDockable: Boolean;
     190    FFloatable: Boolean;
    188191    FMaster: TCoolDockMaster;
    189192    FPanel: TPanel;
    190193    procedure SetDockable(const AValue: Boolean);
     194    procedure SetFloatable(const AValue: Boolean);
    191195    procedure SetMaster(const AValue: TCoolDockMaster);
    192196    constructor Create(AOwner: TComponent); override;
     
    196200    property Dockable: Boolean read FDockable
    197201      write SetDockable default True;
     202    property Floatable: Boolean read FFloatable
     203      write SetFloatable default True;
    198204    property Master: TCoolDockMaster read FMaster
    199205      write SetMaster;
     
    247253  SCustomize = 'Customize...';
    248254  SWrongOwner = 'Owner of TCoolDockClient have to be TForm';
     255  SEnterNewWindowName = 'Enter new window name';
     256  SRenameWindow = 'Rename window';
    249257
    250258procedure Register;
     
    269277  if I < FDockPanels.Count then Result := TCoolDockClientPanel(FDockPanels[I])
    270278    else Result := nil;
     279end;
     280
     281function TCoolDockManager.GetDockSite: TWinControl;
     282begin
     283  Result := FDockSite;
    271284end;
    272285
     
    429442    OnChange := TabControlChange;
    430443    PopupMenu := PopupMenuTabs;
    431     OnMouseDown := TabControlMouseDown;
     444    //OnMouseDown := TabControlMouseDown;
     445    TTabControlNoteBookStrings(Tabs).NoteBook.OnMouseDown := TabControlMouseDown;
    432446    Images := TabImageList;
    433447  end;
     
    518532    if DockStyle = dsTabs then begin
    519533      TabControl.Tabs.Add(Control.Caption);
     534      TabImageList.Add(NewPanel.Header.Icon.Picture.Bitmap, nil);
    520535      if Assigned(NewPanel.Splitter) then
    521536        NewPanel.Splitter.Visible := False;
     
    820835
    821836procedure TCoolDockManager.PopupMenuRenameClick(Sender: TObject);
    822 begin
    823 
     837var
     838  Value: string;
     839begin
     840  Value := DockSite.Parent.Caption;
     841  if InputQuery(SRenameWindow, SEnterNewWindowName, False, Value) then
     842    DockSite.Parent.Caption := Value;
    824843end;
    825844
     
    850869
    851870procedure TCoolDockManager.PopupMenuUndockClick(Sender: TObject);
    852 begin
    853 
     871var
     872  Control: TControl;
     873begin
     874
     875  //Control.ManualFloat(Control.BoundsRect);
    854876end;
    855877
     
    13301352  if FDockable = AValue then Exit;
    13311353  FDockable := AValue;
    1332   if not (Owner is TForm) then
     1354  if (Owner is TForm) then
    13331355  with (Owner as TForm) do
    13341356  if AValue then begin
     
    13391361    DragMode := dmManual;
    13401362  end;
     1363end;
     1364
     1365procedure TCoolDockClient.SetFloatable(const AValue: Boolean);
     1366begin
     1367  if FFloatable = AValue then Exit;
     1368  FFloatable := AValue;
    13411369end;
    13421370
Note: See TracChangeset for help on using the changeset viewer.