disabled text control doesn't show the caret

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8619 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-10-23 10:26:20 +00:00
parent d131b63b6d
commit 36830fc59e
2 changed files with 29 additions and 20 deletions

View File

@@ -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

View File

@@ -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