Stop using wxColourDisplay() inside wxWidgets code

This function always returns true in practice and it's completely
useless to call it during each wxDC object construction, especially
because wxDC::m_colour itself is not used anywhere.
This commit is contained in:
Vadim Zeitlin 2018-10-06 16:12:48 +02:00
parent 24b5e256df
commit 382404f0a7
4 changed files with 14 additions and 21 deletions

View file

@ -163,7 +163,7 @@ void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y)
height = *max_y;
}
if (DrawIt && wxColourDisplay())
if (DrawIt)
{
dc->SetBrush(*wxLIGHT_GREY_BRUSH);
dc->SetPen(*wxGREY_PEN);
@ -347,20 +347,18 @@ void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y)
if (DrawIt)
{
// Draw dark grey thick border
if (wxColourDisplay())
{
dc->SetBrush(*wxGREY_BRUSH);
dc->SetPen(*wxGREY_PEN);
dc->SetBrush(*wxGREY_BRUSH);
dc->SetPen(*wxGREY_PEN);
// Left side
dc->DrawRectangle(0, 0, THIN_LINE_BORDER, height);
// Top side
dc->DrawRectangle(THIN_LINE_BORDER, 0, width-THIN_LINE_BORDER, THIN_LINE_BORDER);
// Right side
dc->DrawRectangle(width-THIN_LINE_BORDER, THIN_LINE_BORDER, width, height-THIN_LINE_BORDER);
// Bottom side
dc->DrawRectangle(THIN_LINE_BORDER, height-THIN_LINE_BORDER, width-THIN_LINE_BORDER, height);
// Left side
dc->DrawRectangle(0, 0, THIN_LINE_BORDER, height);
// Top side
dc->DrawRectangle(THIN_LINE_BORDER, 0, width-THIN_LINE_BORDER, THIN_LINE_BORDER);
// Right side
dc->DrawRectangle(width-THIN_LINE_BORDER, THIN_LINE_BORDER, width, height-THIN_LINE_BORDER);
// Bottom side
dc->DrawRectangle(THIN_LINE_BORDER, height-THIN_LINE_BORDER, width-THIN_LINE_BORDER, height);
}
// Draw border
// Have grey background, plus 3-d border -
// One black rectangle.
@ -376,10 +374,7 @@ void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y)
// Right and bottom white lines - 'grey' (black!) if
// we're running on a mono display.
if (wxColourDisplay())
dc->SetPen(*wxWHITE_PEN);
else
dc->SetPen(*wxBLACK_PEN);
dc->SetPen(*wxWHITE_PEN);
dc->DrawLine(width-THICK_LINE_BORDER, THICK_LINE_BORDER,
width-THICK_LINE_BORDER, height-THICK_LINE_BORDER);