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

📄 kxdlg.h

📁 这是书上的代码
💻 H
字号:
//written by  熊英


#if !defined(AFX_KXDLG_H__AC569E81_6CD5_11D6_B9FC_444553540000__INCLUDED_)
#define AFX_KXDLG_H__AC569E81_6CD5_11D6_B9FC_444553540000__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// KXdlg.h : header file
//

#include "XYCALCDlg.h"
#include "colorbtn.h"
/////////////////////////////////////////////////////////////////////////////
// CKXdlg dialog
//enum Operator { OpNone, OpAdd, OpSubtract, OpMultiply, OpDivide,OpSqrt,OpPercent,OpMadd};
//enum CalcError { ErrNone, ErrDivideByZero };
#include "math.h"
#define  pi  3.141592655358979323846264
#include "tempzhan1.h"

#include <stdlib.h>
#include <string.h>

//科学型对话框
class CKXdlg : public CDialog
{
// Construction
private:
	void computer(Operator opp);
	void enterp(Operator opp);
	int gettwo(double& op1,double& op2);
	void enters(double num);
	Stack<double> s;
	Stack<Operator> p;
public:
	void clearp(void);
	void clears(void);
	void run(void);

	
	void colorbutton();
    double m_operand;
	double m_accum;
    void enablecount(bool state);
	int flagjz;
	void strtonum(int m,int n);
	void input(int l,int lm);
	void disp2();
	void turnword();
	void disp16();
	void ClickNumberAF(int n);
	void pushfh();
	Operator opersign[20];
	double opernum[20];
	void enablefunc(bool state);
	void enable10(bool state);
	void enable2(bool state);
	void enable8(bool state);
	void settext();
	void clicknumber(int lm);
	void setoperand(double value);
	void enable16(bool state);
	int m_bitnum;
	void updisp();
	void disp8();
	void onclearkx();
	CKXdlg(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CKXdlg)
	enum { IDD = IDD_KXDIALOG };
	int		m_jinzhi;
	int		m_dushu;
	BOOL	m_inv;
	BOOL	m_hyp;
	CString	m_str;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CKXdlg)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	int left;
	double kxmemory;
		HACCEL m_hAccel;
	int number;
	int signum;
	bool m_operavail;
	bool fe;
	int bitnum;
	CalcError m_errorState;
	double memoryvalue;
	int point;
	Operator m_operator;


	CColorButton m_btn1;
	CColorButton m_btn2;
	CColorButton m_btn3;
	CColorButton m_btn4;
	CColorButton m_btn5;
	CColorButton m_btn6;

	CColorButton m_d1;
	CColorButton m_d2;
	CColorButton m_d3;
	CColorButton m_d4;
	
	CColorButton m_C1;
	CColorButton m_C2;
	CColorButton m_C3;

	
	CColorButton m_t5;
	CColorButton m_t6;
	CColorButton m_t7;
	CColorButton m_t8;

	CColorButton m_b1;
	CColorButton m_b2;
	CColorButton m_b3;
	CColorButton m_b4;
	CColorButton m_b5;
	CColorButton m_b6;
	CColorButton m_b7;
	CColorButton m_b8;
	CColorButton m_b9;
	CColorButton m_b10;
	CColorButton m_b11;
	CColorButton m_b12;
	CColorButton m_b13;
	CColorButton m_b14;
	CColorButton m_b15;

	CColorButton m_1;
	CColorButton m_2;
	CColorButton m_3;
	CColorButton m_4;
	CColorButton m_5;
	CColorButton m_6;
	CColorButton m_7;
	CColorButton m_8;
	CColorButton m_9;
	CColorButton m_10;
	CColorButton m_11;
	CColorButton m_12;
	CColorButton m_13;
	CColorButton m_14;
	CColorButton m_15;
	CColorButton m_16;
	CColorButton m_17;
	CColorButton m_18;

	CColorButton m_m1;
	CColorButton m_m2;
	CColorButton m_m3;
	CColorButton m_m4;
	CColorButton m_m5;
	CColorButton m_m6;
	CColorButton m_m7;
	CColorButton m_m8;
	// Generated message map functions
	//{{AFX_MSG(CKXdlg)
	afx_msg void OnMenuitem32777();
	virtual BOOL OnInitDialog();
	afx_msg void OnButtondivid();
	afx_msg void OnButtontime();
	afx_msg void OnButtonsub();
	afx_msg void OnButtonadd();
	afx_msg void OnMod();
	afx_msg void OnOr();
	afx_msg void OnLsh();
	afx_msg void OnEqual();
	afx_msg void OnAnd();
	afx_msg void OnXor();
	afx_msg void OnNot();
	afx_msg void OnInt();
	afx_msg void OnRadio1();
	afx_msg void OnRadio2();
	afx_msg void OnRadio3();
	afx_msg void OnRadio4();
	afx_msg void OnButtonpoint();
	virtual void OnCancel();
	afx_msg void OnDestroy();
	virtual void OnOK();
	afx_msg void OnCC();
	afx_msg void OnSin();
	afx_msg void OnRadio6();
	afx_msg void OnRadio5();
	afx_msg void OnRadio7();
	afx_msg void OnCos();
	afx_msg void OnTan();
	afx_msg void OnIn();
	afx_msg void OnLog();
	afx_msg void OnFactor();
	afx_msg void OnDaoshux();
	afx_msg void Onzhengfu();
	afx_msg void OnFe();
	afx_msg void OnExp();
	afx_msg void OnX3();
	afx_msg void OnX2();
	afx_msg void OnXy();
	afx_msg void OnPi();
	afx_msg void OnDms();
	afx_msg void OnMc1();
	afx_msg void OnMr1();
	afx_msg void OnMs1();
	afx_msg void OnMadd1();
	afx_msg void OnBaspace();
	afx_msg void OnCheck1();
	afx_msg void OnCheck2();
	afx_msg void OnLeft();
	afx_msg void OnRight();
	afx_msg void OnMENUcopy();
	afx_msg void OnMENUpaste();
		afx_msg void OnClickedNumber(UINT nID);
	afx_msg void OnClickedNumberAF(UINT nID);
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnSta();
	afx_msg void OnDat();
	afx_msg void OnSum();
	afx_msg void OnAve();
	afx_msg void OnS();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_KXDLG_H__AC569E81_6CD5_11D6_B9FC_444553540000__INCLUDED_)

⌨️ 快捷键说明

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