KiCad PCB EDA Suite
UNIT_BINDER Class Reference

#include <unit_binder.h>

Inheritance diagram for UNIT_BINDER:

Public Member Functions

 UNIT_BINDER (EDA_DRAW_FRAME *aParent, wxStaticText *aLabel, wxWindow *aValue, wxStaticText *aUnitLabel, bool aUseMils=false, bool aAllowEval=true)
 Constructor. More...
 
 ~UNIT_BINDER () override
 
virtual void SetUnits (EDA_UNITS aUnits, bool aUseMils=false)
 Function SetUnits Normally not needed (as the UNIT_BINDER inherits from the parent frame), but can be used to set to DEGREES for angular controls. More...
 
void SetDataType (EDA_DATA_TYPE aDataType)
 Used to override the datatype of the displayed property (default is DISTANCE) More...
 
virtual void SetValue (int aValue)
 Function SetValue Sets new value (in Internal Units) for the text field, taking care of units conversion. More...
 
void SetValue (wxString aValue)
 
virtual void SetDoubleValue (double aValue)
 Function SetDoubleValue Sets new value (in Internal Units) for the text field, taking care of units conversion. More...
 
virtual void ChangeValue (int aValue)
 Function ChangeValue Changes the value (in Internal Units) for the text field, taking care of units conversion but does not trigger the update routine. More...
 
void ChangeValue (const wxString &aValue)
 
virtual long long int GetValue ()
 Function GetValue Returns the current value in Internal Units. More...
 
virtual double GetDoubleValue ()
 Function GetValue Returns the current value in Internal Units. More...
 
bool IsIndeterminate () const
 Function IsIndeterminate Returns true if the control holds the indeterminate value (for instance, if it represents a multiple selection of differing values). More...
 
wxString GetOriginalText () const
 Function GetOriginalText Returns the pre-evaluated text (or the current text if evaluation is not supported). More...
 
virtual bool Validate (double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED, bool aUseMils=false)
 Function Validate Validates the control against the given range, informing the user of any errors found. More...
 
void SetLabel (const wxString &aLabel)
 
void Enable (bool aEnable)
 Function Enable Enables/diasables the label, widget and units label. More...
 
void Show (bool aShow, bool aResize=false)
 Function Show Shows/hides the label, widget and units label. More...
 
ORIGIN_TRANSFORMS::COORD_TYPES_T GetCoordType () const
 Get the origin transforms coordinate type. More...
 
void SetCoordType (ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
 Function SetOriginTransform Sets the current origin transform mode. More...
 

Protected Member Functions

void onSetFocus (wxFocusEvent &aEvent)
 
void onKillFocus (wxFocusEvent &aEvent)
 
void delayedFocusHandler (wxCommandEvent &aEvent)
 
void onUnitsChanged (wxCommandEvent &aEvent)
 

Protected Attributes

EDA_DRAW_FRAMEm_frame
 
wxStaticText * m_label
 

The bound widgets

More...
 
wxWindow * m_value
 
wxStaticText * m_unitLabel
 
EDA_UNITS m_units
 

Currently used units.

More...
 
bool m_useMils
 
EDA_DATA_TYPE m_dataType
 
wxString m_errorMessage
 

Validation support.

More...
 
NUMERIC_EVALUATOR m_eval
 

Evaluator

More...
 
bool m_allowEval
 
bool m_needsEval
 
long m_selStart
 

Selection start and end of the original text

More...
 
long m_selEnd
 
ORIGIN_TRANSFORMSm_originTransforms
 A reference to an ORIGIN_TRANSFORMS object. More...
 
ORIGIN_TRANSFORMS::COORD_TYPES_T m_coordType
 Type of coordinate for display origin transforms. More...
 

Detailed Description

Definition at line 41 of file unit_binder.h.

Constructor & Destructor Documentation

◆ UNIT_BINDER()

UNIT_BINDER::UNIT_BINDER ( EDA_DRAW_FRAME aParent,
wxStaticText *  aLabel,
wxWindow *  aValue,
wxStaticText *  aUnitLabel,
bool  aUseMils = false,
bool  aAllowEval = true 
)

Constructor.

Parameters
aParentis the parent EDA_DRAW_FRAME.
aLabelis the static text used to label the text input widget (note: the label text, trimmed of its colon, will also be used in error messages)
aValueis the control used to edit or display the given value (wxTextCtrl, wxComboBox, wxStaticText, etc.).
aUnitLabelis the units label displayed after the text input widget
aUseMilsspecifies the use of mils for imperial units (instead of inches)
aAllowEvalindicates aTextInput's content should be eval'ed before storing

Definition at line 38 of file unit_binder.cpp.

40  :
41  m_frame( aParent ),
42  m_label( aLabel ),
43  m_value( aValue ),
44  m_unitLabel( aUnitLabel ),
45  m_eval( aParent->GetUserUnits(), aUseMils ),
48 {
49  m_units = aParent->GetUserUnits();
50  m_useMils = aUseMils;
52  m_allowEval = allowEval && dynamic_cast<wxTextEntry*>( m_value );
53  m_needsEval = false;
54  m_selStart = 0;
55  m_selEnd = 0;
56 
57  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( m_value );
58 
59  if( textEntry )
60  {
61  // Use ChangeValue() instead of SetValue() so we don't generate events.
62  textEntry->ChangeValue( wxT( "0" ) );
63  }
64 
66 
67  m_value->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( UNIT_BINDER::onSetFocus ), NULL, this );
68  m_value->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( UNIT_BINDER::onKillFocus ), NULL, this );
69  Connect( DELAY_FOCUS, wxCommandEventHandler( UNIT_BINDER::delayedFocusHandler ), NULL, this );
70 
71  m_frame->Connect( UNITS_CHANGED, wxCommandEventHandler( UNIT_BINDER::onUnitsChanged ), nullptr, this );
72 }
ORIGIN_TRANSFORMS::COORD_TYPES_T m_coordType
Type of coordinate for display origin transforms.
Definition: unit_binder.h:212
EDA_DRAW_FRAME * m_frame
Definition: unit_binder.h:184
void delayedFocusHandler(wxCommandEvent &aEvent)
wxWindow * m_value
Definition: unit_binder.h:188
ORIGIN_TRANSFORMS & m_originTransforms
A reference to an ORIGIN_TRANSFORMS object.
Definition: unit_binder.h:209
virtual ORIGIN_TRANSFORMS & GetOriginTransforms()
Return a reference to the default ORIGIN_TRANSFORMS object.
bool m_needsEval
Definition: unit_binder.h:202
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:495
EDA_UNITS m_units
Currently used units.
Definition: unit_binder.h:192
#define NULL
wxStaticText * m_label
The bound widgets
Definition: unit_binder.h:187
EDA_DATA_TYPE m_dataType
Definition: unit_binder.h:194
wxStaticText * m_unitLabel
Definition: unit_binder.h:189
NUMERIC_EVALUATOR m_eval
Evaluator
Definition: unit_binder.h:200
bool m_useMils
Definition: unit_binder.h:193
bool m_allowEval
Definition: unit_binder.h:201
void onKillFocus(wxFocusEvent &aEvent)
void onSetFocus(wxFocusEvent &aEvent)
void onUnitsChanged(wxCommandEvent &aEvent)
Definition: unit_binder.cpp:96
long m_selStart
Selection start and end of the original text
Definition: unit_binder.h:205
EDA_UNITS GetUserUnits() const
Return the user units currently in use.

