KiCad PCB EDA Suite
|
#include <listboxes.h>
Public Member Functions | |
LIBRARY_LISTBOX (CVPCB_MAINFRAME *parent, wxWindowID id) | |
~LIBRARY_LISTBOX () override | |
int | GetCount () |
void | SetSelection (int index, bool State=true) |
void | SetString (unsigned linecount, const wxString &text) |
void | AppendLine (const wxString &text) |
void | Finish () |
void | ClearList () |
wxString | GetSelectedLibrary () |
wxString | OnGetItemText (long item, long column) const override |
void | OnSelectLibrary (wxListEvent &event) |
void | OnChar (wxKeyEvent &event) |
Called on a key press. | |
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_libraryList |
int | columnWidth |
Definition at line 142 of file listboxes.h.
LIBRARY_LISTBOX::LIBRARY_LISTBOX | ( | CVPCB_MAINFRAME * | parent, |
wxWindowID | id | ||
) |
Definition at line 36 of file library_listbox.cpp.
|
inlineoverride |
Definition at line 146 of file listboxes.h.
void LIBRARY_LISTBOX::AppendLine | ( | const wxString & | text | ) |
Definition at line 81 of file library_listbox.cpp.
References m_libraryList, and text.
Referenced by CVPCB_MAINFRAME::BuildLibrariesList().
void LIBRARY_LISTBOX::ClearList | ( | ) |
Definition at line 123 of file library_listbox.cpp.
References m_libraryList.
Referenced by CVPCB_MAINFRAME::BuildLibrariesList().
LIBRARY_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 FOOTPRINTS_LISTBOX::SetFootprints(), and CVPCB_MAINFRAME::SetSelectedComponent().
void LIBRARY_LISTBOX::Finish | ( | ) |
Definition at line 113 of file library_listbox.cpp.
References m_libraryList, and ITEMS_LISTBOX_BASE::UpdateWidth().
Referenced by CVPCB_MAINFRAME::BuildLibrariesList().
int LIBRARY_LISTBOX::GetCount | ( | ) |
Definition at line 42 of file library_listbox.cpp.
References m_libraryList.
Referenced by SetSelection().
|
virtualinherited |
Definition at line 113 of file listbox_base.cpp.
Referenced by FOOTPRINTS_LISTBOX::OnLeftDClick(), SYMBOLS_LISTBOX::OnSelectComponent(), and OnSelectLibrary().
wxString LIBRARY_LISTBOX::GetSelectedLibrary | ( | ) |
Definition at line 63 of file library_listbox.cpp.
References LIB_TREE_MODEL_ADAPTER::GetPinningSymbol(), and m_libraryList.
Referenced by CVPCB_MAINFRAME::DisplayStatus(), CVPCB_MAINFRAME::OnSelectComponent(), and CVPCB_MAINFRAME::onTextFilterChangedTimer().
|
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 FOOTPRINTS_LISTBOX::SetFootprints().
void LIBRARY_LISTBOX::OnChar | ( | wxKeyEvent & | event | ) |
Called on a key press.
Call default handler for some special keys, and for "ASCII" keys, select the first footprint that the name starts by the letter.
This is the default behavior of a listbox, but because we use virtual lists, the listbox does not know anything to what is displayed, we must handle this behavior here. Furthermore the footprint name is not at the beginning of displayed lines (the first word is the line number).
Definition at line 135 of file library_listbox.cpp.
References dump(), kicadTraceKeyEvent, and text.
|
override |
Definition at line 89 of file library_listbox.cpp.
References m_libraryList.
void LIBRARY_LISTBOX::OnSelectLibrary | ( | wxListEvent & | event | ) |
Definition at line 194 of file library_listbox.cpp.
References CVPCB_MAINFRAME::FILTER_ENABLE, FOOTPRINTS_LISTBOX::FILTERING_BY_LIBRARY, ITEMS_LISTBOX_BASE::GetParent(), CVPCB_MAINFRAME::OnSelectComponent(), and CVPCB_MAINFRAME::SetFootprintFilter().
void LIBRARY_LISTBOX::SetSelection | ( | int | index, |
bool | State = true |
||
) |
Definition at line 95 of file library_listbox.cpp.
References GetCount(), and Refresh().
void LIBRARY_LISTBOX::SetString | ( | unsigned | linecount, |
const wxString & | text | ||
) |
Definition at line 48 of file library_listbox.cpp.
References m_libraryList, 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(), Finish(), FOOTPRINTS_LISTBOX::SetFootprints(), FOOTPRINTS_LISTBOX::SetString(), 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 176 of file listboxes.h.
Referenced by AppendLine(), ClearList(), Finish(), GetCount(), GetSelectedLibrary(), OnGetItemText(), and SetString().