KiCad PCB EDA Suite
Loading...
Searching...
No Matches
FOOTPRINTS_LISTBOX Class Reference

#include <listboxes.h>

Inheritance diagram for FOOTPRINTS_LISTBOX:
ITEMS_LISTBOX_BASE

Public Types

enum  FP_FILTER_T : int { UNFILTERED_FP_LIST = 0 , FILTERING_BY_COMPONENT_FP_FILTERS = 0x0001 , FILTERING_BY_PIN_COUNT = 0x0002 , FILTERING_BY_LIBRARY = 0x0004 }
 Filter setting constants. More...
 

Public Member Functions

 FOOTPRINTS_LISTBOX (CVPCB_MAINFRAME *parent, wxWindowID id)
 
 ~FOOTPRINTS_LISTBOX ()
 
int GetCount ()
 
void SetSelection (int aIndex, bool aState=true)
 
void SetSelectedFootprint (const LIB_ID &aFPID)
 
void SetString (unsigned linecount, const wxString &text)
 
void AppendLine (const wxString &text)
 
void SetFootprints (FOOTPRINT_LIST &aList, const wxString &aLibName, COMPONENT *aComponent, const wxString &aFootPrintFilterPattern, int aFilterType)
 Populate the wxListCtrl with the footprints from aList that meet the filter criteria defined by aFilterType. More...
 
wxString GetSelectedFootprint ()
 
wxString OnGetItemText (long item, long column) const override
 This overloaded function MUST be provided for the wxLC_VIRTUAL mode because real data is not handled by ITEMS_LISTBOX_BASE. More...
 
void OnLeftClick (wxListEvent &event)
 
void OnLeftDClick (wxListEvent &event)
 
void OnChar (wxKeyEvent &event)
 
 DECLARE_EVENT_TABLE ()
 
int GetSelection ()
 
void DeselectAll ()
 Remove all selection in lists which can have more than one item selected. More...
 
virtual CVPCB_MAINFRAMEGetParent () const
 
void UpdateWidth (int aLine=-1)
 Update the width of the column based on its contents. More...
 

Private Member Functions

void UpdateLineWidth (unsigned aLine, wxClientDC &dc)
 Calculate the width of the given line, and increase the column width if needed. More...
 

Private Attributes

wxArrayString m_footprintList
 
int columnWidth
 

Detailed Description

Definition at line 85 of file listboxes.h.

Member Enumeration Documentation

◆ FP_FILTER_T

Filter setting constants.

The filter type is a bitwise OR of these flags, and only footprints matching all selected filter types are shown.

Enumerator
UNFILTERED_FP_LIST 
FILTERING_BY_COMPONENT_FP_FILTERS 
FILTERING_BY_PIN_COUNT 
FILTERING_BY_LIBRARY 

Definition at line 92 of file listboxes.h.

Constructor & Destructor Documentation

◆ FOOTPRINTS_LISTBOX()

FOOTPRINTS_LISTBOX::FOOTPRINTS_LISTBOX ( CVPCB_MAINFRAME parent,
wxWindowID  id 
)

Definition at line 36 of file footprints_listbox.cpp.

◆ ~FOOTPRINTS_LISTBOX()

FOOTPRINTS_LISTBOX::~FOOTPRINTS_LISTBOX ( )

Definition at line 42 of file footprints_listbox.cpp.

Member Function Documentation

◆ AppendLine()

void FOOTPRINTS_LISTBOX::AppendLine ( const wxString &  text)

Definition at line 84 of file footprints_listbox.cpp.

References m_footprintList, text, and ITEMS_LISTBOX_BASE::UpdateWidth().

◆ DECLARE_EVENT_TABLE()

FOOTPRINTS_LISTBOX::DECLARE_EVENT_TABLE ( )

◆ DeselectAll()

void ITEMS_LISTBOX_BASE::DeselectAll ( )
inherited

Remove all selection in lists which can have more than one item selected.

Definition at line 104 of file listbox_base.cpp.

Referenced by SetFootprints(), and CVPCB_MAINFRAME::SetSelectedComponent().

◆ GetCount()

int FOOTPRINTS_LISTBOX::GetCount ( )

◆ GetParent()

CVPCB_MAINFRAME * ITEMS_LISTBOX_BASE::GetParent ( ) const
virtualinherited

◆ GetSelectedFootprint()

wxString FOOTPRINTS_LISTBOX::GetSelectedFootprint ( )

Definition at line 67 of file footprints_listbox.cpp.

References m_footprintList.

Referenced by CVPCB_MAINFRAME::GetSelectedFootprint().

◆ GetSelection()

int ITEMS_LISTBOX_BASE::GetSelection ( )
inherited
Returns
the index of the selected item in lists allowing only one item selected and the index of the first selected item in lists allowing many selection

Definition at line 98 of file listbox_base.cpp.

