mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 00:00:42 +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;
|
destructor Destroy; override;
|
||||||
function InsertPage(aIndex: integer; S: string): TCDTabSheet;
|
function InsertPage(aIndex: integer; S: string): TCDTabSheet;
|
||||||
procedure RemovePage(aIndex: integer);
|
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;
|
function GetPage(aIndex: integer): TCDTabSheet;
|
||||||
property PageCount: integer read GetPageCount;
|
property PageCount: integer read GetPageCount;
|
||||||
// Used by the property editor in customdrawnextras
|
// Used by the property editor in customdrawnextras
|
||||||
@ -1268,7 +1269,11 @@ end;
|
|||||||
procedure TCDTabSheet.SetParent(NewParent: TWinControl);
|
procedure TCDTabSheet.SetParent(NewParent: TWinControl);
|
||||||
begin
|
begin
|
||||||
inherited SetParent(NewParent);
|
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;
|
end;
|
||||||
|
|
||||||
constructor TCDTabSheet.Create(AOwner: TComponent);
|
constructor TCDTabSheet.Create(AOwner: TComponent);
|
||||||
@ -1342,6 +1347,14 @@ begin
|
|||||||
Result := NewPage;
|
Result := NewPage;
|
||||||
end;
|
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;
|
function TCDPageControl.GetPage(AIndex: integer): TCDTabSheet;
|
||||||
begin
|
begin
|
||||||
if (AIndex >= 0) and (AIndex < FTabs.Count) then
|
if (AIndex >= 0) and (AIndex < FTabs.Count) then
|
||||||
@ -1503,9 +1516,10 @@ procedure TCDPageControl.PositionTabSheet(ATabSheet: TCDTabSheet);
|
|||||||
var
|
var
|
||||||
lTabHeight, lIndex: Integer;
|
lTabHeight, lIndex: Integer;
|
||||||
begin
|
begin
|
||||||
// ATabSheet.SetBounds(1, 32 + 1, Width - 3, Height - 32 - 4);
|
|
||||||
lIndex := FTabs.IndexOfObject(ATabSheet);
|
lIndex := FTabs.IndexOfObject(ATabSheet);
|
||||||
FTabCState.TabIndex := lIndex;
|
FTabCState.TabIndex := lIndex;
|
||||||
|
PrepareControlState;
|
||||||
|
PrepareControlStateEx;
|
||||||
lTabHeight := FDrawer.GetMeasuresEx(Canvas, TCDCTABCONTROL_TAB_HEIGHT, FState, FStateEx);
|
lTabHeight := FDrawer.GetMeasuresEx(Canvas, TCDCTABCONTROL_TAB_HEIGHT, FState, FStateEx);
|
||||||
ATabSheet.BorderSpacing.Top := lTabHeight;
|
ATabSheet.BorderSpacing.Top := lTabHeight;
|
||||||
ATabSheet.BorderSpacing.Left := 2;
|
ATabSheet.BorderSpacing.Left := 2;
|
||||||
|
@ -25,7 +25,6 @@ procedure GradCenterFill(Canvas: TFPCustomCanvas; aRect: TRect;
|
|||||||
procedure DrawAndroidButton(Canvas: TCanvas; Color: TColor);
|
procedure DrawAndroidButton(Canvas: TCanvas; Color: TColor);
|
||||||
procedure DrawXPTaskbarButton(Canvas: TCanvas; Color: TColor);
|
procedure DrawXPTaskbarButton(Canvas: TCanvas; Color: TColor);
|
||||||
procedure FPImgCloneRect(IntfImg1, IntfImg2: TLazIntfImage; lRect: TRect; Fast: boolean);
|
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 DrawArrow(aDest: TFPCustomCanvas; aRect: TRect; R: boolean);
|
||||||
procedure DrawCDButtonDown(Canvas: TCanvas; ABackgroundColor: TColor);
|
procedure DrawCDButtonDown(Canvas: TCanvas; ABackgroundColor: TColor);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user