Fling Engine  0.00.1
Fling Engine is a game engine written in Vulkan
FileBrowser.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <filesystem>
5 #if WITH_IMGUI
6 #include <imgui.h>
7 #endif
8 namespace Fling
9 {
11  {
12  public:
13  FileBrowser(std::string t_Title = "Open File...");
14  ~FileBrowser() = default;
15 
17  void Display();
18 
20  void SetTitle(std::string t_Title);
21 
23  void Open();
24 
25  bool HasSelected() const { return m_HasSelected; }
26  std::string GetSelected() const { return m_SelectedFile; }
27  void ClearSelected();
28 
29  bool IsOpen() const { return m_IsOpen; }
30 
31  private:
32  std::string m_Title = "Select File...";
33 
35  std::string m_SelectedFile = std::string();
36 
37  std::string m_CurrentWorkingDir = std::string();
38 
39  bool m_IsOpen = false;
40 
41  bool m_HasSelected = false;
42  };
43 } // namespace Fling
std::string m_CurrentWorkingDir
Definition: FileBrowser.h:37
std::string m_SelectedFile
The selected file in this dialog.
Definition: FileBrowser.h:35
std::string GetSelected() const
Definition: FileBrowser.h:26
~FileBrowser()=default
bool m_IsOpen
Definition: FileBrowser.h:39
void Display()
Display the actual ImGUI info here.
bool IsOpen() const
Definition: FileBrowser.h:29
Definition: FileBrowser.h:10
void SetTitle(std::string t_Title)
Set the text in the title bar of this file dialoag.
bool m_HasSelected
Definition: FileBrowser.h:41
FileBrowser(std::string t_Title="Open File...")
void Open()
Opens this file dialoag next time Display is called.
std::string m_Title
Definition: FileBrowser.h:32
bool HasSelected() const
Definition: FileBrowser.h:25
Definition: Engine.h:29