References delayedFocusHandler(), DISTANCE, GetAbbreviatedUnitsLabel(), EDA_BASE_FRAME::GetUserUnits(), m_allowEval, m_dataType, m_frame, m_needsEval, m_selEnd, m_selStart, m_unitLabel, m_units, m_useMils, m_value, NULL, onKillFocus(), onSetFocus(), and onUnitsChanged().

◆ ~UNIT_BINDER()

UNIT_BINDER::~UNIT_BINDER ( )
override

Definition at line 75 of file unit_binder.cpp.

76 {
77  m_frame->Disconnect( UNITS_CHANGED, wxCommandEventHandler( UNIT_BINDER::onUnitsChanged ), nullptr, this );
78 }
EDA_DRAW_FRAME * m_frame
Definition: unit_binder.h:184
void onUnitsChanged(wxCommandEvent &aEvent)
Definition: unit_binder.cpp:96

References m_frame, and onUnitsChanged().

Member Function Documentation

◆ ChangeValue() [1/2]

void UNIT_BINDER::ChangeValue ( int  aValue)
virtual

Function ChangeValue Changes the value (in Internal Units) for the text field, taking care of units conversion but does not trigger the update routine.

Parameters
aValueis the new value.

Definition at line 258 of file unit_binder.cpp.

259 {
260  double value = aValue;
261  double displayValue = m_originTransforms.ToDisplay( value, m_coordType );
262  ChangeValue( StringFromValue( m_units, displayValue, false, m_useMils ) );
263 }
ORIGIN_TRANSFORMS::COORD_TYPES_T m_coordType
Type of coordinate for display origin transforms.
Definition: unit_binder.h:212
ORIGIN_TRANSFORMS & m_originTransforms
A reference to an ORIGIN_TRANSFORMS object.
Definition: unit_binder.h:209
EDA_UNITS m_units
Currently used units.
Definition: unit_binder.h:192
bool m_useMils
Definition: unit_binder.h:193
virtual int ToDisplay(int aValue, COORD_TYPES_T aCoordType)
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, bool aUseMils, EDA_DATA_TYPE aType)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:233
virtual void ChangeValue(int aValue)
Function ChangeValue Changes the value (in Internal Units) for the text field, taking care of units c...

References m_coordType, m_originTransforms, m_units, m_useMils, StringFromValue(), and ORIGIN_TRANSFORMS::ToDisplay().

Referenced by DIALOG_PAD_PROPERTIES::initValues(), DIALOG_PAD_PROPERTIES::onCornerSizePercentChange(), DIALOG_TRACK_VIA_PROPERTIES::onViaSelect(), DIALOG_PAD_PROPERTIES::PadTypeSelected(), and DIALOG_PAD_PROPERTIES::updateRoundRectCornerValues().

◆ ChangeValue() [2/2]

void UNIT_BINDER::ChangeValue ( const wxString &  aValue)

Definition at line 266 of file unit_binder.cpp.

267 {
268  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( m_value );
269  wxStaticText* staticText = dynamic_cast<wxStaticText*>( m_value );
270 
271  if( textEntry )
272  textEntry->ChangeValue( aValue );
273  else if( staticText )
274  staticText->SetLabel( aValue );
275 
276  if( m_allowEval )
277  m_eval.Clear();
278 
280 }
wxWindow * m_value
Definition: unit_binder.h:188
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:495
EDA_UNITS m_units
Currently used units.
Definition: unit_binder.h:192
EDA_DATA_TYPE m_dataType
Definition: unit_binder.h:194
wxStaticText * m_unitLabel
Definition: unit_binder.h:189
NUMERIC_EVALUATOR m_eval
Evaluator
Definition: unit_binder.h:200
bool m_useMils
Definition: unit_binder.h:193
bool m_allowEval
Definition: unit_binder.h:201

References NUMERIC_EVALUATOR::Clear(), GetAbbreviatedUnitsLabel(), m_allowEval, m_dataType, m_eval, m_unitLabel, m_units, m_useMils, and m_value.

◆ delayedFocusHandler()

void UNIT_BINDER::delayedFocusHandler ( wxCommandEvent &  aEvent)
protected

