mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-14 14:19:08 +02:00
lcl: initialize PageControl.PageIndex in handle creation instead of loaded. Fix issue when setting TabVisible after control is loaded
git-svn-id: trunk@41407 -
This commit is contained in:
parent
3b13212b92
commit
e829b31b56
@ -288,6 +288,16 @@ begin
|
||||
OnChange(Self);
|
||||
end;
|
||||
|
||||
procedure TCustomTabControl.InitializeWnd;
|
||||
begin
|
||||
inherited InitializeWnd;
|
||||
if FLoadedPageIndex > -1 then
|
||||
PageIndex := FindVisiblePage(FLoadedPageIndex);
|
||||
FLoadedPageIndex := -1;
|
||||
//DebugLn(['TCustomTabControl.InitializeWnd ',DbgSName(Self),' fPageIndex=',fPageIndex]);
|
||||
FPageIndexOnLastChange := PageIndex;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCustomTabControl.Destroy
|
||||
Params: None
|
||||
@ -779,7 +789,7 @@ end;
|
||||
{------------------------------------------------------------------------------
|
||||
TCustomTabControl GetPageCount
|
||||
------------------------------------------------------------------------------}
|
||||
function TCustomTabControl.GetPageCount: Integer;
|
||||
function TCustomTabControl.GetPageCount: integer;
|
||||
begin
|
||||
if FUnPaged then
|
||||
Result := FAccess.Count
|
||||
@ -928,17 +938,6 @@ begin
|
||||
DoChange;
|
||||
end;
|
||||
|
||||
procedure TCustomTabControl.Loaded;
|
||||
begin
|
||||
inherited Loaded;
|
||||
if FLoadedPageIndex > -1 then
|
||||
PageIndex := FindVisiblePage(FLoadedPageIndex);
|
||||
FLoadedPageIndex := -1;
|
||||
//DebugLn(['TCustomTabControl.Loaded ',DbgSName(Self),' fPageIndex=',fPageIndex]);
|
||||
FPageIndexOnLastChange := PageIndex;
|
||||
if HandleAllocated then DoCreateWnd;
|
||||
end;
|
||||
|
||||
function TCustomTabControl.DialogChar(var Message: TLMKey): boolean;
|
||||
var
|
||||
destPage: TCustomPage;
|
||||
|
Loading…
Reference in New Issue
Block a user