GUI
include
Scrollbar.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 by Maciej Wiecierzewski
3
*/
4
5
#ifndef SCROLLBAR_H
6
#define SCROLLBAR_H
7
8
#include "
Button.h
"
9
#include "
EventListener.h
"
10
#include "
Handle.h
"
11
#include "
MouseEvent.h
"
12
#include "
Renderer.h
"
13
#include "
Widget.h
"
14
15
namespace
gui
16
{
17
18
class
GUISystem;
19
21
22
class
Scrollbar
:
public
Widget
23
{
24
public
:
25
Scrollbar
(
GUISystem
*
guiSystem
,
int
x
,
int
y
,
int
w
,
int
h
);
26
virtual
~Scrollbar
() {};
27
28
void
render
(
Renderer
*renderer);
29
30
void
downButtonClick
(
Event
& event);
31
void
upButtonClick
(
Event
& event);
32
void
sliderMouseDown
(
Event
& event);
33
void
sliderMouseUp
(
Event
& event);
34
void
sliderMouseMove
(
Event
& event);
35
36
void
setSlider
(
float
position);
37
void
setSliderLength
(
float
length);
38
float
getSliderPosition
() {
return
sliderPosition
; }
39
40
protected
:
41
Color
backgroundColor
;
42
Color
frameColor
;
43
44
private
:
45
Handle<Button>
upButton
;
46
Handle<Button>
downButton
;
47
Handle<Button>
slideButton
;
48
49
EventListener::Id
mouseMoveListenerId
;
50
51
float
sliderPosition
;
52
float
sliderLength
;
53
int
holdPointX
;
54
int
holdPointY
;
55
float
sliderPrevPos
;
56
57
friend
class
GUISystem
;
58
};
59
60
}
61
62
#endif // SCROLLBAR_H
Generated on Sat Feb 11 2017 20:22:32 for GUI by
1.8.13