]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/image/image.cpp
Fixed problems caused by duplicated names across different style types.
[wxWidgets.git] / samples / image / image.cpp
index 9a99f1487f0afb7ca6adfe129535f992ef7ca1d5..9ba854ebe6605bb3075678f4f2206793dc216dfd 100644 (file)
@@ -7,7 +7,7 @@
 // RCS-ID:      $Id$
 // Copyright:   (c) 1998-2005 Robert Roebling
 //              (c) 2005-2009 Vadim Zeitlin
-// License:     wxWindows licence
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx/wx.h".
@@ -28,6 +28,7 @@
 #include "wx/wfstream.h"
 #include "wx/quantize.h"
 #include "wx/stopwatch.h"
+#include "wx/versioninfo.h"
 
 #if wxUSE_CLIPBOARD
     #include "wx/dataobj.h"
@@ -185,11 +186,8 @@ private:
     {
         wxPaintDC dc(this);
 
-#ifndef __WXOSX__
-        // on OSX the immediate Update from within ClearBackground leads to a recursion
         if ( GetMenuBar()->IsChecked(ID_PAINT_BG) )
-            ClearBackground();
-#endif
+            dc.Clear();
 
         dc.SetUserScale(m_zoom, m_zoom);
 
@@ -657,7 +655,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..."));
+    menuImage->Append( ID_ABOUT, wxT("&About...\tF1"));
     menuImage->AppendSeparator();
     menuImage->Append( ID_QUIT, wxT("E&xit\tCtrl-Q"));
     menu_bar->Append(menuImage, wxT("&Image"));
@@ -681,6 +679,7 @@ MyFrame::MyFrame()
 
     // 500 width * 2750 height
     m_canvas->SetScrollbars( 10, 10, 50, 275 );
+    m_canvas->SetCursor(wxImage("cursor.png"));
 }
 
 void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) )
@@ -688,11 +687,35 @@ void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) )
     Close( true );
 }
 
+#if wxUSE_ZLIB && wxUSE_STREAMS
+#include "wx/zstream.h"
+#endif
+
 void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) )
 {
-    (void)wxMessageBox( "wxImage demo\n"
-                        "(c) Robert Roebling 1998-2005"
-                        "(c) Vadim Zeitlin 2005-2009",
+    wxArrayString array;
+
+    array.Add("wxImage demo");
+    array.Add("(c) Robert Roebling 1998-2005");
+    array.Add("(c) Vadim Zeitlin 2005-2009");
+
+    array.Add(wxEmptyString);
+    array.Add("Version of the libraries used:");
+
+#if wxUSE_LIBPNG
+    array.Add(wxPNGHandler::GetLibraryVersionInfo().ToString());
+#endif
+#if wxUSE_LIBJPEG
+    array.Add(wxJPEGHandler::GetLibraryVersionInfo().ToString());
+#endif
+#if wxUSE_LIBTIFF
+    array.Add(wxTIFFHandler::GetLibraryVersionInfo().ToString());
+#endif
+#if wxUSE_ZLIB && wxUSE_STREAMS
+    // zlib is used by libpng
+    array.Add(wxGetZlibVersionInfo().ToString());
+#endif
+    (void)wxMessageBox( wxJoin(array, '\n'),
                         "About wxImage Demo",
                         wxICON_INFORMATION | wxOK );
 }