Form to edit the limit control data.
More...
#include <LimiterForm.h>
Form to edit the limit control data.
- Author
- Thales Lima Oliveira thale.nosp@m.s@uf.nosp@m.u.br
- Date
- 05/10/2017
Definition at line 31 of file LimiterForm.h.
◆ LimiterForm()
| LimiterForm::LimiterForm |
( |
wxWindow * |
parent, |
|
|
Limiter * |
limiter |
|
) |
| |
Definition at line 21 of file LimiterForm.cpp.
21 : LimiterFormBase(parent)
22{
23 SetSize(GetBestSize());
24
25 m_limiter = limiter;
26 m_parent = parent;
27
28 m_textCtrlUpLimit->SetValue(m_limiter->
StringFromDouble(m_limiter->GetUpLimit()));
29 m_textCtrlLowLimit->SetValue(m_limiter->
StringFromDouble(m_limiter->GetLowLimit()));
30}
static wxString StringFromDouble(double value, int minDecimal=1, int maxDecimals=13)
Convert a double value to string.
◆ ~LimiterForm()
| LimiterForm::~LimiterForm |
( |
| ) |
|
|
virtual |
◆ OnCancelButtonClick()
| virtual void LimiterForm::OnCancelButtonClick |
( |
wxCommandEvent & |
event | ) |
|
|
inlineprotectedvirtual |
◆ OnOKButtonClick()
| void LimiterForm::OnOKButtonClick |
( |
wxCommandEvent & |
event | ) |
|
|
protectedvirtual |
Definition at line 33 of file LimiterForm.cpp.
34{
35 if(ValidateData()) EndModal(wxID_OK);
36}
◆ ValidateData()
| bool LimiterForm::ValidateData |
( |
| ) |
|
|
virtual |
Definition at line 38 of file LimiterForm.cpp.
39{
40 double upLimit;
41 double lowLimit;
42
43 if(!m_limiter->
DoubleFromString(
this, m_textCtrlUpLimit->GetValue(), upLimit,
44 _("Value entered incorrectly in the field \"Upper limit\".")))
45 return false;
46 if(!m_limiter->
DoubleFromString(
this, m_textCtrlLowLimit->GetValue(), lowLimit,
47 _("Value entered incorrectly in the field \"Lower limit\".")))
48 return false;
49
50 m_limiter->SetUpLimit(upLimit);
51 m_limiter->SetLowLimit(lowLimit);
52 return true;
53}
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.
◆ m_limiter
| Limiter* LimiterForm::m_limiter = nullptr |
|
protected |
◆ m_parent
| wxWindow* LimiterForm::m_parent = nullptr |
|
protected |
The documentation for this class was generated from the following files: