21ExponentialForm::ExponentialForm(wxWindow* parent,
Exponential* exponential) : ExponentialFormBase(parent)
23 SetSize(GetBestSize());
25 wxString expSymbol = wxString::FromUTF8(
"\xF0\x9D\x91\x92");
26 wxString superscriptCapitalB = wxString::FromUTF8(
"\xE1\xB4\xAE");
27 wxString superscriptSmallX = wxString::FromUTF8(
"\xCB\xA3");
28 m_staticTextExp->SetLabel(
"y = A" + expSymbol + superscriptCapitalB + superscriptSmallX);
30 wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
31 font.SetPointSize(14);
32 m_staticTextExp->SetFont(font);
35 m_exponential = exponential;
38 m_exponential->GetValues(a, b);
39 m_textCtrlAValue->SetValue(m_exponential->StringFromDouble(a));
40 m_textCtrlBValue->SetValue(m_exponential->StringFromDouble(b));
46ExponentialForm::~ExponentialForm() {}
47void ExponentialForm::OnOKButtonClick(wxCommandEvent& event)
49 if(ValidateData()) EndModal(wxID_OK);
52bool ExponentialForm::ValidateData()
55 if(!m_exponential->DoubleFromString(
this, m_textCtrlAValue->GetValue(), a,
56 _(
"Value entered incorrectly in the field \"A value\".")))
58 if(!m_exponential->DoubleFromString(
this, m_textCtrlBValue->GetValue(), b,
59 _(
"Value entered incorrectly in the field \"B value\".")))
61 m_exponential->SetValues(a, b);
Generates an output following an exponential function.