Simple SFML GUI
0.2a
include
SSG
Button.hpp
1
/*
2
* Button.hpp
3
*
4
* Created on: 17.03.2017
5
* Author: jakub
6
*/
7
23
#ifndef MENUBUTTON_HPP_
24
#define MENUBUTTON_HPP_
25
26
#include <functional>
27
#include <SFML/Graphics.hpp>
28
#include "Pressable.hpp"
29
#include "Panel.hpp"
30
#include "PanelModelLine.hpp"
31
#include "TextLabel.hpp"
32
#include "HaveEnabled.hpp"
33
#include "HaveBackground.hpp"
34
#include "HaveOutline.hpp"
35
#include "HaveText.hpp"
36
#include "HaveFont.hpp"
37
#include "ColorAccess.hpp"
38
39
#include "UTest.hpp"
40
41
class
Button
:
42
public
Pressable
<Button&>,
43
public
HaveEnabled
,
44
public
HaveBackground
,
45
public
HaveOutline
,
46
public
SetColorAccess
,
47
public
GetColorAccess
{
48
public
:
49
UT_FRIEND
50
Button
();
51
Button
(
const
Button& button);
52
Button
(std::function<
void
(Button&)>&& action);
53
Button
(std::function<
void
()>&& action);
54
Button
(
const
sf::String& name);
55
Button
(
const
sf::String& name, std::function<
void
(Button&)>&& action);
56
Button
(
const
sf::String& name, std::function<
void
()>&& action);
57
Button
(
const
sf::String& name,
const
sf::String& text);
58
Button
(
const
sf::String& name,
const
sf::String& text, std::function<
void
(Button&)>&& action);
59
Button
(
const
sf::String& name,
const
sf::String& text, std::function<
void
()>&& action);
60
61
virtual
void
draw(sf::RenderTarget& target, sf::RenderStates states);
62
virtual
bool
update(sf::Vector2f mp,
bool
pressLeft,
bool
pressRight,
bool
aboveHover);
63
virtual
void
updateArea();
64
65
TextLabel
& getLabel();
66
const
TextLabel
& getLabel()
const
;
67
68
private
:
69
TextLabel
label;
70
71
};
72
73
typedef
std::shared_ptr<Button> ButtonPtr;
74
75
#endif
/* MENUBUTTON_HPP_ */
TextLabel
Definition:
TextLabel.hpp:26
HaveBackground
Definition:
HaveBackground.hpp:28
Button
Pressable button with some configuration options.
Definition:
Button.hpp:41
SetColorAccess
Definition:
ColorAccess.hpp:17
HaveEnabled
Definition:
HaveEnabled.hpp:15
Button::Button
Button()
Default constructor.
Definition:
Button.cpp:12
GetColorAccess
Definition:
ColorAccess.hpp:26
HaveOutline
Definition:
HaveOutline.hpp:15
Pressable
Definition:
Pressable.hpp:42
Generated by
1.8.13