-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDropDownList.h
53 lines (41 loc) · 1.02 KB
/
DropDownList.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
#include "Button.h"
namespace gui
{
class DropDownList
{
private:
//Variables:
float keyTime;
const float keyTimeMax;
sf::Font& font;
gui::Button* activeElement;
std::vector<gui::Button*> list;
bool showList;
std::string strWidth;
std::string strHeight;
public:
//Constructors and Destructor:
DropDownList
(
float x, float y, float width, float height,
sf::Font& font, unsigned int font_size, std::string list[],
unsigned number_of_elements, unsigned default_index = 0
);
DropDownList
(
float x, float y, float width, float height,
sf::VideoMode video_mode,
sf::Font& font, unsigned int font_size, std::string list[],
unsigned number_of_elements, unsigned default_index = 0
);
virtual ~DropDownList();
//Accessors:
const bool getKeyTime();
const uint32_t& getActiveElementId() const;
//Fucntions:
void updateKeyTime(const float& dt);
void update(const sf::Vector2i& mouse_position, const float& dt);
void render(sf::RenderTarget* target);
};
}