2022-03-13 19:32:35 -04:00
|
|
|
#include "../ta-utils.h"
|
|
|
|
#include "imgui.h"
|
2022-04-25 20:20:41 -04:00
|
|
|
#include <functional>
|
2022-03-13 22:06:08 -04:00
|
|
|
#include <vector>
|
2022-03-13 19:32:35 -04:00
|
|
|
|
|
|
|
namespace pfd {
|
|
|
|
class open_file;
|
|
|
|
class save_file;
|
|
|
|
}
|
|
|
|
|
2022-04-25 19:58:17 -04:00
|
|
|
typedef std::function<void(const char*)> FileDialogSelectCallback;
|
|
|
|
|
2022-03-13 19:32:35 -04:00
|
|
|
class FurnaceGUIFileDialog {
|
|
|
|
bool sysDialog;
|
|
|
|
bool opened;
|
|
|
|
bool saving;
|
|
|
|
String curPath;
|
|
|
|
String fileName;
|
|
|
|
pfd::open_file* dialogO;
|
|
|
|
pfd::save_file* dialogS;
|
|
|
|
public:
|
2022-04-25 19:58:17 -04:00
|
|
|
bool openLoad(String header, std::vector<String> filter, const char* noSysFilter, String path, double dpiScale, FileDialogSelectCallback clickCallback=NULL);
|
2022-03-14 00:10:43 -04:00
|
|
|
bool openSave(String header, std::vector<String> filter, const char* noSysFilter, String path, double dpiScale);
|
2022-03-13 19:32:35 -04:00
|
|
|
bool accepted();
|
|
|
|
void close();
|
|
|
|
bool render(const ImVec2& min, const ImVec2& max);
|
2022-04-30 03:02:55 -04:00
|
|
|
bool isOpen();
|
2022-03-13 19:32:35 -04:00
|
|
|
String getPath();
|
|
|
|
String getFileName();
|
2022-04-14 19:25:59 -04:00
|
|
|
explicit FurnaceGUIFileDialog(bool system):
|
2022-03-13 19:32:35 -04:00
|
|
|
sysDialog(system),
|
|
|
|
opened(false),
|
|
|
|
saving(false),
|
|
|
|
dialogO(NULL),
|
|
|
|
dialogS(NULL) {}
|
2022-03-13 22:06:08 -04:00
|
|
|
};
|