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

📄 calcobj.h

📁 计算器程序
💻 H
字号:
//****************************************************************
//This software may not be distributed further without permission from
// Sun Xueshi's Group
//      
//This software is distributed WITHOUT ANY WARRANTY. No claims are made
// as to its functionality or purpose.
// 
//Authors: 孙学诗
// Date: 12/4/03
// 
//****************************************************************

#ifndef CALCOBJ_H
#define CALCOBJ_H

#include <vector>
#include "button.h"
#include "evaluate.h"

using namespace std;

const Position InitialPosition(0.23, 1.43);         //Initialize a position as a parameter
const int BtnVectorLength = 27;                        //Number of different buttons

class CalcObj {
	public:
		//Constructor for CalcObj
		//SimpleWindow W1 is the Calc Window and W2 is the About Window
		CalcObj(SimpleWindow &W1, SimpleWindow &W2);  
		~CalcObj() {}
		void Initialize();                                                    //Initialize the calculator object
		int MouseClick(const Position &MousePosn);     //MouseClick event
		void JumpUpTimer();       //automate the button status from down to up within an interval
	private:
		int Find(const Position &MousePosn) const;     //Find the selected Button object
		void InsertButton();                                          //Insert 27 buttons
		void Display();                                                   //Display expression and result on screen
		void Reset();                                                     //Reset all parameters to default
		void Erase();                                                      //Erase contents that are displaying
		void About();                                                      //Show information of authors
		void Backspace();                                             //Erase a character if input has mistake
	        SimpleWindow &W, &AboutWin;                        //Calc Window and About Window
		vector<Button> Btn;                                           //Button vector
		Button CurrentButton;                                       //Current Button object
		BitMap Calc;                                                       //Calculator bitmap
		BitMap AboutBmp;                                              //About bitmap
                Evaluate Evaluate;                                             //Define a Evaluate object
		FILE *Stream;                                                    //Define a virtual stream
		char ValueText[30];                                           //char Array contains input text
		int index;                                                            //count characters has been input
		int Bracket;                                                        //count brackets has been input
		string Result;	                                                   //Result text	
};
#endif
		
		
	        
	        
		
	




⌨️ 快捷键说明

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