kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #23202
[PATCH 15/19] 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 ebbcb4e..3b93ff2 100644
--- a/eeschema/dialogs/dialog_lib_edit_pin.h
+++ b/eeschema/dialogs/dialog_lib_edit_pin.h
@@ -67,7 +67,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/19] Pin shape and type refactoring
From: Simon Richter, 2016-02-17
-
[PATCH 01/19] Replace DrawPinShape enum with PinShape
From: Simon Richter, 2016-02-17
-
[PATCH 02/19] PinShapeComboBox: Introduce widget
From: Simon Richter, 2016-02-17
-
[PATCH 03/19] PinShapeComboBox: Fully initialize in c'tor
From: Simon Richter, 2016-02-17
-
[PATCH 04/19] PinShapeComboBox: typesafe Get/Set
From: Simon Richter, 2016-02-17
-
[PATCH 05/19] PinShape: move enum to own header
From: Simon Richter, 2016-02-17
-
[PATCH 06/19] PinShape: move text lookup
From: Simon Richter, 2016-02-17
-
[PATCH 07/19] PinShape: drop list interfaces
From: Simon Richter, 2016-02-17
-
[PATCH 08/19] PinShape: move bitmap lookup
From: Simon Richter, 2016-02-17
-
[PATCH 09/19] ElectricPinType: move definition to pin_type.h
From: Simon Richter, 2016-02-17
-
[PATCH 10/19] ElectricPinType: Use enum rather than int where possible
From: Simon Richter, 2016-02-17
-
[PATCH 11/19] ElectricPinType: Rename PIN_NMAX to PINTYPE_COUNT
From: Simon Richter, 2016-02-17
-
[PATCH 12/19] ElectricPinType: Separate PINTYPE_COUNT from enum
From: Simon Richter, 2016-02-17
-
[PATCH 13/19] PinTypeComboBox: Introduce widget
From: Simon Richter, 2016-02-17
-
[PATCH 14/19] PinTypeComboBox: fully initialize in c'tor
From: Simon Richter, 2016-02-17