Power System Platform  2026w10a-beta
Loading...
Searching...
No Matches
ExponentialForm Class Reference

Form to edit the exponential control data. More...

#include <ExponentialForm.h>

Inheritance diagram for ExponentialForm:
Collaboration diagram for ExponentialForm:

Public Member Functions

 ExponentialForm (wxWindow *parent, Exponential *exponential)
 
virtual bool ValidateData ()
 

Protected Member Functions

virtual void OnCancelButtonClick (wxCommandEvent &event)
 
virtual void OnOKButtonClick (wxCommandEvent &event)
 

Protected Attributes

wxWindow * m_parent = nullptr
 
Exponentialm_exponential = nullptr
 

Detailed Description

Form to edit the exponential 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 ExponentialForm.h.

Constructor & Destructor Documentation

◆ ExponentialForm()

ExponentialForm::ExponentialForm ( wxWindow *  parent,
Exponential exponential 
)

Definition at line 21 of file ExponentialForm.cpp.

21 : ExponentialFormBase(parent)
22{
23 SetSize(GetBestSize());
24
25 wxString expSymbol = wxString::FromUTF8("\xF0\x9D\x91\x92");
26 wxString superscriptCapitalB = wxString::FromUTF8("\xE1\xB4\xAE");
27 wxString superscriptSmallX = wxString::FromUTF8("\xCB\xA3");
28 m_staticTextExp->SetLabel("y = A" + expSymbol + superscriptCapitalB + superscriptSmallX);
29
30 wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
31 font.SetPointSize(14);
32 m_staticTextExp->SetFont(font);
33
34 m_parent = parent;
35 m_exponential = exponential;
36
37 double a, b;
38 m_exponential->GetValues(a, b);
39 m_textCtrlAValue->SetValue(m_exponential->StringFromDouble(a));
40 m_textCtrlBValue->SetValue(m_exponential->StringFromDouble(b));
41
42 SetInitialSize();
43 Layout();
44}
static wxString StringFromDouble(double value, int minDecimal=1, int maxDecimals=13)
Convert a double value to string.
Definition Element.cpp:533

◆ ~ExponentialForm()

ExponentialForm::~ExponentialForm ( )
virtual

Definition at line 46 of file ExponentialForm.cpp.

46{}

Member Function Documentation

◆ OnCancelButtonClick()

virtual void ExponentialForm::OnCancelButtonClick ( wxCommandEvent &  event)
inlineprotectedvirtual

Definition at line 39 of file ExponentialForm.h.

39{ EndModal(wxID_CANCEL); }

◆ OnOKButtonClick()

void ExponentialForm::OnOKButtonClick ( wxCommandEvent &  event)
protectedvirtual

Definition at line 47 of file ExponentialForm.cpp.

48{
49 if(ValidateData()) EndModal(wxID_OK);
50}

◆ ValidateData()

bool ExponentialForm::ValidateData ( )
virtual

Definition at line 52 of file ExponentialForm.cpp.

53{
54 double a, b;
55 if(!m_exponential->DoubleFromString(this, m_textCtrlAValue->GetValue(), a,
56 _("Value entered incorrectly in the field \"A value\".")))
57 return false;
58 if(!m_exponential->DoubleFromString(this, m_textCtrlBValue->GetValue(), b,
59 _("Value entered incorrectly in the field \"B value\".")))
60 return false;
61 m_exponential->SetValues(a, b);
62 return true;
63}
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.
Definition Element.cpp:505

Member Data Documentation

◆ m_exponential

Exponential* ExponentialForm::m_exponential = nullptr
protected

Definition at line 43 of file ExponentialForm.h.

◆ m_parent

wxWindow* ExponentialForm::m_parent = nullptr
protected

Definition at line 42 of file ExponentialForm.h.


The documentation for this class was generated from the following files: