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 ( 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 33 of file pin_type_combobox.cpp.

References GetBitmap(), GetText(), KiBitmap(), and PINTYPE_COUNT.

42  :
43  wxBitmapComboBox( parent, id, value, pos, size, n, choices, style, validator, name )
44 {
45  for( unsigned ii = 0; ii < PINTYPE_COUNT; ++ii )
46  {
47  ELECTRICAL_PINTYPE type = static_cast<ELECTRICAL_PINTYPE>( ii );
48 
49  wxString text = GetText( type );
50  BITMAP_DEF bitmap = GetBitmap( type );
51 
52  if( bitmap == NULL )
53  Append( text );
54  else
55  Insert( text, KiBitmap( bitmap ), ii );
56  }
57 }
PNG memory record (file in memory).
Definition: bitmap_types.h:38
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
wxString GetText(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:33
ELECTRICAL_PINTYPE
The component library pin object electrical types used in ERC tests.
Definition: pin_type.h:37
BITMAP_DEF GetBitmap(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:70

Member Function Documentation

ELECTRICAL_PINTYPE PinTypeComboBox::GetPinTypeSelection ( )

Definition at line 60 of file pin_type_combobox.cpp.

Referenced by DIALOG_LIB_EDIT_PIN::GetElectricalType().

61 {
62  return static_cast<ELECTRICAL_PINTYPE>( GetSelection() );
63 }
ELECTRICAL_PINTYPE
The component library pin object electrical types used in ERC tests.
Definition: pin_type.h:37
void PinTypeComboBox::SetSelection ( ELECTRICAL_PINTYPE  aType)

Definition at line 66 of file pin_type_combobox.cpp.

Referenced by DIALOG_LIB_EDIT_PIN::SetElectricalType().

67 {
68  wxBitmapComboBox::SetSelection( aType );
69 }

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