X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/947f3b358cae28b63c6f69af21c493cab355fb7e..9534c0039b9d708c7c0ab961f74c1b14f3bfec4c:/src/mac/carbon/textctrl.cpp diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index 44ec53aa9a..6aac442420 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -828,6 +828,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) { int key = event.GetKeyCode() ; bool eat_key = false ; + long from, to; if ( key == 'a' && event.MetaDown() ) { @@ -855,10 +856,11 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) // Check if we have reached the max # of chars (if it is set), but still // allow navigation and deletion + GetSelection( &from, &to ); 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 & wxTE_PROCESS_ENTER) ) - ) + key != WXK_BACK && key != WXK_DELETE && !( key == WXK_RETURN && (m_windowStyle & wxTE_PROCESS_ENTER) ) && + from == to ) { // eat it, we don't want to add more than allowed # of characters