29#include <wx/variant.h>
53 const std::shared_ptr<SHEET_SYNCHRONIZATION_ITEM>& item =
m_items[row];
58 aVariant << wxDataViewIconText( item->GetName(), item->GetBitmap() );
79 wxDataViewItemAttr& attr )
const
96 for(
const auto& item :
TakeItems( aItems ) )
105 m_items.push_back( std::move( aItem ) );
114 m_items.push_back( std::move( aItem ) );
123 if( aItems.size() == 1 )
126 std::set<unsigned> rowsToBeRemove;
130 for(
const auto& item : aItems )
134 unsigned int idx = GetRow( item );
135 rowsToBeRemove.insert( idx );
139 for(
unsigned i = 0; i <
m_items.size(); i++ )
141 if( rowsToBeRemove.find( i ) == rowsToBeRemove.end() )
143 items_remain.push_back(
m_items[i] );
147 items_token.push_back(
m_items[i] );
159 const unsigned int row = GetRow( aItem );
164 std::shared_ptr<SHEET_SYNCHRONIZATION_ITEM> item =
m_items[row];
193 if( aRow.has_value() &&
m_items.size() > *aRow )
195 if( wxDataViewItem item = GetItem( *aRow ); item.IsOk() )
209 std::shared_ptr<SHEET_SYNCHRONIZATION_NOTIFIER> aNotifier )
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Agent for all the modifications while syncing the sheet pin and hierarchical label.
~SHEET_SYNCHRONIZATION_MODEL() override
std::list< std::shared_ptr< SHEET_SYNCHRONIZATION_NOTIFIER > > m_notifiers
std::optional< unsigned > m_selectedIndex
bool GetAttrByRow(unsigned row, unsigned int col, wxDataViewItemAttr &attr) const override
bool SetValueByRow(const wxVariant &variant, unsigned row, unsigned col) override
SHEET_SYNCHRONIZATION_ITE_PTR TakeItem(wxDataViewItem const &aItem)
unsigned int GetCount() const override
SHEET_SYNCHRONIZATION_ITEM_LIST TakeItems(wxDataViewItemArray const &aItems)
SHEET_SYNCHRONIZATION_MODEL(SHEET_SYNCHRONIZATION_AGENT &aAgent, SCH_SHEET *aSheet, const SCH_SHEET_PATH &aPath)
SHEET_SYNCHRONIZATION_ITE_PTR GetSynchronizationItem(unsigned aIndex) const
void AddNotifier(std::shared_ptr< SHEET_SYNCHRONIZATION_NOTIFIER > aNotifier)
void GetValueByRow(wxVariant &variant, unsigned row, unsigned col) const override
bool AppendItem(std::shared_ptr< SHEET_SYNCHRONIZATION_ITEM > aItem)
Just append item to the list, the notifiers are not notified.
void UpdateItems(SHEET_SYNCHRONIZATION_ITEM_LIST aItems)
SHEET_SYNCHRONIZATION_AGENT & m_agent
SHEET_SYNCHRONIZATION_ITEM_LIST m_items
void RemoveItems(wxDataViewItemArray const &aItems)
bool AppendNewItem(std::shared_ptr< SHEET_SYNCHRONIZATION_ITEM > aItem)
Add a new item, the notifiers are notified.
void OnRowSelected(std::optional< unsigned > aRow)
wxString getElectricalTypeLabel(LABEL_FLAG_SHAPE aType)
wxString getElectricalTypeLabel(LABEL_FLAG_SHAPE aType)
std::vector< SHEET_SYNCHRONIZATION_ITE_PTR > SHEET_SYNCHRONIZATION_ITEM_LIST
std::shared_ptr< SHEET_SYNCHRONIZATION_ITEM > SHEET_SYNCHRONIZATION_ITE_PTR