KiCad PCB EDA Suite
|
#include <listboxes.h>
Public Member Functions | |
SYMBOLS_LISTBOX (CVPCB_MAINFRAME *parent, wxWindowID id) | |
~SYMBOLS_LISTBOX () | |
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. | |
Public Attributes | |
wxArrayString | m_SymbolList |
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 | columnWidth |
Definition at line 180 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.
SYMBOLS_LISTBOX::~SYMBOLS_LISTBOX | ( | ) |
Definition at line 46 of file symbols_listbox.cpp.
void SYMBOLS_LISTBOX::AppendLine | ( | const wxString & | text | ) |
Definition at line 83 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 92 of file symbols_listbox.cpp.
References m_symbolWarning.
Referenced by CVPCB_MAINFRAME::AssociateFootprint(), and CVPCB_MAINFRAME::readNetListAndFpFiles().
void SYMBOLS_LISTBOX::Clear | ( | ) |
Definition at line 57 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 104 of file listbox_base.cpp.
Referenced by FOOTPRINTS_LISTBOX::SetFootprints(), and CVPCB_MAINFRAME::SetSelectedComponent().
int SYMBOLS_LISTBOX::GetCount | ( | ) |
Definition at line 64 of file symbols_listbox.cpp.
References m_SymbolList.
Referenced by CVPCB_MAINFRAME::GetComponentIndices(), CVPCB_MAINFRAME::readNetListAndFpFiles(), and SetSelection().
|
virtualinherited |
Definition at line 113 of file listbox_base.cpp.
Referenced by FOOTPRINTS_LISTBOX::OnLeftDClick(), OnSelectComponent(), and LIBRARY_LISTBOX::OnSelectLibrary().
|
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 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 144 of file symbols_listbox.cpp.
References dump(), kicadTraceKeyEvent, m_SymbolList, SetSelection(), and text.
|
override |
Definition at line 117 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 111 of file symbols_listbox.cpp.
References m_SymbolList.
void SYMBOLS_LISTBOX::OnSelectComponent | ( | wxListEvent & | event | ) |
Definition at line 202 of file symbols_listbox.cpp.
References ITEMS_LISTBOX_BASE::GetParent(), and CVPCB_MAINFRAME::OnSelectComponent().
void SYMBOLS_LISTBOX::RemoveWarning | ( | int | index | ) |
Definition at line 101 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 127 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 70 of file symbols_listbox.cpp.
References m_SymbolList, text, and ITEMS_LISTBOX_BASE::UpdateWidth().
Referenced by CVPCB_MAINFRAME::AssociateFootprint().
|
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 AppendLine(), LIBRARY_LISTBOX::Finish(), FOOTPRINTS_LISTBOX::SetFootprints(), FOOTPRINTS_LISTBOX::SetString(), LIBRARY_LISTBOX::SetString(), and SetString().
|
privateinherited |
Definition at line 81 of file listboxes.h.
Referenced by ITEMS_LISTBOX_BASE::UpdateLineWidth(), and ITEMS_LISTBOX_BASE::UpdateWidth().
wxArrayString SYMBOLS_LISTBOX::m_SymbolList |
Definition at line 226 of file listboxes.h.
Referenced by AppendLine(), GetCount(), OnChar(), OnGetItemText(), and SetString().
|
private |
Definition at line 229 of file listboxes.h.
Referenced by AppendWarning(), OnGetItemAttr(), and RemoveWarning().
|
private |
Definition at line 230 of file listboxes.h.
Referenced by OnGetItemAttr(), and SYMBOLS_LISTBOX().