]> git.saurik.com Git - wxWidgets.git/commitdiff
Test using transparency in menu bitmaps.
authorJulian Smart <julian@anthemion.co.uk>
Wed, 21 May 2003 22:01:31 +0000 (22:01 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 21 May 2003 22:01:31 +0000 (22:01 +0000)
Better, but still shows background when menu item selected.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/ownerdrw/nosound.png [new file with mode: 0644]
samples/ownerdrw/ownerdrw.cpp
samples/ownerdrw/sound.png [new file with mode: 0644]

diff --git a/samples/ownerdrw/nosound.png b/samples/ownerdrw/nosound.png
new file mode 100644 (file)
index 0000000..0fa3116
Binary files /dev/null and b/samples/ownerdrw/nosound.png differ
index 85608c96e65c63ea019560d708406b60d923e8e1..18c3ed7c0292de3d4a3ab7218ba17031eb990140 100644 (file)
@@ -26,6 +26,7 @@
 
 #include  "wx/ownerdrw.h"
 #include  "wx/menuitem.h"
+#include  "wx/image.h"
 #include  "wx/msw/checklst.h"
 
 // Define a new application type
@@ -83,6 +84,7 @@ IMPLEMENT_APP(OwnerDrawnApp);
 // init our app: create windows
 bool OwnerDrawnApp::OnInit(void)
 {
+    wxInitAllImageHandlers();
     OwnerDrawnFrame *pFrame
         = new OwnerDrawnFrame(NULL, _T("wxWindows Ownerdraw Sample"),
                               50, 50, 450, 340);
@@ -108,7 +110,9 @@ void OwnerDrawnFrame::InitMenu()
            fontBmp(14, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE);
 
     // sorry for my artistic skills...
-    wxBitmap bmpBell(_T("bell")), bmpSound(_T("sound")), bmpNoSound(_T("nosound"));
+    wxBitmap bmpBell(_T("bell"));
+    wxBitmap bmpSound(_T("sound.png"), wxBITMAP_TYPE_PNG);
+    wxBitmap bmpNoSound(_T("nosound.png"), wxBITMAP_TYPE_PNG);
 
     // construct submenu
     pItem = new wxMenuItem(sub_menu, Menu_Sub1, _T("Submenu &first"), _T("large"));
diff --git a/samples/ownerdrw/sound.png b/samples/ownerdrw/sound.png
new file mode 100644 (file)
index 0000000..a62c127
Binary files /dev/null and b/samples/ownerdrw/sound.png differ