|
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 182 of file listboxes.h.
| SYMBOLS_LISTBOX::SYMBOLS_LISTBOX | ( | CVPCB_MAINFRAME * | parent, |
| wxWindowID | id ) |
Definition at line 33 of file symbols_listbox.cpp.
References KIPLATFORM::UI::IsDarkTheme(), ITEMS_LISTBOX_BASE::ITEMS_LISTBOX_BASE(), and m_warningAttr.
Referenced by Clear().
| void SYMBOLS_LISTBOX::AppendLine | ( | const wxString & | text | ) |
Definition at line 74 of file symbols_listbox.cpp.
References m_SymbolList, text, and ITEMS_LISTBOX_BASE::UpdateWidth().
| void SYMBOLS_LISTBOX::AppendWarning | ( | int | index | ) |
Definition at line 83 of file symbols_listbox.cpp.
References index, and m_symbolWarning.
| void SYMBOLS_LISTBOX::Clear | ( | ) |
Definition at line 48 of file symbols_listbox.cpp.
References Clear(), m_SymbolList, and SYMBOLS_LISTBOX().
Referenced by Clear().
| SYMBOLS_LISTBOX::DECLARE_EVENT_TABLE | ( | ) |
|
inherited |
Remove all selection in lists which can have more than one item selected.
Definition at line 94 of file listbox_base.cpp.
Referenced by FOOTPRINTS_LISTBOX::SetFootprints().
| int SYMBOLS_LISTBOX::GetCount | ( | ) |
Definition at line 55 of file symbols_listbox.cpp.
References m_SymbolList.
Referenced by SetSelection().
|
virtualinherited |
Definition at line 103 of file listbox_base.cpp.
Referenced by FOOTPRINTS_LISTBOX::OnLeftClick(), FOOTPRINTS_LISTBOX::OnLeftDClick(), SYMBOLS_LISTBOX::OnSelectComponent(), and LIBRARY_LISTBOX::OnSelectLibrary().
|
inherited |
Definition at line 88 of file listbox_base.cpp.
Referenced by 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 134 of file symbols_listbox.cpp.
References dump(), kicadTraceKeyEvent, ITEMS_LISTBOX_BASE::m_isClosing, m_SymbolList, SetSelection(), and text.
|
override |
Definition at line 108 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 102 of file symbols_listbox.cpp.
References m_SymbolList.
| void SYMBOLS_LISTBOX::OnSelectComponent | ( | wxListEvent & | event | ) |
Definition at line 195 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 92 of file symbols_listbox.cpp.
References index, and m_symbolWarning.
| void SYMBOLS_LISTBOX::SetSelection | ( | int | index, |
| bool | State = true ) |
Definition at line 117 of file symbols_listbox.cpp.
References GetCount(), and index.
Referenced by OnChar().
| void SYMBOLS_LISTBOX::SetString | ( | unsigned | linecount, |
| const wxString & | text ) |
Definition at line 61 of file symbols_listbox.cpp.
References m_SymbolList, text, and ITEMS_LISTBOX_BASE::UpdateWidth().
|
inlineinherited |
Definition at line 69 of file listboxes.h.
References m_isClosing.
|
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 63 of file listbox_base.cpp.
References m_columnWidth.
Referenced by 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 41 of file listbox_base.cpp.
References m_columnWidth, and UpdateLineWidth().
Referenced by SYMBOLS_LISTBOX::AppendLine(), LIBRARY_LISTBOX::Finish(), FOOTPRINTS_LISTBOX::SetFootprints(), FOOTPRINTS_LISTBOX::SetString(), LIBRARY_LISTBOX::SetString(), and SYMBOLS_LISTBOX::SetString().
|
privateinherited |
Definition at line 83 of file listboxes.h.
Referenced by ITEMS_LISTBOX_BASE(), UpdateLineWidth(), and UpdateWidth().
|
protectedinherited |
Definition at line 80 of file listboxes.h.
Referenced by ITEMS_LISTBOX_BASE(), FOOTPRINTS_LISTBOX::OnChar(), SYMBOLS_LISTBOX::OnChar(), FOOTPRINTS_LISTBOX::OnLeftClick(), FOOTPRINTS_LISTBOX::OnLeftDClick(), SYMBOLS_LISTBOX::OnSelectComponent(), and Shutdown().
| wxArrayString SYMBOLS_LISTBOX::m_SymbolList |
Definition at line 227 of file listboxes.h.
Referenced by AppendLine(), Clear(), GetCount(), OnChar(), OnGetItemText(), and SetString().
|
private |
Definition at line 230 of file listboxes.h.
Referenced by AppendWarning(), OnGetItemAttr(), and RemoveWarning().
|
private |
Definition at line 231 of file listboxes.h.
Referenced by OnGetItemAttr(), and SYMBOLS_LISTBOX().