diff --git a/common/widgets/search_pane_base.cpp b/common/widgets/search_pane_base.cpp index e4b592d32d..7e62e9aa0b 100644 --- a/common/widgets/search_pane_base.cpp +++ b/common/widgets/search_pane_base.cpp @@ -20,11 +20,11 @@ SEARCH_PANE_BASE::SEARCH_PANE_BASE( wxWindow* parent, wxWindowID id, const wxPoi m_searchCtrl1->ShowSearchButton( true ); #endif m_searchCtrl1->ShowCancelButton( false ); - m_sizerOuter->Add( m_searchCtrl1, 0, wxEXPAND|wxTOP, 5 ); + m_sizerOuter->Add( m_searchCtrl1, 0, wxEXPAND, 5 ); m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_sizerOuter->Add( m_notebook, 1, wxEXPAND|wxTOP, 5 ); + m_sizerOuter->Add( m_notebook, 1, wxEXPAND|wxBOTTOM, 4 ); this->SetSizer( m_sizerOuter ); diff --git a/common/widgets/search_pane_base.fbp b/common/widgets/search_pane_base.fbp index 7400e655b7..21ddced54a 100644 --- a/common/widgets/search_pane_base.fbp +++ b/common/widgets/search_pane_base.fbp @@ -61,7 +61,7 @@ protected 5 - wxEXPAND|wxTOP + wxEXPAND 0 1 @@ -126,8 +126,8 @@ - 5 - wxEXPAND|wxTOP + 4 + wxEXPAND|wxBOTTOM 1 1 diff --git a/common/widgets/search_pane_tab.cpp b/common/widgets/search_pane_tab.cpp index f76ad3f6b7..db1d92f2ad 100644 --- a/common/widgets/search_pane_tab.cpp +++ b/common/widgets/search_pane_tab.cpp @@ -146,15 +146,15 @@ void SEARCH_PANE_LISTVIEW::RefreshColumnNames() Freeze(); DeleteAllColumns(); - std::vector> columns = m_handler->GetColumns(); + std::vector> columns = m_handler->GetColumns(); - for( auto& [ columnName, colProportion ] : columns ) - AppendColumn( wxGetTranslation( columnName ) ); + for( auto& [ columnName, colProportion, colAlign ] : columns ) + AppendColumn( wxGetTranslation( columnName ), colAlign ); - int widthUnit = GetClientSize().GetWidth() / 4; + int widthUnit = GetClientSize().GetWidth() / 10; for( int ii = 0; ii < (int) columns.size(); ++ii ) - SetColumnWidth( ii, widthUnit * columns[ ii ].second ); + SetColumnWidth( ii, widthUnit * std::get<1>( columns[ ii ] ) ); Thaw(); } diff --git a/eeschema/widgets/search_handlers.cpp b/eeschema/widgets/search_handlers.cpp index 74df3833c1..bd8baa87e5 100644 --- a/eeschema/widgets/search_handlers.cpp +++ b/eeschema/widgets/search_handlers.cpp @@ -122,12 +122,16 @@ void SCH_SEARCH_HANDLER::SelectItems( std::vector& aItemRows ) SYMBOL_SEARCH_HANDLER::SYMBOL_SEARCH_HANDLER( SCH_EDIT_FRAME* aFrame ) : SCH_SEARCH_HANDLER( wxT( "Symbols" ), aFrame ) { - m_columns.emplace_back( wxT( "Reference" ), 1 ); - m_columns.emplace_back( wxT( "Value" ), 3 ); - m_columns.emplace_back( wxT( "Footprint" ), 3 ); - m_columns.emplace_back( wxT( "Page" ), 1 ); - m_columns.emplace_back( wxT( "X" ), 2 ); - m_columns.emplace_back( wxT( "Y" ), 2 ); + m_columns.emplace_back( wxT( "Reference" ), 2, wxLIST_FORMAT_LEFT ); + m_columns.emplace_back( wxT( "Value" ), 6, wxLIST_FORMAT_LEFT ); + m_columns.emplace_back( wxT( "Footprint" ), 10, wxLIST_FORMAT_LEFT ); + m_columns.emplace_back( wxT( "Page" ), 1, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "Excl. sim" ), 2, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "Excl. BOM" ), 2, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "Excl. board" ), 2, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "DNP" ), 2, wxLIST_FORMAT_CENTER ); } @@ -188,7 +192,14 @@ wxString SYMBOL_SEARCH_HANDLER::getResultCell( const SCH_SEARCH_HIT& aHit, int a return m_frame->MessageTextFromValue( sym->GetPosition().x ); else if( aCol == 5 ) return m_frame->MessageTextFromValue( sym->GetPosition().y ); - + else if( aCol == 6 ) + return sym->GetExcludedFromSim() ? wxS( "X" ) : wxS( " " ); + else if( aCol == 7 ) + return sym->GetExcludedFromBOM() ? wxS( "X" ) : wxS( " " ); + else if( aCol == 8 ) + return sym->GetExcludedFromBoard() ? wxS( "X" ) : wxS( " " ); + else if( aCol == 9 ) + return sym->GetDNP() ? wxS( "X" ) : wxS( " " ); return wxEmptyString; } @@ -197,11 +208,11 @@ wxString SYMBOL_SEARCH_HANDLER::getResultCell( const SCH_SEARCH_HIT& aHit, int a TEXT_SEARCH_HANDLER::TEXT_SEARCH_HANDLER( SCH_EDIT_FRAME* aFrame ) : SCH_SEARCH_HANDLER( wxT( "Text" ), aFrame ) { - m_columns.emplace_back( wxT( "Type" ), 1 ); - m_columns.emplace_back( wxT( "Text" ), 5 ); - m_columns.emplace_back( wxT( "Page" ), 1 ); - m_columns.emplace_back( wxT( "X" ), 2 ); - m_columns.emplace_back( wxT( "Y" ), 2 ); + m_columns.emplace_back( wxT( "Type" ), 2, wxLIST_FORMAT_LEFT ); + m_columns.emplace_back( wxT( "Text" ), 12, wxLIST_FORMAT_LEFT ); + m_columns.emplace_back( wxT( "Page" ), 1, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER ); } @@ -281,11 +292,11 @@ wxString TEXT_SEARCH_HANDLER::getResultCell( const SCH_SEARCH_HIT& aHit, int aCo LABEL_SEARCH_HANDLER::LABEL_SEARCH_HANDLER( SCH_EDIT_FRAME* aFrame ) : SCH_SEARCH_HANDLER( wxT( "Labels" ), aFrame ) { - m_columns.emplace_back( wxT( "Type" ), 1 ); - m_columns.emplace_back( wxT( "Name" ), 4 ); - m_columns.emplace_back( wxT( "Page" ), 1 ); - m_columns.emplace_back( wxT( "X" ), 2 ); - m_columns.emplace_back( wxT( "Y" ), 2 ); + m_columns.emplace_back( wxT( "Type" ), 2, wxLIST_FORMAT_LEFT ); + m_columns.emplace_back( wxT( "Name" ), 6, wxLIST_FORMAT_LEFT ); + m_columns.emplace_back( wxT( "Page" ), 2, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "Y" ), 3 , wxLIST_FORMAT_CENTER); } diff --git a/include/widgets/search_pane.h b/include/widgets/search_pane.h index fde79cd565..288e10d5c8 100644 --- a/include/widgets/search_pane.h +++ b/include/widgets/search_pane.h @@ -22,6 +22,7 @@ #include #include +#include class EDA_DRAW_FRAME; class SEARCH_PANE_TAB; @@ -35,7 +36,10 @@ public: wxString GetName() const { return m_name; } - std::vector> GetColumns() const { return m_columns; } + std::vector> GetColumns() const + { + return m_columns; + } virtual int Search( const wxString& string ) = 0; virtual wxString GetResultCell( int row, int col ) = 0; @@ -45,8 +49,8 @@ public: virtual void ActivateItem( long aItemRow ) {} protected: - wxString m_name; - std::vector> m_columns; + wxString m_name; + std::vector> m_columns; }; class SEARCH_PANE : public SEARCH_PANE_BASE diff --git a/pcbnew/widgets/search_handlers.cpp b/pcbnew/widgets/search_handlers.cpp index 85cc874a28..e888179142 100644 --- a/pcbnew/widgets/search_handlers.cpp +++ b/pcbnew/widgets/search_handlers.cpp @@ -78,11 +78,11 @@ void PCB_SEARCH_HANDLER::SelectItems( std::vector& aItemRows ) FOOTPRINT_SEARCH_HANDLER::FOOTPRINT_SEARCH_HANDLER( PCB_EDIT_FRAME* aFrame ) : PCB_SEARCH_HANDLER( wxT( "Footprints" ), aFrame ) { - m_columns.emplace_back( wxT( "Reference" ), 1 ); - m_columns.emplace_back( wxT( "Value" ), 2 ); - m_columns.emplace_back( wxT( "Layer" ), 1 ); - m_columns.emplace_back( wxT( "X" ), 1 ); - m_columns.emplace_back( wxT( "Y" ), 1 ); + m_columns.emplace_back( wxT( "Reference" ), 2, wxLIST_FORMAT_LEFT ); + m_columns.emplace_back( wxT( "Value" ), 8, wxLIST_FORMAT_LEFT ); + m_columns.emplace_back( wxT( "Layer" ), 3, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER ); } @@ -136,12 +136,12 @@ wxString FOOTPRINT_SEARCH_HANDLER::getResultCell( BOARD_ITEM* aItem, int aCol ) ZONE_SEARCH_HANDLER::ZONE_SEARCH_HANDLER( PCB_EDIT_FRAME* aFrame ) : PCB_SEARCH_HANDLER( wxT( "Zones" ), aFrame ) { - m_columns.emplace_back( wxT( "Name" ), 2 ); - m_columns.emplace_back( wxT( "Net" ), 1 ); - m_columns.emplace_back( wxT( "Layer" ), 1 ); - m_columns.emplace_back( wxT( "Priority" ), 1 ); - m_columns.emplace_back( wxT( "X" ), 1 ); - m_columns.emplace_back( wxT( "Y" ), 1 ); + m_columns.emplace_back( wxT( "Name" ), 6, wxLIST_FORMAT_LEFT ); + m_columns.emplace_back( wxT( "Net" ), 6, wxLIST_FORMAT_LEFT); + m_columns.emplace_back( wxT( "Layer" ), 3, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "Priority" ), 2, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER ); } @@ -200,11 +200,11 @@ wxString ZONE_SEARCH_HANDLER::getResultCell( BOARD_ITEM* aItem, int aCol ) TEXT_SEARCH_HANDLER::TEXT_SEARCH_HANDLER( PCB_EDIT_FRAME* aFrame ) : PCB_SEARCH_HANDLER( wxT( "Text" ), aFrame ) { - m_columns.emplace_back( wxT( "Type" ), 1 ); - m_columns.emplace_back( wxT( "Text" ), 3 ); - m_columns.emplace_back( wxT( "Layer" ), 1 ); - m_columns.emplace_back( wxT( "X" ), 1 ); - m_columns.emplace_back( wxT( "Y" ), 1 ); + m_columns.emplace_back( wxT( "Type" ), 2, wxLIST_FORMAT_LEFT ); + m_columns.emplace_back( wxT( "Text" ), 12, wxLIST_FORMAT_LEFT ); + m_columns.emplace_back( wxT( "Layer" ), 3, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER ); + m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER ); } @@ -264,8 +264,8 @@ wxString TEXT_SEARCH_HANDLER::getResultCell( BOARD_ITEM* aItem, int aCol ) NETS_SEARCH_HANDLER::NETS_SEARCH_HANDLER( PCB_EDIT_FRAME* aFrame ) : PCB_SEARCH_HANDLER( wxT( "Nets" ), aFrame ) { - m_columns.emplace_back( wxT( "Name" ), 2 ); - m_columns.emplace_back( wxT( "Class" ), 2 ); + m_columns.emplace_back( wxT( "Name" ), 6, wxLIST_FORMAT_LEFT ); + m_columns.emplace_back( wxT( "Class" ), 6, wxLIST_FORMAT_LEFT ); } @@ -343,8 +343,8 @@ void NETS_SEARCH_HANDLER::ActivateItem( long aItemRow ) RATSNEST_SEARCH_HANDLER::RATSNEST_SEARCH_HANDLER( PCB_EDIT_FRAME* aFrame ) : PCB_SEARCH_HANDLER( wxT( "Ratsnest" ), aFrame ) { - m_columns.emplace_back( wxT( "Name" ), 2 ); - m_columns.emplace_back( wxT( "Class" ), 2 ); + m_columns.emplace_back( wxT( "Name" ), 6, wxLIST_FORMAT_LEFT ); + m_columns.emplace_back( wxT( "Class" ), 6, wxLIST_FORMAT_LEFT ); }