summaryrefslogtreecommitdiff
path: root/plugins/MirandaG15/LCDFramework/src/CLCDBar.h
blob: 1afb446132f38c37e965fb3945bb59ba6d0bea1c (plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef _CLCDBar_H_
#define _CLCDBar_H_

#define TOP 1
#define CENTER 2
#define BOTTOM 3

#define MODE_PROGRESSBAR 0
#define MODE_SCROLLBAR 1

#define DIRECTION_VERTICAL 0
#define DIRECTION_HORIZONTAL 1

class CLCDBar : public CLCDObject
{
public:
	// constructor
	CLCDBar();
	// destructor
	~CLCDBar();
	
	// initializes the bar
	bool Initialize();
	// deintializes the bar
	bool Shutdown();

	// draws the bar
	bool Draw(CLCDGfx *pGfx);
	// updates the bar
	bool Update();

	// specifies the bar's mode ( scrollbar / progressbar )
	void SetMode(int iMode);
	// specifies the orientation of the bar
	void SetOrientation(int iDirection);

	// sets the alignment of the scrollbar position
	void SetAlignment(int iAlignment);
	// sets the size of the slider
	void SetSliderSize(int iSize);
	
	// scrolls up/left
	bool ScrollUp();
	inline bool ScrollLeft() { return ScrollUp(); };
	// scrolls down/right
	bool ScrollDown();
	inline bool ScrollRight() { return ScrollDown(); };

	// scrolls to the specified position
	bool ScrollTo(int iPosition);
	// specifies the bar's range
	void SetRange(int iMin,int iMax);

private:
	int		m_iOrientation;
	int		m_iMode;
	int		m_iSliderSize;
	int		m_iMax;
	int		m_iMin;
	int		m_iPosition;
	int		m_iAlignment;
};

#endif