⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 textprogressctrl.h

📁 VisualC高级编程技术精粹.rar
💻 H
字号:
// TextProgressCtrl.h : header file
//
#if !defined(AFX_TEXTPROGRESSCTRL_H__4C78DBBE_EFB6_11D1_AB14_203E25000000__INCLUDED_)
#define AFX_TEXTPROGRESSCTRL_H__4C78DBBE_EFB6_11D1_AB14_203E25000000__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

/////////////////////////////////////////////////////////////////////////////
// To set the text colour:
//     call SetTextColour(COLORREF crTextClr)
//     or   SendMessage (m_hwnd, PBM_SETTXTCOLOR, 0, (LPARAM)crTextClr)
#define PBM_SETTEXTCOLOR WM_USER + 100

// To show or hide text:
//     call SetShowText(BOOL bShow)
//     or   SendMessage(m_hWnd, PBM_SETSHOWTEXT, (WPARAM)bShow, 0)
#define PBM_SETSHOWTEXT WM_USER + 101

/////////////////////////////////////////////////////////////////////////////
// CTextProgressCtrl window

class CTextProgressCtrl : public CProgressCtrl
{
// Construction
public:
	CTextProgressCtrl();

// Attributes
public:

// Operations
public:
    void SetShowText(BOOL bShow);

    COLORREF SetBarColour(COLORREF crBarClr = CLR_DEFAULT);
    COLORREF GetBarColour() const;
    COLORREF SetBgColour(COLORREF crBgClr = CLR_DEFAULT);
    COLORREF GetBgColour() const;
	COLORREF SetTextColour(COLORREF crTextClr = CLR_DEFAULT);
	COLORREF GetTextColour();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTextProgressCtrl)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CTextProgressCtrl();

	// Generated message map functions
protected:
	COLORREF m_crTextClr;
	COLORREF m_crBarClr,
             m_crBgClr;

    int      m_nPos, 
             m_nStepSize, 
             m_nMax, 
             m_nMin;
	int      m_nBarWidth;

    CString  m_strText;
    BOOL     m_bShowText;

	//{{AFX_MSG(CTextProgressCtrl)
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnPaint();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	//}}AFX_MSG
    afx_msg LRESULT   OnSetText(UINT, LPCTSTR szText);
    afx_msg LRESULT   OnGetText(UINT cchTextMax, LPTSTR szText);
    afx_msg LRESULT   OnGetPos(WPARAM, LPARAM);
    afx_msg LRESULT   OnSetPos(WPARAM newPos, LPARAM);
    afx_msg LRESULT   OnStepIt(WPARAM, LPARAM);
    afx_msg LRESULT   OnGetRange(WPARAM Type, LPARAM PBRange);
    afx_msg LRESULT   OnOffsetPos(WPARAM Incr, LPARAM);
    afx_msg LRESULT   OnSetStep(WPARAM size, LPARAM);
    afx_msg LRESULT   OnSetBarColor(WPARAM, LPARAM Colour);
    afx_msg LRESULT   OnSetBkColor(WPARAM, LPARAM Colour);
    afx_msg LRESULT   OnSetTextColor(WPARAM, LPARAM Colour);

	afx_msg void      OnSetRange(WPARAM, LPARAM range);
    afx_msg void      OnSetRange32(WPARAM lower, LPARAM higher);
    afx_msg void      OnSetShowText(WPARAM bShow, LPARAM);

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TEXTPROGRESSCTRL_H__4C78DBBE_EFB6_11D1_AB14_203E25000000__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -