Changeset 437 for Docking/CoolDocking/Managers/UCDManagerTabs.pas
- Timestamp:
- Nov 19, 2012, 2:34:58 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/Managers/UCDManagerTabs.pas
r430 r437 8 8 Classes, Controls, ExtCtrls, ComCtrls, SysUtils, Dialogs, Contnrs, 9 9 Menus, Forms, UCDCommon, UCDManager, UCDConjoinForm, 10 LCLType, LMessages,Graphics;10 LCLType, Graphics; 11 11 12 12 type … … 35 35 procedure TabControlMouseUp(Sender: TObject; Button: TMouseButton; 36 36 Shift: TShiftState; X, Y: Integer); 37 procedure PageControlContextPopup(Sender: TObject; MousePos: TPoint; 38 var Handled: Boolean); 39 function FindTabSheet(TabSheet: TTabSheet): TCDManagerTabsItem; 40 protected 41 function GetHeaderPos: THeaderPos; override; 42 function FindControlInPanels(Control: TControl): TCDManagerItem; override; 37 43 procedure InsertControlPanel(AControl: TControl; InsertAt: TAlign; 38 44 DropCtl: TControl); override; 39 function FindControlInPanels(Control: TControl): TCDManagerItem; override; 40 function GetHeaderPos: THeaderPos; override; 41 function FindTabSheet(TabSheet: TTabSheet): TCDManagerTabsItem; 42 procedure PageControlContextPopup(Sender: TObject; MousePos: TPoint; 43 var Handled: Boolean); 45 procedure InsertControlNoUpdate(Control: TControl; InsertAt: TAlign); virtual; 46 procedure TabControlChange(Sender: TObject); virtual; 44 47 public 45 48 MouseDownSkip: Boolean; … … 49 52 procedure Update; override; 50 53 procedure SetHeaderPos(const AValue: THeaderPos); override; 51 procedure InsertControlNoUpdate(Control: TControl; InsertAt: TAlign); virtual;52 54 procedure RemoveControl(Control: TControl); override; 53 55 constructor Create(ADockSite: TWinControl); override; 54 56 destructor Destroy; override; 55 procedure TabControlChange(Sender: TObject); virtual;56 57 procedure PaintSite(DC: HDC); override; 57 58 procedure Switch(Index: Integer); override; … … 84 85 Temp: TControl; 85 86 Temp2: TControl; 87 PI: Integer; 86 88 begin 87 89 DebugLog('TCDManagerTabsItem.VisibleChange'); … … 92 94 //TCDManagerTabsItem(DockItems[DockItems.IndexOf( 93 95 // FindControlInPanels(TControl(Sender)))]).HideType := dhtPermanent; 94 end else Update; 96 end else begin 97 TabSheet.TabVisible := False; 98 99 // Workaround for not showing current tab agter other tab is hidden 100 PI := PageControl.PageIndex; 101 PageControl.PageIndex := -1; 102 PageControl.PageIndex := PI; 103 104 Update; 105 end; 95 106 end; 96 107 … … 379 390 LastIndex: Integer; 380 391 begin 381 LastIndex := PageControl. TabIndex;392 LastIndex := PageControl.PageIndex; 382 393 if FUpdateCount = 0 then begin 383 394 DebugLog('TCDManagerTabs.Update'); … … 426 437 if PageControl.PageIndex = I then begin 427 438 TCDManager(Control.DockManager).DockSiteVisible := True; 428 if not Control.Visible then Control.Show; 439 if not Control.Visible then 440 Control.Show; 429 441 //PageControl.TabIndex := I; 430 442 end else begin … … 437 449 //TCDClientPanel(FDockPanels[I]).DockPanelPaint(Self); 438 450 end; 439 end; 440 inherited; 441 //ShowMessage(IntToStr(PageControl.TabIndex)); 442 PageControl.TabIndex := LastIndex; 451 //PageControl.TabIndex := LastIndex; 452 //if PageControl.PageIndex = PI then 453 // PageControl.PageIndex := -1; // Workaround for bug in LCL TPageControl.TabVisible not updating PageIndex properly 454 end; 455 inherited; 443 456 end; 444 457
Note:
See TracChangeset
for help on using the changeset viewer.