Welcome to mirror list, hosted at ThFree Co, Russian Federation.

LCDText.h « LCDUI « ui « src - github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3a74f746ffd41d17ad0b0345f416e9543f5ea39d (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
65
66
67
68
69
70
71
//************************************************************************
//
// LCDText.h
//
// The CLCDText class draws simple text onto the LCD.
// 
// Logitech LCD SDK
//
// Copyright 2005 Logitech Inc.
//************************************************************************

#ifndef _LCDTEXT_H_INCLUDED_ 
#define _LCDTEXT_H_INCLUDED_ 

#include "LCDBase.h"

#include <string>
using namespace std;

class CLCDText : public CLCDBase
{

public:
    CLCDText();
    virtual ~CLCDText();

    virtual HRESULT Initialize(void);
    
    virtual void SetFont(LOGFONT& lf);
    virtual void SetFontFaceName(LPCTSTR szFontName);
    virtual void SetFontPointSize(int nPointSize);
    virtual void SetFontWeight(int nWeight);

    virtual HFONT GetFont();
    virtual void SetText(LPCTSTR szText);
    virtual LPCTSTR GetText();
    virtual void SetWordWrap(BOOL bEnable);
    virtual SIZE& GetVExtent();
    virtual SIZE& GetHExtent();
    virtual void SetLeftMargin(int nLeftMargin);
    virtual int GetLeftMargin(void);
    virtual void SetRightMargin(int nRightMargin);
    virtual int GetRightMargin(void);
    virtual void SetAlignment(int nAlignment = DT_LEFT);

    virtual void OnDraw(CLCDGfx &rGfx);

    enum { DEFAULT_DPI = 96, DEFAULT_POINTSIZE = 8 };

protected:
    void DrawText(CLCDGfx &rGfx);

#ifdef UNICODE
    std::wstring m_sText;
#else
    std::string m_sText;
#endif
    HFONT m_hFont;
    COLORREF m_crColor;
    basic_string <TCHAR>::size_type m_nTextLength;
    UINT m_nTextFormat;
    BOOL m_bRecalcExtent;
    DRAWTEXTPARAMS m_dtp;
    int m_nTextAlignment;
    SIZE m_sizeVExtent, m_sizeHExtent;
};


#endif // !_LCDTEXT_H_INCLUDED_ 

//** end of LCDText.h ****************************************************