KiCad PCB EDA Suite
PinTypeComboBox Class Reference

#include <pin_type_combobox.h>

Inheritance diagram for PinTypeComboBox:

Public Member Functions

 PinTypeComboBox (wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &value=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int n=0, const wxString choices[]=NULL, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxBitmapComboBoxNameStr)
 
ELECTRICAL_PINTYPE GetPinTypeSelection ()
 
void SetSelection (ELECTRICAL_PINTYPE aType)
 

Detailed Description

Definition at line 33 of file pin_type_combobox.h.

Constructor & Destructor Documentation

◆ PinTypeComboBox()

PinTypeComboBox::PinTypeComboBox ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxString &  value = wxEmptyString,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
int  n = 0,
const wxString  choices[] = NULL,
long  style = 0,
const wxValidator &  validator = wxDefaultValidator,
const wxString &  name = wxBitmapComboBoxNameStr 
)
Todo:
C++11: replace with forwarder

Definition at line 34 of file pin_type_combobox.cpp.

43  :
44  wxBitmapComboBox( parent, id, value, pos, size, n, choices, style, validator, name )
45 {
46  for( unsigned ii = 0; ii < ELECTRICAL_PINTYPES_TOTAL; ++ii )
47  {
48  ELECTRICAL_PINTYPE type = static_cast<ELECTRICAL_PINTYPE>( ii );
49 
50  wxString text = ElectricalPinTypeGetText( type );
51  BITMAPS bitmap = ElectricalPinTypeGetBitmap( type );
52 
53  if( bitmap == BITMAPS::INVALID_BITMAP )
54  Append( text );
55  else
56  Insert( text, KiBitmap( bitmap ), ii );
57  }
58 }
wxString ElectricalPinTypeGetText(ELECTRICAL_PINTYPE aType)
Definition: pin_type.cpp:236
BITMAPS ElectricalPinTypeGetBitmap(ELECTRICAL_PINTYPE aType)
Definition: pin_type.cpp:246
const char * name
Definition: DXF_plotter.cpp:59
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:32
ELECTRICAL_PINTYPE
The component library pin object electrical types used in ERC tests.
Definition: pin_type.h:35
#define ELECTRICAL_PINTYPES_TOTAL
Definition: pin_type.h:53
wxBitmap KiBitmap(BITMAPS aBitmap)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:104

References ELECTRICAL_PINTYPES_TOTAL, ElectricalPinTypeGetBitmap(), ElectricalPinTypeGetText(), INVALID_BITMAP, KiBitmap(), and text.

Member Function Documentation

◆ GetPinTypeSelection()

ELECTRICAL_PINTYPE PinTypeComboBox::GetPinTypeSelection ( )

Definition at line 61 of file pin_type_combobox.cpp.

62 {
63  return static_cast<ELECTRICAL_PINTYPE>( GetSelection() );
64 }

Referenced by DIALOG_PIN_PROPERTIES::OnPropertiesChange(), and DIALOG_PIN_PROPERTIES::TransferDataFromWindow().

◆ SetSelection()

void PinTypeComboBox::SetSelection ( ELECTRICAL_PINTYPE  aType)

Definition at line 67 of file pin_type_combobox.cpp.

68 {
69  wxBitmapComboBox::SetSelection( static_cast<int>( aType ) );
70 }

Referenced by DIALOG_PIN_PROPERTIES::TransferDataToWindow().


The documentation for this class was generated from the following files: