- // 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
+ 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(_T("bell")), bmpSound(_T("sound")), bmpNoSound(_T("nosound"));
+
+ // construct submenu
+ pItem = new wxMenuItem(sub_menu, Menu_Sub1, _T("Submenu &first"), _T("large"));
+
+ pItem->SetFont(fontLarge);
+ sub_menu->Append(pItem);
+
+ pItem = new wxMenuItem(sub_menu, Menu_Sub2, _T("Submenu &second"), _T("italic"),
+ wxITEM_CHECK);
+ pItem->SetFont(fontItalic);
+ sub_menu->Append(pItem);
+
+ pItem = new wxMenuItem(sub_menu, Menu_Sub3, _T("Submenu &third"), _T("underlined"),
+ wxITEM_CHECK);
+ pItem->SetFont(fontUlined);
+ sub_menu->Append(pItem);
+
+ // construct menu
+ pItem = new wxMenuItem(file_menu, Menu_Test1, _T("&Uncheckable"), _T("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, _T("&Checkable"),
+ _T("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, _T("&Disabled"), _T("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, _T("&Bell"),
+ _T("check/uncheck me!"), wxITEM_CHECK);
+ pItem->SetFont(fontBmp);
+ pItem->SetBitmaps(bmpBell);
+ file_menu->Append(pItem);
+
+ pItem = new wxMenuItem(file_menu, Menu_Bitmap2, _T("So&und"),
+ _T("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, _T("&Sub menu"), _T(""),
+ wxITEM_CHECK, sub_menu);
+ pItem->SetFont(*wxSWISS_FONT);
+ file_menu->Append(pItem);
+
+ file_menu->AppendSeparator();
+ pItem = new wxMenuItem(file_menu, Menu_Quit, _T("&Quit"), _T("Normal item"),
+ wxITEM_NORMAL);
+ pItem->SetFont(*wxNORMAL_FONT);
+ file_menu->Append(pItem);
+
+ wxMenuBar *menu_bar = new wxMenuBar;
+
+ menu_bar->Append(file_menu, _T("&File"));
+ SetMenuBar(menu_bar);