📄 calculatordlg.h
字号:
// CalculatorDlg.h : header file
//
#if !defined(AFX_CALCULATORDLG_H__7C29CD37_C43E_40A8_92D7_60438FF8EB70__INCLUDED_)
#define AFX_CALCULATORDLG_H__7C29CD37_C43E_40A8_92D7_60438FF8EB70__INCLUDED_
#define YUANZHOU 3.14
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CCalculatorDlg dialog
#include "AdvButton.h"
#include "AdvEdit.h"
class CCalculatorDlg : public CDialog
{
// Construction
public:
CCalculatorDlg(CWnd* pParent = NULL); // standard constructor
void TZero(char *pStr,int iLen);//用于去掉字符串尾部多余的零
void Result();//用来处理按下符号键时的函数,是计算的核心函数
float convertToH(float w);
// CAdvButton m_AdvButton17;
CMenu * m_Menu;
BOOL m_IsExtend;
// Dialog Data
//{{AFX_DATA(CCalculatorDlg)
enum { IDD = IDD_CALCULATOR_DIALOG };
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;
CAdvButton m_AdvButtonPoint;
CAdvButton m_AdvButtonEqu;
CAdvButton m_AdvButtonAdd;
CAdvButton m_AdvButtonSub;
CAdvButton m_AdvButtonMul;
CAdvButton m_AdvButtonDiv;
CAdvButton m_AdvButtonClear;
CAdvButton m_AdvButtonSqrt;
CAdvButton m_AdvButtonReverse;
CAdvButton m_AdvButtonSin;
CAdvButton m_AdvButtonCos;
CAdvButton m_AdvButtonTan;
CAdvButton m_AdvButtonSqu;
CAdvButton m_AdvButtonCub;
CAdvButton m_AdvButtonPow;
CAdvButton m_AdvButtonExp;
CAdvButton m_AdvButtonLn;
CAdvButton m_AdvButtonLog;
CAdvButton m_AdvButtonZof;
CAdvButton m_AdvButtonN;
CAdvButton m_AdvButton10X;
CAdvButton m_AdvButtonAbout;
CButton m_DspStatic;
CAdvEdit m_DspEdit; //显示计算结果的编辑器
CAdvButton m_AdvButtonOff;
// NOTE: the ClassWizard will add data members here
//}}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)
virtual BOOL OnInitDialog();
virtual void OnOK();//虚函数 ,覆盖用来屏蔽Enter操作
virtual void OnCancel();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void On0();
afx_msg void On1();
afx_msg void On10();
afx_msg void On11();
afx_msg void On12();
afx_msg void On13();
afx_msg void On14();
afx_msg void On15();
afx_msg void On16();
afx_msg void On17();
afx_msg void On18();
afx_msg void On19();
afx_msg void On2();
afx_msg void On20();
afx_msg void On21();
afx_msg void On22();
afx_msg void On23();
afx_msg void On24();
afx_msg void On25();
afx_msg void On26();
afx_msg void On27();
afx_msg void On3();
afx_msg void On4();
afx_msg void On5();
afx_msg void On6();
afx_msg void On7();
afx_msg void On8();
afx_msg void On9();
afx_msg HBRUSH OnCtlColor(CDC* pDC,CWnd* pWnd,UINT nCtlColor);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);//响应消息WM_ON_CREATE
afx_msg void OnExtend();
afx_msg void OnZOF();
afx_msg void OnN();
afx_msg void On10X();
afx_msg void OnABOUT();
afx_msg void OnHex();
afx_msg void OnOct();
afx_msg void OnRad();
afx_msg void OnDec();
afx_msg void OnBin();
afx_msg void OnDegree();
afx_msg void OnTidu();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CString m_StrBegin;//记录初始操作数,字符串
char m_buffer[100];//记录结果操作数,字符串
double m_begin;//记录初始操作数,浮点
double m_end;//记录结果操作数,浮点
int m_bit;//记录运算符
int m_IsCheckPoint;//标识是否按下了小数点符号
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CALCULATORDLG_H__7C29CD37_C43E_40A8_92D7_60438FF8EB70__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -