📄 calculate2dlg.h
字号:
// calculate2Dlg.h : header file
//
#if !defined(AFX_CALCULATE2DLG_H__365B406F_9EA1_494B_A07C_E551C14BA78C__INCLUDED_)
#define AFX_CALCULATE2DLG_H__365B406F_9EA1_494B_A07C_E551C14BA78C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CCalculate2Dlg dialog
class CCalculate2Dlg : public CDialog
{
// Construction
typedef struct
{
char *base;
char *top;
int stacksize;
}SqStackChar;
typedef struct
{
float *base;
float *top;
int stacksize;
}SqStackData;
public:
CCalculate2Dlg(CWnd* pParent = NULL); // standard constructor
CString m_show;
void ReadOpr(char Opr[8][8]); //设置优先规则
void InitStackChar(SqStackChar *s); //初始化数栈
void InitStackData(SqStackData *s); //初始化字符栈
void PopChar(SqStackChar *s,char *e);
void PopData(SqStackData *s,float *e);
void PushChar(SqStackChar *s,char n);
void PushData(SqStackData *s,float n);
char GetTopChar(SqStackChar *s);
float GetTopData(SqStackData *s);
float Operate(float a,char theta,float b); //计算
char Precede(char a,char b,char Opr[8][8],char cha[7]); //比较优先规则
int In(char c,char cha[7]); //判断字符
// Dialog Data
//{{AFX_DATA(CCalculate2Dlg)
enum { IDD = IDD_CALCULATE2_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCalculate2Dlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CCalculate2Dlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
virtual void OnOK();
afx_msg void OnButton7();
afx_msg void OnButton8();
afx_msg void OnButton9();
afx_msg void OnButton1add();
afx_msg void OnButton4();
afx_msg void OnButton5();
afx_msg void OnButton6();
afx_msg void OnButton1plus();
afx_msg void OnButton1();
afx_msg void OnButton2();
afx_msg void OnButton3();
afx_msg void OnButton1multiply();
afx_msg void OnButton0();
afx_msg void OnButtondot();
afx_msg void OnButtondiv();
afx_msg void OnButtonleft();
afx_msg void OnButtonright();
virtual void OnCancel();
afx_msg void OnOkCE2();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CALCULATE2DLG_H__365B406F_9EA1_494B_A07C_E551C14BA78C__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -