Aether
SDL2 based UI Framework for NX
ListButton.hpp
1 #ifndef AETHER_LISTBUTTON_HPP
2 #define AETHER_LISTBUTTON_HPP
3 
4 #include "Aether/primary/Rectangle.hpp"
5 #include "Aether/primary/Text.hpp"
6 
7 namespace Aether {
12  class ListButton : public Element {
13  private:
15  Rectangle * topR;
17  Rectangle * bottomR;
19  Text * text_;
20 
21  public:
28  ListButton(std::string s, std::function<void()> f);
29 
36 
42  void setLineColour(Colour c);
43 
50 
56  void setTextColour(Colour c);
57 
64  void setColours(Colour l, Colour t);
65 
71  std::string text();
72 
78  void setText(std::string s);
79 
85  unsigned int fontSize();
86 
92  void setFontSize(unsigned int f);
93 
100  void setW(int w);
101 
108  void setH(int h);
109  };
110 };
111 
112 #endif
A rectangle is a texture containing either a normal or rounded rectangle.
Definition: Rectangle.hpp:11
A ListButton is similar to what appears in Horizon&#39;s lists. It has a string and should be used to ope...
Definition: ListButton.hpp:12
void setColours(Colour l, Colour t)
Set all colours at once: line, text.
Element for rendering a single line of text. It can optionally scroll when overflowing.
Definition: Text.hpp:15
void setW(int w)
Set the width of the list button Adjusting width also changes the width of rectangles.
unsigned int fontSize()
Get the font size.
Colour getTextColour()
Get the text colour.
void setTextColour(Colour c)
Set the text colour.
Colour getLineColour()
Get the line colour.
ListButton(std::string s, std::function< void()> f)
Construct a new List Button object.
void setLineColour(Colour c)
Set the line colour.
void setFontSize(unsigned int f)
Set the font size.
int w()
Returns width of element.
Stores RGBA values representing a colour. Each component can be within the range 0 to 255 (inclusive)...
Definition: Colour.hpp:9
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.
std::string text()
Get the list text.
void setH(int h)
Set the height of the list button Adjusting height also moves same elements.
void setText(std::string s)
Set the list text.