mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-21 14:39:27 +02:00
customdrawn: Many small pagecontrol fixes
git-svn-id: trunk@33263 -
This commit is contained in:
parent
0abff19f7a
commit
9a0bc7076f
@ -381,7 +381,8 @@ type
|
||||
destructor Destroy; override;
|
||||
function InsertPage(aIndex: integer; S: string): TCDTabSheet;
|
||||
procedure RemovePage(aIndex: integer);
|
||||
function AddPage(S: string): TCDTabSheet;
|
||||
function AddPage(S: string): TCDTabSheet; overload;
|
||||
procedure AddPage(APage: TCDTabSheet); overload;
|
||||
function GetPage(aIndex: integer): TCDTabSheet;
|
||||
property PageCount: integer read GetPageCount;
|
||||
// Used by the property editor in customdrawnextras
|
||||
@ -1268,7 +1269,11 @@ end;
|
||||
procedure TCDTabSheet.SetParent(NewParent: TWinControl);
|
||||
begin
|
||||
inherited SetParent(NewParent);
|
||||
CDTabControl := NewParent as TCDCustomTabControl;
|
||||
if (NewParent <> nil) and (NewParent is TCDPageControl) then
|
||||
begin
|
||||
CDTabControl := NewParent as TCDCustomTabControl;
|
||||
TCDPageControl(CDTabControl).AddPage(Self);
|
||||
end;
|
||||
end;
|
||||
|
||||
constructor TCDTabSheet.Create(AOwner: TComponent);
|
||||
@ -1342,6 +1347,14 @@ begin
|
||||
Result := NewPage;
|
||||
end;
|
||||
|
||||
procedure TCDPageControl.AddPage(APage: TCDTabSheet);
|
||||
begin
|
||||
APage.CDTabControl := Self;
|
||||
PositionTabSheet(APage);
|
||||
FTabs.AddObject(APage.Caption, APage);
|
||||
SetActivePage(APage);
|
||||
end;
|
||||
|
||||
function TCDPageControl.GetPage(AIndex: integer): TCDTabSheet;
|
||||
begin
|
||||
if (AIndex >= 0) and (AIndex < FTabs.Count) then
|
||||
@ -1503,9 +1516,10 @@ procedure TCDPageControl.PositionTabSheet(ATabSheet: TCDTabSheet);
|
||||
var
|
||||
lTabHeight, lIndex: Integer;
|
||||
begin
|
||||
// ATabSheet.SetBounds(1, 32 + 1, Width - 3, Height - 32 - 4);
|
||||
lIndex := FTabs.IndexOfObject(ATabSheet);
|
||||
FTabCState.TabIndex := lIndex;
|
||||
PrepareControlState;
|
||||
PrepareControlStateEx;
|
||||
lTabHeight := FDrawer.GetMeasuresEx(Canvas, TCDCTABCONTROL_TAB_HEIGHT, FState, FStateEx);
|
||||
ATabSheet.BorderSpacing.Top := lTabHeight;
|
||||
ATabSheet.BorderSpacing.Left := 2;
|
||||
|
@ -25,7 +25,6 @@ procedure GradCenterFill(Canvas: TFPCustomCanvas; aRect: TRect;
|
||||
procedure DrawAndroidButton(Canvas: TCanvas; Color: TColor);
|
||||
procedure DrawXPTaskbarButton(Canvas: TCanvas; Color: TColor);
|
||||
procedure FPImgCloneRect(IntfImg1, IntfImg2: TLazIntfImage; lRect: TRect; Fast: boolean);
|
||||
function GetUniqueName(const Name: string; PControl: TComponent): string;
|
||||
procedure DrawArrow(aDest: TFPCustomCanvas; aRect: TRect; R: boolean);
|
||||
procedure DrawCDButtonDown(Canvas: TCanvas; ABackgroundColor: TColor);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user