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

📄 calusurface.cpp

📁 将中缀表达式转换为后缀表达式
💻 CPP
字号:
//======== Copyright(C) ?????????????? All rights reserved! ======
// Copyright contents herein, currently it is not defined!!
// 
// Purpose: Calu surface or the GUI!
//
// $Date:		$
// $Nokeywords:	$
//----------------------------------------------------------------
// Log:
//----------------------------------------------------------------
// Programmer: wuwenxi
//================================================================

#include "wx/wx.h"

// Vendor info
#define APP_VENDOR wxT("1.0.0.0")
#define ID_ABOUT	1
#define ID_EXIT		2

// Application Class
class CCaluApp : public wxApp
{
public:
	virtual bool OnInit( void );
	virtual int  OnExit( void );
};

IMPLEMENT_APP(CCaluApp)

// Frame Class
class CCaluFrame : public wxFrame
{
public:
	// Consturcot, Destructor
	CCaluFrame( const wxString& sTitle );
	~CCaluFrame( void );
	
private:
	void InitMenu( void );
	void InitText( void );
	void InitButton( void );
	bool CheckValid( void );
	
private:
	// Members are...
	
	// Menu
	wxMenu * 	m_pItem;
	wxMenuBar * m_pMenuBar;
	// Number button
	wxButton *  m_p0;
	wxButton *  m_p1;
	wxButton *  m_p2;
	wxButton *  m_p3;
	wxButton *  m_p4;
	wxButton *  m_p5;
	wxButton *  m_p6;
	wxButton *  m_p7;
	wxButton *  m_p8;
	wxButton *  m_p9;
	// Left & Right ( )
	wxButton *  m_pLeft;
	wxButton *  m_pRight;
	// Back
	wxButton *  m_pBack;
	// Clear
	wxButton *  m_pClear;
	// Negative
	wxButton *  m_pNeg;
	// DOT
	wxButton *  m_pDot;
	// Opeator button
	wxButton *  m_pAdd;
	wxButton *  m_pSub;
	wxButton *  m_pMul;
	wxButton *  m_pDiv;
	// Arthmatic button
	wxButton *  m_pSqrt;
	wxButton *  m_pPercent;
	wxButton *  m_pCountDown;
	// Equal 
	wxButton *  m_pEqual;
	// Text Display
	wxTextCtrl * m_pText;
	
private:
	// Not allowed
	CCaluFrame( const CCaluFrame& );
	CCaluFrame& operator=( const CCaluFrame& );
};

//
// Define
//
//-------------------------------------
// Constructor
//-------------------------------------
CCaluFrame::CCaluFrame( const wxString & sTitle )
: wxFrame( NULL, wxID_ANY, sTitle )
{
	this->SetPosition( wxPoint( 100, 100 ) );
	this->SetSize( wxSize( 250, 250 ) );
	this->Show( true );
	
	InitMenu( );
}

//-------------------------------------
// Destructor
//-------------------------------------
CCaluFrame::~CCaluFrame( void )
{
	
}

//-------------------------------------
// InitMenu
//-------------------------------------
void CCaluFrame::InitMenu( void )
{
	m_pItem = new wxMenu;
	m_pItem->Append( ID_ABOUT, wxT("A&bout...\tF1") );
	m_pItem->Append( ID_EXIT, wxT("E&xit...\tF9") );
	m_pMenuBar = new wxMenuBar;
	m_pMenuBar->Append( m_pItem, wxT( "&Items" ) );
	this->SetMenuBar( m_pMenuBar );
}

// Entry point
bool CCaluApp::OnInit( void )
{
	this->SetVendorName( wxString( APP_VENDOR ) );
	CCaluFrame *pFrame = new CCaluFrame( wxT("Calculator") );
	
	return true;
}


int CCaluApp::OnExit( void )
{
	return 0;
}

⌨️ 快捷键说明

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