// Author: Julian Smart
// Modified by:
// Created: 2005-09-30
-// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
if (m_baseStyle.IsEmpty())
return m_style;
- bool isParaStyle = IsKindOf(CLASSINFO(wxRichTextParagraphStyleDefinition));
- bool isCharStyle = IsKindOf(CLASSINFO(wxRichTextCharacterStyleDefinition));
- bool isListStyle = IsKindOf(CLASSINFO(wxRichTextListStyleDefinition));
- bool isBoxStyle = IsKindOf(CLASSINFO(wxRichTextBoxStyleDefinition));
+ bool isParaStyle = IsKindOf(wxCLASSINFO(wxRichTextParagraphStyleDefinition));
+ bool isCharStyle = IsKindOf(wxCLASSINFO(wxRichTextCharacterStyleDefinition));
+ bool isListStyle = IsKindOf(wxCLASSINFO(wxRichTextListStyleDefinition));
+ bool isBoxStyle = IsKindOf(wxCLASSINFO(wxRichTextBoxStyleDefinition));
// Collect the styles, detecting loops
wxArrayString styleNames;
{
int i = GetIndexForStyle(name);
if (i > -1)
+ {
SetSelection(i);
+ if (!IsVisible(i))
+ ScrollToRow(i);
+ }
return i;
}
if (attr.HasAlignment() && attr.GetAlignment() == wxTEXT_ALIGNMENT_CENTRE)
isCentred = true;
+ str << wxT("<html><head></head>");
+ str << wxT("<body");
+ if (attr.GetBackgroundColour().Ok())
+ str << wxT(" bgcolor=\"#") << ColourToHexString(attr.GetBackgroundColour()) << wxT("\"");
+ str << wxT(">");
+
if (isCentred)
str << wxT("<center>");
+ str << wxT("<table");
+ if (attr.GetBackgroundColour().Ok())
+ str << wxT(" bgcolor=\"#") << ColourToHexString(attr.GetBackgroundColour()) << wxT("\"");
- str << wxT("<table><tr>");
+ str << wxT("><tr>");
if (attr.GetLeftIndent() > 0)
{
if (attr.GetTextColour().IsOk())
str << wxT(" color=\"#") << ColourToHexString(attr.GetTextColour()) << wxT("\"");
+ if (attr.GetBackgroundColour().Ok())
+ str << wxT(" bgcolor=\"#") << ColourToHexString(attr.GetBackgroundColour()) << wxT("\"");
+
str << wxT(">");
bool hasBold = false;
bool hasItalic = false;
bool hasUnderline = false;
- if (attr.GetFontWeight() == wxBOLD)
+ if (attr.GetFontWeight() == wxFONTWEIGHT_BOLD)
hasBold = true;
- if (attr.GetFontStyle() == wxITALIC)
+ if (attr.GetFontStyle() == wxFONTSTYLE_ITALIC)
hasItalic = true;
if (attr.GetFontUnderlined())
hasUnderline = true;
if (isCentred)
str << wxT("</center>");
+ str << wxT("</body></html>");
return str;
}