ES-DE/es-app/src/guis/GuiSettings.h
Leon Styhre 6b62065595 Large code cleanup and code documentation update.
The initial code cleanup of es-app is now complete as of this commit.
2020-06-23 20:07:00 +02:00

36 lines
1 KiB
C++

//
// GuiSettings.h
//
// User interface template for a settings GUI.
//
#pragma once
#ifndef ES_APP_GUIS_GUI_SETTINGS_H
#define ES_APP_GUIS_GUI_SETTINGS_H
#include "components/MenuComponent.h"
// This is just a really simple template for a GUI that calls some save functions when closed.
class GuiSettings : public GuiComponent
{
public:
GuiSettings(Window* window, const char* title);
virtual ~GuiSettings(); // Just calls save()
void save();
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); };
bool input(InputConfig* config, Input input) override;
std::vector<HelpPrompt> getHelpPrompts() override;
HelpStyle getHelpStyle() override;
private:
MenuComponent mMenu;
std::vector< std::function<void()> > mSaveFuncs;
};
#endif // ES_APP_GUIS_GUI_SETTINGS_H