]> git.saurik.com Git - wxWidgets.git/commitdiff
compilation fixes for wxMSW compilation with wxUSE_PALETTE set to 0
authorDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Tue, 4 Jan 2011 19:00:10 +0000 (19:00 +0000)
committerDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Tue, 4 Jan 2011 19:00:10 +0000 (19:00 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66581 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/glcanvas.cpp
src/msw/graphics.cpp

index e446fe096bddb60cb20efb0a57c19534eca9be3c..0dff02b534e2d40386808262b6d95722eb67074d 100644 (file)
@@ -146,8 +146,10 @@ bool wxGLContext::SetCurrent(const wxGLCanvas& win) const
 IMPLEMENT_CLASS(wxGLCanvas, wxWindow)
 
 BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow)
+#if wxUSE_PALETTE
     EVT_PALETTE_CHANGED(wxGLCanvas::OnPaletteChanged)
     EVT_QUERY_NEW_PALETTE(wxGLCanvas::OnQueryNewPalette)
+#endif
 END_EVENT_TABLE()
 
 // ----------------------------------------------------------------------------
index 52c809b805eb19465d9776bd066d1b8f2648335d..87c5d8602fa9565856c1747ec42f1d919271c37d 100644 (file)
@@ -516,7 +516,13 @@ wxGDIPlusPenData::wxGDIPlusPenData( wxGraphicsRenderer* renderer, const wxPen &p
             wxBitmap* bmp = pen.GetStipple();
             if ( bmp && bmp->Ok() )
             {
-                m_penImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),(HPALETTE)bmp->GetPalette()->GetHPALETTE());
+                m_penImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),
+#if wxUSE_PALETTE
+                    (HPALETTE)bmp->GetPalette()->GetHPALETTE()
+#else
+                    NULL
+#endif
+                );
                 m_penBrush = new TextureBrush(m_penImage);
                 m_pen->SetBrush( m_penBrush );
             }
@@ -619,7 +625,13 @@ wxGDIPlusBrushData::wxGDIPlusBrushData( wxGraphicsRenderer* renderer , const wxB
         if ( bmp && bmp->Ok() )
         {
             wxDELETE( m_brushImage );
-            m_brushImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),(HPALETTE)bmp->GetPalette()->GetHPALETTE());
+            m_brushImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),
+#if wxUSE_PALETTE
+                (HPALETTE)bmp->GetPalette()->GetHPALETTE()
+#else
+                NULL
+#endif
+            );
             m_brush = new TextureBrush(m_brushImage);
         }
     }
@@ -755,7 +767,13 @@ wxGDIPlusBitmapData::wxGDIPlusBitmapData( wxGraphicsRenderer* renderer,
     Bitmap* image = NULL;
     if ( bmp.GetMask() )
     {
-        Bitmap interim((HBITMAP)bmp.GetHBITMAP(),(HPALETTE)bmp.GetPalette()->GetHPALETTE()) ;
+        Bitmap interim((HBITMAP)bmp.GetHBITMAP(),
+#if wxUSE_PALETTE
+            (HPALETTE)bmp.GetPalette()->GetHPALETTE()
+#else
+            NULL
+#endif
+        );
 
         size_t width = interim.GetWidth();
         size_t height = interim.GetHeight();
@@ -811,7 +829,13 @@ wxGDIPlusBitmapData::wxGDIPlusBitmapData( wxGraphicsRenderer* renderer,
     }
     else
     {
-        image = Bitmap::FromHBITMAP((HBITMAP)bmp.GetHBITMAP(),(HPALETTE)bmp.GetPalette()->GetHPALETTE());
+        image = Bitmap::FromHBITMAP((HBITMAP)bmp.GetHBITMAP(),
+#if wxUSE_PALETTE
+            (HPALETTE)bmp.GetPalette()->GetHPALETTE()
+#else
+            NULL
+#endif
+        );
         if ( bmp.HasAlpha() && GetPixelFormatSize(image->GetPixelFormat()) == 32 )
         {
             size_t width = image->GetWidth();