// Author: Julian Smart
// Modified by:
// Created: 2005-09-30
-// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ----------------------------------------------------------------------------
// 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
textBox->AddParagraph(wxEmptyString);
textBox->SetParent(NULL);
+ // If the box has an invalid foreground colour, its text will mimic any upstream value (see #15224)
+ if (!textBox->GetAttributes().GetTextColour().IsOk())
+ {
+ textBox->GetAttributes().SetTextColour(GetBasicStyle().GetTextColour());
+ }
+
// The object returned is the one actually inserted into the buffer,
// while the original one is deleted.
wxRichTextObject* obj = GetFocusObject()->InsertObjectWithUndo(& GetBuffer(), m_caretPosition+1, textBox, this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
wxRichTextTable* table = new wxRichTextTable;
table->SetAttributes(tableAttr);
table->SetParent(& GetBuffer()); // set parent temporarily for AddParagraph to use correct style
+ table->SetBasicStyle(GetBasicStyle());
table->CreateTable(rows, cols);
table->SetParent(NULL);
+ // If cells have an invalid foreground colour, their text will mimic any upstream value (see #15224)
+ wxRichTextAttr attr = cellAttr;
+ if (!attr.GetTextColour().IsOk())
+ {
+ attr.SetTextColour(GetBasicStyle().GetTextColour());
+ }
+
int i, j;
for (j = 0; j < rows; j++)
{
for (i = 0; i < cols; i++)
{
- table->GetCell(j, i)->GetAttributes() = cellAttr;
+ table->GetCell(j, i)->GetAttributes() = attr;
}
}
void wxRichTextCaret::DoDraw(wxDC *dc)
{
- dc->SetBrush((m_hasFocus ? m_caretBrush : *wxTRANSPARENT_BRUSH));
- dc->SetPen(m_caretPen);
+ 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);
void wxRichTextCaret::Notify()
{
+#ifdef __WXMAC__
+ // Workaround for lack of kill focus event in wxOSX
+ if (m_richTextCtrl && !m_richTextCtrl->HasFocus())
+ {
+ Hide();
+ return;
+ }
+#endif
+
m_flashOn = !m_flashOn;
Refresh();
}