Definition at line 171 of file unit_binder.cpp.

172 {
173  if( !m_errorMessage.IsEmpty() )
174  DisplayError( m_value->GetParent(), m_errorMessage );
175 
176  m_errorMessage = wxEmptyString;
177  m_value->SetFocus();
178 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:239
wxString m_errorMessage
Validation support.
Definition: unit_binder.h:197
wxWindow * m_value
Definition: unit_binder.h:188

References DisplayError(), m_errorMessage, and m_value.

Referenced by UNIT_BINDER().

◆ Enable()

void UNIT_BINDER::Enable ( bool  aEnable)

Function Enable Enables/diasables the label, widget and units label.

Definition at line 362 of file unit_binder.cpp.

363 {
364  m_label->Enable( aEnable );
365  m_value->Enable( aEnable );
366  m_unitLabel->Enable( aEnable );
367 }
wxWindow * m_value
Definition: unit_binder.h:188
wxStaticText * m_label
The bound widgets
Definition: unit_binder.h:187
wxStaticText * m_unitLabel
Definition: unit_binder.h:189

References m_label, m_unitLabel, and m_value.

Referenced by DIALOG_PAD_PROPERTIES::OnPadShapeSelection(), DIALOG_PAGES_SETTINGS::OnPaperSizeChoice(), DIALOG_TRACK_VIA_PROPERTIES::onTrackNetclassCheck(), DIALOG_PLOT_SCHEMATIC::OnUpdateUI(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnUpdateUI(), DIALOG_PAD_PROPERTIES::OnUpdateUI(), DIALOG_TRACK_VIA_PROPERTIES::onViaNetclassCheck(), and DIALOG_PLOT::SetPlotFormat().

◆ GetCoordType()

ORIGIN_TRANSFORMS::COORD_TYPES_T UNIT_BINDER::GetCoordType ( ) const
inline

Get the origin transforms coordinate type.

Returns
the origin transforms coordinate type

Definition at line 162 of file unit_binder.h.

163  {
164  return m_coordType;
165  }
ORIGIN_TRANSFORMS::COORD_TYPES_T m_coordType
Type of coordinate for display origin transforms.
Definition: unit_binder.h:212

References m_coordType.

◆ GetDoubleValue()

double UNIT_BINDER::GetDoubleValue ( )
virtual

Function GetValue Returns the current value in Internal Units.

Definition at line 306 of file unit_binder.cpp.

307 {
308  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( m_value );
309  wxStaticText* staticText = dynamic_cast<wxStaticText*>( m_value );
310  wxString value;
311 
312  if( textEntry )
313  {
314  if( m_needsEval && m_eval.Process( textEntry->GetValue() ) )
315  value = m_eval.Result();
316  else
317  value = textEntry->GetValue();
318  }
319  else if( staticText )
320  value = staticText->GetLabel();
321  else
322  return 0.0;
323 
324  double displayValue = DoubleValueFromString( m_units, value, m_useMils, m_dataType );
325  return m_originTransforms.FromDisplay( displayValue, m_coordType );
326 }
ORIGIN_TRANSFORMS::COORD_TYPES_T m_coordType
Type of coordinate for display origin transforms.
Definition: unit_binder.h:212
wxWindow * m_value
Definition: unit_binder.h:188
ORIGIN_TRANSFORMS & m_originTransforms
A reference to an ORIGIN_TRANSFORMS object.
Definition: unit_binder.h:209
double DoubleValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, bool aUseMils, EDA_DATA_TYPE aType)
Function DoubleValueFromString converts aTextValue to a double.
Definition: base_units.cpp:346
bool m_needsEval
Definition: unit_binder.h:202
virtual int FromDisplay(int aValue, COORD_TYPES_T aCoordType)
EDA_UNITS m_units
Currently used units.
Definition: unit_binder.h:192
bool Process(const wxString &aString)
EDA_DATA_TYPE m_dataType
Definition: unit_binder.h:194
NUMERIC_EVALUATOR m_eval
Evaluator
Definition: unit_binder.h:200
bool m_useMils
Definition: unit_binder.h:193
wxString Result() const

References DoubleValueFromString(), ORIGIN_TRANSFORMS::FromDisplay(), m_coordType, m_dataType, m_eval, m_needsEval, m_originTransforms, m_units, m_useMils, m_value, NUMERIC_EVALUATOR::Process(), and NUMERIC_EVALUATOR::Result().

Referenced by DIALOG_POSITION_RELATIVE::GetTranslationInIU(), DIALOG_MOVE_EXACT::GetTranslationInIU(), DIALOG_POSITION_RELATIVE::OnClear(), DIALOG_POSITION_RELATIVE::OnOkClick(), DIALOG_POSITION_RELATIVE::OnPolarChanged(), DIALOG_MOVE_EXACT::OnPolarChanged(), and DIALOG_MOVE_EXACT::OnTextChanged().

◆ GetOriginalText()

wxString UNIT_BINDER::GetOriginalText ( ) const

Function GetOriginalText Returns the pre-evaluated text (or the current text if evaluation is not supported).

Used primarily to remember values between dialog invocations.

Definition at line 340 of file unit_binder.cpp.

341 {
342  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( m_value );
343  wxStaticText* staticText = dynamic_cast<wxStaticText*>( m_value );
344 
345  if( m_allowEval )
346  return m_eval.OriginalText();
347  else if( textEntry )
348  return textEntry->GetValue();
349  else if( staticText )
350  return staticText->GetLabel();
351  else
352  return wxEmptyString;
353 }
wxWindow * m_value
Definition: unit_binder.h:188
wxString OriginalText() const
NUMERIC_EVALUATOR m_eval
Evaluator
Definition: unit_binder.h:200
bool m_allowEval
Definition: unit_binder.h:201

References m_allowEval, m_eval, m_value, and NUMERIC_EVALUATOR::OriginalText().

Referenced by DIALOG_MOVE_EXACT::TransferDataFromWindow().

◆ GetValue()

long long int UNIT_BINDER::GetValue ( )
virtual

Function GetValue Returns the current value in Internal Units.

Definition at line 283 of file unit_binder.cpp.

284 {
285  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( m_value );
286  wxStaticText* staticText = dynamic_cast<wxStaticText*>( m_value );
287  wxString value;
288 
289  if( textEntry )
290  {
291  if( m_needsEval && m_eval.Process( textEntry->GetValue() ) )
292  value = m_eval.Result();
293  else
294  value = textEntry->GetValue();
295  }
296  else if( staticText )
297  value = staticText->GetLabel();
298  else
299  return 0;
300 
301  long long int displayValue = ValueFromString( m_units, value, m_useMils, m_dataType );
302  return m_originTransforms.FromDisplay( displayValue, m_coordType );
303 }
ORIGIN_TRANSFORMS::COORD_TYPES_T m_coordType
Type of coordinate for display origin transforms.
Definition: unit_binder.h:212
wxWindow * m_value
Definition: unit_binder.h:188
ORIGIN_TRANSFORMS & m_originTransforms
A reference to an ORIGIN_TRANSFORMS object.
Definition: unit_binder.h:209
bool m_needsEval
Definition: unit_binder.h:202
virtual int FromDisplay(int aValue, COORD_TYPES_T aCoordType)
EDA_UNITS m_units
Currently used units.
Definition: unit_binder.h:192
bool Process(const wxString &aString)
EDA_DATA_TYPE m_dataType
Definition: unit_binder.h:194
NUMERIC_EVALUATOR m_eval
Evaluator
Definition: unit_binder.h:200
bool m_useMils
Definition: unit_binder.h:193
wxString Result() const
long long int ValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, bool aUseMils, EDA_DATA_TYPE aType)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application.
Definition: base_units.cpp:471

