KiCad PCB EDA Suite
|
wxTextCtrl wrapper to handle math expression evaluation. More...
#include <text_ctrl_eval.h>
Public Member Functions | |
TEXT_CTRL_EVAL (wxWindow *aParent, wxWindowID aId, const wxString &aValue=wxEmptyString, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize, long aStyle=0, const wxValidator &aValidator=wxDefaultValidator, const wxString &aName=wxTextCtrlNameStr) | |
virtual | ~TEXT_CTRL_EVAL () |
void | SetValue (const wxString &aValue) override |
Set a new value in evaluator buffer, and display it in the wxTextCtrl. | |
Protected Member Functions | |
void | onTextFocusGet (wxFocusEvent &aEvent) |
void | onTextFocusLost (wxFocusEvent &aEvent) |
void | onTextEnter (wxCommandEvent &aEvent) |
void | evaluate () |
Protected Attributes | |
NUMERIC_EVALUATOR | m_eval |
< Numeric expression evaluator | |
wxTextCtrl wrapper to handle math expression evaluation.
Expressions are evaluated after the text control loses the focus. If user decides to modify the expression, he will get the original expression to modify.
Definition at line 38 of file text_ctrl_eval.h.
TEXT_CTRL_EVAL::TEXT_CTRL_EVAL | ( | wxWindow * | aParent, |
wxWindowID | aId, | ||
const wxString & | aValue = wxEmptyString , |
||
const wxPoint & | aPos = wxDefaultPosition , |
||
const wxSize & | aSize = wxDefaultSize , |
||
long | aStyle = 0 , |
||
const wxValidator & | aValidator = wxDefaultValidator , |
||
const wxString & | aName = wxTextCtrlNameStr |
||
) |
Definition at line 29 of file text_ctrl_eval.cpp.
References onTextEnter(), onTextFocusGet(), and onTextFocusLost().
|
inlinevirtual |
Definition at line 46 of file text_ctrl_eval.h.
|
protected |
Definition at line 80 of file text_ctrl_eval.cpp.
References m_eval, NUMERIC_EVALUATOR::Process(), NUMERIC_EVALUATOR::Result(), and SetValue().
Referenced by onTextEnter(), and onTextFocusLost().
|
protected |
Definition at line 70 of file text_ctrl_eval.cpp.
References evaluate().
Referenced by TEXT_CTRL_EVAL().
|
protected |
Definition at line 52 of file text_ctrl_eval.cpp.
References m_eval, NUMERIC_EVALUATOR::OriginalText(), and SetValue().
Referenced by TEXT_CTRL_EVAL().
|
protected |
Definition at line 63 of file text_ctrl_eval.cpp.
References evaluate().
Referenced by TEXT_CTRL_EVAL().
|
override |
Set a new value in evaluator buffer, and display it in the wxTextCtrl.
aValue | is the new value to store and display if aValue is empty, the value "0" is stored and displayed |
Definition at line 45 of file text_ctrl_eval.cpp.
References NUMERIC_EVALUATOR::Clear(), and m_eval.
Referenced by DIALOG_EXPORT_IDF3::DIALOG_EXPORT_IDF3(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), evaluate(), and onTextFocusGet().
|
protected |
< Numeric expression evaluator
Definition at line 60 of file text_ctrl_eval.h.
Referenced by evaluate(), onTextFocusGet(), and SetValue().