mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 09:00:33 +02:00
lcl: GetTabIndex should return the index of Tab, not the index of Page. Remove SetTabIndex.
git-svn-id: trunk@25329 -
This commit is contained in:
parent
91f1a118d2
commit
bdab0c4699
@ -224,14 +224,13 @@ type
|
||||
function GetPageControl: TPageControl;
|
||||
function GetTabIndex: Integer;
|
||||
procedure SetPageControl(APageControl: TPageControl);
|
||||
procedure SetTabIndex(const AValue: Integer);
|
||||
protected
|
||||
class procedure WSRegisterClass; override;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
property PageControl: TPageControl read GetPageControl write SetPageControl;
|
||||
property TabIndex: Integer read GetTabIndex write SetTabIndex;
|
||||
property TabIndex: Integer read GetTabIndex;
|
||||
published
|
||||
property Caption;
|
||||
property ChildSizing;
|
||||
|
@ -159,7 +159,7 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TCustomPage.GetPageIndex: integer;
|
||||
begin
|
||||
if (Parent<>nil) and (Parent is TCustomNotebook) then
|
||||
if (Parent <> nil) and (Parent is TCustomNotebook) then
|
||||
Result := TCustomNotebook(Parent).PageList.IndexOf(Self)
|
||||
else
|
||||
Result := -1;
|
||||
|
@ -23,16 +23,26 @@
|
||||
{ TTabSheet }
|
||||
|
||||
function TTabSheet.GetTabIndex: Integer;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
Result:=PageIndex;
|
||||
if not TabVisible then
|
||||
Result := -1
|
||||
else
|
||||
begin
|
||||
Result := 0;
|
||||
for i := 0 to PageIndex - 1 do
|
||||
if PageControl.Pages[i].TabVisible then
|
||||
inc(Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TTabSheet.GetPageControl: TPageControl;
|
||||
begin
|
||||
if (Parent is TPageControl) then
|
||||
Result:=TPageControl(Parent)
|
||||
Result := TPageControl(Parent)
|
||||
else
|
||||
Result:=nil;
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
procedure TTabSheet.SetPageControl(APageControl: TPageControl);
|
||||
@ -41,11 +51,6 @@ begin
|
||||
Parent:=APageControl;
|
||||
end;
|
||||
|
||||
procedure TTabSheet.SetTabIndex(const AValue: Integer);
|
||||
begin
|
||||
PageIndex:=AValue;
|
||||
end;
|
||||
|
||||
class procedure TTabSheet.WSRegisterClass;
|
||||
begin
|
||||
inherited WSRegisterClass;
|
||||
|
Loading…
Reference in New Issue
Block a user