Displays the number of instances to modify in rescue dialog.

This commit is contained in:
jean-pierre charras 2017-03-09 19:16:24 +01:00
parent ae7e3f725b
commit 4605cae588
4 changed files with 17 additions and 13 deletions

View File

@ -150,6 +150,7 @@ void DIALOG_RESCUE_EACH::PopulateInstanceList()
RESCUE_CANDIDATE& selected_part = m_Rescuer->m_all_candidates[row];
wxVector<wxVariant> data;
int count = 0;
for( SCH_COMPONENT* each_component : *m_Rescuer->GetComponents() )
{
if( each_component->GetLibId().Format() != UTF8( selected_part.GetRequestedName() ) )
@ -161,8 +162,11 @@ void DIALOG_RESCUE_EACH::PopulateInstanceList()
data.push_back( each_component->GetRef( & m_Parent->GetCurrentSheet() ) );
data.push_back( valueField ? valueField->GetText() : wxT( "" ) );
m_ListOfInstances->AppendItem( data );
count++;
}
m_titleInstances->SetLabelText( wxString::Format(
_( "Instances of this symbol (%d items):" ), count ) );
}

View File

@ -20,20 +20,20 @@ DIALOG_RESCUE_EACH_BASE::DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID i
m_lblInfo->Wrap( 500 );
bSizerMain->Add( m_lblInfo, 0, wxALL|wxEXPAND, 5 );
m_staticText5 = new wxStaticText( this, wxID_ANY, _("Symbols to update:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText5->Wrap( -1 );
m_staticText5->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
m_titleSymbols = new wxStaticText( this, wxID_ANY, _("Symbols to update:"), wxDefaultPosition, wxDefaultSize, 0 );
m_titleSymbols->Wrap( -1 );
m_titleSymbols->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
bSizerMain->Add( m_staticText5, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
bSizerMain->Add( m_titleSymbols, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ListOfConflicts = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
bSizerMain->Add( m_ListOfConflicts, 2, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticText4 = new wxStaticText( this, wxID_ANY, _("Instances of this symbol:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText4->Wrap( -1 );
m_staticText4->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
m_titleInstances = new wxStaticText( this, wxID_ANY, _("Instances of this symbol:"), wxDefaultPosition, wxDefaultSize, 0 );
m_titleInstances->Wrap( -1 );
m_titleInstances->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
bSizerMain->Add( m_staticText4, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
bSizerMain->Add( m_titleInstances, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ListOfInstances = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
bSizerMain->Add( m_ListOfInstances, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );

View File

@ -216,7 +216,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticText5</property>
<property name="name">m_titleSymbols</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -367,7 +367,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticText4</property>
<property name="name">m_titleInstances</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>

View File

@ -38,9 +38,9 @@ class DIALOG_RESCUE_EACH_BASE : public DIALOG_SHIM
protected:
wxStaticText* m_lblInfo;
wxStaticText* m_staticText5;
wxStaticText* m_titleSymbols;
wxDataViewListCtrl* m_ListOfConflicts;
wxStaticText* m_staticText4;
wxStaticText* m_titleInstances;
wxDataViewListCtrl* m_ListOfInstances;
wxStaticText* m_staticText2;
wxPanel* m_componentViewOld;