📄 计算器dlg.h
字号:
// 计算器Dlg.h : header file
//
#if !defined(AFX_DLG_H__673D46A6_6833_4CDE_BE5B_2C45A9809CB4__INCLUDED_)
#define AFX_DLG_H__673D46A6_6833_4CDE_BE5B_2C45A9809CB4__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include<math.h>
/////////////////////////////////////////////////////////////////////////////
// CMyDlg dialog
class CMyDlg : public CDialog
{
// Construction
public:
BYTE m_cLast; //表示刚刚输入的数字或操作符
BYTE m_cLastOpr; //表示上次输入的操作符
int m_nFraction; //小数点后的数字位数,-1表示无小数点
int m_nDigitLen; //所输入数的位数
double m_dNumber; //正在输入的浮点数
int m_nSign; //正负号
double m_dOperands[3]; //操作数数组
BYTE m_cOprs[3]; //操作符数组
int m_nOprldx; //操作符数组索引
CMyDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CMyDlg)
enum { IDD = IDD_MY_DIALOG };
CString m_result;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMyDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
void Calculate();
int Operate(double& d1,double d2,BYTE opr);
int Priority(BYTE opr);
void DealDigit(int n);
void DealOpr(BYTE opr);
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CMyDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void On7();
afx_msg void On8();
afx_msg void On9();
afx_msg void Ondiv();
afx_msg void On4();
afx_msg void On5();
afx_msg void On6();
afx_msg void Onmul();
afx_msg void On1();
afx_msg void On2();
afx_msg void On3();
afx_msg void Onsub();
afx_msg void On0();
afx_msg void Onzf();
afx_msg void Onpoint();
afx_msg void Onadd();
afx_msg void Onequal();
afx_msg void OnBackspace();
afx_msg void OnCE();
afx_msg void Onsqrt();
afx_msg void Onsquare();
afx_msg void Oncb();
afx_msg void Onpi();
afx_msg void Onsin();
afx_msg void Oncos();
afx_msg void Ontan();
afx_msg void Onln();
afx_msg void Onlog();
afx_msg void Onexp();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLG_H__673D46A6_6833_4CDE_BE5B_2C45A9809CB4__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -