diff --git a/eeschema/dialogs/dialog_lib_symbol_properties.cpp b/eeschema/dialogs/dialog_lib_symbol_properties.cpp index 250f82f497..fc47fd8e47 100644 --- a/eeschema/dialogs/dialog_lib_symbol_properties.cpp +++ b/eeschema/dialogs/dialog_lib_symbol_properties.cpp @@ -108,6 +108,15 @@ DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES( SYMBOL_EDIT_FRAME* a } ) ); m_bodyStyleNamesGrid->SetSelectionMode( wxGrid::wxGridSelectRows ); + m_jumperGroupsGrid->SetupColumnAutosizer( 0 ); + m_jumperGroupsGrid->SetSelectionMode( wxGrid::wxGridSelectRows ); + + m_jumperGroupsGrid->PushEventHandler( new GRID_TRICKS( m_jumperGroupsGrid, + [this]( wxCommandEvent& aEvent ) + { + OnAddJumperGroup( aEvent ); + } ) ); + // Configure button logos m_bpAdd->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) ); m_bpMoveUp->SetBitmap( KiBitmapBundle( BITMAPS::small_up ) ); @@ -123,8 +132,8 @@ DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES( SYMBOL_EDIT_FRAME* a m_editFilterButton->SetBitmap( KiBitmapBundle( BITMAPS::small_edit ) ); m_deleteFilterButton->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) ); - m_btnCreateJumperPinGroup->SetBitmap( KiBitmapBundle( BITMAPS::right ) ); - m_btnRemoveJumperPinGroup->SetBitmap( KiBitmapBundle( BITMAPS::left ) ); + m_bpAddJumperGroup->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) ); + m_bpRemoveJumperGroup->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) ); SetupStandardButtons(); @@ -194,6 +203,7 @@ DIALOG_LIB_SYMBOL_PROPERTIES::~DIALOG_LIB_SYMBOL_PROPERTIES() m_grid->PopEventHandler( true ); m_unitNamesGrid->PopEventHandler( true ); m_bodyStyleNamesGrid->PopEventHandler( true ); + m_jumperGroupsGrid->PopEventHandler( true ); } @@ -331,8 +341,6 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow() m_FootprintFilterListBox->Append( tmp ); m_cbDuplicatePinsAreJumpers->SetValue( m_libEntry->GetDuplicatePinNumbersAreJumpers() ); - m_btnCreateJumperPinGroup->Disable(); - m_btnRemoveJumperPinGroup->Disable(); std::set availablePins; @@ -342,23 +350,19 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow() for( const std::set& group : m_libEntry->JumperPinGroups() ) { wxString groupTxt; - size_t i = 0; for( const wxString& pinNumber : group ) { - availablePins.erase( pinNumber ); - groupTxt << pinNumber; - - if( ++i < group.size() ) + if( !groupTxt.IsEmpty() ) groupTxt << ", "; + + groupTxt << pinNumber; } - m_listJumperPinGroups->Append( groupTxt ); + m_jumperGroupsGrid->AppendRows( 1 ); + m_jumperGroupsGrid->SetCellValue( m_jumperGroupsGrid->GetNumberRows() - 1, 0, groupTxt ); } - for( const wxString& pin : availablePins ) - m_listAvailablePins->AppendString( pin ); - // Populate the list of root parts for inherited objects. if( m_libEntry->IsDerived() ) { @@ -514,17 +518,13 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::Validate() bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow() { - if( !wxDialog::TransferDataFromWindow() ) - return false; - - if( !m_grid->CommitPendingChanges() ) - return false; - - if( !m_unitNamesGrid->CommitPendingChanges() ) - return false; - - if( !m_bodyStyleNamesGrid->CommitPendingChanges() ) + if( !m_grid->CommitPendingChanges() + || !m_unitNamesGrid->CommitPendingChanges() + || !m_bodyStyleNamesGrid->CommitPendingChanges() + || !m_jumperGroupsGrid->CommitPendingChanges() ) + { return false; + } wxString newName = EscapeString( m_SymbolNameCtrl->GetValue(), CTX_LIBID ); wxString oldName = m_libEntry->GetName(); @@ -687,9 +687,9 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow() std::vector>& jumpers = m_libEntry->JumperPinGroups(); jumpers.clear(); - for( unsigned i = 0; i < m_listJumperPinGroups->GetCount(); ++i ) + for( int ii = 0; ii < m_jumperGroupsGrid->GetNumberRows(); ++ii ) { - wxStringTokenizer tokenizer( m_listJumperPinGroups->GetString( i ), ", \t\r\n", wxTOKEN_STRTOK ); + wxStringTokenizer tokenizer( m_jumperGroupsGrid->GetCellValue( ii, 0 ), ", \t\r\n", wxTOKEN_STRTOK ); std::set& group = jumpers.emplace_back(); while( tokenizer.HasMoreTokens() ) @@ -1262,79 +1262,28 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnPageChanging( wxBookCtrlEvent& aEvent ) } -void DIALOG_LIB_SYMBOL_PROPERTIES::OnBtnCreateJumperPinGroup( wxCommandEvent& aEvent ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnAddJumperGroup( wxCommandEvent& event ) { - wxArrayInt selections; - m_listAvailablePins->GetSelections( selections ); - - if( !selections.empty() ) - { - m_listJumperPinGroups->Freeze(); - m_listAvailablePins->Freeze(); - - wxString group; - unsigned i = 0; - - for( int idx : selections ) - { - group << m_listAvailablePins->GetString( idx ); - - if( ++i < selections.Count() ) - group << ", "; - } - - for( int idx = (int) selections.size() - 1; idx >= 0; --idx ) - m_listAvailablePins->Delete( selections[idx] ); - - m_listJumperPinGroups->AppendString( group ); - - m_listJumperPinGroups->Thaw(); - m_listAvailablePins->Thaw(); - } -} - - -void DIALOG_LIB_SYMBOL_PROPERTIES::OnBtnRemoveJumperPinGroup( wxCommandEvent& aEvent ) -{ - wxArrayInt selections; - m_listJumperPinGroups->GetSelections( selections ); - - if( !selections.empty() ) - { - m_listJumperPinGroups->Freeze(); - m_listAvailablePins->Freeze(); - - for( int idx : selections ) - { - wxStringTokenizer tokenizer( m_listJumperPinGroups->GetString( idx ), ", \t\r\n", wxTOKEN_STRTOK ); - - while( tokenizer.HasMoreTokens() ) + m_jumperGroupsGrid->OnAddRow( + [&]() -> std::pair { - if( wxString token = tokenizer.GetNextToken(); !token.IsEmpty() ) - m_listAvailablePins->AppendString( token ); - } - } + m_jumperGroupsGrid->AppendRows( 1 ); + OnModify(); - for( int idx = (int) selections.size() - 1; idx >= 0; --idx ) - m_listJumperPinGroups->Delete( selections[idx] ); - - m_listJumperPinGroups->Thaw(); - m_listAvailablePins->Thaw(); - } + return { m_jumperGroupsGrid->GetNumberRows() - 1, 0 }; + } ); } -void DIALOG_LIB_SYMBOL_PROPERTIES::OnGroupedPinListClick( wxCommandEvent& aEvent ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnRemoveJumperGroup( wxCommandEvent& event ) { - wxArrayInt selections; - int n = m_listJumperPinGroups->GetSelections( selections ); - m_btnRemoveJumperPinGroup->Enable( n > 0 ); + m_jumperGroupsGrid->OnDeleteRows( + [&]( int row ) + { + m_jumperGroupsGrid->DeleteRows( row, 1 ); + } ); + + OnModify(); } -void DIALOG_LIB_SYMBOL_PROPERTIES::OnAvailablePinsClick( wxCommandEvent& aEvent ) -{ - wxArrayInt selections; - int n = m_listAvailablePins->GetSelections( selections ); - m_btnCreateJumperPinGroup->Enable( n > 0 ); -} diff --git a/eeschema/dialogs/dialog_lib_symbol_properties.h b/eeschema/dialogs/dialog_lib_symbol_properties.h index 323c2d4c1d..f0e3d6b4b6 100644 --- a/eeschema/dialogs/dialog_lib_symbol_properties.h +++ b/eeschema/dialogs/dialog_lib_symbol_properties.h @@ -81,10 +81,8 @@ private: void OnCancelButtonClick( wxCommandEvent& event ) override; void OnPageChanging( wxNotebookEvent& event ) override; void OnFpFilterDClick( wxMouseEvent& event ) override; - void OnBtnCreateJumperPinGroup( wxCommandEvent& event ) override; - void OnBtnRemoveJumperPinGroup( wxCommandEvent& event ) override; - void OnGroupedPinListClick( wxCommandEvent& event ) override; - void OnAvailablePinsClick( wxCommandEvent& event ) override; + void OnAddJumperGroup( wxCommandEvent& event ) override; + void OnRemoveJumperGroup( wxCommandEvent& event ) override; bool updateUnitCount(); void syncControlStates( bool aIsAlias ); diff --git a/eeschema/dialogs/dialog_lib_symbol_properties_base.cpp b/eeschema/dialogs/dialog_lib_symbol_properties_base.cpp index 0f0b5d954b..fd919088e7 100644 --- a/eeschema/dialogs/dialog_lib_symbol_properties_base.cpp +++ b/eeschema/dialogs/dialog_lib_symbol_properties_base.cpp @@ -483,71 +483,67 @@ DIALOG_LIB_SYMBOL_PROPERTIES_BASE::DIALOG_LIB_SYMBOL_PROPERTIES_BASE( wxWindow* wxBoxSizer* bSizerPinConnections; bSizerPinConnections = new wxBoxSizer( wxVERTICAL ); - m_cbDuplicatePinsAreJumpers = new wxCheckBox( m_PanelPinConnections, wxID_ANY, _("Pins with duplicate numbers are jumpers"), wxDefaultPosition, wxDefaultSize, 0 ); - m_cbDuplicatePinsAreJumpers->SetToolTip( _("When enabled, this symbol can have more than one pin with the same number, and pins with the same number will be considered to be jumpered together internally.") ); + wxBoxSizer* bMargins; + bMargins = new wxBoxSizer( wxVERTICAL ); - bSizerPinConnections->Add( m_cbDuplicatePinsAreJumpers, 0, wxALL, 5 ); + m_cbDuplicatePinsAreJumpers = new wxCheckBox( m_PanelPinConnections, wxID_ANY, _("All pins with duplicate numbers are jumpers"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbDuplicatePinsAreJumpers->SetToolTip( _("When enabled, this footprint can have more than one pad with the same number, and pads with the same number will be considered to be jumpered together internally.") ); + + bMargins->Add( m_cbDuplicatePinsAreJumpers, 0, wxALL, 5 ); - bSizerPinConnections->Add( 0, 3, 0, wxEXPAND, 5 ); + bMargins->Add( 0, 5, 0, wxEXPAND, 5 ); - wxStaticBoxSizer* sbJumperPinGroups; - sbJumperPinGroups = new wxStaticBoxSizer( new wxStaticBox( m_PanelPinConnections, wxID_ANY, _("Jumper Pin Groups") ), wxVERTICAL ); + m_jumperGroupsLabel = new wxStaticText( m_PanelPinConnections, wxID_ANY, _("Explicit jumper pin groups:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_jumperGroupsLabel->Wrap( -1 ); + bMargins->Add( m_jumperGroupsLabel, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - wxBoxSizer* bSizerMargins; - bSizerMargins = new wxBoxSizer( wxHORIZONTAL ); + m_jumperGroupsGrid = new WX_GRID( m_PanelPinConnections, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - wxBoxSizer* bSizerLeft; - bSizerLeft = new wxBoxSizer( wxVERTICAL ); + // Grid + m_jumperGroupsGrid->CreateGrid( 0, 1 ); + m_jumperGroupsGrid->EnableEditing( true ); + m_jumperGroupsGrid->EnableGridLines( true ); + m_jumperGroupsGrid->EnableDragGridSize( false ); + m_jumperGroupsGrid->SetMargins( 0, 0 ); - stLabelAvailablePins = new wxStaticText( sbJumperPinGroups->GetStaticBox(), wxID_ANY, _("Available pins:"), wxDefaultPosition, wxDefaultSize, 0 ); - stLabelAvailablePins->Wrap( -1 ); - bSizerLeft->Add( stLabelAvailablePins, 0, wxRIGHT|wxLEFT, 4 ); + // Columns + m_jumperGroupsGrid->SetColSize( 0, 320 ); + m_jumperGroupsGrid->EnableDragColMove( false ); + m_jumperGroupsGrid->EnableDragColSize( true ); + m_jumperGroupsGrid->SetColLabelSize( 0 ); + m_jumperGroupsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); - m_listAvailablePins = new wxListBox( sbJumperPinGroups->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED|wxLB_SORT ); - m_listAvailablePins->SetMinSize( wxSize( 200,-1 ) ); + // Rows + m_jumperGroupsGrid->EnableDragRowSize( true ); + m_jumperGroupsGrid->SetRowLabelSize( 0 ); + m_jumperGroupsGrid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); - bSizerLeft->Add( m_listAvailablePins, 1, wxALL|wxEXPAND, 2 ); + // Label Appearance + + // Cell Defaults + m_jumperGroupsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER ); + m_jumperGroupsGrid->SetMinSize( wxSize( -1,30 ) ); + + bMargins->Add( m_jumperGroupsGrid, 1, wxALL|wxEXPAND, 5 ); + + wxBoxSizer* bButtonSize21; + bButtonSize21 = new wxBoxSizer( wxHORIZONTAL ); + + m_bpAddJumperGroup = new STD_BITMAP_BUTTON( m_PanelPinConnections, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); + bButtonSize21->Add( m_bpAddJumperGroup, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - bSizerMargins->Add( bSizerLeft, 1, wxEXPAND, 5 ); + bButtonSize21->Add( 20, 0, 0, wxEXPAND, 5 ); - wxBoxSizer* bSizerCenter; - bSizerCenter = new wxBoxSizer( wxVERTICAL ); - - m_btnCreateJumperPinGroup = new wxBitmapButton( sbJumperPinGroups->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); - m_btnCreateJumperPinGroup->SetToolTip( _("Create jumper group from the selected pins") ); - - bSizerCenter->Add( m_btnCreateJumperPinGroup, 0, wxALL, 5 ); - - m_btnRemoveJumperPinGroup = new wxBitmapButton( sbJumperPinGroups->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); - m_btnRemoveJumperPinGroup->SetToolTip( _("Remove the selected jumper pin group") ); - - bSizerCenter->Add( m_btnRemoveJumperPinGroup, 0, wxALL, 5 ); + m_bpRemoveJumperGroup = new STD_BITMAP_BUTTON( m_PanelPinConnections, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); + bButtonSize21->Add( m_bpRemoveJumperGroup, 0, wxBOTTOM|wxRIGHT, 5 ); - bSizerMargins->Add( bSizerCenter, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer* bSizerRight; - bSizerRight = new wxBoxSizer( wxVERTICAL ); - - stLabelGroups = new wxStaticText( sbJumperPinGroups->GetStaticBox(), wxID_ANY, _("Grouped pins:"), wxDefaultPosition, wxDefaultSize, 0 ); - stLabelGroups->Wrap( -1 ); - bSizerRight->Add( stLabelGroups, 0, wxRIGHT|wxLEFT, 4 ); - - m_listJumperPinGroups = new wxListBox( sbJumperPinGroups->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED|wxLB_SORT ); - m_listJumperPinGroups->SetMinSize( wxSize( 200,-1 ) ); - - bSizerRight->Add( m_listJumperPinGroups, 1, wxALL|wxEXPAND, 2 ); + bMargins->Add( bButtonSize21, 0, wxEXPAND, 5 ); - bSizerMargins->Add( bSizerRight, 1, wxEXPAND, 5 ); - - - sbJumperPinGroups->Add( bSizerMargins, 1, wxEXPAND|wxTOP, 2 ); - - - bSizerPinConnections->Add( sbJumperPinGroups, 1, wxALL|wxTOP, 5 ); + bSizerPinConnections->Add( bMargins, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); m_PanelPinConnections->SetSizer( bSizerPinConnections ); @@ -626,10 +622,8 @@ DIALOG_LIB_SYMBOL_PROPERTIES_BASE::DIALOG_LIB_SYMBOL_PROPERTIES_BASE( wxWindow* m_FootprintFilterListBox->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditFootprintFilter ), NULL, this ); m_addFilterButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnAddFootprintFilter ), NULL, this ); m_editFilterButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditFootprintFilter ), NULL, this ); - m_listAvailablePins->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnAvailablePinsClick ), NULL, this ); - m_btnCreateJumperPinGroup->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnBtnCreateJumperPinGroup ), NULL, this ); - m_btnRemoveJumperPinGroup->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnBtnRemoveJumperPinGroup ), NULL, this ); - m_listJumperPinGroups->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnGroupedPinListClick ), NULL, this ); + m_bpAddJumperGroup->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnAddJumperGroup ), NULL, this ); + m_bpRemoveJumperGroup->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnRemoveJumperGroup ), NULL, this ); m_spiceFieldsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditSpiceModel ), NULL, this ); m_stdSizerButtonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this ); } @@ -673,10 +667,8 @@ DIALOG_LIB_SYMBOL_PROPERTIES_BASE::~DIALOG_LIB_SYMBOL_PROPERTIES_BASE() m_FootprintFilterListBox->Disconnect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditFootprintFilter ), NULL, this ); m_addFilterButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnAddFootprintFilter ), NULL, this ); m_editFilterButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditFootprintFilter ), NULL, this ); - m_listAvailablePins->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnAvailablePinsClick ), NULL, this ); - m_btnCreateJumperPinGroup->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnBtnCreateJumperPinGroup ), NULL, this ); - m_btnRemoveJumperPinGroup->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnBtnRemoveJumperPinGroup ), NULL, this ); - m_listJumperPinGroups->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnGroupedPinListClick ), NULL, this ); + m_bpAddJumperGroup->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnAddJumperGroup ), NULL, this ); + m_bpRemoveJumperGroup->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnRemoveJumperGroup ), NULL, this ); m_spiceFieldsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditSpiceModel ), NULL, this ); m_stdSizerButtonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this ); diff --git a/eeschema/dialogs/dialog_lib_symbol_properties_base.fbp b/eeschema/dialogs/dialog_lib_symbol_properties_base.fbp index 12b5eff309..2c9cf81318 100644 --- a/eeschema/dialogs/dialog_lib_symbol_properties_base.fbp +++ b/eeschema/dialogs/dialog_lib_symbol_properties_base.fbp @@ -3522,535 +3522,406 @@ none 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Pins with duplicate numbers are jumpers - - 0 - - - 0 - - 1 - m_cbDuplicatePinsAreJumpers - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - When enabled, this symbol can have more than one pin with the same number, and pins with the same number will be considered to be jumpered together internally. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxEXPAND - 0 - - 3 - protected - 0 - - - - 5 - wxALL|wxTOP + wxEXPAND|wxRIGHT|wxLEFT 1 - - wxID_ANY - Jumper Pin Groups + - sbJumperPinGroups + bMargins wxVERTICAL - 1 none - 2 - wxEXPAND|wxTOP + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + All pins with duplicate numbers are jumpers + + 0 + + + 0 + + 1 + m_cbDuplicatePinsAreJumpers + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + When enabled, this footprint can have more than one pad with the same number, and pads with the same number will be considered to be jumpered together internally. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND + 0 + + 5 + protected + 0 + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Explicit jumper pin groups: + 0 + + 0 + + + 0 + + 1 + m_jumperGroupsLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL|wxEXPAND 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + 0 + + + + 1 + + + wxALIGN_LEFT + + wxALIGN_CENTER + 0 + 1 + wxALIGN_CENTER + 0 + + wxALIGN_CENTER + 1 + 320 + + 1 + 0 + Dock + 0 + Left + 0 + 0 + 1 + 0 + 1 + 1 + 1 + + 1 + + + 1 + 0 + 0 + wxID_ANY + + + + 0 + 0 + + 0 + + + 0 + -1,30 + 1 + m_jumperGroupsGrid + 1 + + + protected + 1 + + Resizable + wxALIGN_CENTER + 0 + + wxALIGN_CENTER + + 0 + 1 + + WX_GRID; widgets/wx_grid.h; forward_declare + 0 + + + + + + + + 5 + wxEXPAND + 0 - bSizerMargins + bButtonSize21 wxHORIZONTAL none 5 - wxEXPAND - 1 - - - bSizerLeft - wxVERTICAL - none - - 4 - wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Available pins: - 0 - - 0 - - - 0 - - 1 - stLabelAvailablePins - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 2 - wxALL|wxEXPAND - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - 200,-1 - 1 - m_listAvailablePins - 1 - - - protected - 1 - - Resizable - 1 - - wxLB_EXTENDED|wxLB_SORT - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnAvailablePinsClick - - - - - - 5 - wxALIGN_CENTER_VERTICAL + wxBOTTOM|wxLEFT|wxRIGHT 0 - - - bSizerCenter - wxVERTICAL - none - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 0 - 1 - - 1 - - - 0 - 0 - wxID_ANY - MyButton - - 0 - - 0 - - - 0 - - 1 - m_btnCreateJumperPinGroup - 1 - - - protected - 1 - - - - Resizable - 1 - - - ; ; forward_declare - 0 - Create jumper group from the selected pins - - wxFILTER_NONE - wxDefaultValidator - - - - - OnBtnCreateJumperPinGroup - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 0 - 1 - - 1 - - - 0 - 0 - wxID_ANY - MyButton - - 0 - - 0 - - - 0 - - 1 - m_btnRemoveJumperPinGroup - 1 - - - protected - 1 - - - - Resizable - 1 - - - ; ; forward_declare - 0 - Remove the selected jumper pin group - - wxFILTER_NONE - wxDefaultValidator - - - - - OnBtnRemoveJumperPinGroup - - + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Add Jumper Group + + 0 + + 0 + + + 0 + -1,-1 + 1 + m_bpAddJumperGroup + 1 + + + protected + 1 + + + + Resizable + 1 + + + STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddJumperGroup 5 wxEXPAND - 1 - - - bSizerRight - wxVERTICAL - none - - 4 - wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Grouped pins: - 0 - - 0 - - - 0 - - 1 - stLabelGroups - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 2 - wxALL|wxEXPAND - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - 200,-1 - 1 - m_listJumperPinGroups - 1 - - - protected - 1 - - Resizable - 1 - - wxLB_EXTENDED|wxLB_SORT - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnGroupedPinListClick - - + 0 + + 0 + protected + 20 + + + + 5 + wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Delete Jumper Group + + 0 + + 0 + + + 0 + -1,-1 + 1 + m_bpRemoveJumperGroup + 1 + + + protected + 1 + + + + Resizable + 1 + + + STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnRemoveJumperGroup diff --git a/eeschema/dialogs/dialog_lib_symbol_properties_base.h b/eeschema/dialogs/dialog_lib_symbol_properties_base.h index 60d9930b74..18cf3eb193 100644 --- a/eeschema/dialogs/dialog_lib_symbol_properties_base.h +++ b/eeschema/dialogs/dialog_lib_symbol_properties_base.h @@ -98,12 +98,10 @@ class DIALOG_LIB_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM STD_BITMAP_BUTTON* m_deleteFilterButton; wxPanel* m_PanelPinConnections; wxCheckBox* m_cbDuplicatePinsAreJumpers; - wxStaticText* stLabelAvailablePins; - wxListBox* m_listAvailablePins; - wxBitmapButton* m_btnCreateJumperPinGroup; - wxBitmapButton* m_btnRemoveJumperPinGroup; - wxStaticText* stLabelGroups; - wxListBox* m_listJumperPinGroups; + wxStaticText* m_jumperGroupsLabel; + WX_GRID* m_jumperGroupsGrid; + STD_BITMAP_BUTTON* m_bpAddJumperGroup; + STD_BITMAP_BUTTON* m_bpRemoveJumperGroup; wxButton* m_spiceFieldsButton; wxStdDialogButtonSizer* m_stdSizerButton; wxButton* m_stdSizerButtonOK; @@ -134,10 +132,8 @@ class DIALOG_LIB_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM virtual void OnFpFilterDClick( wxMouseEvent& event ) { event.Skip(); } virtual void OnEditFootprintFilter( wxCommandEvent& event ) { event.Skip(); } virtual void OnAddFootprintFilter( wxCommandEvent& event ) { event.Skip(); } - virtual void OnAvailablePinsClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnBtnCreateJumperPinGroup( wxCommandEvent& event ) { event.Skip(); } - virtual void OnBtnRemoveJumperPinGroup( wxCommandEvent& event ) { event.Skip(); } - virtual void OnGroupedPinListClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnAddJumperGroup( wxCommandEvent& event ) { event.Skip(); } + virtual void OnRemoveJumperGroup( wxCommandEvent& event ) { event.Skip(); } virtual void OnEditSpiceModel( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); }