]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/image/image.cpp
fix vertical mouse wheel event rotation value, sign was reversed in r74805
[wxWidgets.git] / samples / image / image.cpp
index 9002c5b84f1032e24260f1b59a45184260c9ab24..3c614c322930476fc0d86852b3f1a715dbdbdbf8 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Robert Roebling
 // Modified by: Francesco Montorsi
 // Created:     1998
-// RCS-ID:      $Id$
 // Copyright:   (c) 1998-2005 Robert Roebling
 //              (c) 2005-2009 Vadim Zeitlin
 // Licence:     wxWindows licence
@@ -50,7 +49,7 @@
 
 #include "canvas.h"
 
-#ifndef __WXMSW__
+#ifndef wxHAS_IMAGES_IN_RESOURCES
     #include "../sample.xpm"
 #endif
 
@@ -150,7 +149,7 @@ private:
         m_zoom = 1.;
 
         wxMenu *menu = new wxMenu;
-        menu->Append(wxID_SAVE);
+        menu->Append(wxID_SAVEAS);
         menu->AppendSeparator();
         menu->AppendCheckItem(ID_PAINT_BG, wxT("&Paint background"),
                               "Uncheck this for transparent images");
@@ -214,7 +213,7 @@ private:
         wxString savefilename = wxFileSelector( wxT("Save Image"),
                                                 wxEmptyString,
                                                 wxEmptyString,
-                                                (const wxChar *)NULL,
+                                                wxEmptyString,
                                                 wxT("BMP files (*.bmp)|*.bmp|")
 #if wxUSE_LIBPNG
                                                 wxT("PNG files (*.png)|*.png|")
@@ -230,10 +229,13 @@ private:
 #endif
 #if wxUSE_PCX
                                                 wxT("PCX files (*.pcx)|*.pcx|")
+#endif
+#if wxUSE_XPM
+                                                wxT("X PixMap files (*.xpm)|*.xpm|")
 #endif
                                                 wxT("ICO files (*.ico)|*.ico|")
                                                 wxT("CUR files (*.cur)|*.cur"),
-                                                wxFD_SAVE,
+                                                wxFD_SAVE | wxFD_OVERWRITE_PROMPT,
                                                 this);
 
         if ( savefilename.empty() )
@@ -590,7 +592,7 @@ BEGIN_EVENT_TABLE(MyImageFrame, wxFrame)
     EVT_ERASE_BACKGROUND(MyImageFrame::OnEraseBackground)
     EVT_PAINT(MyImageFrame::OnPaint)
 
-    EVT_MENU(wxID_SAVE, MyImageFrame::OnSave)
+    EVT_MENU(wxID_SAVEAS, MyImageFrame::OnSave)
     EVT_MENU_RANGE(ID_ROTATE_LEFT, ID_ROTATE_RIGHT, MyImageFrame::OnRotate)
     EVT_MENU(ID_RESIZE, MyImageFrame::OnResize)
 
@@ -668,7 +670,7 @@ MyFrame::MyFrame()
     menuImage->Append( ID_SHOWTHUMBNAIL, wxT("Test &thumbnail...\tCtrl-T"),
                         "Test scaling the image during load (try with JPEG)");
     menuImage->AppendSeparator();
-    menuImage->Append( ID_ABOUT, wxT("&About...\tF1"));
+    menuImage->Append( ID_ABOUT, wxT("&About\tF1"));
     menuImage->AppendSeparator();
     menuImage->Append( ID_QUIT, wxT("E&xit\tCtrl-Q"));
     menu_bar->Append(menuImage, wxT("&Image"));