The style listbox now takes into account the style background colour if specified.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2013-06-12 09:51:32 +00:00
parent d4e5c5b98a
commit 8836dcaadd

View File

@@ -740,11 +740,20 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons
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)
{
@@ -837,6 +846,9 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons
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;
@@ -876,6 +888,7 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons
if (isCentred)
str << wxT("</center>");
str << wxT("</body></html>");
return str;
}