some more convenience functions/wrappers (all inline, cross-platform)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7293 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-04-27 18:02:48 +00:00
parent 7322bbe14e
commit 071bb1283a

View File

@@ -102,6 +102,59 @@ public:
// insert an item before given position
bool Insert(size_t pos, wxMenuItem *item);
void Insert(size_t pos,
int id,
const wxString& text,
const wxString& help = wxEmptyString,
bool isCheckable = FALSE)
{
Insert(pos, wxMenuItem::New((wxMenu *)this, id, text, help, isCheckable));
}
// insert a separator
bool InsertSeparator(size_t pos)
{
Insert(pos, wxMenuItem::New((wxMenu *)this));
}
// insert a submenu
bool Insert(size_t pos,
int id,
const wxString& text,
wxMenu *submenu,
const wxString& help = wxEmptyString)
{
Insert(pos, wxMenuItem::New((wxMenu *)this, id, text, help, FALSE, submenu));
}
// prepend an item to the menu
bool Prepend(wxMenuItem *item)
{
Insert(0u, item);
}
void Prepend(int id,
const wxString& text,
const wxString& help = wxEmptyString,
bool isCheckable = FALSE)
{
Insert(0u, id, text, help, isCheckable);
}
// insert a separator
bool PrependSeparator()
{
InsertSeparator(0u);
}
// insert a submenu
bool Prepend(int id,
const wxString& text,
wxMenu *submenu,
const wxString& help = wxEmptyString)
{
Insert(0u, id, text, submenu, help);
}
// detach an item from the menu, but don't delete it so that it can be
// added back later (but if it's not, the caller is responsible for