26 #ifndef __UNIT_BINDER_H_ 27 #define __UNIT_BINDER_H_ 57 wxStaticText* aLabel, wxWindow* aValueCtrl, wxStaticText* aUnitLabel,
58 bool aAllowEval =
true );
150 void SetLabel(
const wxString& aLabel );
156 void Enable(
bool aEnable );
165 void Show(
bool aShow,
bool aResize =
false );
203 double setPrecision(
double aValue,
bool aValueUsesUserUnits );
wxString m_errorMessage
Validation support.
wxString GetOriginalText() const
Function GetOriginalText Returns the pre-evaluated text (or the current text if evaluation is not sup...
ORIGIN_TRANSFORMS::COORD_TYPES_T m_coordType
Type of coordinate for display origin transforms.
UNIT_BINDER(EDA_DRAW_FRAME *aParent, wxStaticText *aLabel, wxWindow *aValueCtrl, wxStaticText *aUnitLabel, bool aAllowEval=true)
Constructor.
void delayedFocusHandler(wxCommandEvent &aEvent)
Implementation of conversion functions that require both schematic and board internal units.
EDA_DATA_TYPE
The type of unit.
ORIGIN_TRANSFORMS & m_originTransforms
A reference to an ORIGIN_TRANSFORMS object.
void SetDataType(EDA_DATA_TYPE aDataType)
Used to override the datatype of the displayed property (default is DISTANCE)
bool IsIndeterminate() const
Function IsIndeterminate Returns true if the control holds the indeterminate value (for instance,...
The base class for create windows for drawing purpose.
virtual void SetPrecision(int aLength)
Normally not needed, but can be used to set the precision when using internal units that are floats (...
EDA_UNITS m_units
Currently used units.
void Show(bool aShow, bool aResize=false)
Function Show Shows/hides the label, widget and units label.
wxStaticText * m_label
The bound widgets
wxStaticText * m_unitLabel
NUMERIC_EVALUATOR m_eval
Evaluator
ORIGIN_TRANSFORMS::COORD_TYPES_T GetCoordType() const
Get the origin transforms coordinate type.
virtual void SetUnits(EDA_UNITS aUnits)
Normally not needed (as the UNIT_BINDER inherits from the parent frame), but can be used to set to DE...
void onKillFocus(wxFocusEvent &aEvent)
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Function Validate Validates the control against the given range, informing the user of any errors fou...
void onSetFocus(wxFocusEvent &aEvent)
void SetLabel(const wxString &aLabel)
void onUnitsChanged(wxCommandEvent &aEvent)
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
virtual long long int GetValue()
Function GetValue Returns the current value in Internal Units.
long m_selStart
Selection start and end of the original text
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Function SetOriginTransform Sets the current origin transform mode.
virtual void SetDoubleValue(double aValue)
Function SetDoubleValue Sets new value (in Internal Units) for the text field, taking care of units c...
virtual double GetDoubleValue()
Function GetValue Returns the current value in Internal Units.
double setPrecision(double aValue, bool aValueUsesUserUnits)
When m_precision > 0 truncate the value aValue to show only m_precision digits in mantissa.
void Enable(bool aEnable)
Function Enable Enables/diasables the label, widget and units label.
virtual void ChangeValue(int aValue)
Function ChangeValue Changes the value (in Internal Units) for the text field, taking care of units c...