From: Robert Roebling Date: Tue, 12 Sep 2000 08:17:23 +0000 (+0000) Subject: Added test for bitmap menu. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/fcaf9e704e1a622af0a1d84583a63e0c1c9dd9b2 Added test for bitmap menu. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/menu/copy.xpm b/samples/menu/copy.xpm new file mode 100644 index 0000000000..47565c1cae --- /dev/null +++ b/samples/menu/copy.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char *copy_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 15 4 1", +" c None", +". c Black", +"X c Gray100", +"o c #000080", +/* pixels */ +" ", +" ...... ", +" .XXXX.. ", +" .XXXX.X. ", +" .X..X.oooooo ", +" .XXXXXoXXXXoo ", +" .X....oXXXXoXo ", +" .XXXXXoX..Xoooo", +" .X....oXXXXXXXo", +" .XXXXXoX.....Xo", +" ......oXXXXXXXo", +" oX.....Xo", +" oXXXXXXXo", +" ooooooooo", +" " +}; diff --git a/samples/menu/menu.cpp b/samples/menu/menu.cpp index cee944b197..3346cf7424 100644 --- a/samples/menu/menu.cpp +++ b/samples/menu/menu.cpp @@ -26,10 +26,11 @@ #ifndef WX_PRECOMP #include - #include #endif +#include "copy.xpm" + // ---------------------------------------------------------------------------- // classes // ---------------------------------------------------------------------------- @@ -232,6 +233,10 @@ MyFrame::MyFrame() // create the menubar wxMenu *fileMenu = new wxMenu; fileMenu->Append(Menu_File_Quit, "E&xit\tAlt-X", "Quit toolbar sample" ); + + wxMenuItem *bitmap_menu_item = new wxMenuItem( fileMenu, Menu_File_Quit, "Quit with &bitmap" ); + bitmap_menu_item->SetBitmap( wxBitmap( copy_xpm ) ); + fileMenu->Append( bitmap_menu_item ); wxMenu *menubarMenu = new wxMenu; menubarMenu->Append(Menu_MenuBar_Append, "&Append menu\tCtrl-A",