2017-10-31 17:12:50 +00:00
|
|
|
#pragma once
|
|
|
|
#ifndef ES_APP_GUIS_GUI_SCREENSAVER_OPTIONS_H
|
|
|
|
#define ES_APP_GUIS_GUI_SCREENSAVER_OPTIONS_H
|
2017-09-09 03:45:50 +00:00
|
|
|
|
2017-06-01 20:08:44 +00:00
|
|
|
#include "components/MenuComponent.h"
|
|
|
|
|
|
|
|
// This is just a really simple template for a GUI that calls some save functions when closed.
|
|
|
|
class GuiScreensaverOptions : public GuiComponent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GuiScreensaverOptions(Window* window, const char* title);
|
|
|
|
virtual ~GuiScreensaverOptions(); // just calls save();
|
|
|
|
|
2017-09-09 03:45:50 +00:00
|
|
|
virtual void save();
|
2017-06-01 20:08:44 +00:00
|
|
|
inline void addRow(const ComponentListRow& row) { mMenu.addRow(row); };
|
|
|
|
inline void addWithLabel(const std::string& label, const std::shared_ptr<GuiComponent>& comp) { mMenu.addWithLabel(label, comp); };
|
|
|
|
inline void addSaveFunc(const std::function<void()>& func) { mSaveFuncs.push_back(func); };
|
2019-06-19 17:51:32 +00:00
|
|
|
void addEditableTextComponent(ComponentListRow row, const std::string label, std::shared_ptr<GuiComponent> ed, std::string value);
|
2017-06-01 20:08:44 +00:00
|
|
|
|
|
|
|
bool input(InputConfig* config, Input input) override;
|
|
|
|
std::vector<HelpPrompt> getHelpPrompts() override;
|
|
|
|
HelpStyle getHelpStyle() override;
|
|
|
|
|
2017-09-09 03:45:50 +00:00
|
|
|
protected:
|
2017-06-01 20:08:44 +00:00
|
|
|
MenuComponent mMenu;
|
|
|
|
std::vector< std::function<void()> > mSaveFuncs;
|
2017-09-09 03:45:50 +00:00
|
|
|
};
|
|
|
|
|
2017-10-31 17:12:50 +00:00
|
|
|
#endif // ES_APP_GUIS_GUI_SCREENSAVER_OPTIONS_H
|