KiCad PCB EDA Suite
Loading...
Searching...
No Matches
LIB_TREE_MODEL_ADAPTER Class Referenceabstract

#include <lib_tree_model_adapter.h>

Inheritance diagram for LIB_TREE_MODEL_ADAPTER:
FP_TREE_MODEL_ADAPTER SYMBOL_TREE_MODEL_ADAPTER SYMBOL_TREE_SYNCHRONIZING_ADAPTER FP_TREE_SYNCHRONIZING_ADAPTER

Public Types

enum  TREE_COLS { NAME_COL = 0 , DESC_COL , NUM_COLS }
 This enum defines the order of the default columns in the tree view. More...
 
enum  SORT_MODE { BEST_MATCH = 0 , ALPHABETIC }
 

Public Member Functions

 ~LIB_TREE_MODEL_ADAPTER ()
 Destructor. More...
 
void SaveSettings ()
 Save the column widths to the config file. More...
 
void SetFilter (std::function< bool(LIB_TREE_NODE &aNode)> *aFilter)
 Set the symbol filter type. More...
 
std::function< bool(LIB_TREE_NODE &aNode)> * GetFilter () const
 Return the active filter. More...
 
void SetSortMode (SORT_MODE aMode)
 
SORT_MODE GetSortMode () const
 
void ShowUnits (bool aShow)
 Whether or not to show units. More...
 
void SetPreselectNode (const LIB_ID &aLibId, int aUnit)
 Set the symbol name to be selected if there are no search results. More...
 
void DoAddLibrary (const wxString &aNodeName, const wxString &aDesc, const std::vector< LIB_TREE_ITEM * > &aItemList, bool pinned, bool presorted)
 Add the given list of symbols by alias. More...
 
std::vector< wxString > GetAvailableColumns () const
 
std::vector< wxString > GetShownColumns () const
 
std::vector< wxString > GetOpenLibs () const
 
void OpenLibs (const std::vector< wxString > &aLibs)
 
void SetShownColumns (const std::vector< wxString > &aColumnNames)
 Sets which columns are shown in the widget. More...
 
void AssignIntrinsicRanks ()
 Sort the tree and assign ranks after adding libraries. More...
 
void UpdateSearchString (const wxString &aSearch, bool aState)
 Set the search string provided by the user. More...
 
void AttachTo (wxDataViewCtrl *aDataViewCtrl)
 Attach to a wxDataViewCtrl and initialize it. More...
 
void FinishTreeInitialization ()
 A final-stage initialization to be called after the window hierarchy has been realized and the window sizes set. More...
 
LIB_ID GetAliasFor (const wxDataViewItem &aSelection) const
 Return the alias for the given item. More...
 
int GetUnitFor (const wxDataViewItem &aSelection) const
 Return the unit for the given item. More...
 
LIB_TREE_NODE::TYPE GetTypeFor (const wxDataViewItem &aSelection) const
 Return node type for the given item. More...
 
LIB_TREE_NODEGetTreeNodeFor (const wxDataViewItem &aSelection) const
 
virtual wxString GenerateInfo (const LIB_ID &aLibId, int aUnit)
 
virtual bool HasPreview (const wxDataViewItem &aItem)
 
virtual void ShowPreview (wxWindow *aParent, const wxDataViewItem &aItem)
 
TOOL_DISPATCHERGetToolDispatcher () const
 
int GetItemCount () const
 Return the number of symbols loaded in the tree. More...
 
virtual int GetLibrariesCount () const
 Return the number of libraries loaded in the tree. More...
 
wxDataViewItem FindItem (const LIB_ID &aLibId)
 Returns tree item corresponding to part. More...
 
virtual wxDataViewItem GetCurrentDataViewItem ()
 
unsigned int GetChildren (const wxDataViewItem &aItem, wxDataViewItemArray &aChildren) const override
 Populate a list of all the children of an item. More...
 
void Freeze ()
 
void Thaw ()
 
bool IsFrozen () const
 
void RefreshTree ()
 
virtual TOOL_INTERACTIVEGetContextMenuTool ()
 
void PinLibrary (LIB_TREE_NODE *aTreeNode)
 
void UnpinLibrary (LIB_TREE_NODE *aTreeNode)
 
void ShowChangedLanguage ()
 

Static Public Member Functions

static const wxString GetPinningSymbol ()
 

Protected Member Functions

 LIB_TREE_MODEL_ADAPTER (EDA_BASE_FRAME *aParent, const wxString &aPinnedKey)
 Create the adapter. More...
 
LIB_TREE_NODE_LIBRARYDoAddLibraryNode (const wxString &aNodeName, const wxString &aDesc, bool pinned)
 
bool HasContainerColumns (const wxDataViewItem &aItem) const override
 Check whether a container has columns too. More...
 
bool IsContainer (const wxDataViewItem &aItem) const override
 Check whether an item can have children. More...
 
wxDataViewItem GetParent (const wxDataViewItem &aItem) const override
 Get the parent of an item. More...
 
unsigned int GetColumnCount () const override
 
wxString GetColumnType (unsigned int aCol) const override
 Return the type of data stored in the column as indicated by wxVariant::GetType() More...
 
void GetValue (wxVariant &aVariant, const wxDataViewItem &aItem, unsigned int aCol) const override
 Get the value of an item. More...
 
bool SetValue (const wxVariant &aVariant, const wxDataViewItem &aItem, unsigned int aCol) override
 Set the value of an item. More...
 
bool GetAttr (const wxDataViewItem &aItem, unsigned int aCol, wxDataViewItemAttr &aAttr) const override
 Get any formatting for an item. More...
 
virtual bool isSymbolModel ()=0
 
void resortTree ()
 
void addColumnIfNecessary (const wxString &aHeader)
 
void recreateColumns ()
 

Static Protected Member Functions

static wxDataViewItem ToItem (const LIB_TREE_NODE *aNode)
 Convert #SYM_TREE_NODE -> wxDataViewItem. More...
 
static LIB_TREE_NODEToNode (wxDataViewItem aItem)
 Convert wxDataViewItem -> #SYM_TREE_NODE. More...
 

Protected Attributes

LIB_TREE_NODE_ROOT m_tree
 
std::map< unsigned, wxString > m_colIdxMap
 
std::vector< wxString > m_availableColumns
 
wxDataViewCtrl * m_widget
 

Private Member Functions

const LIB_TREE_NODEShowResults ()
 Find and expand successful search results. More...
 
wxDataViewColumn * doAddColumn (const wxString &aHeader, bool aTranslate=true)
 

Private Attributes

EDA_BASE_FRAMEm_parent
 
SORT_MODE m_sort_mode
 
bool m_show_units
 
LIB_ID m_preselect_lib_id
 
int m_preselect_unit
 
int m_freeze
 
std::function< bool(LIB_TREE_NODE &aNode)> * m_filter
 
std::vector< wxDataViewColumn * > m_columns
 
std::map< wxString, wxDataViewColumn * > m_colNameMap
 
std::map< wxString, int > m_colWidths
 
std::vector< wxString > m_shownColumns
 

Detailed Description

Definition at line 100 of file lib_tree_model_adapter.h.

Member Enumeration Documentation

◆ SORT_MODE

Enumerator
BEST_MATCH 
ALPHABETIC 

Definition at line 129 of file lib_tree_model_adapter.h.

◆ TREE_COLS

This enum defines the order of the default columns in the tree view.

Enumerator
NAME_COL 

Library or library item name column.

DESC_COL 

Library or library description column.

NUM_COLS 

The number of default tree columns.

Definition at line 122 of file lib_tree_model_adapter.h.

Constructor & Destructor Documentation

◆ ~LIB_TREE_MODEL_ADAPTER()

LIB_TREE_MODEL_ADAPTER::~LIB_TREE_MODEL_ADAPTER ( )

Destructor.

Do NOT delete this class manually; it is reference-counted by wxObject.

Definition at line 159 of file lib_tree_model_adapter.cpp.

◆ LIB_TREE_MODEL_ADAPTER()

LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER ( EDA_BASE_FRAME aParent,
const wxString &  aPinnedKey 
)
protected

Create the adapter.

Parameters
aParentis the parent frame
aPinnedKeyis the key to load the pinned libraries list from the project file

Definition at line 128 of file lib_tree_model_adapter.cpp.

References _HKI, APP_SETTINGS_BASE::LIB_TREE::column_widths, APP_SETTINGS_BASE::LIB_TREE::columns, Kiface(), KIFACE_BASE::KifaceSettings(), m_availableColumns, m_colWidths, APP_SETTINGS_BASE::m_LibTree, and m_shownColumns.

Member Function Documentation

◆ addColumnIfNecessary()

void LIB_TREE_MODEL_ADAPTER::addColumnIfNecessary ( const wxString &  aHeader)
protected

◆ AssignIntrinsicRanks()

void LIB_TREE_MODEL_ADAPTER::AssignIntrinsicRanks ( )
inline

Sort the tree and assign ranks after adding libraries.

Definition at line 201 of file lib_tree_model_adapter.h.

References LIB_TREE_NODE::AssignIntrinsicRanks(), and m_tree.

Referenced by PANEL_SYMBOL_CHOOSER::PANEL_SYMBOL_CHOOSER().

◆ AttachTo()

void LIB_TREE_MODEL_ADAPTER::AttachTo ( wxDataViewCtrl *  aDataViewCtrl)

Attach to a wxDataViewCtrl and initialize it.

This will set up columns and associate the model via the adapter.

Parameters
aDataViewCtrlthe view symbol in the dialog

Definition at line 349 of file lib_tree_model_adapter.cpp.

References kDataViewIndent, m_widget, and recreateColumns().

◆ doAddColumn()

wxDataViewColumn * LIB_TREE_MODEL_ADAPTER::doAddColumn ( const wxString &  aHeader,
bool  aTranslate = true 
)
private

◆ DoAddLibrary()

void LIB_TREE_MODEL_ADAPTER::DoAddLibrary ( const wxString &  aNodeName,
const wxString &  aDesc,
const std::vector< LIB_TREE_ITEM * > &  aItemList,
bool  pinned,
bool  presorted 
)

Add the given list of symbols by alias.

To be called in the setup phase.

Parameters
aNodeNamethe parent node the symbols will appear under
aDescthe description field of the parent node
aItemListlist of symbols

Definition at line 237 of file lib_tree_model_adapter.cpp.

References LIB_TREE_NODE_LIBRARY::AddItem(), LIB_TREE_NODE::AssignIntrinsicRanks(), and DoAddLibraryNode().

Referenced by SYMBOL_TREE_MODEL_ADAPTER::AddLibraries(), FP_TREE_MODEL_ADAPTER::AddLibraries(), SYMBOL_TREE_MODEL_ADAPTER::AddLibrary(), PANEL_FOOTPRINT_CHOOSER::PANEL_FOOTPRINT_CHOOSER(), PANEL_SYMBOL_CHOOSER::PANEL_SYMBOL_CHOOSER(), and FP_TREE_SYNCHRONIZING_ADAPTER::Sync().

◆ DoAddLibraryNode()

LIB_TREE_NODE_LIBRARY & LIB_TREE_MODEL_ADAPTER::DoAddLibraryNode ( const wxString &  aNodeName,
const wxString &  aDesc,
bool  pinned 
)
protected

◆ FindItem()

wxDataViewItem LIB_TREE_MODEL_ADAPTER::FindItem ( const LIB_ID aLibId)

Returns tree item corresponding to part.

Parameters
aLibIdspecifies the part and library name to be searched for.
Returns
Tree data item representing the part. Might be invalid if nothings was found.

Definition at line 497 of file lib_tree_model_adapter.cpp.

References LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), LIB_TREE_NODE::m_Children, m_tree, and ToItem().

Referenced by GetCurrentDataViewItem(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetCurrentDataViewItem(), FP_TREE_SYNCHRONIZING_ADAPTER::GetCurrentDataViewItem(), and OpenLibs().

◆ FinishTreeInitialization()

void LIB_TREE_MODEL_ADAPTER::FinishTreeInitialization ( )

A final-stage initialization to be called after the window hierarchy has been realized and the window sizes set.

Definition at line 551 of file lib_tree_model_adapter.cpp.

References m_colIdxMap, m_columns, m_colWidths, and m_widget.

◆ Freeze()

void LIB_TREE_MODEL_ADAPTER::Freeze ( )
inline

Definition at line 299 of file lib_tree_model_adapter.h.

References m_freeze.

Referenced by resortTree(), and UpdateSearchString().

◆ GenerateInfo()

virtual wxString LIB_TREE_MODEL_ADAPTER::GenerateInfo ( const LIB_ID aLibId,
int  aUnit 
)
inlinevirtual

Reimplemented in SYMBOL_TREE_MODEL_ADAPTER, and FP_TREE_MODEL_ADAPTER.

Definition at line 258 of file lib_tree_model_adapter.h.

◆ GetAliasFor()

LIB_ID LIB_TREE_MODEL_ADAPTER::GetAliasFor ( const wxDataViewItem &  aSelection) const

Return the alias for the given item.

Parameters
aSelectionitem from the wxDataViewCtrl (see wxDataViewCtrl::GetSelection())
Returns
alias, or nullptr if none is selected

Definition at line 459 of file lib_tree_model_adapter.cpp.

References LIB_TREE_NODE::m_LibId, and ToNode().

◆ GetAttr()

bool LIB_TREE_MODEL_ADAPTER::GetAttr ( const wxDataViewItem &  aItem,
unsigned int  aCol,
wxDataViewItemAttr &  aAttr 
) const
overrideprotected

Get any formatting for an item.

Parameters
aItemitem to get formatting for
aColcolumn number of interest
aAttrreceiver for attributes
Returns
true if the item has non-default attributes

Definition at line 699 of file lib_tree_model_adapter.cpp.

References IsFrozen(), LIB_TREE_NODE::ITEM, LIB_TREE_NODE::m_IsRoot, LIB_TREE_NODE::m_Type, and ToNode().

◆ GetAvailableColumns()

std::vector< wxString > LIB_TREE_MODEL_ADAPTER::GetAvailableColumns ( ) const
inline

Definition at line 185 of file lib_tree_model_adapter.h.

References m_availableColumns.

◆ GetChildren()

unsigned int LIB_TREE_MODEL_ADAPTER::GetChildren ( const wxDataViewItem &  aItem,
wxDataViewItemArray &  aChildren 
) const
override

Populate a list of all the children of an item.

Returns
number of children

Definition at line 527 of file lib_tree_model_adapter.cpp.

References LIB_TREE_NODE::LIBRARY, LIB_TREE_NODE::m_Children, m_show_units, m_tree, LIB_TREE_NODE::m_Type, ToItem(), and ToNode().

Referenced by GetOpenLibs().

◆ GetColumnCount()

unsigned int LIB_TREE_MODEL_ADAPTER::GetColumnCount ( ) const
inlineoverrideprotected

Definition at line 355 of file lib_tree_model_adapter.h.

References m_columns.

◆ GetColumnType()

wxString LIB_TREE_MODEL_ADAPTER::GetColumnType ( unsigned int  aCol) const
inlineoverrideprotected

Return the type of data stored in the column as indicated by wxVariant::GetType()

Definition at line 360 of file lib_tree_model_adapter.h.

◆ GetContextMenuTool()

virtual TOOL_INTERACTIVE * LIB_TREE_MODEL_ADAPTER::GetContextMenuTool ( )
inlinevirtual

◆ GetCurrentDataViewItem()

wxDataViewItem LIB_TREE_MODEL_ADAPTER::GetCurrentDataViewItem ( )
virtual

◆ GetFilter()

std::function< bool(LIB_TREE_NODE &aNode)> * LIB_TREE_MODEL_ADAPTER::GetFilter ( ) const
inline

Return the active filter.

Definition at line 151 of file lib_tree_model_adapter.h.

References m_filter.

Referenced by SYMBOL_TREE_MODEL_ADAPTER::AddLibraries(), and SYMBOL_TREE_MODEL_ADAPTER::AddLibrary().

◆ GetItemCount()

int LIB_TREE_MODEL_ADAPTER::GetItemCount ( ) const

Return the number of symbols loaded in the tree.

Definition at line 486 of file lib_tree_model_adapter.cpp.

References LIB_TREE_NODE::m_Children, and m_tree.

◆ GetLibrariesCount()

virtual int LIB_TREE_MODEL_ADAPTER::GetLibrariesCount ( ) const
inlinevirtual

Return the number of libraries loaded in the tree.

Reimplemented in SYMBOL_TREE_SYNCHRONIZING_ADAPTER, and FP_TREE_SYNCHRONIZING_ADAPTER.

Definition at line 273 of file lib_tree_model_adapter.h.

References LIB_TREE_NODE::m_Children, and m_tree.

Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetLibrariesCount().

◆ GetOpenLibs()

std::vector< wxString > LIB_TREE_MODEL_ADAPTER::GetOpenLibs ( ) const

Definition at line 163 of file lib_tree_model_adapter.cpp.

References GetChildren(), m_widget, and ToNode().

Referenced by SaveSettings().

◆ GetParent()

wxDataViewItem LIB_TREE_MODEL_ADAPTER::GetParent ( const wxDataViewItem &  aItem) const
overrideprotected

Get the parent of an item.

Returns
parent of aItem, or an invalid wxDataViewItem if parent is root

Definition at line 636 of file lib_tree_model_adapter.cpp.

References m_freeze, LIB_TREE_NODE::m_Parent, LIB_TREE_NODE::m_Type, ToItem(), and ToNode().

Referenced by UpdateSearchString().

◆ GetPinningSymbol()

◆ GetShownColumns()

std::vector< wxString > LIB_TREE_MODEL_ADAPTER::GetShownColumns ( ) const
inline

Definition at line 187 of file lib_tree_model_adapter.h.

References m_shownColumns.

Referenced by SaveSettings().

◆ GetSortMode()

SORT_MODE LIB_TREE_MODEL_ADAPTER::GetSortMode ( ) const
inline

Definition at line 154 of file lib_tree_model_adapter.h.

References m_sort_mode.

◆ GetToolDispatcher()

TOOL_DISPATCHER * LIB_TREE_MODEL_ADAPTER::GetToolDispatcher ( ) const
inline

Definition at line 263 of file lib_tree_model_adapter.h.

References TOOLS_HOLDER::GetToolDispatcher(), and m_parent.

◆ GetTreeNodeFor()

LIB_TREE_NODE * LIB_TREE_MODEL_ADAPTER::GetTreeNodeFor ( const wxDataViewItem &  aSelection) const

Definition at line 480 of file lib_tree_model_adapter.cpp.

References ToNode().

◆ GetTypeFor()

LIB_TREE_NODE::TYPE LIB_TREE_MODEL_ADAPTER::GetTypeFor ( const wxDataViewItem &  aSelection) const

Return node type for the given item.

Parameters
aSelectionitem from the wxDataViewCtrl (see wxDataViewCtrl::GetSelection())
Returns
Type of the selected node, might be INVALID.

Definition at line 473 of file lib_tree_model_adapter.cpp.

References LIB_TREE_NODE::INVALID, LIB_TREE_NODE::m_Type, and ToNode().

◆ GetUnitFor()

int LIB_TREE_MODEL_ADAPTER::GetUnitFor ( const wxDataViewItem &  aSelection) const

Return the unit for the given item.

Parameters
aSelectionitem from the wxDataViewCtrl (see wxDataViewCtrl::GetSelection())
Returns
Unit, or zero if the alias itself is selected. Return valid is invalid if GetAliasFor() returns nullptr.

Definition at line 466 of file lib_tree_model_adapter.cpp.

References LIB_TREE_NODE::m_Unit, and ToNode().

◆ GetValue()

void LIB_TREE_MODEL_ADAPTER::GetValue ( wxVariant &  aVariant,
const wxDataViewItem &  aItem,
unsigned int  aCol 
) const
overrideprotected

Get the value of an item.

Parameters
aVariantwxVariant to receive the data
aItemitem whose data will be placed into aVariant
aColcolumn number of the data

Definition at line 653 of file lib_tree_model_adapter.cpp.

References GetPinningSymbol(), IsFrozen(), m_colIdxMap, LIB_TREE_NODE::m_Desc, LIB_TREE_NODE::m_Fields, LIB_TREE_NODE::m_Name, LIB_TREE_NODE::m_Pinned, NAME_COL, ToNode(), and UnescapeString().

◆ HasContainerColumns()

bool LIB_TREE_MODEL_ADAPTER::HasContainerColumns ( const wxDataViewItem &  aItem) const
overrideprotected

Check whether a container has columns too.

Definition at line 623 of file lib_tree_model_adapter.cpp.

References IsContainer().

◆ HasPreview()

virtual bool LIB_TREE_MODEL_ADAPTER::HasPreview ( const wxDataViewItem &  aItem)
inlinevirtual

◆ IsContainer()

bool LIB_TREE_MODEL_ADAPTER::IsContainer ( const wxDataViewItem &  aItem) const
overrideprotected

Check whether an item can have children.

Definition at line 629 of file lib_tree_model_adapter.cpp.

References LIB_TREE_NODE::m_Children, and ToNode().

Referenced by HasContainerColumns().

◆ IsFrozen()

◆ isSymbolModel()

virtual bool LIB_TREE_MODEL_ADAPTER::isSymbolModel ( )
protectedpure virtual

◆ OpenLibs()

void LIB_TREE_MODEL_ADAPTER::OpenLibs ( const std::vector< wxString > &  aLibs)

Definition at line 181 of file lib_tree_model_adapter.cpp.

References FindItem(), and m_widget.

◆ PinLibrary()

◆ recreateColumns()

void LIB_TREE_MODEL_ADAPTER::recreateColumns ( )
protected

◆ RefreshTree()

void LIB_TREE_MODEL_ADAPTER::RefreshTree ( )

Definition at line 578 of file lib_tree_model_adapter.cpp.

References m_colNameMap, m_columns, and m_colWidths.

◆ resortTree()

void LIB_TREE_MODEL_ADAPTER::resortTree ( )
protected

◆ SaveSettings()

void LIB_TREE_MODEL_ADAPTER::SaveSettings ( )

◆ SetFilter()

void LIB_TREE_MODEL_ADAPTER::SetFilter ( std::function< bool(LIB_TREE_NODE &aNode)> *  aFilter)
inline

Set the symbol filter type.

Must be set before adding libraries

Parameters
aFilterif SYM_FILTER_POWER, only power parts are loaded

Definition at line 146 of file lib_tree_model_adapter.h.

References m_filter.

Referenced by PANEL_FOOTPRINT_CHOOSER::PANEL_FOOTPRINT_CHOOSER(), and PANEL_SYMBOL_CHOOSER::PANEL_SYMBOL_CHOOSER().

◆ SetPreselectNode()

void LIB_TREE_MODEL_ADAPTER::SetPreselectNode ( const LIB_ID aLibId,
int  aUnit 
)

Set the symbol name to be selected if there are no search results.

May be set at any time; updates at the next UpdateSearchString().

Parameters
aLibIdsymbol LIB_ID to be selected
aUnitunit to be selected, if > 0 (0 selects the alias itself)

Definition at line 218 of file lib_tree_model_adapter.cpp.

References m_preselect_lib_id, and m_preselect_unit.

Referenced by PANEL_FOOTPRINT_CHOOSER::PANEL_FOOTPRINT_CHOOSER(), and PANEL_SYMBOL_CHOOSER::PANEL_SYMBOL_CHOOSER().

◆ SetShownColumns()

void LIB_TREE_MODEL_ADAPTER::SetShownColumns ( const std::vector< wxString > &  aColumnNames)

Sets which columns are shown in the widget.

Invalid column names are discarded.

Parameters
aColumnNamesis an ordered list of column names to show

Definition at line 448 of file lib_tree_model_adapter.cpp.

References m_shownColumns, m_widget, and recreateColumns().

◆ SetSortMode()

void LIB_TREE_MODEL_ADAPTER::SetSortMode ( SORT_MODE  aMode)
inline

Definition at line 153 of file lib_tree_model_adapter.h.

References m_sort_mode.

◆ SetValue()

bool LIB_TREE_MODEL_ADAPTER::SetValue ( const wxVariant &  aVariant,
const wxDataViewItem &  aItem,
unsigned int  aCol 
)
inlineoverrideprotected

Set the value of an item.

Does nothing - this model doesn't support editing.

Definition at line 377 of file lib_tree_model_adapter.h.

◆ ShowChangedLanguage()

void LIB_TREE_MODEL_ADAPTER::ShowChangedLanguage ( )
inline

Definition at line 311 of file lib_tree_model_adapter.h.

References recreateColumns().

◆ ShowPreview()

virtual void LIB_TREE_MODEL_ADAPTER::ShowPreview ( wxWindow *  aParent,
const wxDataViewItem &  aItem 
)
inlinevirtual

◆ ShowResults()

const LIB_TREE_NODE * LIB_TREE_MODEL_ADAPTER::ShowResults ( )
private

◆ ShowUnits()

void LIB_TREE_MODEL_ADAPTER::ShowUnits ( bool  aShow)

Whether or not to show units.

May be set at any time; updates at the next UpdateSearchString()

Parameters
aShowif true, units are displayed

Definition at line 212 of file lib_tree_model_adapter.cpp.

References m_show_units.

◆ Thaw()

void LIB_TREE_MODEL_ADAPTER::Thaw ( )
inline

Definition at line 300 of file lib_tree_model_adapter.h.

References m_freeze.

Referenced by resortTree(), and UpdateSearchString().

◆ ToItem()

wxDataViewItem LIB_TREE_MODEL_ADAPTER::ToItem ( const LIB_TREE_NODE aNode)
staticprotected

◆ ToNode()

◆ UnpinLibrary()

◆ UpdateSearchString()

void LIB_TREE_MODEL_ADAPTER::UpdateSearchString ( const wxString &  aSearch,
bool  aState 
)

Set the search string provided by the user.

Parameters
aSearchfull, unprocessed search text
aStateif true, we are keeping the state and so we shouldn't collapse the tree

Definition at line 250 of file lib_tree_model_adapter.cpp.

References BEST_MATCH, CTX_LIBITEM, Freeze(), GetParent(), LIB_TREE_NODE::m_Children, m_filter, m_sort_mode, m_tree, m_widget, LIB_TREE_NODE::ResetScore(), ShowResults(), LIB_TREE_NODE::SortNodes(), Thaw(), ToItem(), and LIB_TREE_NODE_ROOT::UpdateScore().

Member Data Documentation

◆ m_availableColumns

std::vector<wxString> LIB_TREE_MODEL_ADAPTER::m_availableColumns
protected

◆ m_colIdxMap

std::map<unsigned, wxString> LIB_TREE_MODEL_ADAPTER::m_colIdxMap
protected

◆ m_colNameMap

std::map<wxString, wxDataViewColumn*> LIB_TREE_MODEL_ADAPTER::m_colNameMap
private

◆ m_columns

std::vector<wxDataViewColumn*> LIB_TREE_MODEL_ADAPTER::m_columns
private

◆ m_colWidths

std::map<wxString, int> LIB_TREE_MODEL_ADAPTER::m_colWidths
private

◆ m_filter

std::function<bool( LIB_TREE_NODE& aNode )>* LIB_TREE_MODEL_ADAPTER::m_filter
private

Definition at line 425 of file lib_tree_model_adapter.h.

Referenced by GetFilter(), SetFilter(), and UpdateSearchString().

◆ m_freeze

int LIB_TREE_MODEL_ADAPTER::m_freeze
private

Definition at line 423 of file lib_tree_model_adapter.h.

Referenced by Freeze(), GetParent(), IsFrozen(), and Thaw().

◆ m_parent

EDA_BASE_FRAME* LIB_TREE_MODEL_ADAPTER::m_parent
private

Definition at line 417 of file lib_tree_model_adapter.h.

Referenced by GetToolDispatcher(), PinLibrary(), and UnpinLibrary().

◆ m_preselect_lib_id

LIB_ID LIB_TREE_MODEL_ADAPTER::m_preselect_lib_id
private

Definition at line 421 of file lib_tree_model_adapter.h.

Referenced by GetCurrentDataViewItem(), SetPreselectNode(), and ShowResults().

◆ m_preselect_unit

int LIB_TREE_MODEL_ADAPTER::m_preselect_unit
private

Definition at line 422 of file lib_tree_model_adapter.h.

Referenced by SetPreselectNode(), and ShowResults().

◆ m_show_units

bool LIB_TREE_MODEL_ADAPTER::m_show_units
private

Definition at line 420 of file lib_tree_model_adapter.h.

Referenced by GetChildren(), and ShowUnits().

◆ m_shownColumns

std::vector<wxString> LIB_TREE_MODEL_ADAPTER::m_shownColumns
private

◆ m_sort_mode

SORT_MODE LIB_TREE_MODEL_ADAPTER::m_sort_mode
private

Definition at line 419 of file lib_tree_model_adapter.h.

Referenced by GetSortMode(), resortTree(), SetSortMode(), and UpdateSearchString().

◆ m_tree

◆ m_widget


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