X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3cbab64109b007fa1d939fe588f5e79f9105b915..893f78406dcd40841cd39294112f6382945a7be8:/src/gtk1/renderer.cpp diff --git a/src/gtk1/renderer.cpp b/src/gtk1/renderer.cpp index 65efb88eae..04d03ae16d 100644 --- a/src/gtk1/renderer.cpp +++ b/src/gtk1/renderer.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: gtk/renderer.cpp +// Name: src/gtk1/renderer.cpp // Purpose: implementation of wxRendererNative for wxGTK // Author: Vadim Zeitlin // Modified by: @@ -25,13 +25,16 @@ #endif #include "wx/renderer.h" + +#ifndef WX_PRECOMP + #include "wx/window.h" + #include "wx/dc.h" + #include "wx/dcclient.h" +#endif + #include #include "wx/gtk1/win_gtk.h" -#include "wx/window.h" -#include "wx/dc.h" -#include "wx/dcclient.h" - // RR: After a correction to the orientation of the sash // this doesn't seem to be required anymore and it // seems to confuse some themes so USE_ERASE_RECT=0 @@ -306,11 +309,9 @@ wxRendererGTK::DrawDropArrow(wxWindow *win, // work for wxMemoryDC. So that is why we assume wxDC // is wxWindowDC (wxClientDC, wxMemoryDC and wxPaintDC // are derived from it) and use its m_window. - wxWindowDC& wdc = (wxWindowDC&)dc; - - // only doing debug-time checking here (it should - // probably be enough) - wxASSERT ( wdc.IsKindOf(CLASSINFO(wxWindowDC)) ); + GdkWindow* gdk_window = dc.GetGDKWindow(); + wxASSERT_MSG( gdk_window, + wxT("cannot use wxRendererNative on wxDC of this type") ); // draw arrow so that there is even space horizontally // on both sides @@ -337,7 +338,7 @@ wxRendererGTK::DrawDropArrow(wxWindow *win, gtk_paint_arrow ( button->style, - wdc.m_window, + gdk_window, state, flags & wxCONTROL_PRESSED ? GTK_SHADOW_IN : GTK_SHADOW_OUT, NULL, @@ -361,8 +362,9 @@ wxRendererGTK::DrawComboBoxDropButton(wxWindow *win, GtkWidget *button = GetButtonWidget(); // for reason why we do this, see DrawDropArrow - wxWindowDC& wdc = (wxWindowDC&)dc; - wxASSERT ( wdc.IsKindOf(CLASSINFO(wxWindowDC)) ); + GdkWindow* gdk_window = dc.GetGDKWindow(); + wxASSERT_MSG( gdk_window, + wxT("cannot use wxRendererNative on wxDC of this type") ); // draw button GtkStateType state; @@ -379,7 +381,7 @@ wxRendererGTK::DrawComboBoxDropButton(wxWindow *win, gtk_paint_box ( button->style, - wdc.m_window, + gdk_window, state, flags & wxCONTROL_PRESSED ? GTK_SHADOW_IN : GTK_SHADOW_OUT, NULL,