X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/170acdc90e9f92f8b8120fa6c04acdbf45c89582..129b8b1a215fc1fcc1b9f06daa0aeaf22bbce614:/src/generic/choicbkg.cpp diff --git a/src/generic/choicbkg.cpp b/src/generic/choicbkg.cpp index 096d5e4d2f..50ab914d84 100644 --- a/src/generic/choicbkg.cpp +++ b/src/generic/choicbkg.cpp @@ -54,10 +54,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxChoicebookEvent, wxNotifyEvent) const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING = wxNewEventType(); const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED = wxNewEventType(); #endif -const int wxID_CHOICEBOOKCHOICE = wxNewId(); BEGIN_EVENT_TABLE(wxChoicebook, wxBookCtrlBase) - EVT_CHOICE(wxID_CHOICEBOOKCHOICE, wxChoicebook::OnChoiceSelected) + EVT_CHOICE(wxID_ANY, wxChoicebook::OnChoiceSelected) END_EVENT_TABLE() // ============================================================================ @@ -98,7 +97,7 @@ wxChoicebook::Create(wxWindow *parent, m_bookctrl = new wxChoice ( this, - wxID_CHOICEBOOKCHOICE, + wxID_ANY, wxDefaultPosition, wxDefaultSize ); @@ -257,7 +256,6 @@ wxChoicebook::InsertPage(size_t n, if ( selNew != wxNOT_FOUND ) SetSelection(selNew); - InvalidateBestSize(); return true; } @@ -303,6 +301,12 @@ bool wxChoicebook::DeleteAllPages() void wxChoicebook::OnChoiceSelected(wxCommandEvent& eventChoice) { + if ( eventChoice.GetEventObject() != m_bookctrl ) + { + eventChoice.Skip(); + return; + } + const int selNew = eventChoice.GetSelection(); if ( selNew == m_selection )