wxWindowDC::wxWindowDC( wxWindow *window )
{
+ wxASSERT_MSG( window, wxT("DC needs a window") );
+
m_penGC = (GdkGC *) NULL;
m_brushGC = (GdkGC *) NULL;
m_textGC = (GdkGC *) NULL;
m_isScreenDC = FALSE;
m_font = window->GetFont();
- wxASSERT_MSG( window, wxT("DC needs a window") );
-
GtkWidget *widget = window->m_wxwindow;
// some controls don't have m_wxwindow - like wxStaticBox, but the user
if (!m_window) return FALSE;
-#if 0
+#if 1
// transform the source DC coords to the device ones
- xsrc = XLOG2DEV(xsrc);
- ysrc = YLOG2DEV(ysrc);
+ xsrc = source->XLOG2DEV(xsrc);
+ ysrc = source->YLOG2DEV(ysrc);
#endif
wxClientDC *srcDC = (wxClientDC*)source;
dc.SetBrush(*wxBLACK_BRUSH);
dc.Clear();
dc.DrawText(text, 0, 0);
- dc.SetFont(wxNullFont);
dc.SelectObject(wxNullBitmap);
// Calculate the size of the rotated bounding box.
void wxWindowDC::SetFont( const wxFont &font )
{
+ wxCHECK_RET( font.Ok(), _T("invalid font in wxWindowDC::SetFont") );
+
m_font = font;
#ifdef __WXGTK20__
// fix fontdesc?