diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-04-04 18:10:12 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-04-04 18:10:12 -0300 |
commit | 38b3e2decff95f5e29ffb6025ee899d108d22f04 (patch) | |
tree | 2655e3ac2dd13a9bb9ee0d38541239c53e668da7 /Project/GainForm.cpp | |
parent | afb0e6e08d3911b7387799f5c465fd59ca26a484 (diff) | |
download | PSP.git-38b3e2decff95f5e29ffb6025ee899d108d22f04.tar.gz PSP.git-38b3e2decff95f5e29ffb6025ee899d108d22f04.tar.xz PSP.git-38b3e2decff95f5e29ffb6025ee899d108d22f04.zip |
Gain implemented
Implement io: https://ideone.com/0HDBVd
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; +} |