From 8836dcaadd361ce741a18fed2d8578b79c22b620 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 12 Jun 2013 09:51:32 +0000 Subject: [PATCH] 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 --- src/richtext/richtextstyles.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/richtext/richtextstyles.cpp b/src/richtext/richtextstyles.cpp index 3cfec1ff07..da733e121e 100644 --- a/src/richtext/richtextstyles.cpp +++ b/src/richtext/richtextstyles.cpp @@ -740,11 +740,20 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons if (attr.HasAlignment() && attr.GetAlignment() == wxTEXT_ALIGNMENT_CENTRE) isCentred = true; + str << wxT(""); + str << wxT(""); + if (isCentred) str << wxT("
"); + str << wxT(""); + str << wxT(">"); 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("
"); + str << wxT(""); return str; } -- 2.45.2