Move SendTextUpdatedEvent() down to wxTextEntryBase from wxTextCtrlBase.

This will allow reusing it in wxComboBox implementation as well.

Also add SendTextUpdatedEventIfAllowed() which can be used to only send the
events if they were not blocked at wxTextEntry level.

No real changes otherwise.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63880 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-04-06 18:46:24 +00:00
parent ca1f7cb563
commit 501358073b
6 changed files with 50 additions and 37 deletions

View File

@@ -1006,25 +1006,6 @@ wxTextAreaBase::HitTest(const wxPoint& WXUNUSED(pt), long * WXUNUSED(pos)) const
return wxTE_HT_UNKNOWN;
}
// ----------------------------------------------------------------------------
// events
// ----------------------------------------------------------------------------
/* static */
bool wxTextCtrlBase::SendTextUpdatedEvent(wxWindow *win)
{
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, win->GetId());
// do not do this as it could be very inefficient if the text control
// contains a lot of text and we're not using ref-counted wxString
// implementation -- instead, event.GetString() will query the control for
// its current text if needed
//event.SetString(win->GetValue());
event.SetEventObject(win);
return win->GetEventHandler()->ProcessEvent(event);
}
#else // !wxUSE_TEXTCTRL
// define this one even if !wxUSE_TEXTCTRL because it is also used by other