References ORIGIN_TRANSFORMS::FromDisplay(), m_coordType, m_dataType, m_eval, m_needsEval, m_originTransforms, m_units, m_useMils, m_value, NUMERIC_EVALUATOR::Process(), NUMERIC_EVALUATOR::Result(), and ValueFromString().

Referenced by DIALOG_PNS_LENGTH_TUNING_SETTINGS::AcceptOptions(), DIALOG_COPPER_ZONE::AcceptOptions(), DIALOG_PLOT::applyPlotSettings(), DIALOG_CREATE_ARRAY::calculateCircularArrayProperties(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_EXPORT_SVG::ExportSVGFile(), DIALOG_PAGES_SETTINGS::GetCustomSizeMilsFromDialog(), DIALOG_LIB_NEW_COMPONENT::GetPinTextPosition(), DIALOG_PLOT_SCHEMATIC::getPlotOptions(), DIALOG_LIB_EDIT_DRAW_ITEM::GetWidth(), DIALOG_PAD_PROPERTIES::onCornerRadiusChange(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::onPaintPolyPanel(), DIALOG_PIN_PROPERTIES::OnPropertiesChange(), onUnitsChanged(), DIALOG_PAD_PROPERTIES::PadTypeSelected(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), DIALOG_PLOT_SCHEMATIC::SetHPGLPenWidth(), DIALOG_GRID_SETTINGS::TransferDataFromWindow(), DIALOG_JUNCTION_PROPS::TransferDataFromWindow(), DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow(), DIALOG_TRACK_VIA_SIZE::TransferDataFromWindow(), PANEL_EESCHEMA_SETTINGS::TransferDataFromWindow(), DIALOG_EDIT_LINE_STYLE::TransferDataFromWindow(), DIALOG_PNS_DIFF_PAIR_DIMENSIONS::TransferDataFromWindow(), PANEL_SETUP_FORMATTING::TransferDataFromWindow(), DIALOG_PNS_LENGTH_TUNING_SETTINGS::TransferDataFromWindow(), PANEL_LIBEDIT_SETTINGS::TransferDataFromWindow(), DIALOG_EDIT_SHEET_PIN::TransferDataFromWindow(), DIALOG_LIB_EDIT_TEXT::TransferDataFromWindow(), PANEL_SETUP_MASK_AND_PASTE::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataFromWindow(), PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataFromWindow(), DIALOG_EDIT_ONE_FIELD::TransferDataFromWindow(), DIALOG_SCH_SHEET_PROPS::TransferDataFromWindow(), DIALOG_CREATE_ARRAY::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), PANEL_SETUP_FEATURE_CONSTRAINTS::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow(), DIALOG_COPPER_ZONE::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataFromWindow(), DIALOG_PIN_PROPERTIES::TransferDataFromWindow(), DIALOG_MOVE_EXACT::TransferDataFromWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow(), DIALOG_PAD_PRIMITIVES_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::transferDataToPad(), DIALOG_PAD_PRIMITIVES_TRANSFORM::Transform(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), DIALOG_GRAPHIC_ITEM_PROPERTIES::Validate(), Validate(), PANEL_SETUP_TRACKS_AND_VIAS::validateData(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), and DIALOG_EXPORT_SVG::~DIALOG_EXPORT_SVG().

◆ IsIndeterminate()

bool UNIT_BINDER::IsIndeterminate ( ) const

Function IsIndeterminate Returns true if the control holds the indeterminate value (for instance, if it represents a multiple selection of differing values).

Definition at line 329 of file unit_binder.cpp.

330 {
331  wxTextEntry* te = dynamic_cast<wxTextEntry*>( m_value );
332 
333  if( te )
334  return te->GetValue() == INDETERMINATE_STATE || te->GetValue() == INDETERMINATE_ACTION;
335 
336  return false;
337 }
wxWindow * m_value
Definition: unit_binder.h:188
#define INDETERMINATE_ACTION
Definition: base_units.h:49
#define INDETERMINATE_STATE
Used for holding indeterminate values, such as with multiple selections holding different values or c...
Definition: base_units.h:48

References INDETERMINATE_ACTION, INDETERMINATE_STATE, and m_value.

Referenced by DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), DIALOG_JUNCTION_PROPS::TransferDataFromWindow(), DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_LINE_STYLE::TransferDataFromWindow(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ onKillFocus()

void UNIT_BINDER::onKillFocus ( wxFocusEvent &  aEvent)
protected

Definition at line 129 of file unit_binder.cpp.

130 {
131  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( m_value );
132 
133  if( m_allowEval && textEntry )
134  {
135  if( m_eval.Process( textEntry->GetValue() ) )
136  {
137  textEntry->GetSelection( &m_selStart, &m_selEnd );
138  wxString sel = textEntry->GetStringSelection();
139 
140  textEntry->ChangeValue( m_eval.Result() );
141 
142 #ifdef __WXGTK__
143  // Manually copy the selected text to the primary selection clipboard
144  if( wxTheClipboard->Open() )
145  {
146  bool clipTarget = wxTheClipboard->IsUsingPrimarySelection();
147  wxTheClipboard->UsePrimarySelection( true );
148  wxTheClipboard->SetData( new wxTextDataObject( sel ) );
149  wxTheClipboard->UsePrimarySelection( clipTarget );
150  wxTheClipboard->Close();
151  }
152 #endif
153  }
154 
155  m_needsEval = false;
156  }
157 
158  aEvent.Skip();
159 }
wxWindow * m_value
Definition: unit_binder.h:188
bool m_needsEval
Definition: unit_binder.h:202
bool Process(const wxString &aString)
NUMERIC_EVALUATOR m_eval
Evaluator
Definition: unit_binder.h:200
bool m_allowEval
Definition: unit_binder.h:201
wxString Result() const
long m_selStart
Selection start and end of the original text
Definition: unit_binder.h:205

References m_allowEval, m_eval, m_needsEval, m_selEnd, m_selStart, m_value, NUMERIC_EVALUATOR::Process(), and NUMERIC_EVALUATOR::Result().

Referenced by UNIT_BINDER().

◆ onSetFocus()

void UNIT_BINDER::onSetFocus ( wxFocusEvent &  aEvent)
protected

Definition at line 108 of file unit_binder.cpp.

109 {
110  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( m_value );
111 
112  if( m_allowEval && textEntry )
113  {
114  wxString oldStr = m_eval.OriginalText();
115 
116  if( oldStr.length() )
117  {
118  textEntry->SetValue( oldStr );
119  textEntry->SetSelection( m_selStart, m_selEnd );
120  }
121 
122  m_needsEval = true;
123  }
124 
125  aEvent.Skip();
126 }
wxWindow * m_value
Definition: unit_binder.h:188
wxString OriginalText() const
bool m_needsEval
Definition: unit_binder.h:202
NUMERIC_EVALUATOR m_eval
Evaluator
Definition: unit_binder.h:200
bool m_allowEval
Definition: unit_binder.h:201
long m_selStart
Selection start and end of the original text
Definition: unit_binder.h:205

References m_allowEval, m_eval, m_needsEval, m_selEnd, m_selStart, m_value, and NUMERIC_EVALUATOR::OriginalText().

Referenced by UNIT_BINDER().

◆ onUnitsChanged()

void UNIT_BINDER::onUnitsChanged ( wxCommandEvent &  aEvent)
protected

Definition at line 96 of file unit_binder.cpp.

97 {
98  int temp = (int) GetValue();
99 
101 
102  SetValue( temp );
103 
104  aEvent.Skip();
105 }
EDA_DRAW_FRAME * m_frame
Definition: unit_binder.h:184
bool m_useMils
Definition: unit_binder.h:193
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.
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
virtual void SetUnits(EDA_UNITS aUnits, bool aUseMils=false)
Function SetUnits Normally not needed (as the UNIT_BINDER inherits from the parent frame),...
Definition: unit_binder.cpp:81

References EDA_BASE_FRAME::GetUserUnits(), GetValue(), m_frame, m_useMils, SetUnits(), and SetValue().

Referenced by UNIT_BINDER(), and ~UNIT_BINDER().

◆ SetCoordType()

◆ SetDataType()

void UNIT_BINDER::SetDataType ( EDA_DATA_TYPE  aDataType)

Used to override the datatype of the displayed property (default is DISTANCE)

Parameters
aDataTypeis the datatype to use for the units text display

Definition at line 89 of file unit_binder.cpp.

90 {
91  m_dataType = aDataType;
93 }
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:495
EDA_UNITS m_units
Currently used units.
Definition: unit_binder.h:192
EDA_DATA_TYPE m_dataType
Definition: unit_binder.h:194
wxStaticText * m_unitLabel
Definition: unit_binder.h:189
bool m_useMils
Definition: unit_binder.h:193

References GetAbbreviatedUnitsLabel(), m_dataType, m_unitLabel, m_units, and m_useMils.

Referenced by DIALOG_COPPER_ZONE::TransferDataToWindow().

◆ SetDoubleValue()

void UNIT_BINDER::SetDoubleValue ( double  aValue)
virtual

Function SetDoubleValue Sets new value (in Internal Units) for the text field, taking care of units conversion.

Parameters
aValueis the new value.

Definition at line 234 of file unit_binder.cpp.

235 {
236  double displayValue = m_originTransforms.ToDisplay( aValue, m_coordType );
237  SetValue( StringFromValue( m_units, displayValue, false, m_useMils, m_dataType ) );
238 }
ORIGIN_TRANSFORMS::COORD_TYPES_T m_coordType
Type of coordinate for display origin transforms.
Definition: unit_binder.h:212
ORIGIN_TRANSFORMS & m_originTransforms
A reference to an ORIGIN_TRANSFORMS object.
Definition: unit_binder.h:209
EDA_UNITS m_units
Currently used units.
Definition: unit_binder.h:192
EDA_DATA_TYPE m_dataType
Definition: unit_binder.h:194
bool m_useMils
Definition: unit_binder.h:193
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
virtual int ToDisplay(int aValue, COORD_TYPES_T aCoordType)
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, bool aUseMils, EDA_DATA_TYPE aType)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:233

References m_coordType, m_dataType, m_originTransforms, m_units, m_useMils, SetValue(), StringFromValue(), and ORIGIN_TRANSFORMS::ToDisplay().

Referenced by DIALOG_POSITION_RELATIVE::DIALOG_POSITION_RELATIVE(), DIALOG_POSITION_RELATIVE::OnClear(), DIALOG_POSITION_RELATIVE::OnPolarChanged(), DIALOG_MOVE_EXACT::OnPolarChanged(), and DIALOG_COPPER_ZONE::TransferDataToWindow().

◆ SetLabel()

void UNIT_BINDER::SetLabel ( const wxString &  aLabel)

Definition at line 356 of file unit_binder.cpp.

357 {
358  m_label->SetLabel( aLabel );
359 }
wxStaticText * m_label
The bound widgets
Definition: unit_binder.h:187

References m_label.

Referenced by DIALOG_POSITION_RELATIVE::updateDialogControls(), and DIALOG_MOVE_EXACT::updateDialogControls().

◆ SetUnits()

void UNIT_BINDER::SetUnits ( EDA_UNITS  aUnits,
bool  aUseMils = false 
)
virtual

Function SetUnits Normally not needed (as the UNIT_BINDER inherits from the parent frame), but can be used to set to DEGREES for angular controls.

