kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #17920
[PATCH 21/27] PinTypeComboBox: typesafe Get/Set
---
eeschema/dialogs/dialog_lib_edit_pin.h | 2 +-
eeschema/widgets/pin_type_combobox.cpp | 12 ++++++++++++
eeschema/widgets/pin_type_combobox.h | 5 +++++
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/eeschema/dialogs/dialog_lib_edit_pin.h b/eeschema/dialogs/dialog_lib_edit_pin.h
index 8012495..a3209f8 100644
--- a/eeschema/dialogs/dialog_lib_edit_pin.h
+++ b/eeschema/dialogs/dialog_lib_edit_pin.h
@@ -65,7 +65,7 @@ public:
}
ElectricPinType GetElectricalType( void )
{
- return static_cast<ElectricPinType>( m_choiceElectricalType->GetSelection() );
+ return m_choiceElectricalType->GetSelection();
}
void SetStyle( PinShape style ) { m_choiceStyle->SetSelection( style ); }
diff --git a/eeschema/widgets/pin_type_combobox.cpp b/eeschema/widgets/pin_type_combobox.cpp
index c83d14f..ae9676d 100644
--- a/eeschema/widgets/pin_type_combobox.cpp
+++ b/eeschema/widgets/pin_type_combobox.cpp
@@ -56,3 +56,15 @@ PinTypeComboBox::PinTypeComboBox( wxWindow* parent,
Insert( text, KiBitmap( bitmap ), ii );
}
}
+
+
+ElectricPinType PinTypeComboBox::GetSelection()
+{
+ return static_cast<ElectricPinType>( wxBitmapComboBox::GetSelection() );
+}
+
+
+void PinTypeComboBox::SetSelection( ElectricPinType aType )
+{
+ wxBitmapComboBox::SetSelection( aType );
+}
diff --git a/eeschema/widgets/pin_type_combobox.h b/eeschema/widgets/pin_type_combobox.h
index 1564839..05ed022 100644
--- a/eeschema/widgets/pin_type_combobox.h
+++ b/eeschema/widgets/pin_type_combobox.h
@@ -28,6 +28,8 @@
#include <wx/bmpcbox.h>
+#include <pin_type.h>
+
class PinTypeComboBox : public wxBitmapComboBox
{
public:
@@ -43,4 +45,7 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr );
+
+ ElectricPinType GetSelection();
+ void SetSelection( ElectricPinType aType );
};
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
-
[PATCH 20/27] PinTypeComboBox: fully initialize in c'tor
From: Simon Richter, 2015-04-13