]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/render/render.cpp
fixing multilib build
[wxWidgets.git] / samples / render / render.cpp
index a68df35e474408187ad81ebf8c883bb783593251..7cb63278bee4df57e1d208d917367c498625b818 100644 (file)
@@ -35,6 +35,7 @@
     #include "wx/log.h"
     #include "wx/msgdlg.h"
     #include "wx/icon.h"
+    #include "wx/image.h"
 #endif
 
 #include "wx/apptrait.h"
@@ -193,6 +194,27 @@ private:
         renderer.DrawTreeItemButton(this, dc,
                                     wxRect(x2, y, 20, 20), m_flags);
         y += lineHeight + 20;
+
+#ifdef wxHAS_DRAW_TITLE_BAR_BITMAP
+        dc.DrawText("DrawTitleBarBitmap()", x1, y);
+        wxRect rBtn(x2, y, 21, 21);
+        renderer.DrawTitleBarBitmap(this, dc, rBtn,
+                                    wxTITLEBAR_BUTTON_HELP, m_flags);
+        rBtn.x += 2*rBtn.width;
+        renderer.DrawTitleBarBitmap(this, dc, rBtn,
+                                    wxTITLEBAR_BUTTON_ICONIZE, m_flags);
+        rBtn.x += 2*rBtn.width;
+        renderer.DrawTitleBarBitmap(this, dc, rBtn,
+                                    wxTITLEBAR_BUTTON_RESTORE, m_flags);
+        rBtn.x += 2*rBtn.width;
+        renderer.DrawTitleBarBitmap(this, dc, rBtn,
+                                    wxTITLEBAR_BUTTON_MAXIMIZE, m_flags);
+        rBtn.x += 2*rBtn.width;
+        renderer.DrawTitleBarBitmap(this, dc, rBtn,
+                                    wxTITLEBAR_BUTTON_CLOSE, m_flags);
+
+        y += lineHeight + rBtn.height;
+#endif // wxHAS_DRAW_TITLE_BAR_BITMAP
     }
 
     int m_flags;
@@ -276,6 +298,13 @@ bool MyApp::OnInit()
     if ( !wxApp::OnInit() )
         return false;
 
+#ifdef __WXOSX__
+    // currently the images used by DrawTitleBarBitmap() are hard coded as PNG
+    // images inside the library itself so we need to enable PNG support to use
+    // this function
+    wxImage::AddHandler(new wxPNGHandler);
+#endif // OS X
+
     // create the main application window
     new MyFrame;