Don't require skipping "page changed" event in wxMSW wxNotebook.
wxMSW wxNotebook implementation used to handle EVT_NOTEBOOK_PAGE_CHANGED event to update the currently shown page which meant that page changing was broken if the user code handled and didn't skip this event. As the other ports don't require the user code to skip this event, don't do this in wxMSW neither and always update the selected page unconditionally. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66060 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -122,7 +122,6 @@ static bool HasTroubleWithNonTopTabs()
|
||||
WX_DEFINE_LIST( wxNotebookPageInfoList )
|
||||
|
||||
BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase)
|
||||
EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, wxNotebook::OnSelChange)
|
||||
EVT_SIZE(wxNotebook::OnSize)
|
||||
EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
|
||||
|
||||
@@ -457,6 +456,8 @@ int wxNotebook::SetSelection(size_t nPage)
|
||||
// program allows the page change
|
||||
SendPageChangedEvent(m_selection, nPage);
|
||||
|
||||
UpdateSelection(nPage);
|
||||
|
||||
TabCtrl_SetCurSel(GetHwnd(), nPage);
|
||||
}
|
||||
}
|
||||
@@ -1082,18 +1083,6 @@ void wxNotebook::OnSize(wxSizeEvent& event)
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void wxNotebook::OnSelChange(wxBookCtrlEvent& event)
|
||||
{
|
||||
// is it our tab control?
|
||||
if ( event.GetEventObject() == this )
|
||||
{
|
||||
UpdateSelection(event.GetSelection());
|
||||
}
|
||||
|
||||
// we want to give others a chance to process this message as well
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
|
||||
{
|
||||
if ( event.IsWindowChange() ) {
|
||||
@@ -1446,6 +1435,9 @@ bool wxNotebook::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM* result)
|
||||
event.SetInt(idCtrl);
|
||||
|
||||
bool processed = HandleWindowEvent(event);
|
||||
if ( hdr->code == TCN_SELCHANGE )
|
||||
UpdateSelection(event.GetSelection());
|
||||
|
||||
*result = !event.IsAllowed();
|
||||
return processed;
|
||||
}
|
||||
|
Reference in New Issue
Block a user