Referenced by CVPCB_MAINFRAME::GetSelectedComponent(), CVPCB_MAINFRAME::OnSelectComponent(), CVPCB_MAINFRAME::onTextFilterChangedTimer(), CVPCB_MAINFRAME::refreshAfterSymbolSearch(), CVPCB_MAINFRAME::SendComponentSelectionToSch(), and SetFootprints().

◆ OnChar()

void FOOTPRINTS_LISTBOX::OnChar ( wxKeyEvent &  event)

Definition at line 212 of file footprints_listbox.cpp.

References dump(), kicadTraceKeyEvent, m_footprintList, SetSelection(), and text.

◆ OnGetItemText()

wxString FOOTPRINTS_LISTBOX::OnGetItemText ( long  item,
long  column 
) const
override

This overloaded function MUST be provided for the wxLC_VIRTUAL mode because real data is not handled by ITEMS_LISTBOX_BASE.

Definition at line 93 of file footprints_listbox.cpp.

References m_footprintList.

Referenced by CVPCB_MAINFRAME::refreshAfterSymbolSearch().

◆ OnLeftClick()

void FOOTPRINTS_LISTBOX::OnLeftClick ( wxListEvent &  event)

Definition at line 200 of file footprints_listbox.cpp.

◆ OnLeftDClick()

void FOOTPRINTS_LISTBOX::OnLeftDClick ( wxListEvent &  event)

◆ SetFootprints()

void FOOTPRINTS_LISTBOX::SetFootprints ( FOOTPRINT_LIST aList,
const wxString &  aLibName,
COMPONENT aComponent,
const wxString &  aFootPrintFilterPattern,
int  aFilterType 
)

Populate the wxListCtrl with the footprints from aList that meet the filter criteria defined by aFilterType.

Parameters
aListis a FOOTPRINT_LIST item containing the footprints.
aLibNameis wxString containing the name of the selected library. Can be wxEmptyString.
aComponentis the COMPONENT used by the filtering criteria. Can be NULL.
aFootPrintFilterPatternis the filter used to filter list by names.
aFilterTypedefines the criteria to filter aList.

Definition at line 133 of file footprints_listbox.cpp.

References ITEMS_LISTBOX_BASE::DeselectAll(), filter, FILTERING_BY_COMPONENT_FP_FILTERS, FILTERING_BY_LIBRARY, FILTERING_BY_PIN_COUNT, COMPONENT::GetFootprintFilters(), COMPONENT::GetPinCount(), ITEMS_LISTBOX_BASE::GetSelection(), m_footprintList, SetSelection(), and ITEMS_LISTBOX_BASE::UpdateWidth().

Referenced by CVPCB_MAINFRAME::BuildFootprintsList(), CVPCB_MAINFRAME::OnSelectComponent(), and CVPCB_MAINFRAME::onTextFilterChangedTimer().

◆ SetSelectedFootprint()

void FOOTPRINTS_LISTBOX::SetSelectedFootprint ( const LIB_ID aFPID)

◆ SetSelection()

void FOOTPRINTS_LISTBOX::SetSelection ( int  aIndex,
bool  aState = true 
)

◆ SetString()

void FOOTPRINTS_LISTBOX::SetString ( unsigned  linecount,
const wxString &  text 
)

Definition at line 53 of file footprints_listbox.cpp.

References m_footprintList, text, and ITEMS_LISTBOX_BASE::UpdateWidth().

◆ UpdateLineWidth()

void ITEMS_LISTBOX_BASE::UpdateLineWidth ( unsigned  aLine,
wxClientDC &  dc 
)
privateinherited

Calculate the width of the given line, and increase the column width if needed.

This is effectively the wxListCtrl code for autosizing. NB. it relies on the caller checking the given line number is valid.

Definition at line 73 of file listbox_base.cpp.

References ITEMS_LISTBOX_BASE::columnWidth.

Referenced by ITEMS_LISTBOX_BASE::UpdateWidth().

◆ UpdateWidth()

void ITEMS_LISTBOX_BASE::UpdateWidth ( int  aLine = -1)
inherited

Update the width of the column based on its contents.

Parameters
aLineis the line to calculate the width from. If positive, the width will only be increased if needed. If negative, we start from scratch and all lines are considered, i.e., the column may be shrunk.

Definition at line 49 of file listbox_base.cpp.

References ITEMS_LISTBOX_BASE::columnWidth, and ITEMS_LISTBOX_BASE::UpdateLineWidth().

Referenced by AppendLine(), SYMBOLS_LISTBOX::AppendLine(), LIBRARY_LISTBOX::Finish(), SetFootprints(), SetString(), LIBRARY_LISTBOX::SetString(), and SYMBOLS_LISTBOX::SetString().

Member Data Documentation

◆ columnWidth

int ITEMS_LISTBOX_BASE::columnWidth
privateinherited

◆ m_footprintList

wxArrayString FOOTPRINTS_LISTBOX::m_footprintList
private

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