KiCad PCB EDA Suite
|
#include <symbol_tree_synchronizing_adapter.h>
Public Types | |
enum | SYM_FILTER_TYPE { SYM_FILTER_NONE , SYM_FILTER_POWER } |
This enum allows a selective filtering of symbols to list. More... | |
enum | TREE_COLS { NAME_COL = 0 , DESC_COL , NUM_COLS } |
This enum defines the order of the default columns in the tree view. More... | |
Public Member Functions | |
bool | IsContainer (const wxDataViewItem &aItem) const override |
void | Sync (const wxString &aForceRefresh, std::function< void(int, int, const wxString &)> aProgressCallback) |
int | GetLibrariesCount () const override |
Return the number of libraries loaded in the tree. More... | |
TOOL_INTERACTIVE * | GetContextMenuTool () override |
void | SaveSettings () |
Save the column widths to the config file. More... | |
void | SetFilter (SYM_FILTER_TYPE aFilter) |
Set the symbol filter type. More... | |
SYM_FILTER_TYPE | GetFilter () const |
Return the active filter. More... | |
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... | |
void | AddColumn (const wxString &aHeader) |
std::vector< wxString > | GetAvailableColumns () const |
std::vector< wxString > | GetShownColumns () const |
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... | |
void | OnSize (wxSizeEvent &aEvent) |
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_NODE * | GetTreeNodeFor (const wxDataViewItem &aSelection) const |
virtual wxString | GenerateInfo (const LIB_ID &aLibId, int aUnit) |
int | GetItemCount () const |
Return the number of symbols loaded in the tree. More... | |
wxDataViewItem | FindItem (const LIB_ID &aLibId) |
Returns tree item corresponding to part. More... | |
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 () |
void | PinLibrary (LIB_TREE_NODE *aTreeNode) |
void | UnpinLibrary (LIB_TREE_NODE *aTreeNode) |
Static Public Member Functions | |
static wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > | Create (SYMBOL_EDIT_FRAME *aParent, SYMBOL_LIBRARY_MANAGER *aLibs) |
static const wxString | GetPinningSymbol () |
Protected Member Functions | |
void | updateLibrary (LIB_TREE_NODE_LIB &aLibNode) |
LIB_TREE_NODE::PTR_VECTOR::iterator | deleteLibrary (LIB_TREE_NODE::PTR_VECTOR::iterator &aLibNodeIt) |
void | GetValue (wxVariant &aVariant, wxDataViewItem const &aItem, unsigned int aCol) const override |
bool | GetAttr (wxDataViewItem const &aItem, unsigned int aCol, wxDataViewItemAttr &aAttr) const override |
SYMBOL_TREE_SYNCHRONIZING_ADAPTER (SYMBOL_EDIT_FRAME *aParent, SYMBOL_LIBRARY_MANAGER *aLibMgr) | |
bool | isSymbolModel () override |
LIB_TREE_NODE_LIB & | DoAddLibraryNode (const wxString &aNodeName, const wxString &aDesc, bool pinned) |
bool | HasContainerColumns (const wxDataViewItem &aItem) const override |
Check whether a container has columns too. 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... | |
bool | SetValue (const wxVariant &aVariant, const wxDataViewItem &aItem, unsigned int aCol) override |
Set the value of an item. More... | |
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_NODE * | ToNode (wxDataViewItem aItem) |
Convert wxDataViewItem -> #SYM_TREE_NODE. More... | |
static unsigned int | IntoArray (const LIB_TREE_NODE &aNode, wxDataViewItemArray &aChildren) |
Convert SYM_TREE_NODE's children to wxDataViewItemArray. More... | |
Protected Attributes | |
SYMBOL_EDIT_FRAME * | m_frame |
SYMBOL_LIBRARY_MANAGER * | m_libMgr |
Hashes to decide whether a library needs an update. More... | |
std::map< wxString, int > | m_libHashes |
SYMBOL_LIBRARY_MANAGER hash value returned in the last synchronization. More... | |
int | m_lastSyncHash |
LIB_TREE_NODE_ROOT | m_tree |
std::map< unsigned, wxString > | m_colIdxMap |
std::vector< wxString > | m_availableColumns |
Private Member Functions | |
void | Find (LIB_TREE_NODE &aNode, std::function< bool(const LIB_TREE_NODE *)> aFunc, LIB_TREE_NODE **aHighScore) |
Find any results worth highlighting and expand them, according to given criteria The highest-scoring node is written to aHighScore. More... | |
LIB_TREE_NODE * | ShowResults () |
Find and expand successful search results. More... | |
LIB_TREE_NODE * | ShowPreselect () |
Find and expand preselected node. More... | |
LIB_TREE_NODE * | ShowSingleLibrary () |
Find and expand a library if there is only one. More... | |
wxDataViewColumn * | doAddColumn (const wxString &aHeader, bool aTranslate=true) |
Private Attributes | |
EDA_BASE_FRAME * | m_parent |
SYM_FILTER_TYPE | m_filter |
bool | m_show_units |
LIB_ID | m_preselect_lib_id |
int | m_preselect_unit |
int | m_freeze |
wxDataViewCtrl * | m_widget |
std::vector< wxDataViewColumn * > | m_columns |
std::map< wxString, wxDataViewColumn * > | m_colNameMap |
std::map< wxString, int > | m_colWidths |
std::vector< wxString > | m_shownColumns |
Definition at line 36 of file symbol_tree_synchronizing_adapter.h.
|
inherited |
This enum allows a selective filtering of symbols to list.
Enumerator | |
---|---|
SYM_FILTER_NONE | no filtering |
SYM_FILTER_POWER | list symbols flagged PWR |
Definition at line 120 of file lib_tree_model_adapter.h.
|
inherited |
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 129 of file lib_tree_model_adapter.h.
|
protected |
Definition at line 44 of file symbol_tree_synchronizing_adapter.cpp.
Referenced by Create().
|
inlineinherited |
Definition at line 184 of file lib_tree_model_adapter.h.
References LIB_TREE_MODEL_ADAPTER::doAddColumn().
|
protectedinherited |
Definition at line 335 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::m_availableColumns, and LIB_TREE_MODEL_ADAPTER::m_colNameMap.
Referenced by SYMBOL_TREE_MODEL_ADAPTER::AddLibraries().
|
inlineinherited |
Sort the tree and assign ranks after adding libraries.
Definition at line 202 of file lib_tree_model_adapter.h.
References LIB_TREE_NODE::AssignIntrinsicRanks(), and LIB_TREE_MODEL_ADAPTER::m_tree.
Referenced by SCH_BASE_FRAME::PickSymbolFromLibTree().
|
inherited |
Attach to a wxDataViewCtrl and initialize it.
This will set up columns and associate the model via the adapter.
aDataViewCtrl | the view symbol in the dialog |
Definition at line 249 of file lib_tree_model_adapter.cpp.
References kDataViewIndent, LIB_TREE_MODEL_ADAPTER::m_widget, and LIB_TREE_MODEL_ADAPTER::recreateColumns().
|
static |
Definition at line 36 of file symbol_tree_synchronizing_adapter.cpp.
References SYMBOL_TREE_SYNCHRONIZING_ADAPTER().
Referenced by LIB_SYMBOL_LIBRARY_MANAGER::LIB_SYMBOL_LIBRARY_MANAGER().
|
protected |
Definition at line 202 of file symbol_tree_synchronizing_adapter.cpp.
References LIB_TREE_NODE::m_Children, m_libHashes, LIB_TREE_NODE::m_Name, and LIB_TREE_MODEL_ADAPTER::m_tree.
Referenced by Sync().
|
privateinherited |
Definition at line 309 of file lib_tree_model_adapter.cpp.
References KIUI::GetTextSize(), LIB_TREE_MODEL_ADAPTER::m_colIdxMap, LIB_TREE_MODEL_ADAPTER::m_colNameMap, LIB_TREE_MODEL_ADAPTER::m_columns, LIB_TREE_MODEL_ADAPTER::m_colWidths, and LIB_TREE_MODEL_ADAPTER::m_widget.
Referenced by LIB_TREE_MODEL_ADAPTER::AddColumn(), and LIB_TREE_MODEL_ADAPTER::recreateColumns().
|
inherited |
Add the given list of symbols by alias.
To be called in the setup phase.
aNodeName | the parent node the symbols will appear under |
aDesc | the description field of the parent node |
aItemList | list of symbols |
Definition at line 146 of file lib_tree_model_adapter.cpp.
References LIB_TREE_NODE_LIB::AddItem(), LIB_TREE_NODE::AssignIntrinsicRanks(), and LIB_TREE_MODEL_ADAPTER::DoAddLibraryNode().
Referenced by SYMBOL_TREE_MODEL_ADAPTER::AddLibraries(), FP_TREE_MODEL_ADAPTER::AddLibraries(), SYMBOL_TREE_MODEL_ADAPTER::AddLibrary(), SCH_BASE_FRAME::PickSymbolFromLibTree(), PCB_BASE_FRAME::SelectFootprintFromLibTree(), and FP_TREE_SYNCHRONIZING_ADAPTER::Sync().
|
protectedinherited |
Definition at line 135 of file lib_tree_model_adapter.cpp.
References LIB_TREE_NODE_ROOT::AddLib(), LIB_TREE_NODE::m_Pinned, and LIB_TREE_MODEL_ADAPTER::m_tree.
Referenced by LIB_TREE_MODEL_ADAPTER::DoAddLibrary(), and Sync().
|
privateinherited |
Find any results worth highlighting and expand them, according to given criteria The highest-scoring node is written to aHighScore.
Definition at line 622 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::Find(), and LIB_TREE_NODE::m_Children.
Referenced by LIB_TREE_MODEL_ADAPTER::Find(), LIB_TREE_MODEL_ADAPTER::ShowPreselect(), LIB_TREE_MODEL_ADAPTER::ShowResults(), and LIB_TREE_MODEL_ADAPTER::ShowSingleLibrary().
|
inherited |
Returns tree item corresponding to part.
aLibId | specifies the part and library name to be searched for. |
Definition at line 401 of file lib_tree_model_adapter.cpp.
References LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), LIB_TREE_NODE::m_Children, LIB_TREE_MODEL_ADAPTER::m_tree, and LIB_TREE_MODEL_ADAPTER::ToItem().
|
inherited |
A final-stage initialization to be called after the window hierarchy has been realized and the window sizes set.
Definition at line 444 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::m_colIdxMap, LIB_TREE_MODEL_ADAPTER::m_columns, LIB_TREE_MODEL_ADAPTER::m_colWidths, and LIB_TREE_MODEL_ADAPTER::m_widget.
|
inlineinherited |
Definition at line 294 of file lib_tree_model_adapter.h.
References LIB_TREE_MODEL_ADAPTER::m_freeze.
Referenced by LIB_TREE_MODEL_ADAPTER::resortTree(), and LIB_TREE_MODEL_ADAPTER::UpdateSearchString().
|
inlinevirtualinherited |
Reimplemented in SYMBOL_TREE_MODEL_ADAPTER, and FP_TREE_MODEL_ADAPTER.
Definition at line 260 of file lib_tree_model_adapter.h.
|
inherited |
Return the alias for the given item.
aSelection | item from the wxDataViewCtrl (see wxDataViewCtrl::GetSelection()) |
Definition at line 357 of file lib_tree_model_adapter.cpp.
References LIB_TREE_NODE::m_LibId, and LIB_TREE_MODEL_ADAPTER::ToNode().
|
overrideprotected |
Definition at line 282 of file symbol_tree_synchronizing_adapter.cpp.
References SYMBOL_EDIT_FRAME::GetCurSymbol(), LIB_SYMBOL::GetLibId(), LIB_ID::GetLibNickname(), LIB_TREE_MODEL_ADAPTER::IsFrozen(), SYMBOL_LIBRARY_MANAGER::IsLibraryLoaded(), SYMBOL_LIBRARY_MANAGER::IsLibraryModified(), SYMBOL_LIBRARY_MANAGER::IsSymbolModified(), LIB_TREE_NODE::LIB, LIB_TREE_NODE::LIBID, m_frame, LIB_TREE_NODE::m_IsRoot, LIB_TREE_NODE::m_LibId, m_libMgr, LIB_TREE_NODE::m_Name, LIB_TREE_NODE::m_Parent, LIB_TREE_NODE::m_Type, LIB_TREE_MODEL_ADAPTER::NAME_COL, and LIB_TREE_MODEL_ADAPTER::ToNode().
|
inlineinherited |
Definition at line 189 of file lib_tree_model_adapter.h.
References LIB_TREE_MODEL_ADAPTER::m_availableColumns.
|
overrideinherited |
Populate a list of all the children of an item.
Definition at line 425 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::IntoArray(), LIB_TREE_NODE::LIB, LIB_TREE_MODEL_ADAPTER::m_show_units, LIB_TREE_MODEL_ADAPTER::m_tree, LIB_TREE_NODE::m_Type, and LIB_TREE_MODEL_ADAPTER::ToNode().
|
inlineoverrideprotectedinherited |
Definition at line 350 of file lib_tree_model_adapter.h.
References LIB_TREE_MODEL_ADAPTER::m_columns.
|
inlineoverrideprotectedinherited |
Return the type of data stored in the column as indicated by wxVariant::GetType()
Definition at line 355 of file lib_tree_model_adapter.h.
|
overridevirtual |
Reimplemented from LIB_TREE_MODEL_ADAPTER.
Definition at line 54 of file symbol_tree_synchronizing_adapter.cpp.
References TOOL_MANAGER::GetTool(), TOOLS_HOLDER::GetToolManager(), and m_frame.
|
inlineinherited |
Return the active filter.
Definition at line 153 of file lib_tree_model_adapter.h.
References LIB_TREE_MODEL_ADAPTER::m_filter.
Referenced by SYMBOL_TREE_MODEL_ADAPTER::AddLibraries(), SYMBOL_TREE_MODEL_ADAPTER::AddLibrary(), and SCH_BASE_FRAME::PickSymbolFromLibTree().
|
inherited |
Return the number of symbols loaded in the tree.
Definition at line 390 of file lib_tree_model_adapter.cpp.
References LIB_TREE_NODE::m_Children, and LIB_TREE_MODEL_ADAPTER::m_tree.
Referenced by SYMBOL_VIEWER_FRAME::OnSelectSymbol(), and PCB_BASE_FRAME::SelectFootprintFromLibTree().
|
overridevirtual |
Return the number of libraries loaded in the tree.
Reimplemented from LIB_TREE_MODEL_ADAPTER.
Definition at line 138 of file symbol_tree_synchronizing_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::GetLibrariesCount(), SYMBOL_LIBRARY_MANAGER::GetLibraryNames(), m_libHashes, and m_libMgr.
Referenced by Sync().
|
overrideprotectedinherited |
Get the parent of an item.
Definition at line 535 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::m_freeze, LIB_TREE_NODE::m_Parent, LIB_TREE_NODE::m_Type, LIB_TREE_MODEL_ADAPTER::ToItem(), and LIB_TREE_MODEL_ADAPTER::ToNode().
Referenced by LIB_TREE_MODEL_ADAPTER::UpdateSearchString().
|
inlinestaticinherited |
Definition at line 105 of file lib_tree_model_adapter.h.
Referenced by CVPCB_MAINFRAME::BuildLibrariesListBox(), FOOTPRINT_EDIT_FRAME::buildSaveAsDialog(), SYMBOL_EDIT_FRAME::buildSaveAsDialog(), WX_LISTBOX::FindString(), WX_LISTBOX::GetBaseString(), LIBRARY_LISTBOX::GetSelectedLibrary(), WX_LISTBOX::GetStringSelection(), EDA_LIST_DIALOG::GetTextSelection(), LIB_TREE_MODEL_ADAPTER::GetValue(), GetValue(), FP_TREE_SYNCHRONIZING_ADAPTER::GetValue(), SYMBOL_VIEWER_FRAME::ReCreateLibList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), PCB_BASE_FRAME::SelectLibrary(), SCH_BASE_FRAME::SelectLibraryFromList(), and WX_LISTBOX::SetStringSelection().
|
inlineinherited |
Definition at line 191 of file lib_tree_model_adapter.h.
References LIB_TREE_MODEL_ADAPTER::m_shownColumns.
Referenced by LIB_TREE_MODEL_ADAPTER::SaveSettings().
|
inherited |
Definition at line 384 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::ToNode().
|
inherited |
Return node type for the given item.
aSelection | item from the wxDataViewCtrl (see wxDataViewCtrl::GetSelection()) |
Definition at line 377 of file lib_tree_model_adapter.cpp.
References LIB_TREE_NODE::INVALID, LIB_TREE_NODE::m_Type, and LIB_TREE_MODEL_ADAPTER::ToNode().
|
inherited |
Return the unit for the given item.
aSelection | item from the wxDataViewCtrl (see wxDataViewCtrl::GetSelection()) |
Definition at line 370 of file lib_tree_model_adapter.cpp.
References LIB_TREE_NODE::m_Unit, and LIB_TREE_MODEL_ADAPTER::ToNode().
|
overrideprotected |
Definition at line 211 of file symbol_tree_synchronizing_adapter.cpp.
References _, SYMBOL_EDIT_FRAME::GetCurSymbol(), LIB_TABLE_ROW::GetDescr(), LIB_SYMBOL::GetDescription(), LIB_SYMBOL::GetLibId(), LIB_ID::GetLibItemName(), SYMBOL_EDIT_FRAME::GetLibManager(), LIB_ID::GetLibNickname(), SYMBOL_LIBRARY_MANAGER::GetLibrary(), LIB_TREE_MODEL_ADAPTER::GetPinningSymbol(), LIB_TREE_MODEL_ADAPTER::IsFrozen(), SYMBOL_LIBRARY_MANAGER::IsLibraryLoaded(), SYMBOL_LIBRARY_MANAGER::IsLibraryModified(), SYMBOL_LIBRARY_MANAGER::IsSymbolModified(), LIB_TREE_NODE::LIB, LIB_TREE_NODE::LIBID, LIB_TREE_MODEL_ADAPTER::m_colIdxMap, LIB_TREE_NODE::m_Desc, LIB_TREE_NODE::m_Fields, m_frame, LIB_TREE_NODE::m_LibId, m_libMgr, LIB_TREE_NODE::m_Name, LIB_TREE_NODE::m_Parent, LIB_TREE_NODE::m_Pinned, LIB_TREE_NODE::m_Type, LIB_TREE_MODEL_ADAPTER::NAME_COL, LIB_TREE_MODEL_ADAPTER::ToNode(), and UnescapeString().
|
overrideprotectedinherited |
Check whether a container has columns too.
Definition at line 522 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::IsContainer().
|
staticprotectedinherited |
Convert SYM_TREE_NODE's children to wxDataViewItemArray.
Definition at line 49 of file lib_tree_model_adapter.cpp.
References LIB_TREE_NODE::m_Children, and LIB_TREE_MODEL_ADAPTER::ToItem().
Referenced by LIB_TREE_MODEL_ADAPTER::GetChildren().
|
override |
Definition at line 60 of file symbol_tree_synchronizing_adapter.cpp.
References LIB_TREE_NODE::LIB, LIB_TREE_NODE::m_Type, and LIB_TREE_MODEL_ADAPTER::ToNode().
|
inlineinherited |
Definition at line 296 of file lib_tree_model_adapter.h.
References LIB_TREE_MODEL_ADAPTER::m_freeze.
Referenced by LIB_TREE_MODEL_ADAPTER::GetAttr(), GetAttr(), FP_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), LIB_TREE_MODEL_ADAPTER::GetValue(), GetValue(), and FP_TREE_SYNCHRONIZING_ADAPTER::GetValue().
|
inlineoverrideprotectedvirtual |
Implements LIB_TREE_MODEL_ADAPTER.
Definition at line 64 of file symbol_tree_synchronizing_adapter.h.
|
inherited |
Definition at line 471 of file lib_tree_model_adapter.cpp.
|
inherited |
Definition at line 289 of file lib_tree_model_adapter.cpp.
References LIB_ID::GetLibNickname(), LIB_TREE_MODEL_ADAPTER::isSymbolModel(), LIB_TREE_NODE::m_LibId, LIB_TREE_MODEL_ADAPTER::m_parent, LIB_TREE_NODE::m_Pinned, LIB_TREE_MODEL_ADAPTER::m_widget, PROJECT::PinLibrary(), KIWAY_HOLDER::Prj(), LIB_TREE_MODEL_ADAPTER::resortTree(), and LIB_TREE_MODEL_ADAPTER::ToItem().
|
protectedinherited |
Definition at line 258 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::doAddColumn(), LIB_TREE_MODEL_ADAPTER::m_colIdxMap, LIB_TREE_MODEL_ADAPTER::m_colNameMap, LIB_TREE_MODEL_ADAPTER::m_columns, LIB_TREE_MODEL_ADAPTER::m_shownColumns, and LIB_TREE_MODEL_ADAPTER::m_widget.
Referenced by LIB_TREE_MODEL_ADAPTER::AttachTo(), and LIB_TREE_MODEL_ADAPTER::SetShownColumns().
|
inherited |
Definition at line 477 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::m_colNameMap, LIB_TREE_MODEL_ADAPTER::m_columns, and LIB_TREE_MODEL_ADAPTER::m_colWidths.
|
protectedinherited |
Definition at line 277 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::Freeze(), LIB_TREE_MODEL_ADAPTER::m_tree, LIB_TREE_NODE::SortNodes(), and LIB_TREE_MODEL_ADAPTER::Thaw().
Referenced by LIB_TREE_MODEL_ADAPTER::PinLibrary(), and LIB_TREE_MODEL_ADAPTER::UnpinLibrary().
|
inherited |
Save the column widths to the config file.
This requires the tree view to still be valid.
Definition at line 101 of file lib_tree_model_adapter.cpp.
References APP_SETTINGS_BASE::LIB_TREE::column_widths, APP_SETTINGS_BASE::LIB_TREE::columns, LIB_TREE_MODEL_ADAPTER::GetShownColumns(), Kiface(), KIFACE_BASE::KifaceSettings(), LIB_TREE_MODEL_ADAPTER::m_colNameMap, APP_SETTINGS_BASE::m_LibTree, and LIB_TREE_MODEL_ADAPTER::m_widget.
Referenced by SYMBOL_VIEWER_FRAME::OnSelectSymbol(), SCH_BASE_FRAME::PickSymbolFromLibTree(), and PCB_BASE_FRAME::SelectFootprintFromLibTree().
|
inherited |
Set the symbol filter type.
Must be set before adding libraries
aFilter | if SYM_FILTER_POWER, only power parts are loaded |
Definition at line 116 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::m_filter.
Referenced by SCH_BASE_FRAME::PickSymbolFromLibTree().
|
inherited |
Set the symbol name to be selected if there are no search results.
May be set at any time; updates at the next UpdateSearchString().
aLibId | symbol LIB_ID to be selected |
aUnit | unit to be selected, if > 0 (0 selects the alias itself) |
Definition at line 128 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::m_preselect_lib_id, and LIB_TREE_MODEL_ADAPTER::m_preselect_unit.
Referenced by SYMBOL_VIEWER_FRAME::OnSelectSymbol(), SCH_BASE_FRAME::PickSymbolFromLibTree(), and PCB_BASE_FRAME::SelectFootprintFromLibTree().
|
inherited |
Sets which columns are shown in the widget.
Invalid column names are discarded.
aColumnNames | is an ordered list of column names to show |
Definition at line 346 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::m_shownColumns, LIB_TREE_MODEL_ADAPTER::m_widget, and LIB_TREE_MODEL_ADAPTER::recreateColumns().
|
inlineoverrideprotectedinherited |
Set the value of an item.
Does nothing - this model doesn't support editing.
Definition at line 372 of file lib_tree_model_adapter.h.
|
privateinherited |
Find and expand preselected node.
Return the best match (if any).
Definition at line 661 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::Find(), LIB_ID::IsValid(), LIB_TREE_NODE::LIBID, LIB_TREE_NODE::m_Children, LIB_TREE_NODE::m_LibId, LIB_TREE_NODE::m_Parent, LIB_TREE_MODEL_ADAPTER::m_preselect_lib_id, LIB_TREE_MODEL_ADAPTER::m_preselect_unit, LIB_TREE_MODEL_ADAPTER::m_tree, LIB_TREE_NODE::m_Type, LIB_TREE_NODE::m_Unit, LIB_TREE_MODEL_ADAPTER::m_widget, and LIB_TREE_NODE::UNIT.
Referenced by LIB_TREE_MODEL_ADAPTER::UpdateSearchString().
|
privateinherited |
Find and expand successful search results.
Return the best match (if any).
Definition at line 639 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::Find(), LIB_TREE_NODE::m_Score, LIB_TREE_MODEL_ADAPTER::m_tree, LIB_TREE_NODE::m_Type, and LIB_TREE_MODEL_ADAPTER::m_widget.
Referenced by LIB_TREE_MODEL_ADAPTER::UpdateSearchString().
|
privateinherited |
Find and expand a library if there is only one.
Return the best match (if any).
Definition at line 692 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::Find(), LIB_TREE_NODE::m_Children, LIB_TREE_NODE::m_Parent, LIB_TREE_MODEL_ADAPTER::m_tree, LIB_TREE_NODE::m_Type, and LIB_TREE_MODEL_ADAPTER::m_widget.
Referenced by LIB_TREE_MODEL_ADAPTER::UpdateSearchString().
|
inherited |
Whether or not to show units.
May be set at any time; updates at the next UpdateSearchString()
aShow | if true, units are displayed |
Definition at line 122 of file lib_tree_model_adapter.cpp.
References LIB_TREE_MODEL_ADAPTER::m_show_units.
void SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync | ( | const wxString & | aForceRefresh, |
std::function< void(int, int, const wxString &)> | aProgressCallback | ||
) |
Definition at line 69 of file symbol_tree_synchronizing_adapter.cpp.
References LIB_TREE_NODE::AssignIntrinsicRanks(), alg::contains(), deleteLibrary(), LIB_TREE_MODEL_ADAPTER::DoAddLibraryNode(), SYMBOL_LIBRARY_MANAGER::GetHash(), GetLibrariesCount(), SYMBOL_LIBRARY_MANAGER::GetLibrary(), SYMBOL_LIBRARY_MANAGER::GetLibraryNames(), PROJECT::GetProjectFile(), library, SYMBOL_LIBRARY_MANAGER::LibraryExists(), LIB_TREE_NODE::m_Children, m_frame, m_lastSyncHash, m_libHashes, m_libMgr, COMMON_SETTINGS::m_Session, LIB_TREE_MODEL_ADAPTER::m_tree, name, Pgm(), COMMON_SETTINGS::SESSION::pinned_symbol_libs, KIWAY_HOLDER::Prj(), PROGRESS_INTERVAL_MILLIS, project, and updateLibrary().
Referenced by LIB_SYMBOL_LIBRARY_MANAGER::Sync().
|
inlineinherited |
Definition at line 295 of file lib_tree_model_adapter.h.
References LIB_TREE_MODEL_ADAPTER::m_freeze.
Referenced by LIB_TREE_MODEL_ADAPTER::resortTree(), and LIB_TREE_MODEL_ADAPTER::UpdateSearchString().
|
staticprotectedinherited |
Convert #SYM_TREE_NODE -> wxDataViewItem.
Definition at line 37 of file lib_tree_model_adapter.cpp.
Referenced by LIB_TREE_MODEL_ADAPTER::FindItem(), LIB_TREE_MODEL_ADAPTER::GetParent(), LIB_TREE_MODEL_ADAPTER::IntoArray(), and LIB_TREE_MODEL_ADAPTER::PinLibrary().
|
staticprotectedinherited |
Convert wxDataViewItem -> #SYM_TREE_NODE.
Definition at line 43 of file lib_tree_model_adapter.cpp.
Referenced by LIB_TREE_MODEL_ADAPTER::GetAliasFor(), LIB_TREE_MODEL_ADAPTER::GetAttr(), GetAttr(), FP_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), LIB_TREE_MODEL_ADAPTER::GetChildren(), LIB_TREE_MODEL_ADAPTER::GetParent(), LIB_TREE_MODEL_ADAPTER::GetTreeNodeFor(), LIB_TREE_MODEL_ADAPTER::GetTypeFor(), LIB_TREE_MODEL_ADAPTER::GetUnitFor(), LIB_TREE_MODEL_ADAPTER::GetValue(), GetValue(), FP_TREE_SYNCHRONIZING_ADAPTER::GetValue(), IsContainer(), LIB_TREE_MODEL_ADAPTER::IsContainer(), and FP_TREE_SYNCHRONIZING_ADAPTER::IsContainer().
|
inherited |
Definition at line 299 of file lib_tree_model_adapter.cpp.
References LIB_ID::GetLibNickname(), LIB_TREE_MODEL_ADAPTER::isSymbolModel(), LIB_TREE_NODE::m_LibId, LIB_TREE_MODEL_ADAPTER::m_parent, LIB_TREE_NODE::m_Pinned, KIWAY_HOLDER::Prj(), LIB_TREE_MODEL_ADAPTER::resortTree(), and PROJECT::UnpinLibrary().
|
protected |
Definition at line 152 of file symbol_tree_synchronizing_adapter.cpp.
References LIB_TREE_NODE_LIB::AddItem(), LIB_TREE_NODE::AssignIntrinsicRanks(), SYMBOL_LIBRARY_MANAGER::GetAliases(), SYMBOL_LIBRARY_MANAGER::GetLibraryHash(), LIB_TREE_NODE::m_Children, m_libHashes, m_libMgr, and LIB_TREE_NODE::m_Name.
Referenced by Sync().
|
inherited |
Set the search string provided by the user.
aSearch | full, unprocessed search text |
aState | if true, we are keeping the state and so we shouldn't collapse the tree |
Definition at line 159 of file lib_tree_model_adapter.cpp.
References CTX_LIBITEM, LIB_TREE_MODEL_ADAPTER::Freeze(), LIB_TREE_MODEL_ADAPTER::GetParent(), LIB_TREE_NODE::m_Children, LIB_TREE_MODEL_ADAPTER::m_tree, LIB_TREE_MODEL_ADAPTER::m_widget, LIB_TREE_NODE::ResetScore(), LIB_TREE_MODEL_ADAPTER::ShowPreselect(), LIB_TREE_MODEL_ADAPTER::ShowResults(), LIB_TREE_MODEL_ADAPTER::ShowSingleLibrary(), LIB_TREE_NODE::SortNodes(), LIB_TREE_MODEL_ADAPTER::Thaw(), and LIB_TREE_NODE_ROOT::UpdateScore().
|
protectedinherited |
Definition at line 424 of file lib_tree_model_adapter.h.
Referenced by LIB_TREE_MODEL_ADAPTER::addColumnIfNecessary(), LIB_TREE_MODEL_ADAPTER::GetAvailableColumns(), LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER(), and SYMBOL_TREE_MODEL_ADAPTER::SYMBOL_TREE_MODEL_ADAPTER().
|
protectedinherited |
Definition at line 423 of file lib_tree_model_adapter.h.
Referenced by LIB_TREE_MODEL_ADAPTER::doAddColumn(), LIB_TREE_MODEL_ADAPTER::FinishTreeInitialization(), LIB_TREE_MODEL_ADAPTER::GetValue(), GetValue(), and LIB_TREE_MODEL_ADAPTER::recreateColumns().
|
privateinherited |
Definition at line 438 of file lib_tree_model_adapter.h.
Referenced by LIB_TREE_MODEL_ADAPTER::addColumnIfNecessary(), LIB_TREE_MODEL_ADAPTER::doAddColumn(), LIB_TREE_MODEL_ADAPTER::recreateColumns(), LIB_TREE_MODEL_ADAPTER::RefreshTree(), and LIB_TREE_MODEL_ADAPTER::SaveSettings().
|
privateinherited |
|
privateinherited |
Definition at line 439 of file lib_tree_model_adapter.h.
Referenced by LIB_TREE_MODEL_ADAPTER::doAddColumn(), LIB_TREE_MODEL_ADAPTER::FinishTreeInitialization(), LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER(), and LIB_TREE_MODEL_ADAPTER::RefreshTree().
|
privateinherited |
Definition at line 429 of file lib_tree_model_adapter.h.
Referenced by LIB_TREE_MODEL_ADAPTER::GetFilter(), and LIB_TREE_MODEL_ADAPTER::SetFilter().
|
protected |
Definition at line 67 of file symbol_tree_synchronizing_adapter.h.
Referenced by GetAttr(), GetContextMenuTool(), GetValue(), and Sync().
|
privateinherited |
Definition at line 433 of file lib_tree_model_adapter.h.
Referenced by LIB_TREE_MODEL_ADAPTER::Freeze(), LIB_TREE_MODEL_ADAPTER::GetParent(), LIB_TREE_MODEL_ADAPTER::IsFrozen(), and LIB_TREE_MODEL_ADAPTER::Thaw().
|
protected |
Definition at line 74 of file symbol_tree_synchronizing_adapter.h.
Referenced by Sync().
|
protected |
SYMBOL_LIBRARY_MANAGER hash value returned in the last synchronization.
Definition at line 71 of file symbol_tree_synchronizing_adapter.h.
Referenced by deleteLibrary(), GetLibrariesCount(), Sync(), and updateLibrary().
|
protected |
Hashes to decide whether a library needs an update.
Definition at line 68 of file symbol_tree_synchronizing_adapter.h.
Referenced by GetAttr(), GetLibrariesCount(), GetValue(), Sync(), and updateLibrary().
|
privateinherited |
Definition at line 427 of file lib_tree_model_adapter.h.
Referenced by LIB_TREE_MODEL_ADAPTER::PinLibrary(), and LIB_TREE_MODEL_ADAPTER::UnpinLibrary().
|
privateinherited |
Definition at line 431 of file lib_tree_model_adapter.h.
Referenced by LIB_TREE_MODEL_ADAPTER::SetPreselectNode(), and LIB_TREE_MODEL_ADAPTER::ShowPreselect().
|
privateinherited |
Definition at line 432 of file lib_tree_model_adapter.h.
Referenced by LIB_TREE_MODEL_ADAPTER::SetPreselectNode(), and LIB_TREE_MODEL_ADAPTER::ShowPreselect().
|
privateinherited |
Definition at line 430 of file lib_tree_model_adapter.h.
Referenced by LIB_TREE_MODEL_ADAPTER::GetChildren(), and LIB_TREE_MODEL_ADAPTER::ShowUnits().
|
privateinherited |
Definition at line 440 of file lib_tree_model_adapter.h.
Referenced by LIB_TREE_MODEL_ADAPTER::GetShownColumns(), LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER(), LIB_TREE_MODEL_ADAPTER::recreateColumns(), and LIB_TREE_MODEL_ADAPTER::SetShownColumns().
|
protectedinherited |
Definition at line 422 of file lib_tree_model_adapter.h.
Referenced by SYMBOL_TREE_MODEL_ADAPTER::AddLibraries(), FP_TREE_MODEL_ADAPTER::AddLibraries(), LIB_TREE_MODEL_ADAPTER::AssignIntrinsicRanks(), deleteLibrary(), FP_TREE_SYNCHRONIZING_ADAPTER::deleteLibrary(), LIB_TREE_MODEL_ADAPTER::DoAddLibraryNode(), LIB_TREE_MODEL_ADAPTER::FindItem(), LIB_TREE_MODEL_ADAPTER::GetChildren(), LIB_TREE_MODEL_ADAPTER::GetItemCount(), LIB_TREE_MODEL_ADAPTER::GetLibrariesCount(), LIB_TREE_MODEL_ADAPTER::resortTree(), LIB_TREE_MODEL_ADAPTER::ShowPreselect(), LIB_TREE_MODEL_ADAPTER::ShowResults(), LIB_TREE_MODEL_ADAPTER::ShowSingleLibrary(), Sync(), FP_TREE_SYNCHRONIZING_ADAPTER::Sync(), and LIB_TREE_MODEL_ADAPTER::UpdateSearchString().
|
privateinherited |
Definition at line 435 of file lib_tree_model_adapter.h.
Referenced by LIB_TREE_MODEL_ADAPTER::AttachTo(), LIB_TREE_MODEL_ADAPTER::doAddColumn(), LIB_TREE_MODEL_ADAPTER::FinishTreeInitialization(), LIB_TREE_MODEL_ADAPTER::PinLibrary(), LIB_TREE_MODEL_ADAPTER::recreateColumns(), LIB_TREE_MODEL_ADAPTER::SaveSettings(), LIB_TREE_MODEL_ADAPTER::SetShownColumns(), LIB_TREE_MODEL_ADAPTER::ShowPreselect(), LIB_TREE_MODEL_ADAPTER::ShowResults(), LIB_TREE_MODEL_ADAPTER::ShowSingleLibrary(), and LIB_TREE_MODEL_ADAPTER::UpdateSearchString().