From 9cd722e33761671e3a03a30313ef6486a55d2730 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Thu, 17 Apr 2008 15:19:15 +0000 Subject: [PATCH] Patches-1940222 ] wxTextCtrl and keydown on fully selected text (wxMac) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53246 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/textctrl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 -- 2.45.2