Move wxRendererMSW::DrawTextCtrl() implementation to wxRendererGeneric.

This ensures that wxRendererGeneric::DrawGauge() is actually usable as
otherwise calling it always resulted in an assertion failure because it used
DrawTextCtrl() which was not implemented in wxRendererGeneric. So this fixes
using DrawGauge() in non-MSW ports which was added by r77023 (see #16406) but
apparently never worked.

Also remove wxRendererMSW::DrawGauge() as it's exactly the same as the version
inherited from wxRendererGeneric.

Closes #16725.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-12-16 20:16:20 +00:00
parent a580f0b994
commit 090a8353e5
2 changed files with 20 additions and 59 deletions

View File

@@ -777,10 +777,21 @@ void wxRendererGeneric::DrawRadioBitmap(wxWindow* WXUNUSED(win), wxDC& WXUNUSED(
wxFAIL_MSG("UNIMPLEMENTED: wxRendererGeneric::DrawRadioBitmap");
}
void wxRendererGeneric::DrawTextCtrl(wxWindow* WXUNUSED(win), wxDC& WXUNUSED(dc),
const wxRect& WXUNUSED(rect), int WXUNUSED(flags))
void wxRendererGeneric::DrawTextCtrl(wxWindow* WXUNUSED(win),
wxDC& dc,
const wxRect& rect,
int WXUNUSED(flags))
{
wxFAIL_MSG("UNIMPLEMENTED: wxRendererGeneric::DrawTextCtrl");
wxColour fill;
wxColour bdr;
{
fill = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
bdr = *wxBLACK;
}
dc.SetPen(bdr);
dc.SetBrush(fill);
dc.DrawRectangle(rect);
}
#ifdef wxHAS_DRAW_TITLE_BAR_BITMAP
@@ -800,7 +811,12 @@ void wxRendererGeneric::DrawTitleBarBitmap(wxWindow * WXUNUSED(win),
#endif // wxHAS_DRAW_TITLE_BAR_BITMAP
void wxRendererGeneric::DrawGauge(wxWindow* win, wxDC& dc, const wxRect& rect, int value, int max, int WXUNUSED(flags))
void wxRendererGeneric::DrawGauge(wxWindow* win,
wxDC& dc,
const wxRect& rect,
int value,
int max,
int WXUNUSED(flags))
{
// Use same background as text controls.
DrawTextCtrl(win, dc, rect);