Fix compilation of image sample with wxUSE_LIBPNG==0.

Also don't propose to save the file using the extensions not supported in this
library build.

Closes #11495.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62746 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-11-30 00:30:15 +00:00
parent 5fc0c309f7
commit c8688139b0

View File

@@ -210,11 +210,21 @@ private:
wxEmptyString, wxEmptyString,
(const wxChar *)NULL, (const wxChar *)NULL,
wxT("BMP files (*.bmp)|*.bmp|") wxT("BMP files (*.bmp)|*.bmp|")
#if wxUSE_LIBPNG
wxT("PNG files (*.png)|*.png|") wxT("PNG files (*.png)|*.png|")
#endif
#if wxUSE_LIBJPEG
wxT("JPEG files (*.jpg)|*.jpg|") wxT("JPEG files (*.jpg)|*.jpg|")
#endif
#if wxUSE_GIF
wxT("GIF files (*.gif)|*.gif|") wxT("GIF files (*.gif)|*.gif|")
#endif
#if wxUSE_LIBTIFF
wxT("TIFF files (*.tif)|*.tif|") wxT("TIFF files (*.tif)|*.tif|")
#endif
#if wxUSE_PCX
wxT("PCX files (*.pcx)|*.pcx|") wxT("PCX files (*.pcx)|*.pcx|")
#endif
wxT("ICO files (*.ico)|*.ico|") wxT("ICO files (*.ico)|*.ico|")
wxT("CUR files (*.cur)|*.cur"), wxT("CUR files (*.cur)|*.cur"),
wxFD_SAVE, wxFD_SAVE,
@@ -274,6 +284,7 @@ private:
} }
} }
} }
#if wxUSE_LIBPNG
else if ( extension == wxT("png") ) else if ( extension == wxT("png") )
{ {
static const int pngvalues[] = static const int pngvalues[] =
@@ -344,6 +355,7 @@ private:
} }
} }
} }
#endif // wxUSE_LIBPNG
else if ( extension == wxT("cur") ) else if ( extension == wxT("cur") )
{ {
image.Rescale(32,32); image.Rescale(32,32);