]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/dcclient.cpp
Fixed three mouse event bugs
[wxWidgets.git] / src / motif / dcclient.cpp
index a91a4e7d5721ee9f511621251091751907783ad1..e99b12a34706d6c618d274a5f4655458f8ca10cd 100644 (file)
@@ -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 ();