KiCad PCB EDA Suite
|
#include <listboxes.h>
Public Member Functions | |
SYMBOLS_LISTBOX (CVPCB_MAINFRAME *parent, wxWindowID id) | |
virtual | ~SYMBOLS_LISTBOX ()=default |
void | Clear () |
int | GetCount () |
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. | |
wxListItemAttr * | OnGetItemAttr (long item) const override |
void | SetSelection (int index, bool State=true) |
void | SetString (unsigned linecount, const wxString &text) |
void | AppendLine (const wxString &text) |
void | AppendWarning (int index) |
void | RemoveWarning (int index) |
void | OnChar (wxKeyEvent &event) |
Called on a key press. | |
void | OnSelectComponent (wxListEvent &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. | |
void | Shutdown () |
Public Attributes | |
wxArrayString | m_SymbolList |
Protected Attributes | |
bool | m_isClosing |
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 | |
std::vector< long > | m_symbolWarning |
std::unique_ptr< wxListItemAttr > | m_warningAttr |
int | m_columnWidth |
Definition at line 186 of file listboxes.h.
SYMBOLS_LISTBOX::SYMBOLS_LISTBOX | ( | CVPCB_MAINFRAME * | parent, |
wxWindowID | id | ||
) |
Definition at line 37 of file symbols_listbox.cpp.
References KIPLATFORM::UI::IsDarkTheme(), and m_warningAttr.
|
virtualdefault |
void SYMBOLS_LISTBOX::AppendLine | ( | const wxString & | text | ) |
Definition at line 78 of file symbols_listbox.cpp.
References m_SymbolList, text, and ITEMS_LISTBOX_BASE::UpdateWidth().
Referenced by CVPCB_MAINFRAME::readNetListAndFpFiles().
void SYMBOLS_LISTBOX::AppendWarning | ( | int | index | ) |
Definition at line 87 of file symbols_listbox.cpp.
References m_symbolWarning.
Referenced by CVPCB_MAINFRAME::AssociateFootprint(), and CVPCB_MAINFRAME::readNetListAndFpFiles().
void SYMBOLS_LISTBOX::Clear | ( | ) |
Definition at line 52 of file symbols_listbox.cpp.
References Clear().
Referenced by Clear(), and CVPCB_MAINFRAME::readNetListAndFpFiles().
SYMBOLS_LISTBOX::DECLARE_EVENT_TABLE | ( | ) |
|
inherited |
Remove all selection in lists which can have more than one item selected.
Definition at line 98 of file listbox_base.cpp.
Referenced by FOOTPRINTS_LISTBOX::SetFootprints(), and CVPCB_MAINFRAME::SetSelectedComponent().
int SYMBOLS_LISTBOX::GetCount | ( | ) |
Definition at line 59 of file symbols_listbox.cpp.
References m_SymbolList.
Referenced by CVPCB_MAINFRAME::GetComponentIndices(), CVPCB_MAINFRAME::readNetListAndFpFiles(), and SetSelection().
|
virtualinherited |
Definition at line 107 of file listbox_base.cpp.
Referenced by FOOTPRINTS_LISTBOX::OnLeftDClick(), OnSelectComponent(), and LIBRARY_LISTBOX::OnSelectLibrary().
|
inherited |
Definition at line 92 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 SYMBOLS_LISTBOX::OnChar | ( | wxKeyEvent & | event | ) |
Called on a key press.
Call default handler for some special keys, and for "ASCII" keys, select the first component 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 reference of components is not at the beginning of displayed lines (the first word is the line number).
Definition at line 138 of file symbols_listbox.cpp.
References dump(), kicadTraceKeyEvent, ITEMS_LISTBOX_BASE::m_isClosing, m_SymbolList, SetSelection(), and text.
|
override |
Definition at line 112 of file symbols_listbox.cpp.
References m_symbolWarning, and m_warningAttr.
|
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 106 of file symbols_listbox.cpp.
References m_SymbolList.
void SYMBOLS_LISTBOX::OnSelectComponent | ( | wxListEvent & | event | ) |
Definition at line 199 of file symbols_listbox.cpp.
References ITEMS_LISTBOX_BASE::GetParent(), ITEMS_LISTBOX_BASE::m_isClosing, and CVPCB_MAINFRAME::OnSelectComponent().
void SYMBOLS_LISTBOX::RemoveWarning | ( | int | index | ) |
Definition at line 96 of file symbols_listbox.cpp.
References m_symbolWarning.
Referenced by CVPCB_MAINFRAME::AssociateFootprint().
void SYMBOLS_LISTBOX::SetSelection | ( | int | index, |
bool | State = true |
||
) |
Definition at line 121 of file symbols_listbox.cpp.
References GetCount().
Referenced by OnChar(), CVPCB_MAINFRAME::readNetListAndFpFiles(), and CVPCB_MAINFRAME::SetSelectedComponent().
void SYMBOLS_LISTBOX::SetString | ( | unsigned | linecount, |
const wxString & | text | ||
) |
Definition at line 65 of file symbols_listbox.cpp.
References m_SymbolList, text, and ITEMS_LISTBOX_BASE::UpdateWidth().
Referenced by CVPCB_MAINFRAME::AssociateFootprint().
|
inlineinherited |
Definition at line 73 of file listboxes.h.
References ITEMS_LISTBOX_BASE::m_isClosing.
Referenced by CVPCB_MAINFRAME::doCloseWindow().
|
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 67 of file listbox_base.cpp.
References ITEMS_LISTBOX_BASE::m_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 45 of file listbox_base.cpp.
References ITEMS_LISTBOX_BASE::m_columnWidth, and ITEMS_LISTBOX_BASE::UpdateLineWidth().
Referenced by AppendLine(), LIBRARY_LISTBOX::Finish(), FOOTPRINTS_LISTBOX::SetFootprints(), FOOTPRINTS_LISTBOX::SetString(), LIBRARY_LISTBOX::SetString(), and SetString().
|
privateinherited |
Definition at line 87 of file listboxes.h.
Referenced by ITEMS_LISTBOX_BASE::UpdateLineWidth(), and ITEMS_LISTBOX_BASE::UpdateWidth().
|
protectedinherited |
Definition at line 84 of file listboxes.h.
Referenced by FOOTPRINTS_LISTBOX::OnChar(), OnChar(), FOOTPRINTS_LISTBOX::OnLeftDClick(), OnSelectComponent(), and ITEMS_LISTBOX_BASE::Shutdown().
wxArrayString SYMBOLS_LISTBOX::m_SymbolList |
Definition at line 231 of file listboxes.h.
Referenced by AppendLine(), GetCount(), OnChar(), OnGetItemText(), and SetString().
|
private |
Definition at line 234 of file listboxes.h.
Referenced by AppendWarning(), OnGetItemAttr(), and RemoveWarning().
|
private |
Definition at line 235 of file listboxes.h.
Referenced by OnGetItemAttr(), and SYMBOLS_LISTBOX().