Click here to Skip to main content
15,881,248 members
Articles / Desktop Programming / ATL

Visual Calc v3.0 - A new dimension for the desktop calculator

Rate me:
Please Sign up or sign in to vote.
3.62/5 (113 votes)
28 Apr 2006CPOL22 min read 348.6K   6.8K   104  
How to start programming a parser.
// FunctionsPage.cpp : implementation file
//

#include "stdafx.h"
#include "VisualCalc.h"
#include "FunctionsPage.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


IMPLEMENT_DYNCREATE(CFunctionsPage, CPropertyPage)


// Default constructor
CFunctionsPage::CFunctionsPage() : CPropertyPage(CFunctionsPage::IDD) {
	//{{AFX_DATA_INIT(CFunctionsPage)
	//}}AFX_DATA_INIT

	CString strCaption;
	strCaption.LoadString(IDS_HELP_FUNCTIONS);
	this->m_psp.dwFlags &= ~PSP_HASHELP;
	this->m_psp.dwFlags |=  PSP_USETITLE;
	this->m_psp.pszTitle = "Functions";
}


// Destructor
CFunctionsPage::~CFunctionsPage() {
}


// For exchange between control and data members
void CFunctionsPage::DoDataExchange(CDataExchange* pDX) {
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFunctionsPage)
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CFunctionsPage, CPropertyPage)
	//{{AFX_MSG_MAP(CFunctionsPage)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

