#ifndef _plat_wxwidgets__menu_branches__hpp__included__ #define _plat_wxwidgets__menu_branches__hpp__included__ #include "core/dispatch.hpp" #include #include #include #include #include class branches_menu : public wxMenu { public: branches_menu(wxWindow* win, int wxid_low, int wxid_high); ~branches_menu(); void on_select(wxCommandEvent& e); void update(); bool any_enabled(); struct miteminfo { miteminfo(wxMenuItem* it, bool ismenu, wxMenu* p) : item(it), is_menu(ismenu), parent(p) { } wxMenuItem* item; bool is_menu; wxMenu* parent; }; void set_disabler(std::function fn) { disabler_fn = fn; } private: struct dispatch::target<> branchchange; wxWindow* pwin; int wxid_range_low; int wxid_range_high; std::map branch_ids; std::list menus; std::list otheritems; std::function disabler_fn; }; #endif