]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/textentrycmn.cpp
Generate key events in generic wxDataViewCtrl implementation.
[wxWidgets.git] / src / common / textentrycmn.cpp
index f7b11237efa7ac13f6e86940e4627f3e19557e0b..9dc8ca9461b1190665684c0f542ec4f0f267267d 100644 (file)
@@ -279,4 +279,25 @@ wxPoint wxTextEntryBase::DoGetMargins() const
     return wxPoint(-1, -1);
 }
 
+// ----------------------------------------------------------------------------
+// events
+// ----------------------------------------------------------------------------
+
+/* static */
+bool wxTextEntryBase::SendTextUpdatedEvent(wxWindow *win)
+{
+    wxCHECK_MSG( win, false, "can't send an event without a window" );
+
+    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->HandleWindowEvent(event);
+}
+
 #endif // wxUSE_TEXTCTRL || wxUSE_COMBOBOX