- // Make a menubar
- wxMenu *file_menu = new wxMenu,
- *sub_menu = new wxMenu;
-
- // vars used for menu construction
- wxMenuItem *pItem;
- wxFont fontLarge(18, wxROMAN, wxNORMAL, wxBOLD, FALSE),
- fontUlined(12, wxDEFAULT, wxNORMAL, wxNORMAL, TRUE),
- fontItalic(12, wxMODERN, wxITALIC, wxBOLD, FALSE),
- // should be at least of the size of bitmaps
- fontBmp(14, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE);
-
- // sorry for my artistic skills...
- wxBitmap bmpBell("bell"), bmpSound("sound"), bmpNoSound("nosound");
-
- // construct submenu
- pItem = new wxMenuItem(sub_menu, Menu_Sub1, "Submenu &first", "large", TRUE);
- pItem->SetFont(fontLarge);
- sub_menu->Append(pItem);
-
- pItem = new wxMenuItem(sub_menu, Menu_Sub2, "Submenu &second", "italic", TRUE);
- pItem->SetFont(fontItalic);
- sub_menu->Append(pItem);
-
- pItem = new wxMenuItem(sub_menu, Menu_Sub3, "Submenu &third", "underlined", TRUE);
- pItem->SetFont(fontUlined);
- sub_menu->Append(pItem);
-
- // construct menu
- pItem = new wxMenuItem(file_menu, Menu_Test1, "&Uncheckable", "red item");
- pItem->SetFont(*wxITALIC_FONT);
- pItem->SetTextColour(wxColor(255, 0, 0));
- pItem->SetMarginWidth(23);
- file_menu->Append(pItem);
-
- pItem = new wxMenuItem(file_menu, Menu_Test2, "&Checkable", "checkable item", TRUE);
- pItem->SetFont(*wxSMALL_FONT);
- file_menu->Append(pItem);
- file_menu->Check(Menu_Test2, TRUE);
-
- pItem = new wxMenuItem(file_menu, Menu_Test3, "&Disabled", "disabled item");
- pItem->SetFont(*wxNORMAL_FONT);
- file_menu->Append(pItem);
- file_menu->Enable(Menu_Test3, FALSE);
-
- file_menu->AppendSeparator();
-
- pItem = new wxMenuItem(file_menu, Menu_Bitmap, "&Bell", "check/uncheck me!", TRUE);
- pItem->SetFont(fontBmp);
- pItem->SetBitmaps(bmpBell);
- file_menu->Append(pItem);
-
- pItem = new wxMenuItem(file_menu, Menu_Bitmap2, "So&und", "icon changes!", TRUE);
- pItem->SetFont(fontBmp);
- pItem->SetBitmaps(bmpSound, bmpNoSound);
- file_menu->Append(pItem);
-
- file_menu->AppendSeparator();
-
- pItem = new wxMenuItem(file_menu, Menu_Submenu, "&Sub menu", "", TRUE, sub_menu);
- pItem->SetFont(*wxSWISS_FONT);
- file_menu->Append(pItem);
-
- file_menu->AppendSeparator();
- file_menu->Append(Menu_Quit, "&Quit", "Normal item");
-
- wxMenuBar *menu_bar = new wxMenuBar;
-
- menu_bar->Append(file_menu, "&File");
- SetMenuBar(menu_bar);
+ // Make a menubar
+ wxMenuItem *pItem;
+ wxMenu *file_menu = new wxMenu;
+
+#ifndef __WXUNIVERSAL__
+ wxMenu *sub_menu = new wxMenu;
+
+ // vars used for menu construction
+ wxFont fontLarge(18, wxROMAN, wxNORMAL, wxBOLD, false),
+ fontUlined(12, wxDEFAULT, wxNORMAL, wxNORMAL, true),
+ fontItalic(12, wxMODERN, wxITALIC, wxBOLD, false),
+ // should be at least of the size of bitmaps
+ fontBmp(14, wxDEFAULT, wxNORMAL, wxNORMAL, false);
+
+ // sorry for my artistic skills...
+ wxBitmap bmpBell(wxT("bell")),
+ bmpSound(wxT("sound")),
+ bmpNoSound(wxT("nosound")),
+ bmpInfo(wxT("info")),
+ bmpInfo_mono(wxT("info_mono"));
+
+ // construct submenu
+ pItem = new wxMenuItem(sub_menu, Menu_Sub1, wxT("Submenu &first"), wxT("large"));
+
+ pItem->SetFont(fontLarge);
+ sub_menu->Append(pItem);
+
+ pItem = new wxMenuItem(sub_menu, Menu_Sub2, wxT("Submenu &second"), wxT("italic"),
+ wxITEM_CHECK);
+ pItem->SetFont(fontItalic);
+ sub_menu->Append(pItem);
+
+ pItem = new wxMenuItem(sub_menu, Menu_Sub3, wxT("Submenu &third"), wxT("underlined"),
+ wxITEM_CHECK);
+ pItem->SetFont(fontUlined);
+ sub_menu->Append(pItem);
+
+ // construct menu
+ pItem = new wxMenuItem(file_menu, Menu_Test1, wxT("&Uncheckable"), wxT("red item"));
+ pItem->SetFont(*wxITALIC_FONT);
+ pItem->SetTextColour(wxColor(255, 0, 0));
+ file_menu->Append(pItem);
+
+ pItem = new wxMenuItem(file_menu, Menu_Test2, wxT("&Checkable"),
+ wxT("checkable item"), wxITEM_CHECK);
+ pItem->SetFont(*wxSMALL_FONT);
+ file_menu->Append(pItem);
+ file_menu->Check(Menu_Test2, true);
+
+ pItem = new wxMenuItem(file_menu, Menu_Test3, wxT("&Disabled"), wxT("disabled item"));
+ pItem->SetFont(*wxNORMAL_FONT);
+ file_menu->Append(pItem);
+ file_menu->Enable(Menu_Test3, false);
+
+ file_menu->AppendSeparator();
+
+ pItem = new wxMenuItem(file_menu, Menu_Bitmap, wxT("&Bell"),
+ wxT("check/uncheck me!"), wxITEM_CHECK);
+ pItem->SetFont(fontBmp);
+ pItem->SetBitmaps(bmpBell);
+ file_menu->Append(pItem);
+
+ pItem = new wxMenuItem(file_menu, Menu_Bitmap2, wxT("So&und"),
+ wxT("icon changes!"), wxITEM_CHECK);
+ pItem->SetFont(fontBmp);
+ pItem->SetBitmaps(bmpSound, bmpNoSound);
+ file_menu->Append(pItem);
+
+ file_menu->AppendSeparator();
+
+ pItem = new wxMenuItem(file_menu, Menu_Submenu, wxT("&Sub menu"), wxT(""),
+ wxITEM_CHECK, sub_menu);
+ pItem->SetFont(*wxSWISS_FONT);
+ file_menu->Append(pItem);
+
+ file_menu->AppendSeparator();
+ pItem = new wxMenuItem(file_menu, Menu_Toggle, wxT("&Disable/Enable\tCtrl+D"),
+ wxT("enables/disables the About-Item"), wxITEM_NORMAL);
+ pItem->SetFont(*wxNORMAL_FONT);
+ file_menu->Append(pItem);
+
+ // Of course Ctrl+RatherLongAccel will not work in this example:
+ pAboutItem = new wxMenuItem(file_menu, Menu_About, wxT("&About\tCtrl+RatherLongAccel"),
+ wxT("display program information"), wxITEM_NORMAL);
+ pAboutItem->SetBitmap(bmpInfo);
+ pAboutItem->SetDisabledBitmap(bmpInfo_mono);
+ file_menu->Append(pAboutItem);
+
+ file_menu->AppendSeparator();
+#endif
+
+ pItem = new wxMenuItem(file_menu, Menu_Quit, wxT("&Quit"), wxT("Normal item"),
+ wxITEM_NORMAL);
+ file_menu->Append(pItem);
+
+ wxMenu* drawn_menu = new wxMenu;
+ pItem = new wxMenuItem(drawn_menu, Menu_Drawn1, wxT("&Menu item\tCtrl+K"));
+ drawn_menu->Append(pItem);
+
+ drawn_menu->AppendSeparator();
+
+ pItem = new wxMenuItem(drawn_menu, Menu_Drawn2, wxT("&Cheked item"),
+ wxT("check/uncheck me!"), wxITEM_CHECK);
+ drawn_menu->Append(pItem);
+ drawn_menu->Check(Menu_Drawn2, true);
+
+ pItem = new wxMenuItem(drawn_menu, Menu_Drawn3, wxT("&Radio item"),
+ wxT("check/uncheck me!"), wxITEM_RADIO);
+ drawn_menu->Append(pItem);
+
+ drawn_menu->AppendSeparator();
+
+ pItem = new wxMenuItem(drawn_menu, Menu_Drawn4, wxT("&Disabled item\tCtrl+RatherLongAccel"),
+ wxT("disabled item"));
+ pItem->Enable(false);
+ drawn_menu->Append(pItem);
+
+ pItem = new wxMenuItem(drawn_menu, Menu_Drawn5, wxT("&Other\tCtrl+O"), wxT("other item"));
+ pItem->SetTextColour(*wxRED);
+ drawn_menu->Append(pItem);
+
+ wxMenu* native_menu = new wxMenu;
+ pItem = new wxMenuItem(native_menu, Menu_Native1, wxT("&Menu item\tCtrl+K"));
+ native_menu->Append(pItem);
+
+ native_menu->AppendSeparator();
+
+ pItem = new wxMenuItem(native_menu, Menu_Native2, wxT("&Cheked item"),
+ wxT("check/uncheck me!"), wxITEM_CHECK);
+ native_menu->Append(pItem);
+ native_menu->Check(Menu_Native2, true);
+
+ pItem = new wxMenuItem(native_menu, Menu_Native3, wxT("&Radio item"),
+ wxT("check/uncheck me!"), wxITEM_RADIO);
+ native_menu->Append(pItem);
+
+ native_menu->AppendSeparator();
+
+ pItem = new wxMenuItem(native_menu, Menu_Native4, wxT("&Disabled item\tCtrl+RatherLongAccel"),
+ wxT("disabled item"));
+ pItem->Enable(false);
+ native_menu->Append(pItem);
+
+ pItem = new wxMenuItem(native_menu, Menu_Native5, wxT("&Other\tCtrl+O"), wxT("other item"));
+ native_menu->Append(pItem);
+
+ wxMenuBar *menu_bar = new wxMenuBar;
+
+ menu_bar->Append(file_menu, wxT("&File"));
+ menu_bar->Append(drawn_menu, wxT("&Drawn"));
+ menu_bar->Append(native_menu, wxT("&Native"));
+ SetMenuBar(menu_bar);