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:
blikblum 2013-05-25 23:35:51 +00:00
parent 3b13212b92
commit e829b31b56

View File

@ -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;