summaryrefslogtreecommitdiff
path: root/wx+/context_menu.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <shieldwed@outlook.com>2019-12-14 15:52:53 +0000
committerDaniel Wilhelm <shieldwed@outlook.com>2019-12-14 15:52:53 +0000
commitcc75e50ca861529d50601d247fd66f806fcb23a8 (patch)
treee2c5c7b1f98e64011b1ee8ca4e9bb9157510dfe7 /wx+/context_menu.h
parentMerge branch '10.17' into 'master' (diff)
parentadd upstream 10.18 (diff)
downloadFreeFileSync-cc75e50ca861529d50601d247fd66f806fcb23a8.tar.gz
FreeFileSync-cc75e50ca861529d50601d247fd66f806fcb23a8.tar.bz2
FreeFileSync-cc75e50ca861529d50601d247fd66f806fcb23a8.zip
Merge branch '10.18' into 'master'10.18
add upstream 10.18 See merge request opensource-tracking/FreeFileSync!15
Diffstat (limited to 'wx+/context_menu.h')
-rw-r--r--wx+/context_menu.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/wx+/context_menu.h b/wx+/context_menu.h
index d856db03..08a313bf 100644
--- a/wx+/context_menu.h
+++ b/wx+/context_menu.h
@@ -14,7 +14,7 @@
#include <wx/app.h>
/*
-A context menu supporting C++11 lambda callbacks!
+A context menu supporting lambda callbacks!
Usage:
ContextMenu menu;
@@ -56,7 +56,7 @@ public:
void addSeparator() { menu_->AppendSeparator(); }
- void addSubmenu(const wxString& label, ContextMenu& submenu, const wxBitmap* bmp = nullptr) //invalidates submenu!
+ void addSubmenu(const wxString& label, ContextMenu& submenu, const wxBitmap* bmp = nullptr, bool enabled = true) //invalidates submenu!
{
//transfer submenu commands:
commandList_.insert(submenu.commandList_.begin(), submenu.commandList_.end());
@@ -67,6 +67,7 @@ public:
wxMenuItem* newItem = new wxMenuItem(menu_.get(), wxID_ANY, label, L"", wxITEM_NORMAL, submenu.menu_.release()); //menu owns item, item owns submenu!
if (bmp) newItem->SetBitmap(*bmp); //do not set AFTER appending item! wxWidgets screws up for yet another crappy reason
menu_->Append(newItem);
+ if (!enabled) newItem->Enable(false);
}
void popup(wxWindow& wnd, const wxPoint& pos = wxDefaultPosition) //show popup menu + process lambdas
bgstack15