mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
* compatibility with wxWdigets 2.9+: use wxItemKind for menu style
* cleaned up the interface of IconMenu a bit git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1562 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+8
-14
@@ -66,22 +66,16 @@ void set_menu_item_image(wxMenuItem* item, const String& resource) {
|
||||
|
||||
// ----------------------------------------------------------------------------- : IconMenu
|
||||
|
||||
void IconMenu::Append(int id, const String& resource, const String& text, const String& help, int style, wxMenu* submenu) {
|
||||
void IconMenu::Append(int id, const String& resource, const String& text, const String& help, wxItemKind kind, wxMenu* submenu) {
|
||||
// create menu, load icon
|
||||
wxMenuItem* item = new wxMenuItem(this, id, text, help, style, submenu);
|
||||
wxMenuItem* item = new wxMenuItem(this, id, text, help, kind, submenu);
|
||||
set_menu_item_image(item, resource);
|
||||
// add to menu
|
||||
wxMenu::Append(item);
|
||||
}
|
||||
|
||||
void IconMenu::Append(int id, const String& text, const String& help) {
|
||||
wxMenuItem* item = new wxMenuItem (this, id, text, help);
|
||||
item->SetBitmap(wxNullBitmap);
|
||||
wxMenu::Append(item);
|
||||
}
|
||||
|
||||
void IconMenu::Append(int id, const String& text, const String& help, wxMenu* submenu) {
|
||||
wxMenuItem* item = new wxMenuItem (this, id, text, help, wxITEM_NORMAL, submenu);
|
||||
void IconMenu::Append(int id, const String& text, const String& help, wxItemKind kind, wxMenu* submenu) {
|
||||
wxMenuItem* item = new wxMenuItem (this, id, text, help, kind, submenu);
|
||||
item->SetBitmap(wxNullBitmap);
|
||||
wxMenu::Append(item);
|
||||
}
|
||||
@@ -91,16 +85,16 @@ void IconMenu::Append(wxMenuItem* item) {
|
||||
wxMenu::Append(item);
|
||||
}
|
||||
|
||||
void IconMenu::Insert(size_t pos, int id, const String& resource, const String& text, const String& help, int style, wxMenu* submenu) {
|
||||
void IconMenu::Insert(size_t pos, int id, const String& resource, const String& text, const String& help, wxItemKind kind, wxMenu* submenu) {
|
||||
// create menu, load icon
|
||||
wxMenuItem* item = new wxMenuItem(this, id, text, help, style, submenu);
|
||||
wxMenuItem* item = new wxMenuItem(this, id, text, help, kind, submenu);
|
||||
set_menu_item_image(item, resource);
|
||||
// add to menu
|
||||
wxMenu::Insert(pos,item);
|
||||
}
|
||||
|
||||
void IconMenu::Insert(size_t pos, int id, const String& text, const String& help) {
|
||||
wxMenuItem* item = new wxMenuItem (this, id, text, help);
|
||||
void IconMenu::Insert(size_t pos, int id, const String& text, const String& help, wxItemKind kind, wxMenu* submenu) {
|
||||
wxMenuItem* item = new wxMenuItem (this, id, text, help, kind, submenu);
|
||||
item->SetBitmap(wxNullBitmap);
|
||||
wxMenu::Insert(pos, item);
|
||||
}
|
||||
|
||||
@@ -22,17 +22,15 @@
|
||||
class IconMenu : public wxMenu {
|
||||
public:
|
||||
/// Append a menu item, with an image (loaded from a resource)
|
||||
void Append(int id, const String& resource, const String& text, const String& help, int style = wxITEM_NORMAL, wxMenu* submenu = nullptr);
|
||||
void Append(int id, const String& resource, const String& text, const String& help, wxItemKind kind = wxITEM_NORMAL, wxMenu* submenu = nullptr);
|
||||
/// Append a menu item, without an image
|
||||
void Append(int id, const String& text, const String& help);
|
||||
/// Append a menu item, without an image
|
||||
void Append(int id, const String& text, const String& help, wxMenu* submenu);
|
||||
void Append(int id, const String& text, const String& help, wxItemKind kind = wxITEM_NORMAL, wxMenu* submenu = nullptr);
|
||||
/// Append a menu item, without an image
|
||||
void Append(wxMenuItem* item);
|
||||
/// Insert a menu item, with an image (loaded from a resource)
|
||||
void Insert(size_t pos, int id, const String& resource, const String& text, const String& help, int style = wxITEM_NORMAL, wxMenu* submenu = nullptr);
|
||||
void Insert(size_t pos, int id, const String& resource, const String& text, const String& help, wxItemKind kind = wxITEM_NORMAL, wxMenu* submenu = nullptr);
|
||||
/// Insert a menu item, without an image
|
||||
void Insert(size_t pos, int id, const String& text, const String& help);
|
||||
void Insert(size_t pos, int id, const String& text, const String& help, wxItemKind kind = wxITEM_NORMAL, wxMenu* submenu = nullptr);
|
||||
};
|
||||
|
||||
void set_menu_item_image(wxMenuItem* menuitem, const String& resource);
|
||||
|
||||
Reference in New Issue
Block a user