Aether
SDL2 based UI Framework for NX
List.hpp
1 #ifndef AETHER_LIST_HPP
2 #define AETHER_LIST_HPP
3 
4 #include "Aether/base/Scrollable.hpp"
5 
6 namespace Aether {
11  class List : public Scrollable {
12  private:
14  Button heldButton;
16  bool scroll;
17  bool waitUntilVisible;
19  bool wrapAround_;
20 
26  bool hasVisibleItem();
27 
28  public:
38  List(int x, int y, int w, int h, Padding p = Padding::Default);
39 
43  void setInactive();
44 
51  bool wrapAround();
52 
58  void setWrapAround(bool b);
59 
67  bool handleEvent(InputEvent * e);
68 
74  void update(unsigned int dt);
75  };
76 };
77 
78 #endif
bool handleEvent(InputEvent *e)
Attempts to handle event.
bool wrapAround()
Returns whether the list is configured to wrap around.
A list is a scrollable with some values changed to match how a list functions within Horizon...
Definition: List.hpp:11
Padding
Enum class for amount of padding in a scrollable.
Definition: Types.hpp:47
A scrollable element arranges all of it's children as a list. It's children are rendered and 'cut off...
Definition: Scrollable.hpp:13
void setWrapAround(bool b)
Set whether the list 'wraps around' from top to bottom and vice versa.
void update(unsigned int dt)
Updates info as necessary.
int w()
Returns width of element.
int x()
Returns x-coordinate of element.
int h()
Returns height of element.
Base namespace for all Aether related classes and functions.
A class that represents an Aether input event.
Definition: InputEvent.hpp:25
void setInactive()
A list needs to stop scrolling when it is set inactive.
List(int x, int y, int w, int h, Padding p=Padding::Default)
Construct a new List object. The scrollbar is shown by default.
Button
Enum class for buttons Avoids confusion with SDL/libnx names.
Definition: Types.hpp:12
int y()
Returns y-coordinate of element.