Hymn to Beauty
C++ 3D Engine
SelectHymnWindow.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4#include <vector>
5#include <string>
6
7namespace GUI {
10 public:
13
15 void Scan();
16
18 void Show();
19
21
24 void SetClosedCallback(const std::function<void(const std::string&)>& callback);
25
27
30 bool IsVisible() const;
31
33
36 void SetVisible(bool visible);
37
39
42 void SetTitle(const char* title);
43
45
48 void SetOpenButtonName(const char* openButtonName);
49
50 private:
51 // Interaction
52 bool hasClosedCallback = false;
53 std::function<void(const std::string&)> closedCallback;
54
55 std::vector<std::string> files;
56 char name[128];
57
58 bool visible = false;
59
60 const char* title;
61 const char* openButtonName;
62};
63} // namespace GUI
A window where a hymn can be selected.
Definition: SelectHymnWindow.hpp:9
void SetVisible(bool visible)
Set whether the window should be visible.
Definition: SelectHymnWindow.cpp:53
void Show()
Show the window and let the user select a hymn.
Definition: SelectHymnWindow.cpp:18
void SetTitle(const char *title)
Set window title.
Definition: SelectHymnWindow.cpp:58
void SetClosedCallback(const std::function< void(const std::string &)> &callback)
Set function to call when closed.
Definition: SelectHymnWindow.cpp:44
void Scan()
Scan the save directory for hymns.
Definition: SelectHymnWindow.cpp:14
void SetOpenButtonName(const char *openButtonName)
Set the name of the open button.
Definition: SelectHymnWindow.cpp:62
bool IsVisible() const
Get whether the window is visible.
Definition: SelectHymnWindow.cpp:49
SelectHymnWindow()
Constructor.
Definition: SelectHymnWindow.cpp:10
Definition: AssetEditor.hpp:9