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 32 of file pin_shape_combobox.h.

Constructor & Destructor Documentation

◆ PinShapeComboBox()

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 34 of file pin_shape_combobox.cpp.

43  :
44  wxBitmapComboBox( parent, id, value, pos, size, n, choices, style, validator, name )
45 {
46  for( unsigned ii = 0; ii < GRAPHIC_PINSHAPES_TOTAL; ++ii )
47  {
48  GRAPHIC_PINSHAPE shape = static_cast<GRAPHIC_PINSHAPE>( ii );
49 
50  wxString text = PinShapeGetText( shape );
51  BITMAPS bitmap = PinShapeGetBitmap( shape );
52 
53  if( bitmap == BITMAPS::INVALID_BITMAP )
54  Append( text );
55  else
56  Insert( text, KiBitmap( bitmap ), ii );
57  }
58 }
wxString PinShapeGetText(GRAPHIC_PINSHAPE aShape)
Definition: pin_type.cpp:257
GRAPHIC_PINSHAPE
Definition: pin_type.h:55
#define GRAPHIC_PINSHAPES_TOTAL
Definition: pin_type.h:70
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:104
const char * name
Definition: DXF_plotter.cpp:59
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:32
BITMAPS PinShapeGetBitmap(GRAPHIC_PINSHAPE aShape)
Definition: pin_type.cpp:267

References GRAPHIC_PINSHAPES_TOTAL, INVALID_BITMAP, KiBitmap(), PinShapeGetBitmap(), PinShapeGetText(), and text.

Member Function Documentation

◆ GetPinShapeSelection()

GRAPHIC_PINSHAPE PinShapeComboBox::GetPinShapeSelection ( )

Definition at line 61 of file pin_shape_combobox.cpp.

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

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

◆ SetSelection()

void PinShapeComboBox::SetSelection ( GRAPHIC_PINSHAPE  aShape)

Definition at line 67 of file pin_shape_combobox.cpp.

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

Referenced by DIALOG_PIN_PROPERTIES::TransferDataToWindow().


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