git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70264
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
+ bool GetRefreshEnabled() const { return m_refreshEnabled; }
+ void EnableRefresh(bool b) { m_refreshEnabled = b; }
+
protected:
virtual void DoShow();
virtual void DoHide();
protected:
virtual void DoShow();
virtual void DoHide();
bool m_flashOn;
wxRichTextCaretTimer m_timer;
wxRichTextCtrl* m_richTextCtrl;
bool m_flashOn;
wxRichTextCaretTimer m_timer;
wxRichTextCtrl* m_richTextCtrl;
#if !wxRICHTEXT_USE_OWN_CARET
if (GetCaret() && !IsFrozen())
GetCaret()->Hide();
#if !wxRICHTEXT_USE_OWN_CARET
if (GetCaret() && !IsFrozen())
GetCaret()->Hide();
+#else
+ // Stop the caret refreshing the control from within the
+ // paint handler
+ if (GetCaret())
+ ((wxRichTextCaret*) GetCaret())->EnableRefresh(false);
#if wxRICHTEXT_USE_OWN_CARET
if (GetCaret()->IsVisible())
{
#if wxRICHTEXT_USE_OWN_CARET
if (GetCaret()->IsVisible())
{
((wxRichTextCaret*) GetCaret())->DoDraw(& dc);
}
#endif
((wxRichTextCaret*) GetCaret())->DoDraw(& dc);
}
#endif
GetCaret()->Show();
PositionCaret();
#else
GetCaret()->Show();
PositionCaret();
#else
-#if !defined(__WXMAC__)
- // Causes caret dropouts on Mac
- PositionCaret();
-#endif
+ if (GetCaret())
+ ((wxRichTextCaret*) GetCaret())->EnableRefresh(true);
void wxRichTextCaret::Init()
{
m_hasFocus = true;
void wxRichTextCaret::Init()
{
m_hasFocus = true;
+ m_refreshEnabled = true;
if (m_xOld != -1 && m_yOld != -1)
{
if (m_xOld != -1 && m_yOld != -1)
{
+ if (m_richTextCtrl && m_refreshEnabled)
{
wxRect rect(GetPosition(), GetSize());
m_richTextCtrl->RefreshRect(rect, false);
{
wxRect rect(GetPosition(), GetSize());
m_richTextCtrl->RefreshRect(rect, false);
void wxRichTextCaret::Refresh()
{
void wxRichTextCaret::Refresh()
{
+ if (m_richTextCtrl && m_refreshEnabled)
{
wxRect rect(GetPosition(), GetSize());
m_richTextCtrl->RefreshRect(rect, false);
{
wxRect rect(GetPosition(), GetSize());
m_richTextCtrl->RefreshRect(rect, false);