]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/textentry_osx.cpp
Further refine of #15226: wxRichTextCtrl: Implement setting properties with undo...
[wxWidgets.git] / src / osx / textentry_osx.cpp
index 8fe74193ea6ef0d9849b5e3d87db1ad5104ad8b4..67a858ea8f1fc860dd5a9a1640a3bb2c794bb181 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Stefan Csomor
 // Modified by: Kevin Ollivier
 // Created:     1998-01-01
-// RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -224,6 +223,23 @@ bool wxTextEntry::IsEditable() const
     return m_editable ;
 }
 
+bool wxTextEntry::SendMaxLenEvent()
+{
+    wxWindow *win = GetEditableWindow();
+    wxCHECK_MSG( win, false, "can't send an event without a window" );
+    
+    wxCommandEvent event(wxEVT_TEXT_MAXLEN, 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);
+}
+
 // ----------------------------------------------------------------------------
 // Undo/redo
 // ----------------------------------------------------------------------------