mirror of
https://github.com/rodamaral/lsnes.git
synced 2025-04-02 10:42:15 -04:00
37 lines
895 B
C++
Executable file
37 lines
895 B
C++
Executable file
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<void (string)> callback);
|
|
|
|
FileBrowser();
|
|
~FileBrowser();
|
|
|
|
private:
|
|
configuration config;
|
|
struct FilterMode {
|
|
string name;
|
|
string path;
|
|
lstring filter;
|
|
} *mode;
|
|
vector<FilterMode> filterModes;
|
|
|
|
lstring fileNameList;
|
|
function<void (string)> callback;
|
|
|
|
void synchronize();
|
|
void setPath(const string &path);
|
|
void fileListActivate();
|
|
bool loadFolder(const string &path);
|
|
void loadFile(const string &filename);
|
|
};
|
|
|
|
extern FileBrowser *fileBrowser;
|