Subversion Repositories spk

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
79 cycrow 1
//************************************************************************
2
//
3
// LCDProgressBar.h
4
//
5
// The CLCDProgressBar class draws a progress bar onto the LCD.
6
// 
7
// Logitech LCD SDK
8
//
9
// Copyright 2005 Logitech Inc.
10
//************************************************************************
11
 
12
#ifndef _LCDPROGRESSBAR_H_INCLUDED_ 
13
#define _LCDPROGRESSBAR_H_INCLUDED_ 
14
 
15
#include "LCDBase.h"
16
 
17
typedef struct RANGE
18
{
19
    int nMin;
20
    int nMax;
21
 
22
}RANGE, *LPRANGE;
23
 
24
enum ePROGRESS_STYLE { STYLE_FILLED, STYLE_CURSOR, STYLE_DASHED_CURSOR };
25
 
26
class CLCDProgressBar : public CLCDBase
27
{
28
public:
29
	enum ePROGRESS_STYLE { STYLE_FILLED, STYLE_CURSOR, STYLE_DASHED_CURSOR };
30
 
31
    CLCDProgressBar();
32
    virtual ~CLCDProgressBar();
33
 
34
    // CLCDBase
35
    virtual HRESULT Initialize(void);
36
    virtual void OnDraw(CLCDGfx &rGfx);
37
    virtual void ResetUpdate(void);
38
 
39
    // CLCDProgressBar
40
    virtual void SetRange(int nMin, int nMax);
41
    virtual void SetRange(RANGE& Range);
42
    virtual RANGE& GetRange(void);
43
    virtual float SetPos(float fPos);
44
    virtual float GetPos(void);
45
    virtual void EnableCursor(BOOL bEnable);
46
	virtual void SetProgressStyle(ePROGRESS_STYLE eStyle);
47
 
48
protected:
49
    float Scalef(float fFromMin, float fFromMax,
50
                 float fToMin, float fToMax, float fFromValue);
51
    int Scale(int nFromMin, int nFromMax,
52
              int nToMin, int nToMax, int nFromValue);
53
 
54
private:
55
    RANGE m_Range;
56
    float m_fPos;
57
    ePROGRESS_STYLE m_eStyle;
58
    HBRUSH m_hBrush;
59
	HPEN m_hPen;
60
    int m_nCursorWidth;
61
};
62
 
63
 
64
#endif // !_LCDPROGRESSBAR_H_INCLUDED_ 
65
 
66
//** end of LCDProgressBar.h *********************************************