-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRadioBox.h
51 lines (35 loc) · 1.47 KB
/
RadioBox.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
#pragma once
#include "AbstractBox.h"
/*
* RadioBox
* Derives Functions From AbstractBox.
* Used to show and set RadioBox properties.
*/
class RadioBox : public AbstractBox
{
private:
// selected RadioBox index.
size_t _selected;
// Private function - cleans checked mark from all controls.
void ClearAstrix();
public:
//Constructor. _In: height - height of control, witdh - width of control, entries - text of RadioBox.
RadioBox(uint32_t height, uint32_t width, std::vector<std::string> entries);
~RadioBox();
// Returns selected index.
size_t getSelectedIndex() const;
// Select an index. _In: index - index to be selected.
void setSelectedIndex(size_t index) throw(IndexOutOfBounds);
// Inherited via MouseListener
// CallBack Function when a checklist is pressed.
virtual void MousePressed(Control& control, int x, int y, bool isLeft, Control* msCb = nullptr) override;
// Inherited via Control
// What to when mouse is pressed. _In: x - X Coords of press, y - Y coords of press, isLeft - is press mouse left button.
void mousePressed(uint32_t x, uint32_t y, bool isLeft) override;
// What to do when key is pressd. _In: keyCode - code of key, character - character pressed.
void keyDown(uint32_t keyCode, char character) override;
// Sets background of control. _In: color - color enum to be selected.
void setBackground(Color color) override;
// Sets foreground of control. _In: color - color enum to be selected.
void setForeground(Color color) override;
};