Aether
SDL2 based UI Framework for NX
PopupList.hpp
1 #ifndef AETHER_POPUPLIST_HPP
2 #define AETHER_POPUPLIST_HPP
3 
4 #include "Aether/Overlay.hpp"
5 #include "Aether/horizon/controls/ControlBar.hpp"
6 #include "Aether/horizon/list/List.hpp"
7 #include "Aether/horizon/list/ListButton.hpp"
8 #include "Aether/primary/Rectangle.hpp"
9 
10 namespace Aether {
16  class PopupList : public Overlay {
17  private:
19  ControlBar * ctrl;
21  List * list;
23  Rectangle * rect;
25  Rectangle * top;
27  Rectangle * bottom;
29  Text * title;
31  std::vector<ListButton *> items;
33  Colour hiColour;
35  Colour llColour;
37  Colour txColour;
38 
39  public:
45  PopupList(std::string s);
46 
54  void addEntry(std::string s, std::function<void()> f, bool t = false);
55 
61  void setTitleLabel(std::string s);
62 
68  void setBackLabel(std::string s);
69 
75  void setOKLabel(std::string s);
76 
80  void removeEntries();
81 
88 
95 
102 
108  void setTextColour(Colour c);
109 
116 
122  void setLineColour(Colour c);
123 
130 
136  void setHighlightColour(Colour c);
137 
144 
150  void setListLineColour(Colour c);
151 
161  void setAllColours(Colour bg, Colour hi, Colour li, Colour lli, Colour tx);
162  };
163 };
164 
165 #endif
void setLineColour(Colour c)
Set the line colour.
A rectangle is a texture containing either a normal or rounded rectangle.
Definition: Rectangle.hpp:11
void setAllColours(Colour bg, Colour hi, Colour li, Colour lli, Colour tx)
Set the all colours.
A list is a scrollable with some values changed to match how a list functions within Horizon...
Definition: List.hpp:11
Element for rendering a single line of text. It can optionally scroll when overflowing.
Definition: Text.hpp:15
PopupList(std::string s)
Construct a new Popup List object.
Colour getBackgroundColour()
Get the background colour.
void setTitleLabel(std::string s)
Set the title label.
void addEntry(std::string s, std::function< void()> f, bool t=false)
Add new entry to popup list.
void setBackgroundColour(Colour c)
Set the background colour.
void setBackLabel(std::string s)
Set the back button label.
Stores RGBA values representing a colour. Each component can be within the range 0 to 255 (inclusive)...
Definition: Colour.hpp:9
void setListLineColour(Colour c)
Set the list line colour.
Base namespace for all Aether related classes and functions.
void removeEntries()
Removes all entries from list.
A container holding control elements (and nothing else) which automatically arranges them at the bott...
Definition: ControlBar.hpp:16
Colour getLineColour()
Get the line colour.
void setOKLabel(std::string s)
Set the OK button label.
void setHighlightColour(Colour c)
Set the highlight colour.
A "PopupList" is an overlay at the bottom of the screen containing a list of items to select from...
Definition: PopupList.hpp:16
An object representing an overlay.
Definition: Overlay.hpp:14
Colour getListLineColour()
Get the list line colour.
void setTextColour(Colour c)
Set the text colour.
Colour getTextColour()
Get the text colour.
Colour getHighlightColour()
Get the highlight colour.