]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/image/image.cpp
Add ability to render checkbox in undeterminate state, fixes #12290: wxRendererGTK...
[wxWidgets.git] / samples / image / image.cpp
index f42aca9f0411bfe06f336785b412c51836319208..826cad76863e1ec2f9361d9dc9261ae07c9dd546 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".
@@ -186,7 +186,7 @@ private:
         wxPaintDC dc(this);
 
         if ( GetMenuBar()->IsChecked(ID_PAINT_BG) )
-            ClearBackground();
+            dc.Clear();
 
         dc.SetUserScale(m_zoom, m_zoom);
 
@@ -210,11 +210,21 @@ private:
                                                 wxEmptyString,
                                                 (const wxChar *)NULL,
                                                 wxT("BMP files (*.bmp)|*.bmp|")
+#if wxUSE_LIBPNG
                                                 wxT("PNG files (*.png)|*.png|")
+#endif
+#if wxUSE_LIBJPEG
                                                 wxT("JPEG files (*.jpg)|*.jpg|")
+#endif
+#if wxUSE_GIF
                                                 wxT("GIF files (*.gif)|*.gif|")
+#endif
+#if wxUSE_LIBTIFF
                                                 wxT("TIFF files (*.tif)|*.tif|")
+#endif
+#if wxUSE_PCX
                                                 wxT("PCX files (*.pcx)|*.pcx|")
+#endif
                                                 wxT("ICO files (*.ico)|*.ico|")
                                                 wxT("CUR files (*.cur)|*.cur"),
                                                 wxFD_SAVE,
@@ -274,6 +284,7 @@ private:
                 }
             }
         }
+#if wxUSE_LIBPNG
         else if ( extension == wxT("png") )
         {
             static const int pngvalues[] =
@@ -344,6 +355,7 @@ private:
                 }
             }
         }
+#endif // wxUSE_LIBPNG
         else if ( extension == wxT("cur") )
         {
             image.Rescale(32,32);
@@ -666,6 +678,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) )