]> git.saurik.com Git - wxWidgets.git/commitdiff
don't eat all events if m_maxLength is 0: this means no limit according to the docs...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 27 Jan 2006 23:05:23 +0000 (23:05 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 27 Jan 2006 23:05:23 +0000 (23:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/textctrl.cpp

index ddc9c6261dc5c0e497d34f976d8de7c758589871..e5855c0fbb4bd337fc1dd5c185ddc9d1f6b1dbf5 100644 (file)
@@ -401,8 +401,6 @@ private :
 #endif
 };
 
-#define TE_UNLIMITED_LENGTH 0xFFFFFFFFUL
-
 
 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl)
 
@@ -435,7 +433,7 @@ void wxTextCtrl::Init()
     m_editable = true ;
     m_dirty = false;
 
-    m_maxLength = TE_UNLIMITED_LENGTH ;
+    m_maxLength = 0;
     m_privateContextMenu = NULL;
 }
 
@@ -895,13 +893,16 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
         return ;
     }
 
-    // Check if we have reached the max # of chars, but still allow navigation and deletion
-    if ( !IsMultiLine() && GetValue().Length() >= m_maxLength &&
+    // Check if we have reached the max # of chars (if it is set), but still
+    // allow navigation and deletion
+    if ( !IsMultiLine() && m_maxLength && GetValue().Length() >= m_maxLength &&
         key != WXK_LEFT && key != WXK_RIGHT && key != WXK_TAB &&
         key != WXK_BACK && !( key == WXK_RETURN && (m_windowStyle & wxPROCESS_ENTER) )
        )
     {
         // eat it, we don't want to add more than allowed # of characters
+
+        // TODO: generate EVT_TEXT_MAXLEN()
         return;
     }