Fix wxCommandEvent::GetString() for wxSearchCtrl events
wxEVT_TEXT events generated by native wxSearchCtrl implementations always returned an empty string, as wxSearchCtrl was not recognized by the special hack inside wxCommandEvent::GetString() which retrieved the text on demand. Fix this by adding yet another special case for this. This is not ideal, but should do for now.
This commit is contained in:
@@ -46,6 +46,10 @@
|
|||||||
#endif // wxUSE_GUI
|
#endif // wxUSE_GUI
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_GUI
|
||||||
|
#include "wx/srchctrl.h"
|
||||||
|
#endif // wxUSE_GUI
|
||||||
|
|
||||||
#include "wx/thread.h"
|
#include "wx/thread.h"
|
||||||
|
|
||||||
#if wxUSE_BASE
|
#if wxUSE_BASE
|
||||||
@@ -459,6 +463,12 @@ wxString wxCommandEvent::GetString() const
|
|||||||
if ( combo )
|
if ( combo )
|
||||||
return combo->GetValue();
|
return combo->GetValue();
|
||||||
#endif // wxUSE_COMBOBOX
|
#endif // wxUSE_COMBOBOX
|
||||||
|
|
||||||
|
#if wxUSE_SEARCHCTRL
|
||||||
|
wxSearchCtrl* search = wxDynamicCast(m_eventObject, wxSearchCtrl);
|
||||||
|
if ( search )
|
||||||
|
return search->GetValue();
|
||||||
|
#endif // wxUSE_SEARCHCTRL
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_cmdString;
|
return m_cmdString;
|
||||||
|
Reference in New Issue
Block a user