m_cmap = gtk_widget_get_colormap( window->m_wxwindow );
else
m_cmap = gtk_widget_get_colormap( window->m_widget );
+
+ m_isDrawable = TRUE;
+
SetUpDC();
long x = 0;
long x2 = XLOG2DEV(points[i+1].x + xoffset);
long y1 = YLOG2DEV(points[i].y + yoffset); // oh, what a waste
long y2 = YLOG2DEV(points[i+1].y + yoffset);
- gdk_draw_line( m_window, m_brushGC, x1, y1, x2, y2 );
+ gdk_draw_line( m_window, m_penGC, x1, y1, x2, y2 );
};
};
long x2 = XLOG2DEV(npoint->x + xoffset);
long y1 = YLOG2DEV(point->y + yoffset); // and again...
long y2 = YLOG2DEV(npoint->y + yoffset);
- gdk_draw_line( m_window, m_brushGC, x1, y1, x2, y2 );
+ gdk_draw_line( m_window, m_penGC, x1, y1, x2, y2 );
node = node->Next();
};
};
return TRUE;
};
-void wxPaintDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(use16) )
+void wxPaintDC::DrawText( const wxString &text, long x, long y, bool
+WXUNUSED(use16) )
{
if (!Ok()) return;
-
+
GdkFont *font = m_font.GetInternalFont( m_scaleY );
+ x = XLOG2DEV(x);
+ y = YLOG2DEV(y);
+
// CMB 21/5/98: draw text background if mode is wxSOLID
if (m_backgroundMode == wxSOLID)
{
gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height );
gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() );
}
- gdk_draw_string( m_window, font, m_textGC,
- XLOG2DEV(x),
- YLOG2DEV(y) + font->ascent, text );
+ gdk_draw_string( m_window, font, m_textGC, x, y + font->ascent, text );
+
+ // CMB 17/7/98: simple underline: ignores scaling and underlying
+ // X font's XA_UNDERLINE_POSITION and XA_UNDERLINE_THICKNESS
+ // properties (see wxXt implementation)
+ if (m_font.GetUnderlined())
+ {
+ long width = gdk_string_width( font, text );
+ long ul_y = y + font->ascent;
+ if (font->descent > 0) ul_y++;
+ gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
+ }
};
+
+
bool wxPaintDC::CanGetTextExtent(void) const
{
return TRUE;
if (!Ok()) return;
DestroyClippingRegion();
- gdk_window_clear( m_window );
+
+ if (m_isDrawable)
+ {
+ gdk_window_clear( m_window );
+ }
+ else
+ {
+ int width = 0;
+ int height = 0;
+ GetSize( &width, &height );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, 0, 0, width, height );
+ };
};
void wxPaintDC::SetFont( const wxFont &font )