X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ce7fe42e848cc0c9058dae906c3a7bded50681e6..c37b0f0907b07878551a00165b0ad323bd2ccdaf:/src/richtext/richtextctrl.cpp diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index b330581885..69151389e1 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -4,7 +4,6 @@ // Author: Julian Smart // Modified by: // Created: 2005-09-30 -// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -149,6 +148,8 @@ private: wxRichTextCaretTimer m_timer; wxRichTextCtrl* m_richTextCtrl; bool m_refreshEnabled; + wxPen m_caretPen; + wxBrush m_caretBrush; }; #endif @@ -2663,7 +2664,7 @@ bool wxRichTextCtrl::RecreateBuffer(const wxSize& size) // ---------------------------------------------------------------------------- // file IO functions // ---------------------------------------------------------------------------- - +#if wxUSE_FFILE && wxUSE_STREAMS bool wxRichTextCtrl::DoLoadFile(const wxString& filename, int fileType) { SetFocusObject(& GetBuffer(), true); @@ -2705,6 +2706,7 @@ bool wxRichTextCtrl::DoSaveFile(const wxString& filename, int fileType) return false; } +#endif // wxUSE_FFILE && wxUSE_STREAMS // ---------------------------------------------------------------------------- // wxRichTextCtrl specific functionality @@ -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,15 @@ void wxRichTextCaret::Refresh() void wxRichTextCaret::DoDraw(wxDC *dc) { - dc->SetPen( *wxBLACK_PEN ); - - dc->SetBrush(*(m_hasFocus ? wxBLACK_BRUSH : wxTRANSPARENT_BRUSH)); - dc->SetPen(*wxBLACK_PEN); + wxBrush brush(m_caretBrush); + wxPen pen(m_caretPen); + if (m_richTextCtrl && m_richTextCtrl->GetBasicStyle().HasTextColour()) + { + brush = wxBrush(m_richTextCtrl->GetBasicStyle().GetTextColour()); + pen = wxPen(m_richTextCtrl->GetBasicStyle().GetTextColour()); + } + dc->SetBrush((m_hasFocus ? brush : *wxTRANSPARENT_BRUSH)); + dc->SetPen(pen); wxPoint pt(m_x, m_y);