m_textGC = (WXGC*) wxGetPoolGC( (Window) m_window, wxTEXT_SCREEN );
m_bgGC = (WXGC*) wxGetPoolGC( (Window) m_window, wxBG_SCREEN );
}
-#if 0
else
if (m_isMemDC && (((wxMemoryDC*)this)->m_selected.GetDepth() == 1))
{
m_textGC = (WXGC*) wxGetPoolGC( (Window) m_window, wxTEXT_MONO );
m_bgGC = (WXGC*) wxGetPoolGC( (Window) m_window, wxBG_MONO );
}
-#endif
else
{
m_penGC = (WXGC*) wxGetPoolGC( (Window) m_window, wxPEN_COLOUR );
XSetFillStyle( (Display*) m_display, (GC) m_textGC, FillSolid );
+#if wxUSE_NANOX
+ // By default, draw transparently
+ GrSetGCUseBackground((GC) m_textGC, FALSE);
+#endif
+
/* m_penGC */
m_pen.GetColour().CalcPixel( m_cmap );
XSetForeground( (Display*) m_display, (GC) m_penGC, m_pen.GetColour().GetPixel() );
CalcBoundingBox(x1, y1);
CalcBoundingBox(x2, y2);
-
- wxLogDebug("Drawing line at %d, %d -> %d, %d", XLOG2DEV(x1), YLOG2DEV(y1), XLOG2DEV(x2), YLOG2DEV(y2) );
}
}
if (m_pen.GetStyle () != wxTRANSPARENT)
{
XDrawRectangle( (Display*) m_display, (Window) m_window,
- (GC) m_penGC, xx, yy, ww, hh );
+ (GC) m_penGC, xx, yy, ww-1, hh-1 );
}
}
CalcBoundingBox( x, y );
CalcBoundingBox( x + width, y + height );
- wxLogDebug("Drawing rectangle at %d, %d (%dx%d)", x, y, width, height);
}
void wxWindowDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius )
#endif
XSetFont( (Display*) m_display, (GC) m_textGC, xfont->fid );
+#if !wxUSE_NANOX
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
- {
+#endif
+ {
XDrawString( (Display*) m_display, (Window) m_window,
- (GC) m_textGC, x, y + xfont->ascent, text.c_str(), text.Len() );
- }
+ (GC) m_textGC, x, y + XFontStructGetAscent(xfont), text.c_str(), text.Len() );
+ }
#if 0
if (m_font.GetUnderlined())
{
- wxCoord ul_y = y + font->ascent;
+ wxCoord ul_y = y + XFontStructGetAscent(font);
if (font->descent > 0) ul_y++;
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
}
int direction, ascent, descent2;
XCharStruct overall;
- XTextExtents( xfont, string.c_str(), string.Len(), &direction,
+ XTextExtents( xfont, (char*) string.c_str(), string.Len(), &direction,
&ascent, &descent2, &overall);
if (width)
else
{
XSetFillStyle( (Display*) m_display, (GC) m_brushGC, FillStippled );
-// XSetStipple( (Display*) m_display, (GC) m_brushGC, (Pixmap) m_brush.GetStipple()->GetBitmap() );
+ XSetStipple( (Display*) m_display, (GC) m_brushGC, (Pixmap) m_brush.GetStipple()->GetBitmap() );
}
}
if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
{
XSetFillStyle( (Display*) m_display, (GC) m_textGC, FillOpaqueStippled );
-// XSetStipple( (Display*) m_display, (GC) m_textGC, (Pixmap) m_brush.GetStipple()->GetMask()->GetBitmap() );
+ XSetStipple( (Display*) m_display, (GC) m_textGC, (Pixmap) m_brush.GetStipple()->GetMask()->GetBitmap() );
}
if (IS_HATCH(m_brush.GetStyle()))
else
{
XSetFillStyle( (Display*) m_display, (GC) m_bgGC, FillStippled );
-// XSetStipple( (Display*) m_display, (GC) m_bgGC, (Pixmap) m_backgroundBrush.GetStipple()->GetBitmap() );
+ XSetStipple( (Display*) m_display, (GC) m_bgGC, (Pixmap) m_backgroundBrush.GetStipple()->GetBitmap() );
}
}
m_backgroundMode = mode;
+#if wxUSE_NANOX
+ GrSetGCUseBackground((GC) m_textGC, mode == wxTRANSPARENT ? FALSE : TRUE);
+#endif
+
if (!m_window) return;
// CMB 21/7/98: fill style of cross-hatch brushes is affected by