BCGSuite for MFC
virtual void CBCGPEdit::OnCalculatorUserCommand ( CBCGPCalculator pCalculator,
UINT  uiCmd 
)
protectedvirtual

Called by the framework when a custom calculator command should be executed.

You have to override this function in a derived class in order to process custom calculator commands. You specify these commands when calling EnableCalculatorButton().

uiCmd contains a command ID which is assigned to a button. Command IDs are assigned automatically starting from CBCGPCalculator::idCommandUser and conform to the order of strings you passed in the string list when called EnableCalculatorButton().

Parameters
pCalculatorPoints to a calculator control whose command is executed.
uiCmdSpecifies the command ID.
Copy
// the code below enables calculator button with additional commands
CStringList lstCommands;
lstCommands.AddTail("Sin");
lstCommands.AddTail("Cos");
lstCommands.AddTail("Tan");
m_wndEdit.EnableCalculatorButton(&lstCommands);
// the code below shows how to implement OnCalculatorUserCommand
double dblVal = pCalculator->GetValue();
switch (uiCmd)
{
case CBCGPCalculator::idCommandUser: // Sin
dblVal = sin(dblVal);
break;
case CBCGPCalculator::idCommandUser + 1: // Cos
dblVal = cos(dblVal);
break;
case CBCGPCalculator::idCommandUser + 2: // Tan
dblVal = tan(dblVal);
break;
}