wxASSERT_MSG( (window != (wxWindow*) NULL), "You must pass a valid wxWindow to wxWindowDC/wxClientDC/wxPaintDC constructor." );
m_window = window;
+ m_font = window->GetFont();
m_gc = (WXGC) 0;
m_gcBacking = (WXGC) 0;
m_backgroundPixel = -1;
// TODO: this should be an error log function
wxFAIL_MSG("set a valid font before calling GetTextExtent!");
- *width = -1;
- *height = -1;
+ if (width) *width = -1;
+ if (height) *height = -1;
return;
}
XTextExtents((XFontStruct*) pFontStruct, (char*) (const char*) string, slen, &direction,
&ascent, &descent2, &overall);
- *width = XDEV2LOGREL (overall.width);
- *height = YDEV2LOGREL (ascent + descent2);
+ if (width) *width = XDEV2LOGREL (overall.width);
+ if (height) *height = YDEV2LOGREL (ascent + descent2);
if (descent)
*descent = descent2;
if (externalLeading)
void wxWindowDC::DoSetClippingRegion( long x, long y, long width, long height )
{
- wxDC::SetClippingRegion( x, y, width, height );
+ wxDC::DoSetClippingRegion( x, y, width, height );
if (m_userRegion)
XDestroyRegion ((Region) m_userRegion);
{
wxRect box = region.GetBox();
- wxDC::SetClippingRegion( box.x, box.y, box.width, box.height );
+ wxDC::DoSetClippingRegion( box.x, box.y, box.width, box.height );
if (m_userRegion)
XDestroyRegion ((Region) m_userRegion);
void wxWindowDC::DoDrawSpline( wxList *points )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;