]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/dc.cpp
Fixed three mouse event bugs
[wxWidgets.git] / src / motif / dc.cpp
index a7508a94ba6f8f34cec20eff0e8e53d2cdc1685d..8502eb79e48786a1e29ec503a270f9ccbc15e5dd 100644 (file)
@@ -14,6 +14,7 @@
 #endif
 
 #include "wx/dc.h"
+#include "wx/dcmemory.h"
 
 #if !USE_SHARED_LIBRARY
 IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
@@ -80,6 +81,8 @@ wxDC::wxDC(void)
   m_font = *wxNORMAL_FONT;
   m_brush = *wxTRANSPARENT_BRUSH;
   m_backgroundBrush = *wxWHITE_BRUSH;
+
+  m_isInteractive = FALSE;
   
 //  m_palette = wxAPP_COLOURMAP;
 };
@@ -92,6 +95,31 @@ void wxDC::DrawIcon( const wxIcon &WXUNUSED(icon), long WXUNUSED(x), long WXUNUS
 {
 };
 
+void wxDC::DrawBitmap( const wxBitmap& bitmap, long x, long y, bool useMask )
+{
+    if (!bitmap.Ok())
+        return;
+
+    wxMemoryDC memDC;
+    memDC.SelectObject(bitmap);
+
+/* Not sure if we need this. The mask should leave the
+ * masked areas as per the original background of this DC.
+    if (useMask)
+    {
+        // There might be transparent areas, so make these
+        // the same colour as this DC
+        memDC.SetBackground(* GetBackground());
+        memDC.Clear();
+    }
+*/
+
+    Blit(x, y, bitmap.GetWidth(), bitmap.GetHeight(), & memDC, 0, 0, wxCOPY, useMask);
+
+    memDC.SelectObject(wxNullBitmap);
+};
+
+
 void wxDC::DrawPoint( wxPoint& point ) 
 { 
   DrawPoint( point.x, point.y ); 
@@ -145,11 +173,6 @@ void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
   };
 };
 
-void wxDC::DrawSpline( wxList *points )
-{
-  DrawOpenSpline( points );
-};
-
 void wxDC::DrawSpline( int n, wxPoint points[] )
 {
   wxList list;
@@ -380,10 +403,10 @@ void wxDC::ComputeScaleAndOrigin(void)
   {
     // this is a bit artificial, but we need to force wxDC to think
     // the pen has changed
-    wxPen* pen = GetPen();
+    wxPen* pen = GetPen();
     wxPen tempPen;
     m_pen = tempPen;
-    SetPen(pen);
+    SetPen(pen);
   }
 };