Files
sdrpp/core/src/gui/widgets/file_select.h
2022-02-24 20:49:53 +01:00

31 lines
695 B
C++

#pragma once
#include <imgui.h>
#include <imgui_internal.h>
#include <stdint.h>
#include <string>
#include <thread>
#include <vector>
class FileSelect {
public:
FileSelect(std::string defaultPath, std::vector<std::string> filter = { "All Files", "*" });
bool render(std::string id);
void setPath(std::string path, bool markChanged = false);
bool pathIsValid();
std::string expandString(std::string input);
std::string path = "";
private:
void worker();
std::thread workerThread;
std::vector<std::string> _filter;
std::string root = "";
bool pathValid = false;
bool dialogOpen = false;
char strPath[2048];
bool pathChanged = false;
};