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:
@@ -328,9 +328,6 @@ bool wxNotebook::InsertPage(size_t nPage,
|
|||||||
// it's enough to just redraw the tabs
|
// it's enough to just redraw the tabs
|
||||||
if ( nPages == 0 )
|
if ( nPages == 0 )
|
||||||
{
|
{
|
||||||
// always select the first tab to have at least some selection
|
|
||||||
bSelect = true;
|
|
||||||
|
|
||||||
Relayout();
|
Relayout();
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
@@ -345,7 +342,11 @@ bool wxNotebook::InsertPage(size_t nPage,
|
|||||||
}
|
}
|
||||||
else // pages added to the notebook are initially hidden
|
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;
|
return true;
|
||||||
|
Reference in New Issue
Block a user