diff --git a/include/wx/event.h b/include/wx/event.h index aaa172a39c..dfb0f59310 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -283,7 +283,7 @@ enum wxEVT_PLOT_AREA_SEL_CREATED = wxEVT_FIRST + 1015, wxEVT_PLOT_AREA_SEL_CHANGING = wxEVT_FIRST + 1016, wxEVT_PLOT_AREA_SEL_CHANGED = wxEVT_FIRST + 1017, - wxEVT_PLOT_BEGIN_X_LABEL_EDIT = wxEVT_FIRST + 1020, + wxEVT_PLOT_BEGIN_X_LABEL_EDIT = wxEVT_FIRST + 1020, wxEVT_PLOT_END_X_LABEL_EDIT = wxEVT_FIRST + 1021, wxEVT_PLOT_BEGIN_Y_LABEL_EDIT = wxEVT_FIRST + 1022, wxEVT_PLOT_END_Y_LABEL_EDIT = wxEVT_FIRST + 1023, @@ -1510,7 +1510,7 @@ public: wxObjectEventFunction func = NULL, wxObject *userData = (wxObject *) NULL ) { return Disconnect(id, -1, eventType, func, userData); } - + // implementation from now on virtual bool SearchEventTable(wxEventTable& table, wxEvent& event); bool SearchDynamicEventTable( wxEvent& event ); diff --git a/src/common/docmdi.cpp b/src/common/docmdi.cpp index dc622fc6f5..fd19e42adf 100644 --- a/src/common/docmdi.cpp +++ b/src/common/docmdi.cpp @@ -99,22 +99,22 @@ wxDocMDIChildFrame::wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParen wxDocMDIChildFrame::~wxDocMDIChildFrame(void) { - m_childView = (wxView *) NULL; + m_childView = (wxView *) NULL; } // Extend event processing to search the view's event table bool wxDocMDIChildFrame::ProcessEvent(wxEvent& event) { - if ( !m_childView || ! m_childView->ProcessEvent(event) ) + if ( !m_childView || ! m_childView->ProcessEvent(event) ) { // Only hand up to the parent if it's a menu command if (!event.IsKindOf(CLASSINFO(wxCommandEvent)) || !GetParent() || !GetParent()->ProcessEvent(event)) - return wxEvtHandler::ProcessEvent(event); + return wxEvtHandler::ProcessEvent(event); else return TRUE; } - else - return TRUE; + else + return TRUE; } void wxDocMDIChildFrame::OnActivate(wxActivateEvent& event) diff --git a/src/common/event.cpp b/src/common/event.cpp index 3ace246251..53298074c0 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -397,7 +397,7 @@ void wxKeyEvent::CopyObject(wxObject& obj_d) const obj->m_x = m_x; obj->m_y = m_y; obj->m_keyCode = m_keyCode; - + obj->m_shiftDown = m_shiftDown; obj->m_controlDown = m_controlDown; obj->m_metaDown = m_metaDown; @@ -643,7 +643,7 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event) wxPendingEvents->Append(this); wxLEAVE_CRIT_SECT(*wxPendingEventsLocker); - + // 3) Inform the system that new pending events are somwehere, // and that these should be processed in idle time. wxWakeUpIdle(); @@ -702,7 +702,7 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) // An event handler can be enabled or disabled if ( GetEvtHandlerEnabled() ) { - + #if 0 /* What is this? When using GUI threads, a non main diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index cf839f4748..34f64d2859 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -195,23 +195,38 @@ bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam) bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) { + wxString value; + int sel = -1; switch ( param ) { case CBN_SELCHANGE: - if (GetSelection() > -1) + sel = GetSelection(); + if ( sel > -1 ) { + value = GetString(sel); + wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, GetId()); - event.SetInt(GetSelection()); + event.SetInt(sel); event.SetEventObject(this); - event.SetString(GetStringSelection()); + event.SetString(value); ProcessCommand(event); } - break; + else + { + break; + } + + // fall through: for compability with wxGTK, also send the text + // update event when the selection changes (this also seems more + // logical as the text does change) case CBN_EDITCHANGE: { + // if sel != -1, value was initialized above (and we can't use + // GetValue() here as it would return the old selection and we + // want the new one) wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId()); - event.SetString(GetValue()); + event.SetString(sel == -1 ? GetValue() : value); event.SetEventObject(this); ProcessCommand(event); } diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 98d9b64dd4..ef6a36d657 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -235,6 +235,11 @@ void wxListBox::SetupColours() SetForegroundColour(GetParent()->GetForegroundColour()); } +bool wxListBox::HasMultipleSelection() const +{ + return (m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED); +} + // ---------------------------------------------------------------------------- // implementation of wxListBoxBase methods // ---------------------------------------------------------------------------- @@ -448,11 +453,6 @@ void wxListBox::DoSetItemClientData(int n, void *clientData) wxLogDebug(wxT("LB_SETITEMDATA failed")); } -bool wxListBox::HasMultipleSelection() const -{ - return (m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED); -} - // Return number of selections and an array of selected integers int wxListBox::GetSelections(wxArrayInt& aSelections) const {