From 579d3f478d511cea05d5b744c601cc7a372e64d0 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Sat, 11 Nov 2017 00:27:46 +0100 Subject: [PATCH] Renamed WX_UNIT_BINDER to UNIT_BINDER and moved to common/widgets WX_ prefix should reserved for classes provieded by wxWidgets. --- common/CMakeLists.txt | 2 +- .../unit_binder.cpp} | 14 +++++++------- .../{wx_unit_binder.h => widgets/unit_binder.h} | 12 ++++++------ pcbnew/dialogs/dialog_pns_diff_pair_dimensions.h | 8 ++++---- pcbnew/dialogs/dialog_pns_length_tuning_settings.h | 10 +++++----- pcbnew/dialogs/dialog_track_via_properties.h | 14 +++++++------- pcbnew/dialogs/dialog_track_via_size.h | 8 ++++---- 7 files changed, 34 insertions(+), 34 deletions(-) rename common/{wx_unit_binder.cpp => widgets/unit_binder.cpp} (88%) rename include/{wx_unit_binder.h => widgets/unit_binder.h} (90%) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 4429bc6bee..e1deda0707 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -178,6 +178,7 @@ set( COMMON_WIDGET_SRCS widgets/footprint_select_widget.cpp widgets/footprint_choice.cpp widgets/indicator_icon.cpp + widgets/unit_binder.cpp ) set( COMMON_PAGE_LAYOUT_SRCS @@ -293,7 +294,6 @@ set( COMMON_SRCS worksheet.cpp wxwineda.cpp wxdataviewctrl_helpers.cpp - wx_unit_binder.cpp wx_status_popup.cpp xnode.cpp zoom.cpp diff --git a/common/wx_unit_binder.cpp b/common/widgets/unit_binder.cpp similarity index 88% rename from common/wx_unit_binder.cpp rename to common/widgets/unit_binder.cpp index f9563ef8cd..4c36257e35 100644 --- a/common/wx_unit_binder.cpp +++ b/common/widgets/unit_binder.cpp @@ -29,9 +29,9 @@ #include #include -#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 ) : m_textEntry( aTextInput ), 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 ); @@ -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(); @@ -69,7 +69,7 @@ int WX_UNIT_BINDER::GetValue() const } -bool WX_UNIT_BINDER::Valid() const +bool UNIT_BINDER::Valid() const { 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( m_textEntry ); wxASSERT( wxWin ); diff --git a/include/wx_unit_binder.h b/include/widgets/unit_binder.h similarity index 90% rename from include/wx_unit_binder.h rename to include/widgets/unit_binder.h index 7639c8494a..25da17ec37 100644 --- a/include/wx_unit_binder.h +++ b/include/widgets/unit_binder.h @@ -22,8 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef __WX_UNIT_BINDER_H_ -#define __WX_UNIT_BINDER_H_ +#ifndef __UNIT_BINDER_H_ +#define __UNIT_BINDER_H_ #include #include @@ -32,7 +32,7 @@ class wxTextEntry; class wxSpinButton; class wxStaticText; -class WX_UNIT_BINDER +class UNIT_BINDER { public: @@ -43,9 +43,9 @@ public: * @param aUnitLabel is the units label displayed next to the text field. * @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 @@ -94,4 +94,4 @@ protected: static const wxString DEFAULT_VALUE; }; -#endif /* __WX_UNIT_BINDER_H_ */ +#endif /* __UNIT_BINDER_H_ */ diff --git a/pcbnew/dialogs/dialog_pns_diff_pair_dimensions.h b/pcbnew/dialogs/dialog_pns_diff_pair_dimensions.h index 6b370861a8..946434226a 100644 --- a/pcbnew/dialogs/dialog_pns_diff_pair_dimensions.h +++ b/pcbnew/dialogs/dialog_pns_diff_pair_dimensions.h @@ -26,7 +26,7 @@ #ifndef __dialog_diff_pair_dimensions_settings__ #define __dialog_diff_pair_dimensions_settings__ -#include +#include #include "dialog_pns_diff_pair_dimensions_base.h" @@ -47,9 +47,9 @@ private: virtual void OnOkClick( wxCommandEvent& aEvent ) override; virtual void OnViaTraceGapEqualCheck( wxCommandEvent& event ) override; - WX_UNIT_BINDER m_traceWidth; - WX_UNIT_BINDER m_traceGap; - WX_UNIT_BINDER m_viaGap; + UNIT_BINDER m_traceWidth; + UNIT_BINDER m_traceGap; + UNIT_BINDER m_viaGap; PNS::SIZES_SETTINGS& m_sizes; }; diff --git a/pcbnew/dialogs/dialog_pns_length_tuning_settings.h b/pcbnew/dialogs/dialog_pns_length_tuning_settings.h index 636cd017a6..e5440c27e3 100644 --- a/pcbnew/dialogs/dialog_pns_length_tuning_settings.h +++ b/pcbnew/dialogs/dialog_pns_length_tuning_settings.h @@ -28,7 +28,7 @@ #include "dialog_pns_length_tuning_settings_base.h" -#include +#include #include @@ -46,10 +46,10 @@ public: virtual void OnOkClick( wxCommandEvent& aEvent ) override; private: - WX_UNIT_BINDER m_minAmpl; - WX_UNIT_BINDER m_maxAmpl; - WX_UNIT_BINDER m_spacing; - WX_UNIT_BINDER m_targetLength; + UNIT_BINDER m_minAmpl; + UNIT_BINDER m_maxAmpl; + UNIT_BINDER m_spacing; + UNIT_BINDER m_targetLength; PNS::MEANDER_SETTINGS& m_settings; PNS::ROUTER_MODE m_mode; diff --git a/pcbnew/dialogs/dialog_track_via_properties.h b/pcbnew/dialogs/dialog_track_via_properties.h index ce327b6930..3dc4d77a16 100644 --- a/pcbnew/dialogs/dialog_track_via_properties.h +++ b/pcbnew/dialogs/dialog_track_via_properties.h @@ -23,7 +23,7 @@ */ #include -#include +#include #include #include @@ -63,7 +63,7 @@ private: ///> Sets wxTextEntry to the value stored in OPT or "<...>" if it is not available. template - void setCommonVal( const OPT& aVal, wxTextEntry* aTxtEntry, WX_UNIT_BINDER& aBinder ) + void setCommonVal( const OPT& aVal, wxTextEntry* aTxtEntry, UNIT_BINDER& aBinder ) { if( aVal ) aBinder.SetValue( *aVal ); @@ -74,12 +74,12 @@ private: ///> Selected items to be modified. const SELECTION& m_items; - WX_UNIT_BINDER m_trackStartX, m_trackStartY; - WX_UNIT_BINDER m_trackEndX, m_trackEndY; - WX_UNIT_BINDER m_trackWidth; + UNIT_BINDER m_trackStartX, m_trackStartY; + UNIT_BINDER m_trackEndX, m_trackEndY; + UNIT_BINDER m_trackWidth; - WX_UNIT_BINDER m_viaX, m_viaY; - WX_UNIT_BINDER m_viaDiameter, m_viaDrill; + UNIT_BINDER m_viaX, m_viaY; + UNIT_BINDER m_viaDiameter, m_viaDrill; ///> Flag that determines if the dialog displays track properties. bool m_tracks; diff --git a/pcbnew/dialogs/dialog_track_via_size.h b/pcbnew/dialogs/dialog_track_via_size.h index 39120c6b7c..79e60850b5 100644 --- a/pcbnew/dialogs/dialog_track_via_size.h +++ b/pcbnew/dialogs/dialog_track_via_size.h @@ -25,7 +25,7 @@ #ifndef __dialog_track_via_size__ #define __dialog_track_via_size__ -#include +#include #include "dialog_track_via_size_base.h" @@ -39,9 +39,9 @@ public: DIALOG_TRACK_VIA_SIZE( wxWindow* aParent, BOARD_DESIGN_SETTINGS& aSettings ); protected: - WX_UNIT_BINDER m_trackWidth; - WX_UNIT_BINDER m_viaDiameter; - WX_UNIT_BINDER m_viaDrill; + UNIT_BINDER m_trackWidth; + UNIT_BINDER m_viaDiameter; + UNIT_BINDER m_viaDrill; // Routings settings that are modified by the dialog. BOARD_DESIGN_SETTINGS& m_settings;