X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/227869da8d090e2364530dd310e2d63ad18edecf..60df0f96859fb0131ddfa8b477612a15f4a43790:/samples/png/pngdemo.cpp diff --git a/samples/png/pngdemo.cpp b/samples/png/pngdemo.cpp index be10ff0534..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; @@ -207,12 +202,4 @@ void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) } } -// Define the behaviour for the frame closing -// - must delete all frames except for the main one. -bool MyFrame::OnClose(void) -{ - Show(FALSE); - - return TRUE; -}