]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't flash wxRTC caret if blink time is zero, and also take colour from window text...
authorJulian Smart <julian@anthemion.co.uk>
Fri, 5 Jul 2013 13:33:30 +0000 (13:33 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 5 Jul 2013 13:33:30 +0000 (13:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextctrl.cpp

index b330581885dcbde2c0f3ea52743005e5f1040d2d..8ece5a710d7227a312fd338be5b1854447c3dde2 100644 (file)
@@ -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);