Use fixed width font for the RGB values in the drawing sample

This makes them more readable and aligns all colours vertically.
This commit is contained in:
Vadim Zeitlin
2016-02-12 03:18:30 +01:00
parent 6680dbf906
commit 4a78ed8bb7

View File

@@ -1596,14 +1596,20 @@ void MyCanvas::DrawSystemColours(wxDC& dc)
"wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT"
};
for (int i = wxSYS_COLOUR_SCROLLBAR; i < wxSYS_COLOUR_MAX; i++)
wxFont mono(wxFontInfo().Family(wxFONTFAMILY_TELETYPE));
for (int i = 0; i < wxSYS_COLOUR_MAX; i++)
{
wxSystemColour sysColour = (wxSystemColour)i;
wxString colourName = sysColNames[sysColour];
wxColour c = wxSystemSettings::GetColour(sysColour);
dc.DrawText(c.GetAsString(wxC2S_HTML_SYNTAX), 10, r.y);
{
wxDCFontChanger setMono(dc, mono);
dc.DrawText(c.GetAsString(wxC2S_HTML_SYNTAX), 10, r.y);
}
dc.SetBrush(wxBrush(c));
dc.DrawRectangle(r);