| 
    KiCad PCB EDA Suite
    
   | 
 
Customized combo box for footprint selection. More...
#include <footprint_choice.h>
 Public Member Functions | |
| FOOTPRINT_CHOICE (wxWindow *aParent, int aId) | |
| virtual | ~FOOTPRINT_CHOICE () | 
Protected Member Functions | |
| virtual void | DoSetPopupControl (wxComboPopup *aPopup) override | 
| virtual void | OnDrawItem (wxDC &aDC, const wxRect &aRect, int aItem, int aFlags) const override | 
| virtual wxCoord | OnMeasureItem (size_t aItem) const override | 
| virtual wxCoord | OnMeasureItemWidth (size_t aItem) const override | 
| void | TryVetoMouse (wxMouseEvent &aEvent) | 
| Veto a mouseover event if in the separator.   | |
| void | TryVetoSelect (wxCommandEvent &aEvent, bool aInner) | 
| Veto a select event for the separator.   | |
| wxString | SafeGetString (int aItem) const | 
| Safely get a string for an item, returning wxEmptyString if the item doesn't exist.   | |
| int | GetSelectionEither (bool aInner) const | 
| Get selection from either the outer (combo box) or inner (popup) list.   | |
| void | SetSelectionEither (bool aInner, int aSel) | 
| Safely set selection for either the outer (combo box) or inner (popup) list, doing nothing for invalid selections.   | |
Static Protected Member Functions | |
| static wxCoord | DrawTextFragment (wxDC &aDC, wxCoord x, wxCoord y, const wxString &aText) | 
| Draw a fragment of text, then return the next x coordinate to continue drawing.   | |
Static Protected Attributes | |
| static wxColour | m_grey | 
Private Attributes | |
| int | m_last_selection | 
Customized combo box for footprint selection.
This provides the following features:
Multiple separators in a row is undefined behavior; it is likely to result in errors such as the ability to select separators. Separators ARE valid at the top and bottom.
For any items containing footprints, the "lib:footprint" name should be attached to the item as a wxStringClientData.
Definition at line 38 of file footprint_choice.h.
| FOOTPRINT_CHOICE::FOOTPRINT_CHOICE | ( | wxWindow * | aParent, | 
| int | aId ) | 
Definition at line 28 of file footprint_choice.cpp.
References m_last_selection.
      
  | 
  virtual | 
Definition at line 36 of file footprint_choice.cpp.
      
  | 
  overrideprotectedvirtual | 
Definition at line 41 of file footprint_choice.cpp.
References TryVetoMouse(), and TryVetoSelect().
      
  | 
  staticprotected | 
Draw a fragment of text, then return the next x coordinate to continue drawing.
Definition at line 143 of file footprint_choice.cpp.
Referenced by OnDrawItem().
      
  | 
  protected | 
Get selection from either the outer (combo box) or inner (popup) list.
Definition at line 189 of file footprint_choice.cpp.
Referenced by TryVetoSelect().
      
  | 
  overrideprotectedvirtual | 
Definition at line 58 of file footprint_choice.cpp.
References DrawTextFragment(), m_grey, SafeGetString(), and text.
      
  | 
  overrideprotectedvirtual | 
Definition at line 125 of file footprint_choice.cpp.
References SafeGetString().
      
  | 
  overrideprotectedvirtual | 
Definition at line 134 of file footprint_choice.cpp.
References SafeGetString().
      
  | 
  protected | 
Safely get a string for an item, returning wxEmptyString if the item doesn't exist.
Definition at line 180 of file footprint_choice.cpp.
Referenced by OnDrawItem(), OnMeasureItem(), OnMeasureItemWidth(), TryVetoMouse(), and TryVetoSelect().
      
  | 
  protected | 
Safely set selection for either the outer (combo box) or inner (popup) list, doing nothing for invalid selections.
Definition at line 198 of file footprint_choice.cpp.
Referenced by TryVetoSelect().
      
  | 
  protected | 
Veto a mouseover event if in the separator.
Definition at line 150 of file footprint_choice.cpp.
References SafeGetString().
Referenced by DoSetPopupControl().
      
  | 
  protected | 
Veto a select event for the separator.
| aEvent | - the wxCommandEvent caller | 
| aInner | - true if event was called for the inner list (ie the popup) | 
Definition at line 159 of file footprint_choice.cpp.
References GetSelectionEither(), m_last_selection, SafeGetString(), SetSelectionEither(), and text.
Referenced by DoSetPopupControl().
      
  | 
  staticprotected | 
Definition at line 83 of file footprint_choice.h.
Referenced by OnDrawItem().
      
  | 
  private | 
Definition at line 86 of file footprint_choice.h.
Referenced by FOOTPRINT_CHOICE(), and TryVetoSelect().