23 : MathExpressionFormBase(parent)
24{
25 m_parent = parent;
26 m_mathExpr = mathExpr;
27
28
29 wxString variables = "";
30 for(unsigned int i = 0; i < m_mathExpr->GetVariables().size(); ++i) {
31 variables += m_mathExpr->GetVariables()[i] + " ";
32 }
33 variables.RemoveLast();
34
35
36 wxFont variablesFont = m_textCtrlVariables->GetFont();
37 variablesFont.SetWeight(wxFONTWEIGHT_BOLD);
38 m_textCtrlVariables->SetFont(variablesFont);
39 m_textCtrlVariables->SetForegroundColour(wxColour(160, 0, 0));
40 m_textCtrlVariables->SetValue(variables);
41
42 m_stcMathExpr->SetText(m_mathExpr->GetMathExpression());
43
44 m_staticTextCheckStatus->SetLabel(_("No checks performed."));
45 SetSintaxHighlights();
46 m_stcMathExpr->SetTabWidth(3);
47
48
49 m_stcMathExpr->IndicatorSetUnder(ERROR_INDICATOR, true);
50 m_stcMathExpr->IndicatorSetStyle(ERROR_INDICATOR, wxSTC_INDIC_ROUNDBOX);
51 m_stcMathExpr->IndicatorSetAlpha(ERROR_INDICATOR, 200);
52 m_stcMathExpr->IndicatorSetUnder(ERROR_INDICATOR, true);
53 m_stcMathExpr->IndicatorSetForeground(ERROR_INDICATOR, wxColor(255, 85, 0));
54 m_stcMathExpr->SetIndicatorCurrent(ERROR_INDICATOR);
55
56
57 m_translatedErrorMsg.clear();
58 m_translatedErrorMsg.push_back(_("Syntax error"));
59 m_translatedErrorMsg.push_back(_("Mismatched parenthesis"));
60 m_translatedErrorMsg.push_back(_("Missing ')'"));
61 m_translatedErrorMsg.push_back(_("Empty parentheses"));
62 m_translatedErrorMsg.push_back(_("Syntax error: Operator expected"));
63 m_translatedErrorMsg.push_back(_("Not enough memory"));
64 m_translatedErrorMsg.push_back(_("An unexpected error occurred"));
65 m_translatedErrorMsg.push_back(_("Syntax error in input variables"));
66 m_translatedErrorMsg.push_back(_("Illegal number of parameters to function"));
67 m_translatedErrorMsg.push_back(_("Syntax error: Premature end of string"));
68 m_translatedErrorMsg.push_back(_("Syntax error: Expecting ( after function"));
69 m_translatedErrorMsg.push_back(_("Syntax error: Unknown identifier"));
70 m_translatedErrorMsg.push_back(_("No function has been parsed yet"));
71}