X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5ac5e40e4181aaf7fd79ca445113d7a228a70cb8..eaaf10f671951c3dc50e37e5bb1031d3b5148767:/src/richtext/richtextctrl.cpp 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);