BOOL CFunctionsPage::OnInitDialog() {
	CPropertyPage::OnInitDialog();

	m_psFunctionsAvailable	= (CStatic*)GetDlgItem(IDC_FCTS_AVAILABLE_STATIC);
	m_psFunctionsNames		= (CStatic*)GetDlgItem(IDC_FCTS_NAMES_STATIC);
	m_psFunctionsUses		= (CStatic*)GetDlgItem(IDC_FCTS_USES_STATIC);
	m_psDefAbs				= (CStatic*)GetDlgItem(IDC_FCTS_ABS_DEF_STATIC);
	m_psDefAcos				= (CStatic*)GetDlgItem(IDC_FCTS_ACOS_DEF_STATIC);
	m_psDefAns				= (CStatic*)GetDlgItem(IDC_FCTS_ANS_DEF_STATIC);
	m_psDefAsin				= (CStatic*)GetDlgItem(IDC_FCTS_ASIN_DEF_STATIC);
	m_psDefAtan				= (CStatic*)GetDlgItem(IDC_FCTS_ATAN_DEF_STATIC);
	m_psDefCos				= (CStatic*)GetDlgItem(IDC_FCTS_COS_DEF_STATIC);
	m_psDefCosh				= (CStatic*)GetDlgItem(IDC_FCTS_COSH_DEF_STATIC);
	m_psDefDeg				= (CStatic*)GetDlgItem(IDC_FCTS_DEG_DEF_STATIC);
	m_psDefExp				= (CStatic*)GetDlgItem(IDC_FCTS_EXP_DEF_STATIC);
	m_psDefLn				= (CStatic*)GetDlgItem(IDC_FCTS_LN_DEF_STATIC);
	m_psDefLog				= (CStatic*)GetDlgItem(IDC_FCTS_LOG_DEF_STATIC);
	m_psDefLogn				= (CStatic*)GetDlgItem(IDC_FCTS_LOGN_DEF_STATIC);
	m_psDefNAP				= (CStatic*)GetDlgItem(IDC_FCTS_NAP_DEF_STATIC);
	m_psDefNCP				= (CStatic*)GetDlgItem(IDC_FCTS_NCP_DEF_STATIC);
	m_psDefProduct			= (CStatic*)GetDlgItem(IDC_FCTS_PRODUCT_DEF_STATIC);
	m_psDefRad				= (CStatic*)GetDlgItem(IDC_FCTS_RAD_DEF_STATIC);
	m_psDefSin				= (CStatic*)GetDlgItem(IDC_FCTS_SIN_DEF_STATIC);
	m_psDefSinh				= (CStatic*)GetDlgItem(IDC_FCTS_SINH_DEF_STATIC);
	m_psDefSqrt				= (CStatic*)GetDlgItem(IDC_FCTS_SQRT_DEF_STATIC);
	m_psDefSqrtn			= (CStatic*)GetDlgItem(IDC_FCTS_SQRTN_DEF_STATIC);
	m_psDefSum				= (CStatic*)GetDlgItem(IDC_FCTS_SUM_DEF_STATIC);
	m_psDefTan				= (CStatic*)GetDlgItem(IDC_FCTS_TAN_DEF_STATIC);
	m_psDefTanh				= (CStatic*)GetDlgItem(IDC_FCTS_TANH_DEF_STATIC);
	m_psUseAbs				= (CStatic*)GetDlgItem(IDC_FCTS_ABS_USE_STATIC);
	m_psUseAcos				= (CStatic*)GetDlgItem(IDC_FCTS_ACOS_USE_STATIC);
	m_psUseAns				= (CStatic*)GetDlgItem(IDC_FCTS_ANS_USE_STATIC);
	m_psUseAsin				= (CStatic*)GetDlgItem(IDC_FCTS_ASIN_USE_STATIC);
	m_psUseAtan				= (CStatic*)GetDlgItem(IDC_FCTS_ATAN_USE_STATIC);
	m_psUseCos				= (CStatic*)GetDlgItem(IDC_FCTS_COS_USE_STATIC);
	m_psUseCosh				= (CStatic*)GetDlgItem(IDC_FCTS_COSH_USE_STATIC);
	m_psUseDeg				= (CStatic*)GetDlgItem(IDC_FCTS_DEG_USE_STATIC);
	m_psUseExp				= (CStatic*)GetDlgItem(IDC_FCTS_EXP_USE_STATIC);
	m_psUseLn				= (CStatic*)GetDlgItem(IDC_FCTS_LN_USE_STATIC);
	m_psUseLog				= (CStatic*)GetDlgItem(IDC_FCTS_LOG_USE_STATIC);
	m_psUseLogn				= (CStatic*)GetDlgItem(IDC_FCTS_LOGN_USE_STATIC);
	m_psUseNAP				= (CStatic*)GetDlgItem(IDC_FCTS_NAP_USE_STATIC);
	m_psUseNCP				= (CStatic*)GetDlgItem(IDC_FCTS_NCP_USE_STATIC);
	m_psUseProduct			= (CStatic*)GetDlgItem(IDC_FCTS_PRODUCT_USE_STATIC);
	m_psUseRad				= (CStatic*)GetDlgItem(IDC_FCTS_RAD_USE_STATIC);
	m_psUseSin				= (CStatic*)GetDlgItem(IDC_FCTS_SIN_USE_STATIC);
	m_psUseSinh				= (CStatic*)GetDlgItem(IDC_FCTS_SINH_USE_STATIC);
	m_psUseSqrt				= (CStatic*)GetDlgItem(IDC_FCTS_SQRT_USE_STATIC);
	m_psUseSqrtn			= (CStatic*)GetDlgItem(IDC_FCTS_SQRTN_USE_STATIC);
	m_psUseSum				= (CStatic*)GetDlgItem(IDC_FCTS_SUM_USE_STATIC);
	m_psUseTan				= (CStatic*)GetDlgItem(IDC_FCTS_TAN_USE_STATIC);
	m_psUseTanh				= (CStatic*)GetDlgItem(IDC_FCTS_TANH_USE_STATIC);

	CString strControlCaption;
	strControlCaption.LoadString(IDS_HELP_FCTS_AVAILABLE);
	m_psFunctionsAvailable->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_NAMES);
	m_psFunctionsNames->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USES);
	m_psFunctionsUses->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_ABS);
	m_psDefAbs->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_ACOS);
	m_psDefAcos->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_ANS);
	m_psDefAns->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_ASIN);
	m_psDefAsin->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_ATAN);
	m_psDefAtan->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_COS);
	m_psDefCos->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_COSH);
	m_psDefCosh->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_DEG);
	m_psDefDeg->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_EXP);
	m_psDefExp->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_LN);
	m_psDefLn->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_LOG);
	m_psDefLog->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_LOGN);
	m_psDefLogn->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_NAP);
	m_psDefNAP->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_NCP);
	m_psDefNCP->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_PRODUCT);
	m_psDefProduct->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_RAD);
	m_psDefRad->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_SIN);
	m_psDefSin->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_SINH);
	m_psDefSinh->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_SQRT);
	m_psDefSqrt->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_SQRTN);
	m_psDefSqrtn->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_SUM);
	m_psDefSum->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_TAN);
	m_psDefTan->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_DEF_TANH);
	m_psDefTanh->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_ABS);
	m_psUseAbs->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_ACOS);
	m_psUseAcos->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_ANS);
	m_psUseAns->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_ASIN);
	m_psUseAsin->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_ATAN);
	m_psUseAtan->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_COS);
	m_psUseCos->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_COSH);
	m_psUseCosh->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_DEG);
	m_psUseDeg->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_EXP);
	m_psUseExp->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_LN);
	m_psUseLn->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_LOG);
	m_psUseLog->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_LOGN);
	m_psUseLogn->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_NAP);
	m_psUseNAP->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_NCP);
	m_psUseNCP->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_PRODUCT);
	m_psUseProduct->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_RAD);
	m_psUseRad->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_SIN);
	m_psUseSin->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_SINH);
	m_psUseSinh->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_SQRT);
	m_psUseSqrt->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_SQRTN);
	m_psUseSqrtn->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_SUM);
	m_psUseSum->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_TAN);
	m_psUseTan->SetWindowText(strControlCaption);
	strControlCaption.LoadString(IDS_HELP_FCTS_USE_TANH);
	m_psUseTanh->SetWindowText(strControlCaption);

	strControlCaption.LoadString(IDS_HELP_FUNCTIONS);
	this->SetWindowText(strControlCaption);

	return TRUE;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Accenture Technology Solutions
France France

Toxcct is an electronics guy who felt in love with programming at the age of 10 when he discovered C to play with Texas-Instruments calculators.

Few years later, he discovered "The C++ Language" from Bjarne Stroustrup ; a true transformation in his life.

Now, toxcct is experiencing the Web by developing Siebel CRM Applications for a living. He also respects very much the Web Standards (YES, a HTML/CSS code MUST validate !), and plays around with HTML/CSS/Javascript/Ajax/PHP and such.

_____

After four years of services as a Codeproject MVP, toxcct is now taking some distance as he doesn't like how things are going on the forums. he particularly doesn't accept how some totally ignorant people got the MVP Reward by only being arrogant and insulting while replying on the technical forums.



Comments and Discussions