diff options
Diffstat (limited to 'Project/GainForm.cpp')
-rw-r--r-- | Project/GainForm.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Project/GainForm.cpp b/Project/GainForm.cpp new file mode 100644 index 0000000..22f9079 --- /dev/null +++ b/Project/GainForm.cpp @@ -0,0 +1,27 @@ +#include "GainForm.h" +#include "Gain.h" + +GainForm::GainForm(wxWindow* parent, Gain* gain) : GainFormBase(parent) +{ + m_parent = parent; + m_gain = gain; + + m_textCtrlValue->SetValue(m_gain->StringFromDouble(m_gain->GetValue())); +} + +GainForm::~GainForm() {} +void GainForm::OnOKButtonClick(wxCommandEvent& event) +{ + if(ValidateData()) EndModal(wxID_OK); +} + +bool GainForm::ValidateData() +{ + double value; + if(!m_gain->DoubleFromString(this, m_textCtrlValue->GetValue(), value, + _("Value entered incorrectly in the field \"Gain value\"."))) + return false; + + m_gain->SetValue(value); + return true; +} |