Definition at line 81 of file unit_binder.cpp.

82 {
83  m_units = aUnits;
84  m_useMils = aUseMils;
86 }
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:495
EDA_UNITS m_units
Currently used units.
Definition: unit_binder.h:192
EDA_DATA_TYPE m_dataType
Definition: unit_binder.h:194
wxStaticText * m_unitLabel
Definition: unit_binder.h:189
bool m_useMils
Definition: unit_binder.h:193

References GetAbbreviatedUnitsLabel(), m_dataType, m_unitLabel, m_units, and m_useMils.

Referenced by DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY(), DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES(), DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), DIALOG_PAD_PRIMITIVES_TRANSFORM::DIALOG_PAD_PRIMITIVES_TRANSFORM(), DIALOG_PNS_LENGTH_TUNING_SETTINGS::DIALOG_PNS_LENGTH_TUNING_SETTINGS(), onUnitsChanged(), PANEL_SETUP_FORMATTING::TransferDataToWindow(), DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataToWindow(), DIALOG_COPPER_ZONE::TransferDataToWindow(), DIALOG_PAD_PRIMITIVES_PROPERTIES::TransferDataToWindow(), DIALOG_POSITION_RELATIVE::updateDialogControls(), and DIALOG_MOVE_EXACT::updateDialogControls().

◆ SetValue() [1/2]

void UNIT_BINDER::SetValue ( int  aValue)
virtual

Function SetValue Sets new value (in Internal Units) for the text field, taking care of units conversion.

Parameters
aValueis the new value.

Definition at line 226 of file unit_binder.cpp.

227 {
228  double value = aValue;
229  double displayValue = m_originTransforms.ToDisplay( value, m_coordType );
230  SetValue( StringFromValue( m_units, displayValue, false, m_useMils, m_dataType ) );
231 }
ORIGIN_TRANSFORMS::COORD_TYPES_T m_coordType
Type of coordinate for display origin transforms.
Definition: unit_binder.h:212
ORIGIN_TRANSFORMS & m_originTransforms
A reference to an ORIGIN_TRANSFORMS object.
Definition: unit_binder.h:209
EDA_UNITS m_units
Currently used units.
Definition: unit_binder.h:192
EDA_DATA_TYPE m_dataType
Definition: unit_binder.h:194
bool m_useMils
Definition: unit_binder.h:193
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
virtual int ToDisplay(int aValue, COORD_TYPES_T aCoordType)
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, bool aUseMils, EDA_DATA_TYPE aType)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:233

References m_coordType, m_dataType, m_originTransforms, m_units, m_useMils, StringFromValue(), and ORIGIN_TRANSFORMS::ToDisplay().

Referenced by DIALOG_COPPER_ZONE::AcceptOptions(), DIALOG_PLOT::applyPlotSettings(), DIALOG_CREATE_ARRAY::calculateCircularArrayProperties(), DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT(), DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), PANEL_SETUP_FORMATTING::ImportSettingsFrom(), DIALOG_PLOT::init_Dialog(), DIALOG_EXPORT_SVG::initDialog(), DIALOG_PAGES_SETTINGS::initDialog(), DIALOG_PLOT_SCHEMATIC::initDlg(), DIALOG_POSITION_RELATIVE::OnClear(), DIALOG_MOVE_EXACT::OnClear(), DIALOG_PAD_PROPERTIES::OnOffsetCheckbox(), DIALOG_PAD_PROPERTIES::OnPadToDieCheckbox(), DIALOG_GRID_SETTINGS::OnResetGridOriginClick(), onUnitsChanged(), DIALOG_JUNCTION_PROPS::resetDefaults(), DIALOG_EDIT_LINE_STYLE::resetDefaults(), SetDoubleValue(), DIALOG_LIB_NEW_COMPONENT::SetPinTextPosition(), DIALOG_JUNCTION_PROPS::TransferDataToWindow(), DIALOG_GRID_SETTINGS::TransferDataToWindow(), PANEL_EESCHEMA_SETTINGS::TransferDataToWindow(), DIALOG_EDIT_LINE_STYLE::TransferDataToWindow(), DIALOG_TRACK_VIA_SIZE::TransferDataToWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_PNS_DIFF_PAIR_DIMENSIONS::TransferDataToWindow(), DIALOG_LIB_EDIT_DRAW_ITEM::TransferDataToWindow(), PANEL_SETUP_FORMATTING::TransferDataToWindow(), DIALOG_PNS_LENGTH_TUNING_SETTINGS::TransferDataToWindow(), PANEL_LIBEDIT_SETTINGS::TransferDataToWindow(), DIALOG_EDIT_SHEET_PIN::TransferDataToWindow(), DIALOG_LIB_EDIT_TEXT::TransferDataToWindow(), PANEL_SETUP_MASK_AND_PASTE::TransferDataToWindow(), DIALOG_TARGET_PROPERTIES::TransferDataToWindow(), DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataToWindow(), PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataToWindow(), DIALOG_EDIT_ONE_FIELD::TransferDataToWindow(), DIALOG_SCH_SHEET_PROPS::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), PANEL_SETUP_FEATURE_CONSTRAINTS::TransferDataToWindow(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow(), DIALOG_COPPER_ZONE::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow(), DIALOG_PIN_PROPERTIES::TransferDataToWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow(), DIALOG_PAD_PRIMITIVES_PROPERTIES::TransferDataToWindow(), and DIALOG_PAD_PRIMITIVE_POLY_PROPS::TransferDataToWindow().

◆ SetValue() [2/2]

void UNIT_BINDER::SetValue ( wxString  aValue)

Definition at line 241 of file unit_binder.cpp.

242 {
243  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( m_value );
244  wxStaticText* staticText = dynamic_cast<wxStaticText*>( m_value );
245 
246  if( textEntry )
247  textEntry->SetValue( aValue );
248  else if( staticText )
249  staticText->SetLabel( aValue );
250 
251  if( m_allowEval )
252  m_eval.Clear();
253 
255 }
wxWindow * m_value
Definition: unit_binder.h:188
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:495
EDA_UNITS m_units
Currently used units.
Definition: unit_binder.h:192
EDA_DATA_TYPE m_dataType
Definition: unit_binder.h:194
wxStaticText * m_unitLabel
Definition: unit_binder.h:189
NUMERIC_EVALUATOR m_eval
Evaluator
Definition: unit_binder.h:200
bool m_useMils
Definition: unit_binder.h:193
bool m_allowEval
Definition: unit_binder.h:201

References NUMERIC_EVALUATOR::Clear(), GetAbbreviatedUnitsLabel(), m_allowEval, m_dataType, m_eval, m_unitLabel, m_units, m_useMils, and m_value.

◆ Show()

void UNIT_BINDER::Show ( bool  aShow,
bool  aResize = false 
)

Function Show Shows/hides the label, widget and units label.

Parameters
aShowcalled for the Show() routine in wx
aResizeif true, the element will be sized to 0 on hide and -1 on show

Definition at line 370 of file unit_binder.cpp.

371 {
372  m_label->Show( aShow );
373  m_value->Show( aShow );
374  m_unitLabel->Show( aShow );
375 
376  if( aResize )
377  {
378  if( aShow )
379  {
380  m_label->SetSize( -1, -1 );
381  m_value->SetSize( -1, -1 );
382  m_unitLabel->SetSize( -1, -1 );
383  }
384  else
385  {
386  m_label->SetSize( 0, 0 );
387  m_value->SetSize( 0, 0 );
388  m_unitLabel->SetSize( 0, 0 );
389  }
390  }
391 }
wxWindow * m_value
Definition: unit_binder.h:188
wxStaticText * m_label
The bound widgets
Definition: unit_binder.h:187
wxStaticText * m_unitLabel
Definition: unit_binder.h:189

References m_label, m_unitLabel, and m_value.

Referenced by DIALOG_PAD_PROPERTIES::OnUpdateUI(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow(), and DIALOG_PAD_PRIMITIVES_PROPERTIES::TransferDataToWindow().

◆ Validate()

bool UNIT_BINDER::Validate ( double  aMin,
double  aMax,
EDA_UNITS  aUnits = EDA_UNITS::UNSCALED,
bool  aUseMils = false 
)
virtual

Function Validate Validates the control against the given range, informing the user of any errors found.

Parameters
aMina minimum value for validation
aMaxa maximum value for validation
aUnitsthe units of the min/max parameters (use UNSCALED for internal units)
aUseMilsif aUnits is EDA_UNITS::INCHES, interpret as mils
Returns
false on error.

Definition at line 181 of file unit_binder.cpp.

182 {
183  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( m_value );
184 
185  if( !textEntry
186  || textEntry->GetValue() == INDETERMINATE_ACTION
187  || textEntry->GetValue() == INDETERMINATE_STATE )
188  {
189  return true;
190  }
191 
192  // TODO: Validate() does not currently support m_dataType being anything other than DISTANCE
193  // Note: aMin and aMax are not always given in internal units
194  if( GetValue() < From_User_Unit( aUnits, aMin, aUseMils ) )
195  {
196  double val_min_iu = From_User_Unit( aUnits, aMin, aUseMils );
197  m_errorMessage = wxString::Format( _( "%s must be at least %s." ),
199  StringFromValue( m_units, val_min_iu, true, m_useMils ) );
200 
201  textEntry->SelectAll();
202  // Don't focus directly; we might be inside a KillFocus event handler
203  wxPostEvent( this, wxCommandEvent( DELAY_FOCUS ) );
204 
205  return false;
206  }
207 
208  if( GetValue() > From_User_Unit( aUnits, aMax, aUseMils ) )
209  {
210  double val_max_iu = From_User_Unit( aUnits, aMax, aUseMils );
211  m_errorMessage = wxString::Format( _( "%s must be less than %s." ),
213  StringFromValue( m_units, val_max_iu, true, m_useMils ) );
214 
215  textEntry->SelectAll();
216  // Don't focus directly; we might be inside a KillFocus event handler
217  wxPostEvent( this, wxCommandEvent( DELAY_FOCUS ) );
218 
219  return false;
220  }
221 
222  return true;
223 }
wxString m_errorMessage
Validation support.
Definition: unit_binder.h:197
wxWindow * m_value
Definition: unit_binder.h:188
double From_User_Unit(EDA_UNITS aUnits, double aValue, bool aUseMils)
Return in internal units the value "val" given in a real unit such as "in", "mm" or "deg".
Definition: base_units.cpp:321
wxString valueDescriptionFromLabel(wxStaticText *aLabel)
EDA_UNITS m_units
Currently used units.
Definition: unit_binder.h:192
wxStaticText * m_label
The bound widgets
Definition: unit_binder.h:187
bool m_useMils
Definition: unit_binder.h:193
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:201
#define _(s)
Definition: 3d_actions.cpp:33
virtual long long int GetValue()
Function GetValue Returns the current value in Internal Units.
#define INDETERMINATE_ACTION
Definition: base_units.h:49
#define INDETERMINATE_STATE
Used for holding indeterminate values, such as with multiple selections holding different values or c...
Definition: base_units.h:48
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, bool aUseMils, EDA_DATA_TYPE aType)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:233

References _, Format(), From_User_Unit(), GetValue(), INDETERMINATE_ACTION, INDETERMINATE_STATE, m_errorMessage, m_label, m_units, m_useMils, m_value, StringFromValue(), and valueDescriptionFromLabel().

Referenced by DIALOG_PNS_LENGTH_TUNING_SETTINGS::AcceptOptions(), DIALOG_COPPER_ZONE::AcceptOptions(), DIALOG_PAGES_SETTINGS::OnOkClick(), DIALOG_GRID_SETTINGS::TransferDataFromWindow(), DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), PANEL_SETUP_FEATURE_CONSTRAINTS::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::transferDataToPad(), DIALOG_FOOTPRINT_FP_EDITOR::Validate(), and DIALOG_FOOTPRINT_BOARD_EDITOR::Validate().

