Don't send event when adding first page to wxNotebook in wxUniv

Make behaviour consistent with the other ports and fix failure in
wxNotebook::AddPageEvents unit test with wxUniv.

Closes https://github.com/wxWidgets/wxWidgets/pull/2426
This commit is contained in:
Kvaz1r
2021-07-11 10:11:48 +03:00
committed by Vadim Zeitlin
parent c0c183ac17
commit 4f7f7a9ce1

View File

@@ -328,9 +328,6 @@ bool wxNotebook::InsertPage(size_t nPage,
// it's enough to just redraw the tabs
if ( nPages == 0 )
{
// always select the first tab to have at least some selection
bSelect = true;
Relayout();
Refresh();
}
@@ -345,7 +342,11 @@ bool wxNotebook::InsertPage(size_t nPage,
}
else // pages added to the notebook are initially hidden
{
pPage->Hide();
// always select the first tab to have at least some selection
if ( nPages == 0 )
ChangeSelection(0);
else
pPage->Hide();
}
return true;