KiCad PCB EDA Suite
|
#include <listboxes.h>
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 () override | |
int | GetCount () |
void | SetSelection (int aIndex, bool aState=true) |
void | SetSelectedFootprint (const LIB_ID &aFPID) |
void | SetString (unsigned linecount, 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. | |
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. | |
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. | |
virtual CVPCB_MAINFRAME * | GetParent () const |
void | UpdateWidth (int aLine=-1) |
Update the width of the column based on its contents. | |
Private Member Functions | |
void | UpdateLineWidth (unsigned aLine, wxClientDC &dc) |
Calculate the width of the given line, and increase the column width if needed. | |
Private Attributes | |
wxArrayString | m_footprintList |
int | columnWidth |
Definition at line 85 of file listboxes.h.
enum FOOTPRINTS_LISTBOX::FP_FILTER_T : int |
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.
FOOTPRINTS_LISTBOX::FOOTPRINTS_LISTBOX | ( | CVPCB_MAINFRAME * | parent, |
wxWindowID | id | ||
) |
Definition at line 35 of file footprints_listbox.cpp.
|
inlineoverride |
Definition at line 101 of file listboxes.h.
FOOTPRINTS_LISTBOX::DECLARE_EVENT_TABLE | ( | ) |
|
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().
int FOOTPRINTS_LISTBOX::GetCount | ( | ) |
Definition at line 42 of file footprints_listbox.cpp.
References m_footprintList.
Referenced by CVPCB_MAINFRAME::DisplayStatus(), CVPCB_MAINFRAME::refreshAfterSymbolSearch(), SetSelectedFootprint(), and SetSelection().
|
virtualinherited |
Definition at line 113 of file listbox_base.cpp.
Referenced by OnLeftDClick(), SYMBOLS_LISTBOX::OnSelectComponent(), and LIBRARY_LISTBOX::OnSelectLibrary().
wxString FOOTPRINTS_LISTBOX::GetSelectedFootprint | ( | ) |
Definition at line 64 of file footprints_listbox.cpp.
References m_footprintList.
Referenced by CVPCB_MAINFRAME::GetSelectedFootprint().
|
inherited |
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().
void FOOTPRINTS_LISTBOX::OnChar | ( | wxKeyEvent & | event | ) |
Definition at line 200 of file footprints_listbox.cpp.
References dump(), kicadTraceKeyEvent, m_footprintList, SetSelection(), and text.
|
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 81 of file footprints_listbox.cpp.
References m_footprintList.
Referenced by CVPCB_MAINFRAME::refreshAfterSymbolSearch().
void FOOTPRINTS_LISTBOX::OnLeftClick | ( | wxListEvent & | event | ) |
Definition at line 188 of file footprints_listbox.cpp.
void FOOTPRINTS_LISTBOX::OnLeftDClick | ( | wxListEvent & | event | ) |
Definition at line 194 of file footprints_listbox.cpp.
References CVPCB_ACTIONS::associate, ITEMS_LISTBOX_BASE::GetParent(), TOOLS_HOLDER::GetToolManager(), and TOOL_MANAGER::RunAction().
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.
aList | is a FOOTPRINT_LIST item containing the footprints. |
aLibName | is wxString containing the name of the selected library. Can be wxEmptyString. |
aComponent | is the COMPONENT used by the filtering criteria. Can be NULL. |
aFootPrintFilterPattern | is the filter used to filter list by names. |
aFilterType | defines the criteria to filter aList. |
Definition at line 121 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().
void FOOTPRINTS_LISTBOX::SetSelectedFootprint | ( | const LIB_ID & | aFPID | ) |
Definition at line 104 of file footprints_listbox.cpp.
References LIB_ID::Format(), GetCount(), m_footprintList, SetSelection(), and UTF8::wx_str().
Referenced by CVPCB_MAINFRAME::OnSelectComponent(), and CVPCB_MAINFRAME::onTextFilterChangedTimer().
void FOOTPRINTS_LISTBOX::SetSelection | ( | int | aIndex, |
bool | aState = true |
||
) |
Definition at line 90 of file footprints_listbox.cpp.
References GetCount(), and Refresh().
Referenced by OnChar(), CVPCB_MAINFRAME::OnSelectComponent(), CVPCB_MAINFRAME::onTextFilterChangedTimer(), CVPCB_MAINFRAME::refreshAfterSymbolSearch(), SetFootprints(), and SetSelectedFootprint().
void FOOTPRINTS_LISTBOX::SetString | ( | unsigned | linecount, |
const wxString & | text | ||
) |
Definition at line 48 of file footprints_listbox.cpp.
References m_footprintList, text, and ITEMS_LISTBOX_BASE::UpdateWidth().
|
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().
|
inherited |
Update the width of the column based on its contents.
aLine | is 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 SYMBOLS_LISTBOX::AppendLine(), LIBRARY_LISTBOX::Finish(), SetFootprints(), SetString(), LIBRARY_LISTBOX::SetString(), and SYMBOLS_LISTBOX::SetString().
|
privateinherited |
Definition at line 81 of file listboxes.h.
Referenced by ITEMS_LISTBOX_BASE::UpdateLineWidth(), and ITEMS_LISTBOX_BASE::UpdateWidth().
|
private |
Definition at line 138 of file listboxes.h.
Referenced by GetCount(), GetSelectedFootprint(), OnChar(), OnGetItemText(), SetFootprints(), SetSelectedFootprint(), and SetString().