Member Data Documentation

◆ m_allowEval

bool UNIT_BINDER::m_allowEval
protected

◆ m_coordType

ORIGIN_TRANSFORMS::COORD_TYPES_T UNIT_BINDER::m_coordType
protected

Type of coordinate for display origin transforms.

Definition at line 212 of file unit_binder.h.

Referenced by ChangeValue(), GetCoordType(), GetDoubleValue(), GetValue(), SetCoordType(), SetDoubleValue(), and SetValue().

◆ m_dataType

EDA_DATA_TYPE UNIT_BINDER::m_dataType
protected

◆ m_errorMessage

wxString UNIT_BINDER::m_errorMessage
protected

Validation support.

Definition at line 197 of file unit_binder.h.

Referenced by delayedFocusHandler(), and Validate().

◆ m_eval

NUMERIC_EVALUATOR UNIT_BINDER::m_eval
protected

Evaluator

Definition at line 200 of file unit_binder.h.

Referenced by ChangeValue(), GetDoubleValue(), GetOriginalText(), GetValue(), onKillFocus(), onSetFocus(), and SetValue().

◆ m_frame

EDA_DRAW_FRAME* UNIT_BINDER::m_frame
protected

Definition at line 184 of file unit_binder.h.

Referenced by onUnitsChanged(), UNIT_BINDER(), and ~UNIT_BINDER().

◆ m_label

wxStaticText* UNIT_BINDER::m_label
protected

The bound widgets

Definition at line 187 of file unit_binder.h.

Referenced by Enable(), SetLabel(), Show(), and Validate().

◆ m_needsEval

bool UNIT_BINDER::m_needsEval
protected

Definition at line 202 of file unit_binder.h.

Referenced by GetDoubleValue(), GetValue(), onKillFocus(), onSetFocus(), and UNIT_BINDER().

◆ m_originTransforms

ORIGIN_TRANSFORMS& UNIT_BINDER::m_originTransforms
protected

A reference to an ORIGIN_TRANSFORMS object.

Definition at line 209 of file unit_binder.h.

Referenced by ChangeValue(), GetDoubleValue(), GetValue(), SetDoubleValue(), and SetValue().

◆ m_selEnd

long UNIT_BINDER::m_selEnd
protected

Definition at line 206 of file unit_binder.h.

Referenced by onKillFocus(), onSetFocus(), and UNIT_BINDER().

◆ m_selStart

long UNIT_BINDER::m_selStart
protected

Selection start and end of the original text

Definition at line 205 of file unit_binder.h.

Referenced by onKillFocus(), onSetFocus(), and UNIT_BINDER().

◆ m_unitLabel

wxStaticText* UNIT_BINDER::m_unitLabel
protected

Definition at line 189 of file unit_binder.h.

Referenced by ChangeValue(), Enable(), SetDataType(), SetUnits(), SetValue(), Show(), and UNIT_BINDER().

◆ m_units

EDA_UNITS UNIT_BINDER::m_units
protected

Currently used units.

Definition at line 192 of file unit_binder.h.

Referenced by ChangeValue(), GetDoubleValue(), GetValue(), SetDataType(), SetDoubleValue(), SetUnits(), SetValue(), UNIT_BINDER(), and Validate().

◆ m_useMils

bool UNIT_BINDER::m_useMils
protected

◆ m_value


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