| 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 {
10 class FileBrowser
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
Fling::FileBrowser::m_CurrentWorkingDir
std::string m_CurrentWorkingDir
Definition: FileBrowser.h:37
Fling::FileBrowser::m_SelectedFile
std::string m_SelectedFile
The selected file in this dialog.
Definition: FileBrowser.h:35
Fling::FileBrowser::GetSelected
std::string GetSelected() const
Definition: FileBrowser.h:26
Fling::FileBrowser::~FileBrowser
~FileBrowser()=default
Fling::FileBrowser::m_IsOpen
bool m_IsOpen
Definition: FileBrowser.h:39
Fling::FileBrowser::Display
void Display()
Display the actual ImGUI info here.
Fling::FileBrowser::ClearSelected
void ClearSelected()
Fling::FileBrowser::IsOpen
bool IsOpen() const
Definition: FileBrowser.h:29
Fling::FileBrowser
Definition: FileBrowser.h:10
Fling::FileBrowser::SetTitle
void SetTitle(std::string t_Title)
Set the text in the title bar of this file dialoag.
Fling::FileBrowser::m_HasSelected
bool m_HasSelected
Definition: FileBrowser.h:41
Fling::FileBrowser::FileBrowser
FileBrowser(std::string t_Title="Open File...")
Fling::FileBrowser::Open
void Open()
Opens this file dialoag next time Display is called.
Fling::FileBrowser::m_Title
std::string m_Title
Definition: FileBrowser.h:32
Fling::FileBrowser::HasSelected
bool HasSelected() const
Definition: FileBrowser.h:25
Fling
Definition: Engine.h:29