Avoid deprecated wxPen/wxBrush/wxFont API in wxX11 code.

Also simplify the code by relying on implicit constructors of wxPen and
wxBrush from wxColour.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-09-23 17:45:10 +00:00
parent db2ecf57cc
commit 01c1dde264
5 changed files with 13 additions and 19 deletions

View File

@@ -438,7 +438,7 @@ void wxControlRenderer::DrawCheckItems(const wxCheckListBox *lbox,
void wxControlRenderer::DrawProgressBar(const wxGauge *gauge)
{
// draw background
m_dc.SetBrush(wxBrush(m_window->GetBackgroundColour(), wxSOLID));
m_dc.SetBrush(m_window->GetBackgroundColour());
m_dc.SetPen(*wxTRANSPARENT_PEN);
m_dc.DrawRectangle(m_rect);
@@ -458,7 +458,7 @@ void wxControlRenderer::DrawProgressBar(const wxGauge *gauge)
wxColour col = m_window->UseFgCol() ? m_window->GetForegroundColour()
: wxTHEME_COLOUR(GAUGE);
m_dc.SetBrush(wxBrush(col, wxSOLID));
m_dc.SetBrush(col);
if ( gauge->IsSmooth() )
{

View File

@@ -71,8 +71,7 @@ wxStdRenderer::wxStdRenderer(const wxColourScheme *scheme)
void
wxStdRenderer::DrawSolidRect(wxDC& dc, const wxColour& col, const wxRect& rect)
{
wxBrush brush(col, wxSOLID);
dc.SetBrush(brush);
dc.SetBrush(col);
dc.SetPen(*wxTRANSPARENT_PEN);
dc.DrawRectangle(rect);
}

View File

@@ -180,10 +180,10 @@ wxMetalRenderer::wxMetalRenderer(wxRenderer *renderer, wxColourScheme *scheme)
: wxDelegateRenderer(renderer)
{
// init colours and pens
m_penBlack = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_DARK), 0, wxSOLID);
m_penDarkGrey = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_OUT), 0, wxSOLID);
m_penLightGrey = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_IN), 0, wxSOLID);
m_penHighlight = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_HIGHLIGHT), 0, wxSOLID);
m_penBlack = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_DARK));
m_penDarkGrey = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_OUT));
m_penLightGrey = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_IN));
m_penHighlight = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_HIGHLIGHT));
// init the arrow bitmaps
static const size_t ARROW_WIDTH = 7;
@@ -539,7 +539,7 @@ void wxMetalRenderer::DrawMetal(wxDC &dc, const wxRect &rect )
for (int y = rect.y; y < rect.height+rect.y; y++)
{
unsigned char intens = (unsigned char)(230 + 80 * (rect.y-y) / rect.height);
dc.SetBrush( wxBrush( wxColour(intens,intens,intens), wxSOLID ) );
dc.SetBrush(wxColour(intens, intens, intens));
dc.DrawRectangle( rect.x, y, rect.width, 1 );
}
}