Implemented text background colour
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44612 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -757,9 +757,12 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos,
|
||||
r.WriteText(wxT("colour, like this red bit."));
|
||||
r.EndTextColour();
|
||||
|
||||
r.BeginTextColour(wxColour(0, 0, 255));
|
||||
r.WriteText(wxT(" And this blue bit."));
|
||||
r.EndTextColour();
|
||||
wxRichTextAttr backgroundColourAttr;
|
||||
backgroundColourAttr.SetBackgroundColour(*wxGREEN);
|
||||
backgroundColourAttr.SetTextColour(wxColour(0, 0, 255));
|
||||
r.BeginStyle(backgroundColourAttr);
|
||||
r.WriteText(wxT(" And this blue on green bit."));
|
||||
r.EndStyle();
|
||||
|
||||
r.WriteText(wxT(" Naturally you can make things "));
|
||||
r.BeginBold();
|
||||
|
@@ -4329,14 +4329,20 @@ bool wxRichTextPlainText::DrawTabbedString(wxDC& dc, const wxTextAttrEx& attr, c
|
||||
dc.SetBrush(*wxBLACK_BRUSH);
|
||||
dc.SetPen(*wxBLACK_PEN);
|
||||
dc.SetTextForeground(*wxWHITE);
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.SetTextForeground(attr.GetTextColour());
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
}
|
||||
|
||||
if (attr.HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) && attr.GetBackgroundColour().IsOk())
|
||||
{
|
||||
dc.SetBackgroundMode(wxSOLID);
|
||||
dc.SetTextBackground(attr.GetBackgroundColour());
|
||||
}
|
||||
else
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
|
||||
while (hasTabs)
|
||||
{
|
||||
// the string has a tab
|
||||
|
Reference in New Issue
Block a user