// append any kind of item (normal/check/radio/separator)
wxMenuItem* Append(int itemid,
- const wxString& text,
+ const wxString& text = wxEmptyString,
const wxString& help = wxEmptyString,
wxItemKind kind = wxITEM_NORMAL)
{
}
// append a submenu
- wxMenuItem* Append(int itemid,
- const wxString& text,
- wxMenu *submenu,
- const wxString& help = wxEmptyString)
+ wxMenuItem* AppendSubMenu(wxMenu *submenu,
+ const wxString& text,
+ const wxString& help = wxEmptyString)
{
- return DoAppend(wxMenuItem::New((wxMenu *)this, itemid, text, help,
+ return DoAppend(wxMenuItem::New((wxMenu *)this, wxID_ANY, text, help,
wxITEM_NORMAL, submenu));
}
// insert an item before given position
wxMenuItem* Insert(size_t pos,
int itemid,
- const wxString& text,
+ const wxString& text = wxEmptyString,
const wxString& help = wxEmptyString,
wxItemKind kind = wxITEM_NORMAL)
{
// prepend any item to the menu
wxMenuItem* Prepend(int itemid,
- const wxString& text,
+ const wxString& text = wxEmptyString,
const wxString& help = wxEmptyString,
wxItemKind kind = wxITEM_NORMAL)
{
Append(itemid, text, help, isCheckable ? wxITEM_CHECK : wxITEM_NORMAL);
}
+ // use more readable and not requiring unused itemid AppendSubMenu() instead
+ wxMenuItem* Append(int itemid,
+ const wxString& text,
+ wxMenu *submenu,
+ const wxString& help = wxEmptyString)
+ {
+ return DoAppend(wxMenuItem::New((wxMenu *)this, itemid, text, help,
+ wxITEM_NORMAL, submenu));
+ }
+
void Insert(size_t pos,
int itemid,
const wxString& text,
// update all menu item states in all menus
virtual void UpdateMenus();
+ virtual bool CanBeOutsideClientArea() const { return true; }
+
protected:
// the list of all our menus
wxMenuList m_menus;