Aether
SDL2 based UI Framework for NX
FilledButton.hpp
1 #ifndef AETHER_FILLEDBUTTON_HPP
2 #define AETHER_FILLEDBUTTON_HPP
3 
4 #include "Aether/base/Element.hpp"
5 #include "Aether/primary/Rectangle.hpp"
6 #include "Aether/primary/Text.hpp"
7 
8 namespace Aether {
14  class FilledButton : public Element {
15  private:
17  Rectangle * rect;
19  Text * text;
20 
21  public:
33  FilledButton(int x, int y, int w, int h, std::string t, unsigned int s, std::function<void()> f);
34 
41 
47  void setFillColour(Colour c);
48 
55 
61  void setTextColour(Colour c);
62 
68  std::string getString();
69 
75  void setString(std::string s);
76 
83  void setW(int w);
84 
91  void setH(int h);
92 
97 
102 
107  };
108 };
109 
110 #endif
A rectangle is a texture containing either a normal or rounded rectangle.
Definition: Rectangle.hpp:11
A FilledButton is exactly that. The text/rectangle are resized/repositioned to be centered on any res...
Definition: FilledButton.hpp:14
Drawable * renderHighlight()
Render highlight border.
Drawable * renderHighlightBG()
Render highlight background.
Element for rendering a single line of text. It can optionally scroll when overflowing.
Definition: Text.hpp:15
Colour getTextColour()
Get the text&#39;s colour.
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
Stores either a surface or texture which can be drawn on screen by providing a renderer to render()...
Definition: Drawable.hpp:22
int x()
Returns x-coordinate of element.
FilledButton(int x, int y, int w, int h, std::string t, unsigned int s, std::function< void()> f)
Construct a new Filled Button object.
Element is the base class to be inherited to form all other types of elements.
Definition: Element.hpp:18
void setTextColour(Colour c)
Set the text&#39;s colour.
int h()
Returns height of element.
Base namespace for all Aether related classes and functions.
std::string getString()
Get current button text.
void setFillColour(Colour c)
Set the colour to fill rectangle with.
Drawable * renderSelection()
Render selection layer.
void setH(int h)
Set new width for the button.
Colour getFillColour()
Get the colour to fill rectangle with.
void setW(int w)
Set new width for the button.
void setString(std::string s)
Set new button text.
int y()
Returns y-coordinate of element.