Don't crash if recentfiles line fails to deserialize
[lsnes.git] / include / platform / wxwidgets / menu_loadrom.hpp
blobc53007996ffb0d4fb005217167398a7485b27851
1 #ifndef _plat_wxwidgets__menu_loadrom__hpp__included__
2 #define _plat_wxwidgets__menu_loadrom__hpp__included__
4 #include <wx/string.h>
5 #include <wx/wx.h>
6 #include "interface/romtype.hpp"
7 #include "core/dispatch.hpp"
8 #include <map>
10 class loadrom_menu : public wxMenu
12 public:
13 loadrom_menu(wxWindow* win, int wxid_low, int wxid_high, std::function<void(core_type* name)> cb);
14 void on_select(wxCommandEvent& e);
15 void update();
16 private:
17 wxWindow* pwin;
18 std::map<int, core_type*> entries;
19 std::map<int, wxMenuItem*> items;
20 int wxid_range_low;
21 int wxid_range_high;
22 std::function<void(core_type* name)> callback;
23 struct dispatch::target<> corelistener;
26 #endif