]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/dcmemory.cpp
added wxLstat() (one of patches from bug 1052385)
[wxWidgets.git] / src / motif / dcmemory.cpp
index 20da63305481e7a592cd9f2182dbd1f2be2d7af5..789dac864d6848c09506ed7f5e7ea43683e45b84 100644 (file)
@@ -35,7 +35,7 @@
 
 IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxWindowDC)
 
 
 IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxWindowDC)
 
-wxMemoryDC::wxMemoryDC(void)
+wxMemoryDC::wxMemoryDC( const wxBitmap& bitmap )
 {
     m_ok = true;
     m_display = wxGetDisplay();
 {
     m_ok = true;
     m_display = wxGetDisplay();
@@ -52,11 +52,14 @@ wxMemoryDC::wxMemoryDC(void)
         GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
         &gcvalues);
 
         GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
         &gcvalues);
 
-    m_backgroundPixel = (int) gcvalues.background;
+    m_backgroundPixel = gcvalues.background;
 
     SetBrush (* wxWHITE_BRUSH);
     SetPen (* wxBLACK_PEN);
     SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
 
     SetBrush (* wxWHITE_BRUSH);
     SetPen (* wxBLACK_PEN);
     SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
+    
+    if ( bitmap.IsOk() )
+        SelectObject(bitmap);
 }
 
 wxMemoryDC::wxMemoryDC( wxDC* dc )
 }
 
 wxMemoryDC::wxMemoryDC( wxDC* dc )
@@ -79,7 +82,7 @@ wxMemoryDC::wxMemoryDC( wxDC* dc )
         GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
         &gcvalues);
 
         GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
         &gcvalues);
 
-    m_backgroundPixel = (int) gcvalues.background;
+    m_backgroundPixel = gcvalues.background;
 
     SetBrush (* wxWHITE_BRUSH);
     SetPen (* wxBLACK_PEN);
 
     SetBrush (* wxWHITE_BRUSH);
     SetPen (* wxBLACK_PEN);
@@ -112,7 +115,7 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
             GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
             &gcvalues);
 
             GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
             &gcvalues);
 
-        m_backgroundPixel = (int) gcvalues.background;
+        m_backgroundPixel = gcvalues.background;
         m_ok = true;
 
         SetBrush (* wxWHITE_BRUSH);
         m_ok = true;
 
         SetBrush (* wxWHITE_BRUSH);