struct FileBrowser : Window { VerticalLayout layout; HorizontalLayout pathLayout; LineEdit pathEdit; Button pathBrowse; Button pathUp; ListView fileList; HorizontalLayout controlLayout; Label filterLabel; Button openButton; struct Mode { enum : unsigned { Default, NES, SNES, GameBoy, GameBoyColor, Satellaview, SufamiTurbo }; }; void open(const string &title, unsigned mode, function callback); FileBrowser(); ~FileBrowser(); private: configuration config; struct FilterMode { string name; string path; lstring filter; } *mode; vector filterModes; lstring fileNameList; function callback; void synchronize(); void setPath(const string &path); void fileListActivate(); bool loadFolder(const string &path); void loadFile(const string &filename); }; extern FileBrowser *fileBrowser;