|
KiCad PCB EDA Suite
|
#include <listboxes.h>
Public Member Functions | |
| LIBRARY_LISTBOX (CVPCB_MAINFRAME *parent, wxWindowID id) | |
| virtual | ~LIBRARY_LISTBOX ()=default |
| 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. | |
| void | Shutdown () |
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 | |
| wxArrayString | m_libraryList |
| int | m_columnWidth |
Definition at line 144 of file listboxes.h.
| LIBRARY_LISTBOX::LIBRARY_LISTBOX | ( | CVPCB_MAINFRAME * | parent, |
| wxWindowID | id ) |
Definition at line 32 of file library_listbox.cpp.
References ITEMS_LISTBOX_BASE::ITEMS_LISTBOX_BASE().
Referenced by OnChar().
| void LIBRARY_LISTBOX::AppendLine | ( | const wxString & | text | ) |
Definition at line 77 of file library_listbox.cpp.
References m_libraryList, and text.
| void LIBRARY_LISTBOX::ClearList | ( | ) |
Definition at line 119 of file library_listbox.cpp.
References m_libraryList.
| LIBRARY_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().
| void LIBRARY_LISTBOX::Finish | ( | ) |
Definition at line 109 of file library_listbox.cpp.
References L, m_libraryList, and ITEMS_LISTBOX_BASE::UpdateWidth().
| int LIBRARY_LISTBOX::GetCount | ( | ) |
Definition at line 38 of file library_listbox.cpp.
References m_libraryList.
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().
| wxString LIBRARY_LISTBOX::GetSelectedLibrary | ( | ) |
Definition at line 59 of file library_listbox.cpp.
References LIB_TREE_MODEL_ADAPTER::GetPinningSymbol(), and m_libraryList.
|
inherited |
Definition at line 88 of file listbox_base.cpp.
Referenced by 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 131 of file library_listbox.cpp.
References dump(), kicadTraceKeyEvent, LIBRARY_LISTBOX(), m_libraryList, OnChar(), SetSelection(), and text.
Referenced by OnChar().
|
override |
Definition at line 85 of file library_listbox.cpp.
References m_libraryList.
| void LIBRARY_LISTBOX::OnSelectLibrary | ( | wxListEvent & | event | ) |
Definition at line 190 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 91 of file library_listbox.cpp.
References GetCount(), and index.
Referenced by OnChar().
| void LIBRARY_LISTBOX::SetString | ( | unsigned | linecount, |
| const wxString & | text ) |
Definition at line 44 of file library_listbox.cpp.
References m_libraryList, 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().
|
private |
Definition at line 178 of file listboxes.h.
Referenced by AppendLine(), ClearList(), Finish(), GetCount(), GetSelectedLibrary(), OnChar(), OnGetItemText(), and SetString().