KiCad PCB EDA Suite
EDA_SIZE_CTRL Class Reference

Object to edit/enter a size (pair of values for X and Y size ( INCHES or MM ) in dialog boxes. More...

#include <dialog_helpers.h>

Inheritance diagram for EDA_SIZE_CTRL:
EDA_POSITION_CTRL

Public Member Functions

 EDA_SIZE_CTRL (wxWindow *parent, const wxString &title, const wxSize &size_to_edit, EDA_UNITS user_unit, wxBoxSizer *BoxSizer)
 
 ~EDA_SIZE_CTRL ()
 
wxSize GetValue () const
 
void Enable (bool x_win_on, bool y_win_on)
 
void SetValue (int x_value, int y_value)
 

Public Attributes

EDA_UNITS m_UserUnit
 
wxTextCtrl * m_FramePosX
 
wxTextCtrl * m_FramePosY
 

Detailed Description

Object to edit/enter a size (pair of values for X and Y size ( INCHES or MM ) in dialog boxes.

Definition at line 120 of file dialog_helpers.h.

Constructor & Destructor Documentation

◆ EDA_SIZE_CTRL()

EDA_SIZE_CTRL::EDA_SIZE_CTRL ( wxWindow *  parent,
const wxString &  title,
const wxSize &  size_to_edit,
EDA_UNITS  user_unit,
wxBoxSizer *  BoxSizer 
)

Definition at line 89 of file eda_size_ctrl.cpp.

91  : EDA_POSITION_CTRL( parent, title, wxPoint( aSize.x, aSize.y ), aUnit, aBoxSizer )
92 {
93 }
EDA_POSITION_CTRL(wxWindow *parent, const wxString &title, const wxPoint &pos_to_edit, EDA_UNITS user_unit, wxBoxSizer *BoxSizer)

◆ ~EDA_SIZE_CTRL()

EDA_SIZE_CTRL::~EDA_SIZE_CTRL ( )
inline

Definition at line 126 of file dialog_helpers.h.

126 { }

Member Function Documentation

◆ Enable()

void EDA_POSITION_CTRL::Enable ( bool  x_win_on,
bool  y_win_on 
)
inherited

Definition at line 72 of file eda_size_ctrl.cpp.

73 {
74  m_FramePosX->Enable( x_win_on );
75  m_FramePosY->Enable( y_win_on );
76 }
wxTextCtrl * m_FramePosX
wxTextCtrl * m_FramePosY

References EDA_POSITION_CTRL::m_FramePosX, and EDA_POSITION_CTRL::m_FramePosY.

◆ GetValue()

wxSize EDA_SIZE_CTRL::GetValue ( ) const

Definition at line 96 of file eda_size_ctrl.cpp.

97 {
98  wxPoint pos = EDA_POSITION_CTRL::GetValue();
99 
100  return wxSize( pos.x, pos.y );
101 }
wxPoint GetValue() const

References EDA_POSITION_CTRL::GetValue().

Referenced by MWAVE_POLYGONAL_SHAPE_DLG::OnOkClick().

◆ SetValue()

void EDA_POSITION_CTRL::SetValue ( int  x_value,
int  y_value 
)
inherited

Definition at line 79 of file eda_size_ctrl.cpp.

80 {
81  m_FramePosX->SetValue( StringFromValue( m_UserUnit, x_value ) );
82  m_FramePosY->SetValue( StringFromValue( m_UserUnit, y_value ) );
83 }
wxTextCtrl * m_FramePosX
wxTextCtrl * m_FramePosY
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
Definition: base_units.cpp:190

References EDA_POSITION_CTRL::m_FramePosX, EDA_POSITION_CTRL::m_FramePosY, EDA_POSITION_CTRL::m_UserUnit, and StringFromValue().

Referenced by EDA_POSITION_CTRL::EDA_POSITION_CTRL(), and MWAVE_POLYGONAL_SHAPE_DLG::ReadDataShapeDescr().

Member Data Documentation

◆ m_FramePosX

◆ m_FramePosY

◆ m_UserUnit

EDA_UNITS EDA_POSITION_CTRL::m_UserUnit
inherited

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