Changeset 199 for Docking/CoolDocking/Managers/UCDManagerTabsPopup.pas
- Timestamp:
- Mar 16, 2011, 2:17:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/Managers/UCDManagerTabsPopup.pas
r198 r199 16 16 FDuration: Real; 17 17 FStepCount: Integer; 18 FTabPosition: TTabPosition; 18 19 StartBounds: TRect; 19 20 procedure SetDuration(const AValue: Real); … … 24 25 Position: Real; 25 26 Direction: Integer; 26 TabPosition: TTabPosition;27 27 Enable: Boolean; 28 28 Timer: TTimer; … … 34 34 destructor Destroy; override; 35 35 procedure TimerExecute(Sender: TObject); 36 property TabPosition: TTabPosition read FTabPosition write FTabPosition; 36 37 property Duration: Real read FDuration write SetDuration; 37 38 property StepCount: Integer read FStepCount write SetStepCount; … … 53 54 AutoHideEnabled: Boolean; 54 55 AutoHide: TCDAutoHide; 55 Popup Panel: TPanel;56 PopupForm: TForm; 56 57 procedure SetHeaderPos(const AValue: THeaderPos); override; 57 58 procedure PinShowButtonClick(Sender: TObject); … … 87 88 Control.Height := Round((StartBounds.Bottom - StartBounds.Top) * Position); 88 89 end; 90 tpLeft: begin 91 Control.Width := Round((StartBounds.Right - StartBounds.Left) * Position); 92 end; 89 93 tpRight: begin 90 Control.Width := Round((StartBounds.Right - StartBounds.Left) * Position);91 end;92 tpLeft: begin93 94 Control.Width := Round((StartBounds.Right - StartBounds.Left) * Position); 94 95 Control.Left := StartBounds.Right - Control.Width; … … 119 120 begin 120 121 StartBounds := Control.BoundsRect; 122 Control.Show; 123 Control.BringToFront; 121 124 Direction := -1; 122 125 Position := 1; … … 128 131 begin 129 132 StartBounds := Control.BoundsRect; 133 //StartBounds := Bounds(0, 0, Control.UndockWidth, Control.UndockHeight); 130 134 Control.Show; 131 Control.Align := alCustom; 135 Control.BringToFront; 136 Control.Align := alClient; 132 137 Direction := 1; 133 138 Position := 0; … … 143 148 Timer.OnTimer := TimerExecute; 144 149 StepCount := 10; 145 Duration := 0. 5;150 Duration := 0.05; 146 151 end; 147 152 … … 164 169 if Direction = -1 then begin 165 170 Position := Position - 1 / StepCount; 166 if Position < 1then begin171 if Position < 0 then begin 167 172 Position := 0; 168 173 Timer.Enabled := False; … … 186 191 187 192 procedure TCDManagerTabsPopup.TabControlChange(Sender: TObject); 193 var 194 Pos: TPoint; 195 C: TControl; 188 196 begin 189 197 inherited TabControlChange(Sender); 190 if PopupPanel.ControlCount > 0 then 191 PopupPanel.Controls[0].Parent := nil; 198 MouseDownSkip := True; 199 if PopupForm.ControlCount > 0 then 200 PopupForm.Controls[0].Parent := nil; 192 201 AutoHide.Hide; 202 while AutoHide.Position > 0 do begin 203 Application.ProcessMessages; 204 Sleep(1); 205 end; 193 206 if PageControl.TabIndex >= 0 then begin 194 TCDManagerTabsPopupItem(DockItems[PageControl.TabIndex]).Control.Parent := PopupPanel; 195 AutoHide.Control.Align := alCustom; 207 C := TCDManagerTabsPopupItem(DockItems[PageControl.TabIndex]).Control; 208 C.Parent := PopupForm; 209 //AutoHide.Control.Align := alCustom; 210 Pos := Point(PageControl.Left, PageControl.Top); 211 Pos := DockSite.ClientToScreen(Pos); 196 212 with AutoHide.Control do 197 213 case AutoHide.TabPosition of 198 tpTop: SetBounds(PageControl.Left, PageControl.Top + PageControl.Height, 199 PageControl.Width, Height); 200 tpLeft: SetBounds(PageControl.Left + PageControl.Width, PageControl.Top, 201 Width, PageControl.Height); 202 tpBottom: SetBounds(PageControl.Left, PageControl.Top - Height, 203 PageControl.Width, Height); 204 tpRight: SetBounds(PageControl.Left - Width, PageControl.Top, 205 Width, PageControl.Height); 206 end; 214 tpTop: begin 215 SetBounds(Pos.X, Pos.Y + PageControl.Height, 216 PageControl.Width, C.TBDockHeight); 217 end; 218 tpLeft: begin 219 SetBounds(Pos.X + PageControl.Width, Pos.Y, 220 C.LRDockWidth, PageControl.Height); 221 end; 222 tpBottom: begin 223 SetBounds(Pos.X, Pos.Y - C.TBDockHeight, 224 PageControl.Width, C.TBDockHeight); 225 end; 226 tpRight: begin 227 SetBounds(Pos.X - C.LRDockWidth, Pos.Y, 228 C.LRDockWidth, PageControl.Height); 229 end; 230 end; 231 //AutoHide.Control.SetBounds(0, 0, 100, 100); 207 232 AutoHide.Show; 208 233 end; … … 215 240 inherited; 216 241 FDockStyle := dsPopupTabs; 217 PopupPanel := TPanel.Create(nil); 218 PopupPanel.DockManager := TCDManagerRegions.Create(PopupPanel); 219 PopupPanel.Visible := True; 242 PopupForm := TForm.Create(nil); 243 PopupForm.DockManager := TCDManagerRegions.Create(PopupForm); 244 PopupForm.Visible := True; 245 //PopupForm.Parent := ADockSite; 246 PopupForm.BorderStyle := bsNone; 220 247 AutoHide := TCDAutoHide.Create; 221 AutoHide.Control := Popup Panel;248 AutoHide.Control := PopupForm; 222 249 223 250 for I := 0 to DockItems.Count - 1 do begin … … 225 252 // if 226 253 end; 254 HeaderPos := HeaderPos; // Reset position 227 255 end; 228 256 … … 230 258 begin 231 259 AutoHide.Free; 232 Popup Panel.Free;260 PopupForm.Free; 233 261 inherited Destroy; 234 262 end; … … 281 309 inherited SetHeaderPos(AValue); 282 310 AutoHide.TabPosition := HeaderPosToTabPos(AValue); 311 with PageControl do 312 case AValue of 313 hpTop, hpAuto: begin 314 Align := alTop; 315 Height := 24; 316 end; 317 hpBottom: begin 318 Align := alBottom; 319 Height := 24; 320 end; 321 hpLeft: begin 322 Align := alLeft; 323 Width := 24; 324 end; 325 hpRight: begin 326 Align := alRight; 327 Width := 24; 328 end; 329 end; 283 330 end; 284 331
Note:
See TracChangeset
for help on using the changeset viewer.