2014-03-01 21:02:44 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "NinePatchComponent.h"
|
|
|
|
#include "ComponentList.h"
|
|
|
|
#include "TextComponent.h"
|
|
|
|
|
|
|
|
class MenuComponent : public GuiComponent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MenuComponent(Window* window, const char* title);
|
|
|
|
|
|
|
|
void onSizeChanged() override;
|
|
|
|
|
2014-03-06 19:45:03 +00:00
|
|
|
inline void addRow(const ComponentListRow& row, bool setCursorHere = false) { mList.addRow(row, setCursorHere); }
|
2014-03-01 21:02:44 +00:00
|
|
|
|
2014-03-08 18:19:21 +00:00
|
|
|
inline void addWithLabel(const std::string& label, const std::shared_ptr<GuiComponent>& comp, bool setCursorHere = false)
|
|
|
|
{
|
|
|
|
ComponentListRow row;
|
|
|
|
row.addElement(std::make_shared<TextComponent>(mWindow, label, Font::get(FONT_SIZE_MEDIUM), 0x777777FF), true);
|
|
|
|
row.addElement(comp, false);
|
|
|
|
addRow(row, setCursorHere);
|
|
|
|
}
|
|
|
|
|
2014-03-01 21:02:44 +00:00
|
|
|
private:
|
|
|
|
NinePatchComponent mBackground;
|
|
|
|
TextComponent mTitle;
|
|
|
|
ComponentList mList;
|
|
|
|
};
|