|
|
|
@ -1302,28 +1302,7 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnTableCellClick( wxGridEvent& event ) |
|
|
|
m_grid->ClearSelection(); |
|
|
|
m_grid->SetGridCursor( event.GetRow(), event.GetCol() ); |
|
|
|
|
|
|
|
int flag = m_dataModel->GetRowFlags( event.GetRow() ); |
|
|
|
m_dataModel->ExpandCollapseRow( event.GetRow() ); |
|
|
|
std::vector<SCH_REFERENCE> refs = m_dataModel->GetRowReferences( event.GetRow() ); |
|
|
|
|
|
|
|
// Focus Eeschema view on the symbol selected in the dialog
|
|
|
|
// TODO: Highlight or select more than one unit
|
|
|
|
if( ( flag == GROUP_SINGLETON || flag == CHILD_ITEM ) && refs.size() >= 1 ) |
|
|
|
{ |
|
|
|
SCH_EDITOR_CONTROL* editor = m_parent->GetToolManager()->GetTool<SCH_EDITOR_CONTROL>(); |
|
|
|
|
|
|
|
std::sort( refs.begin(), refs.end(), |
|
|
|
[]( const SCH_REFERENCE& a, const SCH_REFERENCE& b ) |
|
|
|
{ |
|
|
|
return a.GetUnit() < b.GetUnit(); |
|
|
|
} ); |
|
|
|
|
|
|
|
// search and highlight the symbol found by its full path.
|
|
|
|
// It allows select of not yet annotated or duplicaded symbols
|
|
|
|
wxString symbol_path = refs[0].GetFullPath(); |
|
|
|
// wxString reference = refs[0].GetRef() + refs[0].GetRefNumber(); // Not used
|
|
|
|
editor->FindSymbolAndItem( &symbol_path, nullptr, true, HIGHLIGHT_SYMBOL, wxEmptyString ); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
@ -1331,6 +1310,45 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnTableCellClick( wxGridEvent& event ) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void DIALOG_SYMBOL_FIELDS_TABLE::OnTableRangeSelected( wxGridRangeSelectEvent& event ) |
|
|
|
{ |
|
|
|
wxGridCellCoordsArray selectedCells = m_grid->GetSelectedCells(); |
|
|
|
|
|
|
|
if( selectedCells.GetCount() == 1 ) |
|
|
|
{ |
|
|
|
int row = selectedCells[0].GetRow(); |
|
|
|
int col = selectedCells[0].GetCol(); |
|
|
|
|
|
|
|
if( col == REFERENCE_FIELD ) |
|
|
|
{ |
|
|
|
int flag = m_dataModel->GetRowFlags( row ); |
|
|
|
std::vector<SCH_REFERENCE> refs = m_dataModel->GetRowReferences( row ); |
|
|
|
|
|
|
|
// Focus Eeschema view on the symbol selected in the dialog
|
|
|
|
// TODO: Highlight or select more than one unit
|
|
|
|
if( ( flag == GROUP_SINGLETON || flag == CHILD_ITEM ) && refs.size() >= 1 ) |
|
|
|
{ |
|
|
|
SCH_EDITOR_CONTROL* editor = m_parent->GetToolManager()->GetTool<SCH_EDITOR_CONTROL>(); |
|
|
|
|
|
|
|
std::sort( refs.begin(), refs.end(), |
|
|
|
[]( const SCH_REFERENCE& a, const SCH_REFERENCE& b ) |
|
|
|
{ |
|
|
|
return a.GetUnit() < b.GetUnit(); |
|
|
|
} ); |
|
|
|
|
|
|
|
// search and highlight the symbol found by its full path.
|
|
|
|
// It allows select of not yet annotated or duplicaded symbols
|
|
|
|
wxString symbol_path = refs[0].GetFullPath(); |
|
|
|
// wxString reference = refs[0].GetRef() + refs[0].GetRefNumber(); // Not used
|
|
|
|
editor->FindSymbolAndItem( &symbol_path, nullptr, true, HIGHLIGHT_SYMBOL, wxEmptyString ); |
|
|
|
} |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
event.Skip(); |
|
|
|
} |
|
|
|
|
|
|
|
void DIALOG_SYMBOL_FIELDS_TABLE::OnTableItemContextMenu( wxGridEvent& event ) |
|
|
|
{ |
|
|
|
|