X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a724d7892daa5a4eb5e7eb615bfbb4779730f4a6..4a33eba645f96bf7a89397d7dbadd7d62ee2fde1:/src/motif/dcclient.cpp diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index a91a4e7d57..e99b12a347 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -172,7 +172,7 @@ wxWindowDC::~wxWindowDC(void) }; void wxWindowDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1), - wxColour* WXUNUSED(col), int WXUNUSED(style) ) + const wxColour& WXUNUSED(col), int WXUNUSED(style) ) { // TODO }; @@ -354,7 +354,7 @@ void wxWindowDC::DrawEllipticArc( long x, long y, long width, long height, doubl XLOG2DEV_2 (x), YLOG2DEV_2 (y),wd,hd,start,end); } - if (!m_pen.Ok() && m_pen.GetStyle () != wxTRANSPARENT) + if (m_pen.Ok() && m_pen.GetStyle () != wxTRANSPARENT) { if (m_autoSetting) SetPen (m_pen); @@ -1229,7 +1229,8 @@ void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *heigh if (!theFont->Ok()) { // TODO: this should be an error log function - cerr << "wxWindows warning - set a valid font before calling GetTextExtent!\n"; + wxFAIL_MSG("set a valid font before calling GetTextExtent!"); + *width = -1; *height = -1; return; @@ -1298,7 +1299,6 @@ void wxWindowDC::Clear(void) int w, h; if (m_window) { - // TODO: should we get the virtual size? m_window->GetSize(&w, &h); if (m_window && m_window->GetBackingPixmap()) @@ -1330,6 +1330,24 @@ void wxWindowDC::Clear(void) m_brush = saveBrush; }; +void wxWindowDC::Clear(const wxRect& rect) +{ + if (!Ok()) return; + + int x = rect.x; int y = rect.y; + int w = rect.width; int h = rect.height; + + wxBrush saveBrush = m_brush; + SetBrush (m_backgroundBrush); + + XFillRectangle ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, x, y, w, h); + + if (m_window && m_window->GetBackingPixmap()) + XFillRectangle ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking, x, y, w, h); + + m_brush = saveBrush; +}; + void wxWindowDC::SetFont( const wxFont &font ) { if (!Ok()) return; @@ -1385,7 +1403,7 @@ void wxWindowDC::SetPen( const wxPen &pen ) m_currentPenDash = m_pen.GetDash(); if (m_currentStyle == wxSTIPPLE) - m_currentStipple = m_pen.GetStipple (); + m_currentStipple = * m_pen.GetStipple (); bool sameStyle = (oldStyle == m_currentStyle && oldFill == m_currentFill && @@ -1522,7 +1540,7 @@ void wxWindowDC::SetPen( const wxPen &pen ) { Pixmap myStipple; - oldStipple = (wxBitmap*) NULL; // For later reset!! + oldStipple = wxNullBitmap; // For later reset!! switch (m_currentFill) { @@ -1673,7 +1691,7 @@ void wxWindowDC::SetBrush( const wxBrush &brush ) m_currentFill = m_brush.GetStyle (); if (m_currentFill == wxSTIPPLE) - m_currentStipple = m_brush.GetStipple (); + m_currentStipple = * m_brush.GetStipple (); wxColour oldBrushColour(m_currentColour); m_currentColour = m_brush.GetColour ();