Aether
SDL2 based UI Framework for NX
BorderButton.hpp
1 #ifndef AETHER_BORDERBUTTON_HPP
2 #define AETHER_BORDERBUTTON_HPP
3 
4 #include "Aether/base/Element.hpp"
5 #include "Aether/primary/Box.hpp"
6 #include "Aether/primary/Text.hpp"
7 
8 namespace Aether {
13  class BorderButton : public Element {
14  private:
15  Box * box;
16  Text * text;
18  public:
31  BorderButton(int x, int y, int w, int h, unsigned int b, std::string t, unsigned int s, std::function<void()> f);
32 
39 
45  void setBorderColour(Colour c);
46 
53 
59  void setTextColour(Colour c);
60 
66  std::string getString();
67 
73  void setString(std::string s);
74 
81  void setW(int w);
82 
89  void setH(int h);
90 
95 
100 
105  };
106 };
107 
108 #endif
void setBorderColour(Colour c)
Set the colour of the border.
Element for rendering a &#39;box&#39; (rectangle with no fill).
Definition: Box.hpp:11
Colour getTextColour()
Get the colour of the text.
Element for rendering a single line of text. It can optionally scroll when overflowing.
Definition: Text.hpp:15
The BorderButton element looks similar to the unfilled buttons seen within Horizon.
Definition: BorderButton.hpp:13
std::string getString()
Get the text for the button.
BorderButton(int x, int y, int w, int h, unsigned int b, std::string t, unsigned int s, std::function< void()> f)
The text in the button.
void setTextColour(Colour c)
Set the colour of the text.
Drawable * renderSelection()
Render selection layer.
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.
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 setString(std::string s)
Set the text for the button.
void setH(int h)
Set the height for the button.
Drawable * renderHighlightBG()
Render highlight background.
Colour getBorderColour()
Get the colour of the border.
void setW(int w)
Set the width for the button.
Drawable * renderHighlight()
Render highlight border.
int y()
Returns y-coordinate of element.