26#ifndef __UNIT_BINDER_H_
27#define __UNIT_BINDER_H_
58 wxStaticText* aLabel, wxWindow* aValueCtrl, wxStaticText* aUnitLabel,
59 bool aAllowEval =
true,
bool aBindFocusEvent =
true );
62 wxStaticText* aLabel, wxWindow* aValueCtrl, wxStaticText* aUnitLabel,
63 bool aAllowEval =
true,
bool aBindFocusEvent =
true );
93 virtual void SetValue(
long long int aValue );
95 void SetValue(
const wxString& aValue );
146 virtual void SetOptionsList( std::span<const long long int> aOptions );
169 virtual bool Validate(
double aMin,
double aMax,
EDA_UNITS aUnits = EDA_UNITS::UNSCALED );
171 void SetLabel(
const wxString& aLabel );
176 void Enable(
bool aEnable );
184 void Show(
bool aShow,
bool aResize =
false );
214 void onClick( wxMouseEvent& aEvent );
234 double setPrecision(
double aValue,
bool aValueUsesUserUnits )
const;
The base frame for deriving all KiCad main window classes.
The base class for create windows for drawing purpose.
Specialization for wxPropertyGrid, where we have no labels and units are displayed in the editor.
void SetControl(wxWindow *aControl)
virtual ~PROPERTY_EDITOR_UNIT_BINDER()
double setPrecision(double aValue, bool aValueUsesUserUnits) const
When m_precision > 0 truncate the value aValue to show only m_precision digits in mantissa.
ORIGIN_TRANSFORMS::COORD_TYPES_T m_coordType
Type of coordinate for display origin transforms.
wxString getTextForValue(long long int aValue) const
virtual void ChangeDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion WITHOUT trigger...
void onKillFocus(wxFocusEvent &aEvent)
virtual long long int GetValue()
Return the current value in Internal Units.
void Enable(bool aEnable)
Enable/disable the label, widget and units label.
void onClick(wxMouseEvent &aEvent)
virtual void SetPrecision(int aLength)
Normally not needed, but can be used to set the precision when using internal units that are floats (...
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...
wxString getTextForDoubleValue(double aValue) const
const EDA_IU_SCALE * m_iuScale
virtual EDA_ANGLE GetAngleValue()
bool m_negativeZero
Indicates "-0" should be displayed for 0.
wxStaticText * m_unitLabel
Can be nullptr.
virtual void SetNegativeZero()
bool m_unitsInValue
Units label should be included in value text.
void onSetFocus(wxFocusEvent &aEvent)
void onComboBox(wxCommandEvent &aEvent)
ORIGIN_TRANSFORMS & m_originTransforms
A reference to an ORIGIN_TRANSFORMS object.
bool m_bindFocusEvent
The bound widgets.
long m_selStart
Selection start and end of the original text.
virtual void SetDoubleOptionsList(std::span< const double > aOptions)
virtual double GetDoubleValue()
Return the current value in Internal Units.
virtual void SetOptionsList(std::span< const long long int > aOptions)
Set the list of options for a combobox control.
bool IsIndeterminate() const
Return true if the control holds the indeterminate value (for instance, if it represents a multiple s...
void SetDataType(EDA_DATA_TYPE aDataType)
Used to override the datatype of the displayed property (default is DISTANCE)
void RequireEval()
Force the binder to evaluate the text.
void delayedFocusHandler(wxCommandEvent &aEvent)
ORIGIN_TRANSFORMS::COORD_TYPES_T GetCoordType() const
Get the origin transforms coordinate type.
virtual void SetAngleValue(const EDA_ANGLE &aValue)
void SetLabel(const wxString &aLabel)
void init(UNITS_PROVIDER *aProvider)
virtual void ChangeAngleValue(const EDA_ANGLE &aValue)
virtual void SetDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual ~UNIT_BINDER() override
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Validate the control against the given range, informing the user of any errors found.
virtual void ChangeValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion WITHOUT trigger...
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void Show(bool aShow, bool aResize=false)
Show/hide the label, widget and units label.
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Set the current origin transform mode.
bool IsNull() const
Return true if the control holds no value (ie: empty string, not 0).
void onUnitsChanged(wxCommandEvent &aEvent)
EDA_DATA_TYPE
The type of unit.