www.pudn.com > PressMonitor_q.zip > 3DSliderCtrl.h
#if !defined(AFX_3DSLIDERCTRL_H__30FB6305_9546_497F_9BF8_8EA6B4495F54__INCLUDED_)
#define AFX_3DSLIDERCTRL_H__30FB6305_9546_497F_9BF8_8EA6B4495F54__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// 3DSliderCtrl.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// C3DSliderCtrl window
class C3DSliderCtrl : public CStatic
{
// Construction
public:
C3DSliderCtrl();
// Attributes
public:
bool m_bGridBelow;
int m_nScaleStep;
float m_MiniValue;
float m_MaxiValue;
float m_CurrentValue;
int m_nFrameWidth;
//fontHeight Value
int m_nScaleHeight;
int m_nUnitHeight;
int m_nNameHeight;
int m_nValueHeight;
CString m_strUnit;
CString m_strName;
protected:
// CDC and images
CDC m_dcBackground ;
CBitmap *m_pBitmapOldBackground ;
CBitmap m_bitmapBackground ;
// bar rect setting
CRect m_rectCtrl ;
CRect m_rectPane ;
CRect m_rectSlide ;
CRect m_rectPaneLeft ;
CRect m_rectPaneRight ;
CRect m_rectPaneTop ;
CRect m_rectPaneBottom ;
CRect m_rectValue;
// barchart colours
COLORREF m_crFrame;
COLORREF m_crSlider;
COLORREF m_crSliderBack;
COLORREF m_crPane;
COLORREF m_crScale;
COLORREF m_crValue;
COLORREF m_crValueBack;
COLORREF m_crName;
COLORREF m_crRulerScale;
COLORREF m_crProgress;
//system colours
COLORREF m_crWindowText;
COLORREF m_crWindow;
COLORREF m_cr3DFace;
COLORREF m_crShadow;
COLORREF m_crHighlight;
COLORREF m_crDkShadow;
COLORREF m_crLight;
// Operations
public:
//unit operations
void SetUnit(CString strUnit){ m_strUnit=strUnit;}
CString GetUnit(){return m_strUnit;}
void SetName(CString strName);
CString GetName();
void SetValue(float nValue);
float GetValue();
//curves operations
public:
//functions to get value of curves;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(C3DSliderCtrl)
//}}AFX_VIRTUAL
// Implementation
public:
void PaintRect(CDC* pDC,CRect& rect,COLORREF clr);
void RefreshWindow() { Invalidate(); }
BOOL SetScaleFromToValue(float from, float to, int ValueStep = 4);
BOOL Initialize();
BOOL ReCalculating();
void ReconstructControl();
//draw implementation
void DrawGradient(CDC *pDC, const CRect &rect, const int &nMaxWidth,COLORREF crStart,COLORREF crEnd,BOOL ascend = true);
void DrawProgress(CDC *pDC);
void DrawSlider(CDC *pDC);
void DrawValueBack(CDC *pDC);
void DrawValue(CDC *pDC);
void DrawScale(CDC *pDC);
void DrawRuler(CDC *pDC);
void DrawPane(CDC *pDC);
void DrawFrame(CDC *pDC);
virtual ~C3DSliderCtrl();
// Generated message map functions
protected:
//{{AFX_MSG(C3DSliderCtrl)
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnPaint();
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_3DSLIDERCTRL_H__30FB6305_9546_497F_9BF8_8EA6B4495F54__INCLUDED_)