From: Julian Smart Date: Fri, 5 Jul 2013 13:33:30 +0000 (+0000) Subject: Don't flash wxRTC caret if blink time is zero, and also take colour from window text... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/eaaf10f671951c3dc50e37e5bb1031d3b5148767 Don't flash wxRTC caret if blink time is zero, and also take colour from window text colour to avoid invisibility. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index b330581885..8ece5a710d 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -149,6 +149,8 @@ private: wxRichTextCaretTimer m_timer; wxRichTextCtrl* m_richTextCtrl; bool m_refreshEnabled; + wxPen m_caretPen; + wxBrush m_caretBrush; }; #endif @@ -4777,7 +4779,7 @@ void wxRichTextCaret::DoShow() { m_flashOn = true; - if (!m_timer.IsRunning()) + if (!m_timer.IsRunning() && GetBlinkTime() > 0) m_timer.Start(GetBlinkTime()); Refresh(); @@ -4861,10 +4863,8 @@ void wxRichTextCaret::Refresh() void wxRichTextCaret::DoDraw(wxDC *dc) { - dc->SetPen( *wxBLACK_PEN ); - - dc->SetBrush(*(m_hasFocus ? wxBLACK_BRUSH : wxTRANSPARENT_BRUSH)); - dc->SetPen(*wxBLACK_PEN); + dc->SetBrush((m_hasFocus ? m_caretBrush : *wxTRANSPARENT_BRUSH)); + dc->SetPen(m_caretPen); wxPoint pt(m_x, m_y);