Changeset 103 for Docking/CoolDocking/UCoolDockClientPanel.pas
- Timestamp:
- Dec 29, 2010, 1:56:04 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/UCoolDockClientPanel.pas
r98 r103 7 7 uses 8 8 Classes, Controls, SysUtils, Forms, StdCtrls, ExtCtrls, Graphics, 9 Buttons , UCoolDockPopupMenu;9 Buttons; 10 10 11 11 type … … 38 38 FHeaderPos: THeaderPos; 39 39 FShowHeader: Boolean; 40 FControl: TControl; 40 41 function GetAutoHideEnabled: Boolean; 42 function GetControl: TControl; 41 43 procedure SetAutoHide(const AValue: Boolean); 42 44 procedure SetAutoHideEnabled(const AValue: Boolean); 45 procedure SetControl(const AValue: TControl); 43 46 procedure SetHeaderPos(const AValue: THeaderPos); 44 47 procedure SetShowHeader(const AValue: Boolean); 45 48 public 46 49 OwnerDockManager: TObject; // TCoolDockManager; 47 Control: TControl;48 50 Splitter: TSplitter; 49 51 ClientAreaPanel: TPanel; … … 60 62 write SetAutoHideEnabled; 61 63 property HeaderPos: THeaderPos read FHeaderPos write SetHeaderPos; 64 property Control: TControl read GetControl write SetControl; 62 65 end; 63 66 … … 78 81 procedure TCoolDockClientPanel.VisibleChange(Sender: TObject); 79 82 var 80 Visible: Boolean; 81 begin 82 (*if Assigned(Control) then begin 83 Visible := Control.Visible; 84 if Assigned(ClientAreaPanel) then 85 ClientAreaPanel.Visible := Visible; 83 ControlVisible: Boolean; 84 Temp: TControl; 85 Temp2: TControl; 86 begin 87 Temp := TControl(Sender); 88 if Assigned(Control) then 89 begin 90 91 ControlVisible := TControl(Sender).Visible; 92 (*if Assigned(ClientAreaPanel) then 93 ClientAreaPanel.Visible := ControlVisible; 86 94 if Assigned(Splitter) then 87 Splitter.Visible := Visible; 88 OwnerDockManager.UpdateClientSize; 89 end;*) 95 Splitter.Visible := ControlVisible; 96 *) 97 // if Assigned(TCoolDockManager(OwnerDockManager).DockStyleHandler) then 98 if Assigned(OwnerDockManager) then 99 with TCoolDockManager(OwnerDockManager) do 100 if Assigned(DockStyleHandler) then 101 with DockStyleHandler do begin 102 if ControlVisible then 103 Switch(DockPanels.IndexOf(FindControlInPanels(TControl(Sender)))); 104 //UpdateClientSize; 105 ChangeVisible(TWinControl(Control), ControlVisible); 106 // Show parent control 107 Temp := TControl(Sender).HostDockSite; 108 109 if ControlVisible then 110 TControl(Sender).HostDockSite.Visible := ControlVisible; 111 end; 112 if csDestroying in Control.ComponentState then Control := nil; 113 end; 90 114 end; 91 115 … … 100 124 end; 101 125 126 function TCoolDockClientPanel.GetControl: TControl; 127 begin 128 Result := FControl; 129 end; 130 102 131 procedure TCoolDockClientPanel.SetAutoHideEnabled(const AValue: Boolean); 103 132 begin 104 133 134 end; 135 136 procedure TCoolDockClientPanel.SetControl(const AValue: TControl); 137 begin 138 FControl := AValue; 105 139 end; 106 140 … … 148 182 149 183 destructor TCoolDockClientPanel.Destroy; 150 begin 184 var 185 Temp: TControl; 186 begin 187 Temp := Control; 188 //if ClientAreaPanel.GetControlIndex(Control) <> - 1 then 189 if Assigned(Control) then 190 Control.RemoveHandlerOnVisibleChanged(VisibleChange); 191 // If panel is destroyed undock docket control 192 //TWinControl(Control).ManualFloat(TWinControl(Control).BoundsRect); 193 151 194 inherited Destroy; 152 195 end; … … 154 197 procedure TCoolDockClientPanel.ResizeExecute(Sender: TObject); 155 198 begin 156 Control.Top := GrabberSize; 157 Control.Left := 0; 158 Control.Width := Width; 159 Control.Height := Height - GrabberSize; 160 //Control.SetBounds(0, GrabberSize, Width - Control.Left, 161 // Height - Control.Top); 199 if Assigned(Control) then begin 200 Control.Top := GrabberSize; 201 Control.Left := 0; 202 Control.Width := Width; 203 Control.Height := Height - GrabberSize; 204 //Control.SetBounds(0, GrabberSize, Width - Control.Left, 205 // Height - Control.Top); 206 end; 162 207 end; 163 208
Note:
See TracChangeset
for help on using the changeset viewer.