removing duplicated method, wiring native maxlength support, see #10269
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70355 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -75,10 +75,6 @@ public:
|
|||||||
virtual void MarkDirty();
|
virtual void MarkDirty();
|
||||||
virtual void DiscardEdits();
|
virtual void DiscardEdits();
|
||||||
|
|
||||||
// set the max number of characters which may be entered
|
|
||||||
// in a single line text control
|
|
||||||
virtual void SetMaxLength(unsigned long len);
|
|
||||||
|
|
||||||
// set the grayed out hint text
|
// set the grayed out hint text
|
||||||
virtual bool SetHint(const wxString& hint);
|
virtual bool SetHint(const wxString& hint);
|
||||||
virtual wxString GetHint() const;
|
virtual wxString GetHint() const;
|
||||||
|
@@ -154,11 +154,6 @@ void wxTextCtrl::MacCheckSpelling(bool check)
|
|||||||
GetTextPeer()->CheckSpelling(check);
|
GetTextPeer()->CheckSpelling(check);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTextCtrl::SetMaxLength(unsigned long len)
|
|
||||||
{
|
|
||||||
m_maxLength = len ;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool wxTextCtrl::SetFont( const wxFont& font )
|
bool wxTextCtrl::SetFont( const wxFont& font )
|
||||||
{
|
{
|
||||||
if ( !wxTextCtrlBase::SetFont( font ) )
|
if ( !wxTextCtrlBase::SetFont( font ) )
|
||||||
@@ -381,6 +376,8 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !GetTextPeer()->CanClipMaxLength() )
|
||||||
|
{
|
||||||
// Check if we have reached the max # of chars (if it is set), but still
|
// Check if we have reached the max # of chars (if it is set), but still
|
||||||
// allow navigation and deletion
|
// allow navigation and deletion
|
||||||
GetSelection( &from, &to );
|
GetSelection( &from, &to );
|
||||||
@@ -394,6 +391,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
|
|||||||
// TODO: generate EVT_TEXT_MAXLEN()
|
// TODO: generate EVT_TEXT_MAXLEN()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// assume that any key not processed yet is going to modify the control
|
// assume that any key not processed yet is going to modify the control
|
||||||
m_dirty = true;
|
m_dirty = true;
|
||||||
|
Reference in New Issue
Block a user