1 #ifndef _plat_wxwidgets__menu_projects__hpp__included__
2 #define _plat_wxwidgets__menu_projects__hpp__included__
4 #include "core/dispatch.hpp"
5 #include "library/recentfiles.hpp"
13 class emulator_instance
;
15 class projects_menu
: public wxMenu
18 projects_menu(wxWindow
* win
, emulator_instance
& _inst
, int wxid_low
, int wxid_high
, const std::string
& cfg
,
19 std::function
<void(const std::string
& id
)> cb
);
21 void on_select(wxCommandEvent
& e
);
23 void add(recentfiles::namedobj obj
) { rfiles
.add(obj
); }
25 emulator_instance
& inst
;
26 class rhook
: public recentfiles::hook
29 rhook(projects_menu
& _pmenu
) : pmenu(_pmenu
) {}
31 void operator()() { pmenu
.update(); }
38 std::map
<int, wxMenuItem
*> items
;
39 std::map
<int, recentfiles::namedobj
> entries
;
40 std::function
<void(std::string id
)> selected_cb
;
41 recentfiles::set
<recentfiles::namedobj
> rfiles
;