GetTextPeer()->CheckSpelling(check);
}
-void wxTextCtrl::SetMaxLength(unsigned long len)
-{
- m_maxLength = len ;
-}
-
bool wxTextCtrl::SetFont( const wxFont& font )
{
if ( !wxTextCtrlBase::SetFont( font ) )
return ;
}
- // 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 &&
- !event.IsKeyInCategory(WXK_CATEGORY_ARROW | WXK_CATEGORY_TAB | WXK_CATEGORY_CUT) &&
- !( key == WXK_RETURN && (m_windowStyle & wxTE_PROCESS_ENTER) ) &&
- from == to )
+ if ( !GetTextPeer()->CanClipMaxLength() )
{
- // eat it, we don't want to add more than allowed # of characters
+ // 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 &&
+ !event.IsKeyInCategory(WXK_CATEGORY_ARROW | WXK_CATEGORY_TAB | WXK_CATEGORY_CUT) &&
+ !( key == WXK_RETURN && (m_windowStyle & wxTE_PROCESS_ENTER) ) &&
+ from == to )
+ {
+ // eat it, we don't want to add more than allowed # of characters
- // TODO: generate EVT_TEXT_MAXLEN()
- return;
+ // TODO: generate EVT_TEXT_MAXLEN()
+ return;
+ }
}
// assume that any key not processed yet is going to modify the control