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:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user