LCL: TPageControl: Showing correct tab for a page with TabVisible = False. Issue #21723

git-svn-id: trunk@54003 -
This commit is contained in:
michl 2017-01-25 20:38:27 +00:00
parent 6a9b9d4d9e
commit 49bfaecb78
2 changed files with 9 additions and 0 deletions

View File

@ -449,6 +449,12 @@ begin
Result := AIndex;
if csDesigning in ComponentState then
exit; //all pages are visible
// it is possible to show pages without visible tabs, but then, no tab index
// can be sendet back, issue #21723
if not Page[AIndex].TabVisible then
exit(-1);
for i := 0 to AIndex - 1 do begin
if not Page[i].TabVisible then
dec(Result); //exclude invisible page

View File

@ -553,6 +553,9 @@ begin
Exit;
if (AIndex < 0) or (AIndex > ATabControl.PageCount - 1) then
exit;
ANewIndex:=ATabControl.PageToTabIndex(AIndex);
if (ANewIndex < 0) then
exit;
GtkNotebook := {%H-}PGtkNoteBook(ATabControl.Handle);
if gtk_notebook_get_current_page(GtkNotebook) <> AIndex then
begin