X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e306597309a120f2ae91385c731a5cb2722c52aa..3baaf31317b1380ba9f33f8a23ff04bd20356d63:/samples/png/pngdemo.cpp?ds=inline diff --git a/samples/png/pngdemo.cpp b/samples/png/pngdemo.cpp index da50f96d5d..0d88f11699 100644 --- a/samples/png/pngdemo.cpp +++ b/samples/png/pngdemo.cpp @@ -20,10 +20,7 @@ #pragma hdrstop #endif -#ifdef __WXMSW__ -#include -// #include -#endif +#include "wx/image.h" #include "pngdemo.h" @@ -38,11 +35,7 @@ MyApp::MyApp() bool MyApp::OnInit(void) { -#ifdef __WXMSW__ - wxBitmap::AddHandler(new wxPNGFileHandler); -// wxBitmap::AddHandler(new wxXPMFileHandler); -// wxBitmap::AddHandler(new wxXPMDataHandler); -#endif + wxImage::AddHandler(new wxPNGHandler); // Create the main frame window frame = new MyFrame((wxFrame *) NULL, "wxPNGBitmap Demo", wxPoint(0, 0), wxSize(300, 300)); @@ -107,8 +100,9 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnSaveFile(wxCommandEvent& WXUNUSED(event)) { - wxString f = wxFileSelector( "Save Image", (const char *)NULL, (const char *)NULL, - "png", "PNG files (*.png)|*.png" ); + wxString f = wxFileSelector( wxT("Save Image"), (const wxChar *)NULL, + (const wxChar *)NULL, + wxT("png"), wxT("PNG files (*.png)|*.png") ); if (f == "") return; @@ -135,8 +129,9 @@ void MyFrame::OnSaveFile(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnLoadFile(wxCommandEvent& WXUNUSED(event)) { // Show file selector. - wxString f = wxFileSelector("Open Image", (const char *) NULL, (const char *) NULL,"png", - "PNG files (*.png)|*.png"); + wxString f = wxFileSelector(wxT("Open Image"), (const wxChar *) NULL, + (const wxChar *) NULL, wxT("png"), + wxT("PNG files (*.png)|*.png")); if (f == "") return;