summaryrefslogtreecommitdiff
path: root/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.h
blob: 88765c7d046f34406c2fa50ec3a553b200f47faa (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
#ifndef _CLCDTextObject_H_
#define _CLCDTextObject_H_

#include "CLCDObject.h"

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

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

	// sets the textobject's font
	bool SetFont(LOGFONT& lf);
	// sets the textobject's font's facename
	void SetFontFaceName(tstring strFontName);
	// sets the textobject's font's pointsize
	void SetFontPointSize(int nPointSize);
	// sets the textobject's font's weight
	void SetFontWeight(int nWeight);
	// sets the textobject's font's italic flag
	void SetFontItalic(bool flag);

	// sets the textobject's alignment
	void SetAlignment(int iAlignment);
	// sets the textobject's wordwrap mode
	void SetWordWrap(bool bWrap);

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

protected:
	virtual void OnFontChanged();

protected:
	bool m_bWordWrap = false;

	HFONT m_hFont = nullptr;
	int m_iFontHeight = 0;
	UINT m_iTextFormat;
	UINT m_iTextAlignment;

	DRAWTEXTPARAMS	m_dtp;
};

#endif