19#include "../elements/controlElement/Constant.h"
21ConstantForm::ConstantForm(wxWindow* parent,
Constant* constant) : ConstantFormBase(parent)
23 SetSize(GetBestSize());
26 m_constant = constant;
28 m_textCtrlValue->SetValue(m_constant->StringFromDouble(m_constant->GetValue()));
31ConstantForm::~ConstantForm() {}
32void ConstantForm::OnOKButtonClick(wxCommandEvent& event)
34 if(ValidateData()) EndModal(wxID_OK);
37bool ConstantForm::ValidateData()
41 _(
"Value entered incorrectly in the field \"Constant value\".")))
44 m_constant->SetValue(value);
A control element that provides a constant value.
static bool DoubleFromString(wxWindow *parent, wxString strValue, double &value, wxString errorMsg)
Get a double value from a string. Show a error message if the conversion fail.