wxComboBox sends TEXT_UPDATED event under MSW when selection changes now too

(no changes in other files)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@8312 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-09-09 19:40:01 +00:00
parent ed152d040a
commit b8e3e48747
5 changed files with 35 additions and 20 deletions

View File

@@ -283,7 +283,7 @@ enum
wxEVT_PLOT_AREA_SEL_CREATED = wxEVT_FIRST + 1015, wxEVT_PLOT_AREA_SEL_CREATED = wxEVT_FIRST + 1015,
wxEVT_PLOT_AREA_SEL_CHANGING = wxEVT_FIRST + 1016, wxEVT_PLOT_AREA_SEL_CHANGING = wxEVT_FIRST + 1016,
wxEVT_PLOT_AREA_SEL_CHANGED = wxEVT_FIRST + 1017, 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_END_X_LABEL_EDIT = wxEVT_FIRST + 1021,
wxEVT_PLOT_BEGIN_Y_LABEL_EDIT = wxEVT_FIRST + 1022, wxEVT_PLOT_BEGIN_Y_LABEL_EDIT = wxEVT_FIRST + 1022,
wxEVT_PLOT_END_Y_LABEL_EDIT = wxEVT_FIRST + 1023, wxEVT_PLOT_END_Y_LABEL_EDIT = wxEVT_FIRST + 1023,
@@ -1510,7 +1510,7 @@ public:
wxObjectEventFunction func = NULL, wxObjectEventFunction func = NULL,
wxObject *userData = (wxObject *) NULL ) wxObject *userData = (wxObject *) NULL )
{ return Disconnect(id, -1, eventType, func, userData); } { return Disconnect(id, -1, eventType, func, userData); }
// implementation from now on // implementation from now on
virtual bool SearchEventTable(wxEventTable& table, wxEvent& event); virtual bool SearchEventTable(wxEventTable& table, wxEvent& event);
bool SearchDynamicEventTable( wxEvent& event ); bool SearchDynamicEventTable( wxEvent& event );

View File

@@ -99,22 +99,22 @@ wxDocMDIChildFrame::wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParen
wxDocMDIChildFrame::~wxDocMDIChildFrame(void) wxDocMDIChildFrame::~wxDocMDIChildFrame(void)
{ {
m_childView = (wxView *) NULL; m_childView = (wxView *) NULL;
} }
// Extend event processing to search the view's event table // Extend event processing to search the view's event table
bool wxDocMDIChildFrame::ProcessEvent(wxEvent& event) 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 // Only hand up to the parent if it's a menu command
if (!event.IsKindOf(CLASSINFO(wxCommandEvent)) || !GetParent() || !GetParent()->ProcessEvent(event)) if (!event.IsKindOf(CLASSINFO(wxCommandEvent)) || !GetParent() || !GetParent()->ProcessEvent(event))
return wxEvtHandler::ProcessEvent(event); return wxEvtHandler::ProcessEvent(event);
else else
return TRUE; return TRUE;
} }
else else
return TRUE; return TRUE;
} }
void wxDocMDIChildFrame::OnActivate(wxActivateEvent& event) void wxDocMDIChildFrame::OnActivate(wxActivateEvent& event)

View File

@@ -397,7 +397,7 @@ void wxKeyEvent::CopyObject(wxObject& obj_d) const
obj->m_x = m_x; obj->m_x = m_x;
obj->m_y = m_y; obj->m_y = m_y;
obj->m_keyCode = m_keyCode; obj->m_keyCode = m_keyCode;
obj->m_shiftDown = m_shiftDown; obj->m_shiftDown = m_shiftDown;
obj->m_controlDown = m_controlDown; obj->m_controlDown = m_controlDown;
obj->m_metaDown = m_metaDown; obj->m_metaDown = m_metaDown;
@@ -643,7 +643,7 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event)
wxPendingEvents->Append(this); wxPendingEvents->Append(this);
wxLEAVE_CRIT_SECT(*wxPendingEventsLocker); wxLEAVE_CRIT_SECT(*wxPendingEventsLocker);
// 3) Inform the system that new pending events are somwehere, // 3) Inform the system that new pending events are somwehere,
// and that these should be processed in idle time. // and that these should be processed in idle time.
wxWakeUpIdle(); wxWakeUpIdle();
@@ -702,7 +702,7 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
// An event handler can be enabled or disabled // An event handler can be enabled or disabled
if ( GetEvtHandlerEnabled() ) if ( GetEvtHandlerEnabled() )
{ {
#if 0 #if 0
/* /*
What is this? When using GUI threads, a non main What is this? When using GUI threads, a non main

View File

@@ -195,23 +195,38 @@ bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam)
bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
{ {
wxString value;
int sel = -1;
switch ( param ) switch ( param )
{ {
case CBN_SELCHANGE: case CBN_SELCHANGE:
if (GetSelection() > -1) sel = GetSelection();
if ( sel > -1 )
{ {
value = GetString(sel);
wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, GetId()); wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, GetId());
event.SetInt(GetSelection()); event.SetInt(sel);
event.SetEventObject(this); event.SetEventObject(this);
event.SetString(GetStringSelection()); event.SetString(value);
ProcessCommand(event); 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: 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()); wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId());
event.SetString(GetValue()); event.SetString(sel == -1 ? GetValue() : value);
event.SetEventObject(this); event.SetEventObject(this);
ProcessCommand(event); ProcessCommand(event);
} }

View File

@@ -235,6 +235,11 @@ void wxListBox::SetupColours()
SetForegroundColour(GetParent()->GetForegroundColour()); SetForegroundColour(GetParent()->GetForegroundColour());
} }
bool wxListBox::HasMultipleSelection() const
{
return (m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED);
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// implementation of wxListBoxBase methods // implementation of wxListBoxBase methods
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -448,11 +453,6 @@ void wxListBox::DoSetItemClientData(int n, void *clientData)
wxLogDebug(wxT("LB_SETITEMDATA failed")); 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 // Return number of selections and an array of selected integers
int wxListBox::GetSelections(wxArrayInt& aSelections) const int wxListBox::GetSelections(wxArrayInt& aSelections) const
{ {