Subversion Repositories spk

Rev

Rev 123 | Details | Compare with Previous | 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
 
19
class CLCDText : public CLCDBase
20
{
21
 
22
public:
23
    CLCDText();
24
    virtual ~CLCDText();
25
 
26
    virtual HRESULT Initialize(void);
27
 
28
    virtual void SetFont(LOGFONT& lf);
29
    virtual void SetFontFaceName(LPCTSTR szFontName);
30
    virtual void SetFontPointSize(int nPointSize);
31
    virtual void SetFontWeight(int nWeight);
32
 
33
    virtual HFONT GetFont();
34
    virtual void SetText(LPCTSTR szText);
35
    virtual LPCTSTR GetText();
36
    virtual void SetWordWrap(BOOL bEnable);
37
    virtual SIZE& GetVExtent();
38
    virtual SIZE& GetHExtent();
39
    virtual void SetLeftMargin(int nLeftMargin);
40
    virtual int GetLeftMargin(void);
41
    virtual void SetRightMargin(int nRightMargin);
42
    virtual int GetRightMargin(void);
43
    virtual void SetAlignment(int nAlignment = DT_LEFT);
44
 
45
    virtual void OnDraw(CLCDGfx &rGfx);
242 cycrow 46
	virtual void SetText ( const std::wstring &szText );
79 cycrow 47
 
48
    enum { DEFAULT_DPI = 96, DEFAULT_POINTSIZE = 8 };
49
 
50
protected:
51
    void DrawText(CLCDGfx &rGfx);
52
 
53
#ifdef UNICODE
54
    std::wstring m_sText;
55
#else
56
    std::string m_sText;
57
#endif
58
    HFONT m_hFont;
59
    COLORREF m_crColor;
123 cycrow 60
    std::basic_string <TCHAR>::size_type m_nTextLength;
79 cycrow 61
    UINT m_nTextFormat;
62
    BOOL m_bRecalcExtent;
63
    DRAWTEXTPARAMS m_dtp;
64
    int m_nTextAlignment;
65
    SIZE m_sizeVExtent, m_sizeHExtent;
66
};
67
 
68
 
69
#endif // !_LCDTEXT_H_INCLUDED_ 
70
 
71
//** end of LCDText.h ****************************************************