kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #17919
[PATCH 20/27] PinTypeComboBox: fully initialize in c'tor
---
eeschema/dialogs/dialog_lib_edit_pin.cpp | 13 -------------
eeschema/dialogs/dialog_lib_edit_pin.h | 1 -
eeschema/pinedit.cpp | 2 --
eeschema/widgets/pin_type_combobox.cpp | 15 +++++++++++++++
4 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/eeschema/dialogs/dialog_lib_edit_pin.cpp b/eeschema/dialogs/dialog_lib_edit_pin.cpp
index 74e2966..de35dc0 100644
--- a/eeschema/dialogs/dialog_lib_edit_pin.cpp
+++ b/eeschema/dialogs/dialog_lib_edit_pin.cpp
@@ -157,16 +157,3 @@ void DIALOG_LIB_EDIT_PIN::SetOrientationList( const wxArrayString& list,
m_choiceOrientation->Insert( list[ii], KiBitmap( aBitmaps[ii] ), ii );
}
}
-
-
-void DIALOG_LIB_EDIT_PIN::SetElectricalTypeList( const wxArrayString& list,
- const BITMAP_DEF* aBitmaps )
-{
- for ( unsigned ii = 0; ii < list.GetCount(); ii++ )
- {
- if( aBitmaps == NULL )
- m_choiceElectricalType->Append( list[ii] );
- else
- m_choiceElectricalType->Insert( list[ii], KiBitmap( aBitmaps[ii] ), ii );
- }
-}
diff --git a/eeschema/dialogs/dialog_lib_edit_pin.h b/eeschema/dialogs/dialog_lib_edit_pin.h
index b508443..8012495 100644
--- a/eeschema/dialogs/dialog_lib_edit_pin.h
+++ b/eeschema/dialogs/dialog_lib_edit_pin.h
@@ -59,7 +59,6 @@ public:
}
int GetOrientation( void ) { return m_choiceOrientation->GetSelection(); }
- void SetElectricalTypeList( const wxArrayString& list, const BITMAP_DEF* aBitmaps );
void SetElectricalType( ElectricPinType type )
{
m_choiceElectricalType->SetSelection( type );
diff --git a/eeschema/pinedit.cpp b/eeschema/pinedit.cpp
index d77b8de..a9045e6 100644
--- a/eeschema/pinedit.cpp
+++ b/eeschema/pinedit.cpp
@@ -105,8 +105,6 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
dlg.SetOrientationList( LIB_PIN::GetOrientationNames(), LIB_PIN::GetOrientationSymbols() );
dlg.SetOrientation( LIB_PIN::GetOrientationCodeIndex( pin->GetOrientation() ) );
dlg.SetStyle( pin->GetShape() );
- dlg.SetElectricalTypeList( LIB_PIN::GetElectricalTypeNames(),
- LIB_PIN::GetElectricalTypeSymbols() );
dlg.SetElectricalType( pin->GetType() );
dlg.SetPinName( pin->GetName() );
dlg.SetPinNameTextSize( StringFromValue( g_UserUnit, pin->GetNameTextSize() ) );
diff --git a/eeschema/widgets/pin_type_combobox.cpp b/eeschema/widgets/pin_type_combobox.cpp
index 3c2ac7e..c83d14f 100644
--- a/eeschema/widgets/pin_type_combobox.cpp
+++ b/eeschema/widgets/pin_type_combobox.cpp
@@ -28,6 +28,8 @@
#include "pin_type_combobox.h"
+#include <lib_pin.h>
+
PinTypeComboBox::PinTypeComboBox( wxWindow* parent,
wxWindowID id,
const wxString& value,
@@ -40,4 +42,17 @@ PinTypeComboBox::PinTypeComboBox( wxWindow* parent,
const wxString& name ) :
wxBitmapComboBox( parent, id, value, pos, size, n, choices, style, validator, name )
{
+ wxArrayString texts = LIB_PIN::GetElectricalTypeNames();
+ const BITMAP_DEF* bitmaps = LIB_PIN::GetElectricalTypeSymbols();
+
+ for( unsigned ii = 0; ii < PINTYPE_COUNT; ++ii )
+ {
+ wxString text = texts[ ii ];
+ BITMAP_DEF bitmap = bitmaps[ ii ];
+
+ if( bitmap == NULL )
+ Append( text );
+ else
+ Insert( text, KiBitmap( bitmap ), 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
-
[PATCH 13/27] PinShape: drop list interfaces
From: Simon Richter, 2015-04-13
-
[PATCH 14/27] PinShape: move bitmap lookup
From: Simon Richter, 2015-04-13
-
[PATCH 15/27] ElectricPinType: move definition to pin_type.h
From: Simon Richter, 2015-04-13
-
[PATCH 16/27] ElectricPinType: Use enum rather than int where possible
From: Simon Richter, 2015-04-13
-
[PATCH 17/27] ElectricPinType: Rename PIN_NMAX to PINTYPE_COUNT
From: Simon Richter, 2015-04-13
-
[PATCH 18/27] ElectricPinType: Separate PINTYPE_COUNT from enum
From: Simon Richter, 2015-04-13
-
[PATCH 19/27] PinTypeComboBox: Introduce widget
From: Simon Richter, 2015-04-13