mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 01:41:22 +02:00
lcl: handle the case where the design time TPageControl.PageIndex is set to a TabSheet with TabVisible = False
git-svn-id: trunk@39679 -
This commit is contained in:
parent
ef24adff3a
commit
afe0a4ea69
@ -552,9 +552,9 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCustomTabControl.SetPageIndex(AValue: Integer);
|
||||
begin
|
||||
if (AValue < -1) or (AValue >= PageCount) then Exit;
|
||||
if (csLoading in ComponentState) then FLoadedPageIndex := AValue;
|
||||
//debugln('TCustomTabControl.SetPageIndex A ',dbgsName(Self),' AValue=',dbgs(AValue),' fPageIndex=',dbgs(fPageIndex),' PageCount=',dbgs(PageCount),' HandleAllocated=',dbgs(HandleAllocated),' ',dbgs(ComponentState));
|
||||
if (AValue < -1) or (AValue >= PageCount) then Exit;
|
||||
if FPageIndex = AValue then exit;
|
||||
if not CanChangePageIndex then exit;
|
||||
//debugln('TCustomTabControl.SetPageIndex B ',dbgsName(Self),' AValue=',dbgs(AValue),' fPageIndex=',dbgs(fPageIndex),' PageCount=',dbgs(PageCount),' HandleAllocated=',dbgs(HandleAllocated));
|
||||
@ -937,8 +937,8 @@ end;
|
||||
procedure TCustomTabControl.Loaded;
|
||||
begin
|
||||
inherited Loaded;
|
||||
if FLoadedPageIndex >= -1 then
|
||||
PageIndex := FLoadedPageIndex;
|
||||
if FLoadedPageIndex > -1 then
|
||||
PageIndex := FindVisiblePage(FLoadedPageIndex);
|
||||
FLoadedPageIndex := -1;
|
||||
//DebugLn(['TCustomTabControl.Loaded ',DbgSName(Self),' fPageIndex=',fPageIndex]);
|
||||
FPageIndexOnLastChange := PageIndex;
|
||||
|
Loading…
Reference in New Issue
Block a user