Avoid events when implicitly selecting first wxBookCtrl page.
The first page added to a wxBookCtrlBase-derived control is always selected, even if "bSelect" argument of AddPage() was false. This is necessary because a non-empty book control must always have a selection but the "selection changed" event generated when doing it is unexpected. Fix this by not generating any events when the first page is implicitly selected. Closes #12075. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65967 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -252,6 +252,17 @@ protected:
|
||||
// choose the default border for this window
|
||||
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
|
||||
|
||||
// After the insertion of the page in the method InsertPage, calling this
|
||||
// method sets the selection to the given page or the first one if there is
|
||||
// still no selection. The "selection changed" event is sent only if
|
||||
// bSelect is true, so when it is false, no event is sent even if the
|
||||
// selection changed from wxNOT_FOUND to 0 when inserting the first page.
|
||||
//
|
||||
// Returns true if the selection was set to the specified page (explicitly
|
||||
// because of bSelect == true or implicitly because it's the first page) or
|
||||
// false otherwise.
|
||||
bool DoSetSelectionAfterInsertion(size_t n, bool bSelect);
|
||||
|
||||
// set the selection to the given page, sending the events (which can
|
||||
// possibly prevent the page change from taking place) if SendEvent flag is
|
||||
// included
|
||||
|
Reference in New Issue
Block a user