📄 计算器dlg.h
字号:
// 计算器Dlg.h : 头文件
//
#pragma once
#include "Stack.h"
#include "afxwin.h"
// CMyDlg 对话框
class CMyDlg : public CDialog
{
// 构造
public:
CMyDlg(CWnd* pParent = NULL); // 标准构造函数
// 对话框数据
enum { IDD = IDD_MY_DIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
// 实现
protected:
HICON m_hIcon;
// 生成的消息映射函数
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
public:
CString display;
afx_msg void OnBnClickedButton0();
afx_msg void OnBnClickedButton1();
afx_msg void OnBnClickedButton2();
afx_msg void OnBnClickedButton3();
afx_msg void OnBnClickedButton4();
afx_msg void OnBnClickedButton5();
afx_msg void OnBnClickedButton6();
afx_msg void OnBnClickedButton7();
afx_msg void OnBnClickedButton8();
afx_msg void OnBnClickedButton9();
afx_msg void OnBnClickedButtonplusMinus();
bool m;
afx_msg void OnBnClickedButtondot();
afx_msg void OnBnClickedButtonplus();
afx_msg void OnBnClickedButtonminus();
afx_msg void OnBnClickedButtonmul();
afx_msg void OnBnClickedButtondiv();
afx_msg void OnBnClickedButtonleft();
afx_msg void OnBnClickedButtonright();
//表示小数的倍率
double n;
// 表示小数点后几位
int dot;
double amount;
Stack<char> stack1;
Stack<double> stack2;
afx_msg void OnBnClickedButtonenter();
char symbol;
double operate1;
double operate2;
double answer;
double operate;
afx_msg void OnBnClickedButtonce();
HACCEL m_hAccel;
virtual BOOL PreTranslateMessage(MSG* pMsg);
bool haveparent;
afx_msg void OnBnClickedButtonex();
afx_msg void OnBnClickedButtonsqrt();
afx_msg void OnBnClickedButtonx2();
afx_msg void OnBnClickedButtonn();
afx_msg void OnBnClickedButtonln();
afx_msg void OnBnClickedButtonlg();
afx_msg void OnBnClickedButtoncot();
afx_msg void OnBnClickedButtontan();
afx_msg void OnBnClickedButtoncos();
afx_msg void OnBnClickedButtonsin();
afx_msg void OnBnClickedButtonarcsin();
afx_msg void OnBnClickedButtonarccos();
afx_msg void OnBnClickedButtonarctan();
afx_msg void OnBnClickedButtonarccot();
afx_msg void OnBnClickedButtonpi();
afx_msg void OnBnClickedButtonbackspace();
int lastnumber; //最后输入的一个数字
CButton m_ButtonSQRT;
CButton m_ButtonX2;
CButton m_ButtonEX;
CButton m_ButtonPI;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -