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

📄 calculatordlg.h

📁 一个用VC++编写的计算器。 使用高级按钮界面友好。
💻 H
字号:
// CalculatorDlg.h : header file
//

#if !defined(AFX_CALCULATORDLG_H__D6CC11BE_1140_4A4E_8EF0_FB8495613523__INCLUDED_)
#define AFX_CALCULATORDLG_H__D6CC11BE_1140_4A4E_8EF0_FB8495613523__INCLUDED_

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

#include "AdvButton.h"
#include "AdvEdit.h"

/////////////////////////////////////////////////////////////////////////////
// CCalculatorDlg dialog

class CCalculatorDlg : public CDialog
{
// Construction
public:
	void TrimZero(char *pStr,int iLen);//用于去掉字符串尾部多余的零
	void Result();//用来处理按下符号键时的函数,是计算的核心函数
//	CAdvButton m_AdvButton17;
	CCalculatorDlg(CWnd* pParent = NULL);	// standard constructor

	CMenu * m_Menu;
	BOOL    m_IsExtend;
// Dialog Data
	//{{AFX_DATA(CCalculatorDlg)
	enum { IDD = IDD_CALCULATOR_DIALOG };
	CAdvButton	m_AdvButtonLog;
	CAdvButton	m_AdvButtonLn;
	CAdvButton	m_AdvButtonExp;
	CAdvButton	m_AdvButtonPow;
	CAdvButton	m_AdvButtonCub;
	CAdvButton	m_AdvButtonSqu;
	CAdvButton	m_AdvButtonTan;
	CAdvButton	m_AdvButtonCos;
	CAdvButton	m_AdvButtonSin;
	CAdvButton	m_AdvButtonReverse;
	CAdvButton	m_AdvButtonSqrt;
	CAdvButton	m_AdvButtonClear;
	CAdvButton	m_AdvButtonDiv;
	CAdvButton	m_AdvButtonMul;
	CAdvButton	m_AdvButtonSub;
	CAdvButton	m_AdvButtonAdd;
	CAdvButton	m_AdvButtonEqu;
	CAdvButton	m_AdvButtonPoint;
	CButton	m_DspStatic;
	CAdvEdit	m_DspEdit;
	CAdvButton	m_AdvButton0;
	CAdvButton  m_AdvButton1;
	CAdvButton  m_AdvButton2;
	CAdvButton  m_AdvButton3;
	CAdvButton	m_AdvButton4;
	CAdvButton  m_AdvButton5;
	CAdvButton  m_AdvButton6;
	CAdvButton  m_AdvButton7;
	CAdvButton	m_AdvButton8;
	CAdvButton  m_AdvButton9;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CCalculatorDlg)
	afx_msg void OnExtend();
	afx_msg void AdvButton0();
	afx_msg void AdvButton1();
	afx_msg void AdvButton2();
	afx_msg void AdvButton3();
	afx_msg void AdvButton4();
	afx_msg void AdvButton5();
	afx_msg void AdvButton6();
	afx_msg void AdvButton7();
	afx_msg void AdvButton8();
	afx_msg void AdvButton9();
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	virtual void OnOK();
	virtual void OnCancel();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void AdvButtonPoint();
	afx_msg void AdvButtonEqu();
	afx_msg void AdvButtonAdd();
	afx_msg void AdvButtonSub();
	afx_msg void AdvButtonMul();
	afx_msg void AdvButtonDiv();
	afx_msg void AdvButtonClear();
	afx_msg void AdvButtonSqrt();
	afx_msg void AdvButtonReverse();
	afx_msg void AdvButtonSin();
	afx_msg void AdvButtonPow();
	afx_msg void AdvButtonSqu();
	afx_msg void AdvButtonCub();
	afx_msg void AdvButtonExp();
	afx_msg void AdvButtonLn();
	afx_msg void AdvButtonLog();
	afx_msg void AdvButtonCos();
	afx_msg void AdvButtonTan();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	char m_buffer[100];//用来存贮需要显示的数字
	CString m_StrBegin;//记录初始操作数的字符串
	double m_end;//记录结果操作数
	double m_begin;//记录初始操作数
	int m_bit;//记录运算符
	int m_IsCheckPoint;//判断是否按下了小数点符号,当其为0时,表示没有按下
};

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

#endif // !defined(AFX_CALCULATORDLG_H__D6CC11BE_1140_4A4E_8EF0_FB8495613523__INCLUDED_)

⌨️ 快捷键说明

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