Aether
SDL2 based UI Framework for NX
ListOption.hpp
1 #ifndef AETHER_LISTOPTION_HPP
2 #define AETHER_LISTOPTION_HPP
3 
4 #include "Aether/primary/Rectangle.hpp"
5 #include "Aether/primary/Text.hpp"
6 
7 namespace Aether {
13  class ListOption : public Element {
14  private:
16  Rectangle * topR;
18  Rectangle * bottomR;
20  Text * hint_;
22  Text * value_;
23 
27  void positionElements();
28 
29  public:
37  ListOption(std::string t, std::string v, std::function<void()> f);
38 
45 
51  void setLineColour(Colour c);
52 
59 
65  void setHintColour(Colour c);
66 
73 
79  void setValueColour(Colour c);
80 
88  void setColours(Colour l, Colour h, Colour v);
89 
95  std::string hint();
96 
102  void setHint(std::string s);
103 
109  std::string value();
110 
116  void setValue(std::string s);
117 
124  void setFontSize(unsigned int s);
125 
131  unsigned int fontSize();
132 
139  void setW(int w);
140 
147  void setH(int h);
148  };
149 };
150 
151 #endif
ListOption(std::string t, std::string v, std::function< void()> f)
Construct a new List Option object.
A rectangle is a texture containing either a normal or rounded rectangle.
Definition: Rectangle.hpp:11
std::string value()
Get the value string.
void setLineColour(Colour c)
Set the line colour (top rectangle colour)
void setW(int w)
Set the width of the list option All elements are repositioned when this is called.
Element for rendering a single line of text. It can optionally scroll when overflowing.
Definition: Text.hpp:15
void setValueColour(Colour c)
Set the value colour.
void setH(int h)
Set the height of the list option All elements are repositioned when this is called.
Colour getValueColour()
Get the value colour.
std::string hint()
Get the hint string.
int w()
Returns width of element.
void setValue(std::string s)
Set the value string.
Stores RGBA values representing a colour. Each component can be within the range 0 to 255 (inclusive)...
Definition: Colour.hpp:9
Colour getLineColour()
Get the line colour (top rectangle colour)
Element is the base class to be inherited to form all other types of elements.
Definition: Element.hpp:18
int h()
Returns height of element.
Base namespace for all Aether related classes and functions.
void setFontSize(unsigned int s)
Set the font size. Also repositions centers.
void setHint(std::string s)
Set the hint string.
void setHintColour(Colour c)
Set the hint colour.
Colour getHintColour()
Get the hint colour.
void setColours(Colour l, Colour h, Colour v)
Set all colours at once: line, hint, value.
unsigned int fontSize()
Get the font size.
A ListOption is similar to what appears in Horizon&#39;s lists. It has a string and value, as well as a function which is called when selected.
Definition: ListOption.hpp:13