mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 13:17:18 +02:00
LCL: TPageControl: Showing correct tab for a page with TabVisible = False. Issue #21723
git-svn-id: trunk@54003 -
This commit is contained in:
parent
6a9b9d4d9e
commit
49bfaecb78
@ -449,6 +449,12 @@ begin
|
|||||||
Result := AIndex;
|
Result := AIndex;
|
||||||
if csDesigning in ComponentState then
|
if csDesigning in ComponentState then
|
||||||
exit; //all pages are visible
|
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
|
for i := 0 to AIndex - 1 do begin
|
||||||
if not Page[i].TabVisible then
|
if not Page[i].TabVisible then
|
||||||
dec(Result); //exclude invisible page
|
dec(Result); //exclude invisible page
|
||||||
|
@ -553,6 +553,9 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
if (AIndex < 0) or (AIndex > ATabControl.PageCount - 1) then
|
if (AIndex < 0) or (AIndex > ATabControl.PageCount - 1) then
|
||||||
exit;
|
exit;
|
||||||
|
ANewIndex:=ATabControl.PageToTabIndex(AIndex);
|
||||||
|
if (ANewIndex < 0) then
|
||||||
|
exit;
|
||||||
GtkNotebook := {%H-}PGtkNoteBook(ATabControl.Handle);
|
GtkNotebook := {%H-}PGtkNoteBook(ATabControl.Handle);
|
||||||
if gtk_notebook_get_current_page(GtkNotebook) <> AIndex then
|
if gtk_notebook_get_current_page(GtkNotebook) <> AIndex then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user