numpaddlg.h

来自「基于WINDOWS mobile 的用于创建一个窗体和自定义试图的工程」· C头文件 代码 · 共 114 行

H
114
字号
#if !defined(AFX_NUMPADDLG_H__880A457E_E0DD_4F62_8093_533309ACC352__INCLUDED_)
#define AFX_NUMPADDLG_H__880A457E_E0DD_4F62_8093_533309ACC352__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// NumPadDlg.h : header file
//


#include "NumericFormat.h"
#include "DialogTemplate.h"
#include "SubWndContainer.h"
#include "SubStatic.h"


//---------------------------------------------------------------------------
//
//	CNumPadDlg dialog
//
//---------------------------------------------------------------------------


class CNumPadDlg : public CDialog
{
	enum Operation
	{
		opNone,
		opAdd,
		opSub,
		opMul,
		opDiv
	};

// Construction
public:

	CNumPadDlg(ENumberFormat format, CWnd* pParent = NULL);   // standard constructor

	void SetCaption(LPCTSTR pszCaption) {m_strCaption = pszCaption;}

	void SetIntValue(int nVal) {m_dblVal = nVal;}
	void SetDblValue(double dblVal) {m_dblVal = dblVal;}
	void SetCurValue(CURRENCY cyVal);

	int GetIntValue() {return (int)m_dblVal;}
	double GetDblValue() {return m_dblVal;}
	CURRENCY GetCurValue();


// Dialog Data
	//{{AFX_DATA(CNumPadDlg)
//	enum { IDD = IDD_NUMPAD };
//	CStatic	m_sttDisplay;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CNumPadDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	ENumberFormat 		m_format;
	CFont				m_fontDisplay,
						m_fontKeypad;
	double				m_dblVal,
						m_dblOpr,
						m_dblDec;
	Operation			m_op;
	bool				m_bError,
						m_bDec,
						m_bNew;
	TCHAR				m_szDec[8],
						m_szSep[8];
	CDialogTemplate		m_templ;
	CSubWndContainer	m_wndCont;
	CSubStatic*			m_pDisplay;
	CString				m_strCaption;

	void UpdateDisplay();

	// Generated message map functions
	//{{AFX_MSG(CNumPadDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnAc();
	afx_msg void OnChs();
	afx_msg void OnAdd();
	afx_msg void OnSub();
	afx_msg void OnMul();
	afx_msg void OnDiv();
	afx_msg void OnEqual();
	afx_msg void OnDec();
	afx_msg void OnC();
	//}}AFX_MSG
	
	afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); 
	afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);

	afx_msg void OnNumericKey(UINT nID);

	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_NUMPADDLG_H__880A457E_E0DD_4F62_8093_533309ACC352__INCLUDED_)

⌨️ 快捷键说明

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