KiCad PCB EDA Suite
PinShapeComboBox Class Reference

#include <pin_shape_combobox.h>

Inheritance diagram for PinShapeComboBox:

Public Member Functions

 PinShapeComboBox (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)
 
GRAPHIC_PINSHAPE GetPinShapeSelection ()
 
void SetSelection (GRAPHIC_PINSHAPE aShape)
 

Detailed Description

Definition at line 33 of file pin_shape_combobox.h.

Constructor & Destructor Documentation

PinShapeComboBox::PinShapeComboBox ( 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_shape_combobox.cpp.

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

42  :
43  wxBitmapComboBox( parent, id, value, pos, size, n, choices, style, validator, name )
44 {
45  for( unsigned ii = 0; ii < PINSHAPE_COUNT; ++ii )
46  {
47  GRAPHIC_PINSHAPE shape = static_cast<GRAPHIC_PINSHAPE>( ii );
48 
49  wxString text = GetText( shape );
50  BITMAP_DEF bitmap = GetBitmap( shape );
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
GRAPHIC_PINSHAPE
Definition: pin_shape.h:35
wxString GetText(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:33
const char * name
BITMAP_DEF GetBitmap(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:70

Member Function Documentation

GRAPHIC_PINSHAPE PinShapeComboBox::GetPinShapeSelection ( )

Definition at line 60 of file pin_shape_combobox.cpp.

Referenced by DIALOG_LIB_EDIT_PIN::GetStyle().

61 {
62  return static_cast<GRAPHIC_PINSHAPE>( GetSelection() );
63 }
GRAPHIC_PINSHAPE
Definition: pin_shape.h:35
void PinShapeComboBox::SetSelection ( GRAPHIC_PINSHAPE  aShape)

Definition at line 66 of file pin_shape_combobox.cpp.

Referenced by DIALOG_LIB_EDIT_PIN::SetStyle().

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

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