void Notify();
+ bool GetRefreshEnabled() const { return m_refreshEnabled; }
+ void EnableRefresh(bool b) { m_refreshEnabled = b; }
+
protected:
virtual void DoShow();
virtual void DoHide();
bool m_flashOn;
wxRichTextCaretTimer m_timer;
wxRichTextCtrl* m_richTextCtrl;
+ bool m_refreshEnabled;
};
#endif
#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);
#endif
{
#if wxRICHTEXT_USE_OWN_CARET
if (GetCaret()->IsVisible())
{
+ PositionCaret();
((wxRichTextCaret*) GetCaret())->DoDraw(& dc);
}
#endif
GetCaret()->Show();
PositionCaret();
#else
-#if !defined(__WXMAC__)
- // Causes caret dropouts on Mac
- PositionCaret();
-#endif
+ if (GetCaret())
+ ((wxRichTextCaret*) GetCaret())->EnableRefresh(true);
#endif
}
void wxRichTextCaret::Init()
{
m_hasFocus = true;
+ m_refreshEnabled = true;
m_xOld =
m_yOld = -1;
if (m_xOld != -1 && m_yOld != -1)
{
- if (m_richTextCtrl)
+ if (m_richTextCtrl && m_refreshEnabled)
{
wxRect rect(GetPosition(), GetSize());
m_richTextCtrl->RefreshRect(rect, false);
void wxRichTextCaret::Refresh()
{
- if (m_richTextCtrl)
+ if (m_richTextCtrl && m_refreshEnabled)
{
wxRect rect(GetPosition(), GetSize());
m_richTextCtrl->RefreshRect(rect, false);