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:
@@ -1596,14 +1596,20 @@ void MyCanvas::DrawSystemColours(wxDC& dc)
|
|||||||
"wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT"
|
"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;
|
wxSystemColour sysColour = (wxSystemColour)i;
|
||||||
|
|
||||||
wxString colourName = sysColNames[sysColour];
|
wxString colourName = sysColNames[sysColour];
|
||||||
|
|
||||||
wxColour c = wxSystemSettings::GetColour(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.SetBrush(wxBrush(c));
|
||||||
dc.DrawRectangle(r);
|
dc.DrawRectangle(r);
|
||||||
|
Reference in New Issue
Block a user