-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathControl.h
41 lines (30 loc) · 964 Bytes
/
Control.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
#ifndef CONTROL_H
#define CONTROL_H
#include"SFML\Graphics.hpp"
#include<iostream>
#include<vector>
#include<string>
using namespace std;
using namespace sf;
class Control : public Drawable
{
private:
RectangleShape bounds;
public:
Control();
Control(const Vector2f & position, const Vector2f & size);
virtual ~Control() = 0;
bool contains(const Vector2f & point) const;
virtual Vector2f getPosition() const;
virtual Vector2f getSize() const;
virtual FloatRect getGlobalBounds() const = 0;
virtual void setSize(const Vector2f & size);
virtual void setPosition(const Vector2f & position);
void setBackgroundColor(Color bkColor);
void setBorderColor(Color borderColor);
void setBorderThickness(float thickness);
virtual Control * handleEvent(Event event, Vector2f mousePos) = 0;
virtual Control * clone() const = 0;
virtual void draw(RenderTarget& target, RenderStates states) const;
};
#endif // !CONTROL_H