use the right GdkWindow and origin for non-pizza widget with wxClientDC

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58675 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2009-02-05 05:45:40 +00:00
parent ea6e8ec55d
commit b666ade784

View File

@@ -271,16 +271,16 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) :
GtkWidget *widget = window->m_wxwindow;
// Some controls don't have m_wxwindow - like wxStaticBox, but the user
// code should still be able to create wxClientDCs for them, so we will
// use the parent window here then.
// code should still be able to create wxClientDCs for them
if ( !widget )
{
window = window->GetParent();
if (window)
widget = window->m_wxwindow;
}
widget = window->m_widget;
wxASSERT_MSG( widget, wxT("DC needs a widget") );
wxCHECK_RET(widget, "DC needs a widget");
if (GTK_WIDGET_NO_WINDOW(widget))
SetDeviceLocalOrigin(widget->allocation.x, widget->allocation.y);
}
m_context = window->GtkGetPangoDefaultContext();
m_layout = pango_layout_new( m_context );
@@ -297,7 +297,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) :
return;
}
m_cmap = gtk_widget_get_colormap( widget ? widget : window->m_widget );
m_cmap = gtk_widget_get_colormap(widget);
SetUpDC();