kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #17911
[PATCH 13/27] PinShape: drop list interfaces
This removes the list generation, and simply iterates over the allowed
values.
---
eeschema/lib_pin.cpp | 11 -----------
eeschema/lib_pin.h | 7 -------
eeschema/widgets/pin_shape_combobox.cpp | 11 +++++++----
3 files changed, 7 insertions(+), 22 deletions(-)
diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp
index 8a31e34..fe8f9c5 100644
--- a/eeschema/lib_pin.cpp
+++ b/eeschema/lib_pin.cpp
@@ -2224,17 +2224,6 @@ void LIB_PIN::Rotate()
}
-wxArrayString LIB_PIN::GetStyleNames( void )
-{
- wxArrayString tmp;
-
- for( unsigned ii = 0; ii < PINSHAPE_COUNT; ii++ )
- tmp.Add( GetText( static_cast<PinShape>( ii ) ) );
-
- return tmp;
-}
-
-
wxArrayString LIB_PIN::GetElectricalTypeNames( void )
{
wxArrayString tmp;
diff --git a/eeschema/lib_pin.h b/eeschema/lib_pin.h
index c2787ee..7338a83 100644
--- a/eeschema/lib_pin.h
+++ b/eeschema/lib_pin.h
@@ -443,13 +443,6 @@ public:
static int GetOrientationCodeIndex( int aCode );
/**
- * Get a list of pin draw style names.
- *
- * @return List of valid pin draw style names.
- */
- static wxArrayString GetStyleNames();
-
- /**
* Get a list of pin styles bitmaps for menus and dialogs.
*
* @return List of valid pin electrical type bitmaps symbols in .xpm format.
diff --git a/eeschema/widgets/pin_shape_combobox.cpp b/eeschema/widgets/pin_shape_combobox.cpp
index e030534..6579f0d 100644
--- a/eeschema/widgets/pin_shape_combobox.cpp
+++ b/eeschema/widgets/pin_shape_combobox.cpp
@@ -42,15 +42,18 @@ PinShapeComboBox::PinShapeComboBox( wxWindow* parent,
const wxString& name ) :
wxBitmapComboBox( parent, id, value, pos, size, n, choices, style, validator, name )
{
- wxArrayString list = LIB_PIN::GetStyleNames();
const BITMAP_DEF* bitmaps = LIB_PIN::GetStyleSymbols();
- for ( unsigned ii = 0; ii < list.GetCount(); ii++ )
+ for( unsigned ii = 0; ii < PINSHAPE_COUNT; ++ii )
{
+ PinShape shape = static_cast<PinShape>( ii );
+
+ wxString text = GetText( shape );
+
if( bitmaps == NULL )
- Append( list[ii] );
+ Append( text );
else
- Insert( list[ii], KiBitmap( bitmaps[ii] ), ii );
+ Insert( text, KiBitmap( bitmaps[ii] ), ii );
}
}
Follow ups
References
-
[PATCH 00/27] My current patch stack
From: Simon Richter, 2015-04-13
-
[PATCH 01/27] Move feature check before dependent tests
From: Simon Richter, 2015-04-13
-
[PATCH 02/27] Use Link Time Optimization with GCC in Release builds
From: Simon Richter, 2015-04-13
-
[PATCH 03/27] Make NETLIST_OBJECT::GetConnectionType() const
From: Simon Richter, 2015-04-13
-
[PATCH 04/27] Remove superfluous cast
From: Simon Richter, 2015-04-13
-
[PATCH 05/27] Separate ElectricPinType and TypeSheetLabel
From: Simon Richter, 2015-04-13
-
[PATCH 06/27] Regenerate "Edit Pin" dialog with newer wxFormBuilder
From: Simon Richter, 2015-04-13
-
[PATCH 07/27] Replace DrawPinShape enum with PinShape
From: Simon Richter, 2015-04-13
-
[PATCH 08/27] PinShapeComboBox: Introduce widget
From: Simon Richter, 2015-04-13
-
[PATCH 09/27] PinShapeComboBox: Fully initialize in c'tor
From: Simon Richter, 2015-04-13
-
[PATCH 10/27] PinShapeComboBox: typesafe Get/Set
From: Simon Richter, 2015-04-13
-
[PATCH 11/27] PinShape: move enum to own header
From: Simon Richter, 2015-04-13
-
[PATCH 12/27] PinShape: move text lookup
From: Simon Richter, 2015-04-13