compilation fixes for wxMSW compilation with wxUSE_PALETTE set to 0

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66581 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Dimitri Schoolwerth 2011-01-04 19:00:10 +00:00
parent 5ed8e4e2e4
commit e38f5435fb
2 changed files with 30 additions and 4 deletions

View 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()
// ----------------------------------------------------------------------------

View 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();