Subversion Repositories spk

Rev

Rev 123 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
79 cycrow 1
//************************************************************************
2
//
3
// LCDText.h
4
//
5
// The CLCDText class draws simple text onto the LCD.
6
// 
7
// Logitech LCD SDK
8
//
9
// Copyright 2005 Logitech Inc.
10
//************************************************************************
11
 
12
#ifndef _LCDTEXT_H_INCLUDED_ 
13
#define _LCDTEXT_H_INCLUDED_ 
14
 
15
#include "LCDBase.h"
16
 
17
#include <string>
18
using namespace std;
19
 
20
class CLCDText : public CLCDBase
21
{
22
 
23
public:
24
    CLCDText();
25
    virtual ~CLCDText();
26
 
27
    virtual HRESULT Initialize(void);
28
 
29
    virtual void SetFont(LOGFONT& lf);
30
    virtual void SetFontFaceName(LPCTSTR szFontName);
31
    virtual void SetFontPointSize(int nPointSize);
32
    virtual void SetFontWeight(int nWeight);
33
 
34
    virtual HFONT GetFont();
35
    virtual void SetText(LPCTSTR szText);
36
    virtual LPCTSTR GetText();
37
    virtual void SetWordWrap(BOOL bEnable);
38
    virtual SIZE& GetVExtent();
39
    virtual SIZE& GetHExtent();
40
    virtual void SetLeftMargin(int nLeftMargin);
41
    virtual int GetLeftMargin(void);
42
    virtual void SetRightMargin(int nRightMargin);
43
    virtual int GetRightMargin(void);
44
    virtual void SetAlignment(int nAlignment = DT_LEFT);
45
 
46
    virtual void OnDraw(CLCDGfx &rGfx);
47
	virtual void SetText ( const std::string &szText );
48
 
49
    enum { DEFAULT_DPI = 96, DEFAULT_POINTSIZE = 8 };
50
 
51
protected:
52
    void DrawText(CLCDGfx &rGfx);
53
 
54
#ifdef UNICODE
55
    std::wstring m_sText;
56
#else
57
    std::string m_sText;
58
#endif
59
    HFONT m_hFont;
60
    COLORREF m_crColor;
61
    basic_string <TCHAR>::size_type m_nTextLength;
62
    UINT m_nTextFormat;
63
    BOOL m_bRecalcExtent;
64
    DRAWTEXTPARAMS m_dtp;
65
    int m_nTextAlignment;
66
    SIZE m_sizeVExtent, m_sizeHExtent;
67
};
68
 
69
 
70
#endif // !_LCDTEXT_H_INCLUDED_ 
71
 
72
//** end of LCDText.h ****************************************************