Changeset 61 for Docking/CoolDocking/UCoolDocking.pas
- Timestamp:
- Sep 29, 2010, 9:14:55 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/UCoolDocking.pas
r60 r61 10 10 Classes, SysUtils, Controls, LCLType, LMessages, Graphics, StdCtrls, 11 11 Buttons, ExtCtrls, Contnrs, Forms, ComCtrls, Dialogs, Menus, FileUtil, 12 UCoolDockCustomize, DOM, XMLWrite, XMLRead, UCoolDockWindowList; 12 UCoolDockCustomize, DOM, XMLWrite, XMLRead, UCoolDockWindowList, 13 DateUtils; 13 14 14 15 const … … 38 39 39 40 TCoolDockHeader = class(TPanel) 41 private 42 procedure CloseButtonClick(Sender: TObject); 43 procedure DrawGrabber(Canvas: TCanvas; AControl: TControl); 44 public 40 45 CloseButton: TSpeedButton; 41 46 Title: TLabel; … … 45 50 constructor Create(TheOwner: TComponent); override; 46 51 destructor Destroy; override; 47 private48 procedure CloseButtonClick(Sender: TObject);49 procedure DrawGrabber(Canvas: TCanvas; AControl: TControl);50 52 end; 51 53 … … 158 160 FCoolDockCustomize: TCoolDockCustomize; 159 161 FDefaultHeaderPos: THeaderPos; 162 FDefaultTabsPos: THeaderPos; 160 163 FShowIcons: Boolean; 161 164 FTabsEnabled: Boolean; … … 177 180 published 178 181 property TabsEnabled: Boolean read FTabsEnabled write SetTabsEnabled; 182 property DefaultTabsPos: THeaderPos read FDefaultTabsPos 183 write FDefaultTabsPos; 179 184 property DefaultHeaderPos: THeaderPos read FDefaultHeaderPos 180 185 write FDefaultHeaderPos; … … 194 199 procedure SetFloatable(const AValue: Boolean); 195 200 procedure SetMaster(const AValue: TCoolDockMaster); 201 procedure SetPanel(const AValue: TPanel); 202 public 196 203 constructor Create(AOwner: TComponent); override; 197 204 destructor Destroy; override; 198 procedure SetPanel(const AValue: TPanel);199 205 published 200 206 property Dockable: Boolean read FDockable … … 716 722 TCoolDockClientPanel(FDockPanels[I]).ClientAreaPanel.Parent := TCoolDockClientPanel(FDockPanels[I]); 717 723 TCoolDockClientPanel(FDockPanels[I]).ClientAreaPanel.Visible := True; 724 TCoolDockClientPanel(FDockPanels[I]).Control.Visible := True; 718 725 end; 719 726 end; … … 725 732 if FMaster = AValue then Exit; 726 733 FMaster := AValue; 734 TabsPos := AValue.DefaultTabsPos; 727 735 end; 728 736 … … 792 800 for I := 0 to FDockPanels.Count - 1 do begin 793 801 TCoolDockClientPanel(FDockPanels[I]).ClientAreaPanel.Visible := False; 802 TCoolDockClientPanel(FDockPanels[I]).Control.Visible := False; 794 803 end; 795 804 if (TabControl.TabIndex <> -1) and (FDockPanels.Count > TabControl.TabIndex) then begin 796 805 with TCoolDockClientPanel(FDockPanels[TabControl.TabIndex]), ClientAreaPanel do begin 806 Control.Show; 797 807 if AutoHide then begin 798 808 Parent := nil; … … 892 902 begin 893 903 if (Button = mbLeft) and (TabControl.TabIndex <> -1) then begin 904 TCoolDockClientPanel(FDockPanels[TabControl.TabIndex]).ClientAreaPanel.DockSite := False; 894 905 DragManager.DragStart(TCoolDockClientPanel(FDockPanels[TabControl.TabIndex]).Control, False, 1); 895 906 end; … … 911 922 912 923 procedure TCoolDockClientPanel.VisibleChange(Sender: TObject); 913 begin 914 if Assigned(Control) then begin 924 var 925 Visible: Boolean; 926 begin 927 (*if Assigned(Control) then begin 928 Visible := Control.Visible; 915 929 if Assigned(ClientAreaPanel) then 916 ClientAreaPanel.Visible := Control.Visible;930 ClientAreaPanel.Visible := Visible; 917 931 if Assigned(Splitter) then 918 Splitter.Visible := Control.Visible;932 Splitter.Visible := Visible; 919 933 OwnerDockManager.UpdateClientSize; 920 end; 934 end;*) 921 935 end; 922 936 … … 936 950 begin 937 951 inherited; 952 ShowHeader := True; 938 953 Header := TCoolDockHeader.Create(Self); 939 954 with Header do begin … … 964 979 BevelInner := bvNone; 965 980 BevelOuter := bvNone; 966 ShowHeader := True;967 981 AutoHide := False; 968 982 HeaderPos := hpTop; … … 989 1003 R: TRect; 990 1004 begin 1005 if (csDestroyingHandle in ControlState) then 991 1006 if Assigned(Control) then begin 992 1007 R := Control.ClientRect; … … 1009 1024 end; 1010 1025 if (Button = mbLeft) then begin 1011 DragManager.DragStart(Control, False, 1); 1026 //(Control as TWinControl).DockSite := False; 1027 ClientAreaPanel.DockSite := False; 1028 (Control as TWinControl).BeginDrag(True); 1029 //DragManager.DragStart(Control, False, 1); 1012 1030 end; 1013 1031 end; … … 1179 1197 1180 1198 destructor TCoolDockMaster.Destroy; 1181 begin 1199 var 1200 I: Integer; 1201 begin 1202 // Assigning nil to Client Master property cause unregistring client from list 1203 for I := FClients.Count - 1 downto 0 do 1204 TCoolDockClient(FClients[I]).Master := nil; 1182 1205 FClients.Free; 1183 1206 Customize := nil; … … 1188 1211 begin 1189 1212 if Assigned(Client) then 1190 if FClients.IndexOf(Client) <>-1 then begin1213 if FClients.IndexOf(Client) = -1 then begin 1191 1214 FClients.Add(Client); 1192 1215 Client.Master := Self; … … 1357 1380 DragKind := dkDock; 1358 1381 DragMode := dmAutomatic; 1382 DockSite := True; 1359 1383 end else begin 1360 1384 DragKind := dkDrag; 1361 1385 DragMode := dmManual; 1386 DockSite := False; 1362 1387 end; 1363 1388 end; … … 1380 1405 DragKind := dkDock; 1381 1406 DragMode := dmAutomatic; 1407 DockSite := True; 1382 1408 end; 1383 DockSite := True;1384 1409 UseDockManager := True; 1385 1410 DockManager := TCoolDockManager.Create(TWinControl(AOwner));
Note:
See TracChangeset
for help on using the changeset viewer.