// Author: Julian Smart
// Modified by:
// Created: 2005-09-30
-// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
wxRichTextCaretTimer m_timer;
wxRichTextCtrl* m_richTextCtrl;
bool m_refreshEnabled;
+ wxPen m_caretPen;
+ wxBrush m_caretBrush;
};
#endif
// ----------------------------------------------------------------------------
// file IO functions
// ----------------------------------------------------------------------------
-
+#if wxUSE_FFILE && wxUSE_STREAMS
bool wxRichTextCtrl::DoLoadFile(const wxString& filename, int fileType)
{
SetFocusObject(& GetBuffer(), true);
return false;
}
+#endif // wxUSE_FFILE && wxUSE_STREAMS
// ----------------------------------------------------------------------------
// wxRichTextCtrl specific functionality
{
m_flashOn = true;
- if (!m_timer.IsRunning())
+ if (!m_timer.IsRunning() && GetBlinkTime() > 0)
m_timer.Start(GetBlinkTime());
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);