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,
|
long numArg = -1,
|
||||||
const wxString& strArg = wxEmptyString);
|
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 SetFont(const wxFont &font);
|
||||||
|
virtual bool Enable(bool enable = TRUE);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// draw the text
|
// draw the text
|
||||||
|
@@ -184,25 +184,6 @@ bool wxTextCtrl::Create(wxWindow *parent,
|
|||||||
return TRUE;
|
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
|
// set/get the value
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -2280,6 +2261,33 @@ void wxTextCtrl::DoDraw(wxControlRenderer *renderer)
|
|||||||
// caret
|
// 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()
|
void wxTextCtrl::CreateCaret()
|
||||||
{
|
{
|
||||||
// FIXME use renderer
|
// FIXME use renderer
|
||||||
|
Reference in New Issue
Block a user