Add pinned library support to Choose Symbol and Choose Footprint.
This commit is contained in:
parent
a9e18c68a7
commit
05219e4d9a
|
@ -132,8 +132,6 @@ void LIB_TREE_MODEL_ADAPTER::SavePinnedItems()
|
|||
entries.push_back( child->m_LibId.GetLibNickname() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <symbol_async_loader.h>
|
||||
#include <symbol_lib_table.h>
|
||||
#include <symbol_tree_model_adapter.h>
|
||||
#include <string_utils.h>
|
||||
|
||||
|
||||
bool SYMBOL_TREE_MODEL_ADAPTER::m_show_progress = true;
|
||||
|
@ -167,3 +168,24 @@ wxString SYMBOL_TREE_MODEL_ADAPTER::GenerateInfo( LIB_ID const& aLibId, int aUni
|
|||
{
|
||||
return GenerateAliasInfo( m_libs, aLibId, aUnit );
|
||||
}
|
||||
|
||||
|
||||
void SYMBOL_TREE_MODEL_ADAPTER::GetValue( wxVariant& aVariant, wxDataViewItem const& aItem,
|
||||
unsigned int aCol ) const
|
||||
{
|
||||
if( IsFrozen() )
|
||||
{
|
||||
aVariant = wxEmptyString;
|
||||
return;
|
||||
}
|
||||
|
||||
LIB_TREE_NODE* node = ToNode( aItem );
|
||||
wxASSERT( node );
|
||||
|
||||
if( aCol == 0 && node->m_Pinned )
|
||||
aVariant = GetPinningSymbol() + UnescapeString( node->m_Name );
|
||||
else
|
||||
aVariant = UnescapeString( node->m_Name );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -63,6 +63,17 @@ protected:
|
|||
*/
|
||||
SYMBOL_TREE_MODEL_ADAPTER( EDA_BASE_FRAME* aParent, LIB_TABLE* aLibs );
|
||||
|
||||
/**
|
||||
* Get the value of an item.
|
||||
*
|
||||
* @param aVariant wxVariant to receive the data
|
||||
* @param aItem item whose data will be placed into aVariant
|
||||
* @param aCol column number of the data
|
||||
*/
|
||||
void GetValue( wxVariant& aVariant,
|
||||
const wxDataViewItem& aItem,
|
||||
unsigned int aCol ) const override;
|
||||
|
||||
private:
|
||||
friend class SYMBOL_ASYNC_LOADER;
|
||||
/**
|
||||
|
|
|
@ -82,3 +82,24 @@ wxString FP_TREE_MODEL_ADAPTER::GenerateInfo( LIB_ID const& aLibId, int aUnit )
|
|||
{
|
||||
return GenerateFootprintInfo( m_libs, aLibId );
|
||||
}
|
||||
|
||||
|
||||
void FP_TREE_MODEL_ADAPTER::GetValue( wxVariant& aVariant, wxDataViewItem const& aItem,
|
||||
unsigned int aCol ) const
|
||||
{
|
||||
if( IsFrozen() )
|
||||
{
|
||||
aVariant = wxEmptyString;
|
||||
return;
|
||||
}
|
||||
|
||||
LIB_TREE_NODE* node = ToNode( aItem );
|
||||
wxASSERT( node );
|
||||
|
||||
if( aCol == 0 && node->m_Pinned )
|
||||
aVariant = GetPinningSymbol() + node->m_Name;
|
||||
else
|
||||
aVariant = node->m_Name;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -51,6 +51,18 @@ protected:
|
|||
|
||||
std::vector<LIB_TREE_ITEM*> getFootprints( const wxString& aLibName );
|
||||
|
||||
/**
|
||||
* Get the value of an item.
|
||||
*
|
||||
* @param aVariant wxVariant to receive the data
|
||||
* @param aItem item whose data will be placed into aVariant
|
||||
* @param aCol column number of the data
|
||||
*/
|
||||
void GetValue( wxVariant& aVariant,
|
||||
const wxDataViewItem& aItem,
|
||||
unsigned int aCol ) const override;
|
||||
|
||||
protected:
|
||||
FP_LIB_TABLE* m_libs;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue