From 38b3e2decff95f5e29ffb6025ee899d108d22f04 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Tue, 4 Apr 2017 18:10:12 -0300 Subject: Gain implemented Implement io: https://ideone.com/0HDBVd --- Project/GainForm.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Project/GainForm.cpp (limited to 'Project/GainForm.cpp') 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; +} -- cgit