Ensure correct previous page is sent for notebook events

Qt notebook page changed events had the wrong "previous page" index in
circumstances where the page has been changed by methods other than
clicking on the tabs, for example using the "Pages->Next page" menu
option in the notebook sample.

Closes https://github.com/wxWidgets/wxWidgets/pull/1359
This commit is contained in:
Mick Waites
2019-06-18 10:51:25 +01:00
committed by Vadim Zeitlin
parent 0c7f261c4a
commit 9a64acbb79

View File

@@ -192,8 +192,8 @@ int wxNotebook::SetSelection(size_t page)
int selOld = GetSelection(); int selOld = GetSelection();
// change the QTabWidget selected page: // change the QTabWidget selected page:
m_selection = page;
m_qtTabWidget->setCurrentIndex( page ); m_qtTabWidget->setCurrentIndex( page );
m_selection = page;
return selOld; return selOld;
} }