Set the string to search for in wxSearchCtrl events.
It's more convenient to have the string to search for directly in the event object than to retrieve it from wxSearchCtrl itself as it had to be done before. Closes #4665. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -242,6 +242,14 @@ protected:
|
||||
wxCommandEvent event(m_eventType, m_search->GetId());
|
||||
event.SetEventObject(m_search);
|
||||
|
||||
if ( m_eventType == wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN )
|
||||
{
|
||||
// it's convenient to have the string to search for directly in the
|
||||
// event instead of having to retrieve it from the control in the
|
||||
// event handler code later, so provide it here
|
||||
event.SetString(m_search->GetValue());
|
||||
}
|
||||
|
||||
GetEventHandler()->ProcessEvent(event);
|
||||
|
||||
m_search->SetFocus();
|
||||
|
Reference in New Issue
Block a user