summaryrefslogtreecommitdiff
path: root/plugins/MirandaG15/LCDFramework/src/CLCDLabel.h
blob: b2bcc5bc3b503f9f9aa2ac9206555aa7ad847fac (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
#ifndef _CLCDLABEL_H_
#define _CLCDLABEL_H_

#include "CLCDTextObject.h"

class CLCDLabel : public CLCDTextObject
{
public:
	// constructor
	CLCDLabel();
	// destructor
	~CLCDLabel();

	// initializes the label
	bool Initialize();
	// deinitializes the label
	bool Shutdown();

	// update the label
	bool Update();
	// draw the label
	bool Draw(CLCDGfx *pGfx);

	// sets the label's text
	void SetText(tstring strText);

	// sets the cutoff mode
	void SetCutOff(bool bEnable);

	// sets the wordwrap mode
	void SetWordWrap(bool bEnable);

private:
	// updates the cutoff index
	void UpdateCutOffIndex();
	// called when the labels size has changed
	void OnSizeChanged(SIZE OldSize);
	// called when the labels font has changed
	void OnFontChanged();

	bool m_bWordWrap;

	bool m_bCutOff;
	int m_iCutOffIndex;
	tstring m_strText;
	tstring m_strCutOff;
	int	m_iLineCount;

	vector<tstring> m_vLines;
};

#endif