diff --git a/include/wx/univ/textctrl.h b/include/wx/univ/textctrl.h index ccaf81902d..ac19ff009e 100644 --- a/include/wx/univ/textctrl.h +++ b/include/wx/univ/textctrl.h @@ -227,8 +227,9 @@ public: long numArg = -1, const wxString& strArg = wxEmptyString); - // override this to recreate the caret here + // override these methods to handle the caret virtual bool SetFont(const wxFont &font); + virtual bool Enable(bool enable = TRUE); protected: // draw the text diff --git a/src/univ/textctrl.cpp b/src/univ/textctrl.cpp index 540ebb6733..8d4ead1d5f 100644 --- a/src/univ/textctrl.cpp +++ b/src/univ/textctrl.cpp @@ -184,25 +184,6 @@ bool wxTextCtrl::Create(wxWindow *parent, return TRUE; } -bool wxTextCtrl::SetFont(const wxFont& font) -{ - if ( !wxControl::SetFont(font) ) - return FALSE; - - // recreate it, in fact - CreateCaret(); - - // and refresh everything, of course - InitInsertionPoint(); - ClearSelection(); - - m_widthMax = -1; - - Refresh(); - - return TRUE; -} - // ---------------------------------------------------------------------------- // set/get the value // ---------------------------------------------------------------------------- @@ -2280,6 +2261,33 @@ void wxTextCtrl::DoDraw(wxControlRenderer *renderer) // caret // ---------------------------------------------------------------------------- +bool wxTextCtrl::SetFont(const wxFont& font) +{ + if ( !wxControl::SetFont(font) ) + return FALSE; + + // recreate it, in fact + CreateCaret(); + + // and refresh everything, of course + InitInsertionPoint(); + ClearSelection(); + + m_widthMax = -1; + + Refresh(); + + return TRUE; +} + +bool wxTextCtrl::Enable(bool enable) +{ + if ( !wxTextCtrlBase::Enable(enable) ) + return FALSE; + + ShowCaret(enable); +} + void wxTextCtrl::CreateCaret() { // FIXME use renderer