KiCad PCB EDA Suite
No Matches

#include <listboxes.h>

Inheritance diagram for SYMBOLS_LISTBOX:

Public Member Functions

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)
int GetSelection ()
void DeselectAll ()
 Remove all selection in lists which can have more than one item selected.
virtual CVPCB_MAINFRAMEGetParent () 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

Detailed Description

Definition at line 181 of file listboxes.h.

Constructor & Destructor Documentation


wxWindowID  id 

Definition at line 37 of file symbols_listbox.cpp.

References KIPLATFORM::UI::IsDarkTheme(), and m_warningAttr.



Definition at line 46 of file symbols_listbox.cpp.

Member Function Documentation

◆ AppendLine()

void SYMBOLS_LISTBOX::AppendLine ( const wxString &  text)

◆ AppendWarning()

void SYMBOLS_LISTBOX::AppendWarning ( int  index)

◆ Clear()

void SYMBOLS_LISTBOX::Clear ( )

Definition at line 57 of file symbols_listbox.cpp.

References Clear().

Referenced by Clear(), and CVPCB_MAINFRAME::readNetListAndFpFiles().



◆ DeselectAll()

void ITEMS_LISTBOX_BASE::DeselectAll ( )

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().

◆ GetCount()

int SYMBOLS_LISTBOX::GetCount ( )

◆ GetParent()


◆ GetSelection()

int ITEMS_LISTBOX_BASE::GetSelection ( )
the index of the selected item in lists allowing only one item selected and the index of the first selected item in lists allowing many selection

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().

◆ OnChar()

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.

◆ OnGetItemAttr()

wxListItemAttr * SYMBOLS_LISTBOX::OnGetItemAttr ( long  item) const

Definition at line 117 of file symbols_listbox.cpp.

References m_symbolWarning, and m_warningAttr.

◆ OnGetItemText()

wxString SYMBOLS_LISTBOX::OnGetItemText ( long  item,
long  column 
) const

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.

◆ OnSelectComponent()

void SYMBOLS_LISTBOX::OnSelectComponent ( wxListEvent &  event)

◆ RemoveWarning()

void SYMBOLS_LISTBOX::RemoveWarning ( int  index)

Definition at line 101 of file symbols_listbox.cpp.

References m_symbolWarning.

Referenced by CVPCB_MAINFRAME::AssociateFootprint().

◆ SetSelection()

void SYMBOLS_LISTBOX::SetSelection ( int  index,
bool  State = true 

◆ SetString()

void SYMBOLS_LISTBOX::SetString ( unsigned  linecount,
const wxString &  text 

◆ UpdateLineWidth()

void ITEMS_LISTBOX_BASE::UpdateLineWidth ( unsigned  aLine,
wxClientDC &  dc 

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().

◆ UpdateWidth()

void ITEMS_LISTBOX_BASE::UpdateWidth ( int  aLine = -1)

Update the width of the column based on its contents.

aLineis 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 FOOTPRINTS_LISTBOX::AppendLine(), AppendLine(), LIBRARY_LISTBOX::Finish(), FOOTPRINTS_LISTBOX::SetFootprints(), FOOTPRINTS_LISTBOX::SetString(), LIBRARY_LISTBOX::SetString(), and SetString().

Member Data Documentation

◆ columnWidth

int ITEMS_LISTBOX_BASE::columnWidth

◆ m_SymbolList

wxArrayString SYMBOLS_LISTBOX::m_SymbolList

Definition at line 227 of file listboxes.h.

Referenced by AppendLine(), GetCount(), OnChar(), OnGetItemText(), and SetString().

◆ m_symbolWarning

std::vector<long> SYMBOLS_LISTBOX::m_symbolWarning

Definition at line 230 of file listboxes.h.

Referenced by AppendWarning(), OnGetItemAttr(), and RemoveWarning().

◆ m_warningAttr

std::unique_ptr<wxListItemAttr> SYMBOLS_LISTBOX::m_warningAttr

Definition at line 231 of file listboxes.h.

Referenced by OnGetItemAttr(), and SYMBOLS_LISTBOX().

The documentation for this class was generated from the following files: