- // 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("bell"), bmpSound("sound"), bmpNoSound("nosound");
+
+ // construct submenu
+ pItem = new wxMenuItem(sub_menu, Menu_Sub1, "Submenu &first", "large");
+
+ pItem->SetFont(fontLarge);
+ sub_menu->Append(pItem);
+
+ pItem = new wxMenuItem(sub_menu, Menu_Sub2, "Submenu &second", "italic",
+ wxITEM_CHECK);
+ pItem->SetFont(fontItalic);
+ sub_menu->Append(pItem);
+
+ pItem = new wxMenuItem(sub_menu, Menu_Sub3, "Submenu &third", "underlined",
+ wxITEM_CHECK);
+ 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", wxITEM_CHECK);
+ 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!", wxITEM_CHECK);
+ pItem->SetFont(fontBmp);
+ pItem->SetBitmaps(bmpBell);
+ file_menu->Append(pItem);
+
+ pItem = new wxMenuItem(file_menu, Menu_Bitmap2, "So&und",
+ "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, "&Sub menu", "",
+ wxITEM_CHECK, 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);