Unregister a dynamic menu item
| 215 | |
| 216 | /// Unregister a dynamic menu item |
| 217 | void Remove(wxMenuItem *item) { |
| 218 | auto pred = [=](std::pair<std::string, wxMenuItem*> const& o) { |
| 219 | return o.second == item; |
| 220 | }; |
| 221 | |
| 222 | auto it = find_if(dynamic_items.begin(), dynamic_items.end(), pred); |
| 223 | if (it != dynamic_items.end()) |
| 224 | dynamic_items.erase(it); |
| 225 | it = find_if(static_items.begin(), static_items.end(), pred); |
| 226 | if (it != static_items.end()) |
| 227 | static_items.erase(it); |
| 228 | } |
| 229 | |
| 230 | /// Create a MRU menu and register the needed handlers |
| 231 | /// @param name MRU type |
no test coverage detected