Renamed WX_UNIT_BINDER to UNIT_BINDER and moved to common/widgets

WX_ prefix should reserved for classes provieded by wxWidgets.
This commit is contained in:
Maciej Suminski 2017-11-11 00:27:46 +01:00
parent 84e360dd0d
commit 579d3f478d
7 changed files with 34 additions and 34 deletions

View File

@ -178,6 +178,7 @@ set( COMMON_WIDGET_SRCS
widgets/footprint_select_widget.cpp widgets/footprint_select_widget.cpp
widgets/footprint_choice.cpp widgets/footprint_choice.cpp
widgets/indicator_icon.cpp widgets/indicator_icon.cpp
widgets/unit_binder.cpp
) )
set( COMMON_PAGE_LAYOUT_SRCS set( COMMON_PAGE_LAYOUT_SRCS
@ -293,7 +294,6 @@ set( COMMON_SRCS
worksheet.cpp worksheet.cpp
wxwineda.cpp wxwineda.cpp
wxdataviewctrl_helpers.cpp wxdataviewctrl_helpers.cpp
wx_unit_binder.cpp
wx_status_popup.cpp wx_status_popup.cpp
xnode.cpp xnode.cpp
zoom.cpp zoom.cpp

View File

@ -29,9 +29,9 @@
#include <base_units.h> #include <base_units.h>
#include <wx/valnum.h> #include <wx/valnum.h>
#include "wx_unit_binder.h" #include "widgets/unit_binder.h"
WX_UNIT_BINDER::WX_UNIT_BINDER( wxWindow* aParent, wxTextEntry* aTextInput, UNIT_BINDER::UNIT_BINDER( wxWindow* aParent, wxTextEntry* aTextInput,
wxStaticText* aUnitLabel, wxSpinButton* aSpinButton ) : wxStaticText* aUnitLabel, wxSpinButton* aSpinButton ) :
m_textEntry( aTextInput ), m_textEntry( aTextInput ),
m_unitLabel( aUnitLabel ), m_unitLabel( aUnitLabel ),
@ -46,12 +46,12 @@ WX_UNIT_BINDER::WX_UNIT_BINDER( wxWindow* aParent, wxTextEntry* aTextInput,
} }
WX_UNIT_BINDER::~WX_UNIT_BINDER() UNIT_BINDER::~UNIT_BINDER()
{ {
} }
void WX_UNIT_BINDER::SetValue( int aValue ) void UNIT_BINDER::SetValue( int aValue )
{ {
wxString s = StringFromValue( m_units, aValue, false ); wxString s = StringFromValue( m_units, aValue, false );
@ -61,7 +61,7 @@ void WX_UNIT_BINDER::SetValue( int aValue )
} }
int WX_UNIT_BINDER::GetValue() const int UNIT_BINDER::GetValue() const
{ {
wxString s = m_textEntry->GetValue(); wxString s = m_textEntry->GetValue();
@ -69,7 +69,7 @@ int WX_UNIT_BINDER::GetValue() const
} }
bool WX_UNIT_BINDER::Valid() const bool UNIT_BINDER::Valid() const
{ {
double dummy; double dummy;
@ -77,7 +77,7 @@ bool WX_UNIT_BINDER::Valid() const
} }
void WX_UNIT_BINDER::Enable( bool aEnable ) void UNIT_BINDER::Enable( bool aEnable )
{ {
wxWindow* wxWin = dynamic_cast<wxWindow*>( m_textEntry ); wxWindow* wxWin = dynamic_cast<wxWindow*>( m_textEntry );
wxASSERT( wxWin ); wxASSERT( wxWin );

View File

@ -22,8 +22,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef __WX_UNIT_BINDER_H_ #ifndef __UNIT_BINDER_H_
#define __WX_UNIT_BINDER_H_ #define __UNIT_BINDER_H_
#include <common.h> #include <common.h>
#include <wx/spinbutt.h> #include <wx/spinbutt.h>
@ -32,7 +32,7 @@ class wxTextEntry;
class wxSpinButton; class wxSpinButton;
class wxStaticText; class wxStaticText;
class WX_UNIT_BINDER class UNIT_BINDER
{ {
public: public:
@ -43,9 +43,9 @@ public:
* @param aUnitLabel is the units label displayed next to the text field. * @param aUnitLabel is the units label displayed next to the text field.
* @param aSpinButton is an optional spin button (for adjusting the input value) * @param aSpinButton is an optional spin button (for adjusting the input value)
*/ */
WX_UNIT_BINDER( wxWindow* aParent, wxTextEntry* aTextInput, wxStaticText* aUnitLabel, wxSpinButton* aSpinButton = NULL ); UNIT_BINDER( wxWindow* aParent, wxTextEntry* aTextInput, wxStaticText* aUnitLabel, wxSpinButton* aSpinButton = NULL );
virtual ~WX_UNIT_BINDER(); virtual ~UNIT_BINDER();
/** /**
* Function SetValue * Function SetValue
@ -94,4 +94,4 @@ protected:
static const wxString DEFAULT_VALUE; static const wxString DEFAULT_VALUE;
}; };
#endif /* __WX_UNIT_BINDER_H_ */ #endif /* __UNIT_BINDER_H_ */

View File

@ -26,7 +26,7 @@
#ifndef __dialog_diff_pair_dimensions_settings__ #ifndef __dialog_diff_pair_dimensions_settings__
#define __dialog_diff_pair_dimensions_settings__ #define __dialog_diff_pair_dimensions_settings__
#include <wx_unit_binder.h> #include <widgets/unit_binder.h>
#include "dialog_pns_diff_pair_dimensions_base.h" #include "dialog_pns_diff_pair_dimensions_base.h"
@ -47,9 +47,9 @@ private:
virtual void OnOkClick( wxCommandEvent& aEvent ) override; virtual void OnOkClick( wxCommandEvent& aEvent ) override;
virtual void OnViaTraceGapEqualCheck( wxCommandEvent& event ) override; virtual void OnViaTraceGapEqualCheck( wxCommandEvent& event ) override;
WX_UNIT_BINDER m_traceWidth; UNIT_BINDER m_traceWidth;
WX_UNIT_BINDER m_traceGap; UNIT_BINDER m_traceGap;
WX_UNIT_BINDER m_viaGap; UNIT_BINDER m_viaGap;
PNS::SIZES_SETTINGS& m_sizes; PNS::SIZES_SETTINGS& m_sizes;
}; };

View File

@ -28,7 +28,7 @@
#include "dialog_pns_length_tuning_settings_base.h" #include "dialog_pns_length_tuning_settings_base.h"
#include <wx_unit_binder.h> #include <widgets/unit_binder.h>
#include <router/pns_router.h> #include <router/pns_router.h>
@ -46,10 +46,10 @@ public:
virtual void OnOkClick( wxCommandEvent& aEvent ) override; virtual void OnOkClick( wxCommandEvent& aEvent ) override;
private: private:
WX_UNIT_BINDER m_minAmpl; UNIT_BINDER m_minAmpl;
WX_UNIT_BINDER m_maxAmpl; UNIT_BINDER m_maxAmpl;
WX_UNIT_BINDER m_spacing; UNIT_BINDER m_spacing;
WX_UNIT_BINDER m_targetLength; UNIT_BINDER m_targetLength;
PNS::MEANDER_SETTINGS& m_settings; PNS::MEANDER_SETTINGS& m_settings;
PNS::ROUTER_MODE m_mode; PNS::ROUTER_MODE m_mode;

View File

@ -23,7 +23,7 @@
*/ */
#include <dialogs/dialog_track_via_properties_base.h> #include <dialogs/dialog_track_via_properties_base.h>
#include <wx_unit_binder.h> #include <widgets/unit_binder.h>
#include <core/optional.h> #include <core/optional.h>
#include <layers_id_colors_and_visibility.h> #include <layers_id_colors_and_visibility.h>
@ -63,7 +63,7 @@ private:
///> Sets wxTextEntry to the value stored in OPT<T> or "<...>" if it is not available. ///> Sets wxTextEntry to the value stored in OPT<T> or "<...>" if it is not available.
template<typename T> template<typename T>
void setCommonVal( const OPT<T>& aVal, wxTextEntry* aTxtEntry, WX_UNIT_BINDER& aBinder ) void setCommonVal( const OPT<T>& aVal, wxTextEntry* aTxtEntry, UNIT_BINDER& aBinder )
{ {
if( aVal ) if( aVal )
aBinder.SetValue( *aVal ); aBinder.SetValue( *aVal );
@ -74,12 +74,12 @@ private:
///> Selected items to be modified. ///> Selected items to be modified.
const SELECTION& m_items; const SELECTION& m_items;
WX_UNIT_BINDER m_trackStartX, m_trackStartY; UNIT_BINDER m_trackStartX, m_trackStartY;
WX_UNIT_BINDER m_trackEndX, m_trackEndY; UNIT_BINDER m_trackEndX, m_trackEndY;
WX_UNIT_BINDER m_trackWidth; UNIT_BINDER m_trackWidth;
WX_UNIT_BINDER m_viaX, m_viaY; UNIT_BINDER m_viaX, m_viaY;
WX_UNIT_BINDER m_viaDiameter, m_viaDrill; UNIT_BINDER m_viaDiameter, m_viaDrill;
///> Flag that determines if the dialog displays track properties. ///> Flag that determines if the dialog displays track properties.
bool m_tracks; bool m_tracks;

View File

@ -25,7 +25,7 @@
#ifndef __dialog_track_via_size__ #ifndef __dialog_track_via_size__
#define __dialog_track_via_size__ #define __dialog_track_via_size__
#include <wx_unit_binder.h> #include <widgets/unit_binder.h>
#include "dialog_track_via_size_base.h" #include "dialog_track_via_size_base.h"
@ -39,9 +39,9 @@ public:
DIALOG_TRACK_VIA_SIZE( wxWindow* aParent, BOARD_DESIGN_SETTINGS& aSettings ); DIALOG_TRACK_VIA_SIZE( wxWindow* aParent, BOARD_DESIGN_SETTINGS& aSettings );
protected: protected:
WX_UNIT_BINDER m_trackWidth; UNIT_BINDER m_trackWidth;
WX_UNIT_BINDER m_viaDiameter; UNIT_BINDER m_viaDiameter;
WX_UNIT_BINDER m_viaDrill; UNIT_BINDER m_viaDrill;
// Routings settings that are modified by the dialog. // Routings settings that are modified by the dialog.
BOARD_DESIGN_SETTINGS& m_settings; BOARD_DESIGN_SETTINGS& m_settings;