From 53b52b08c9734b9380c79cfda3d8466a1dc88d9f Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 25 Feb 2016 14:57:59 +0100 Subject: [PATCH] CvPcb, filtering fp list by wildcard: Remove dialog to enter the filtering pattern. Use a wxTextCtrl permanently shown in toolbar. The fplist is updated immediately after editing the pattern. --- cvpcb/cfg.cpp | 2 +- cvpcb/class_footprints_listbox.cpp | 20 ++++-- cvpcb/cvpcb_id.h | 3 +- cvpcb/cvpcb_mainframe.cpp | 69 +++++++------------ cvpcb/cvpcb_mainframe.h | 40 +++++------ cvpcb/dialogs/dialog_config_equfiles.cpp | 8 +-- cvpcb/dialogs/dialog_config_equfiles.h | 1 - cvpcb/dialogs/dialog_config_equfiles_base.cpp | 16 ++--- cvpcb/dialogs/dialog_config_equfiles_base.fbp | 3 +- cvpcb/dialogs/dialog_config_equfiles_base.h | 3 +- cvpcb/listview_classes.h | 5 +- cvpcb/menubar.cpp | 9 --- cvpcb/tool_cvpcb.cpp | 7 ++ 13 files changed, 79 insertions(+), 107 deletions(-) diff --git a/cvpcb/cfg.cpp b/cvpcb/cfg.cpp index 2a8c9198af..fe80064002 100644 --- a/cvpcb/cfg.cpp +++ b/cvpcb/cfg.cpp @@ -67,7 +67,7 @@ void CVPCB_MAINFRAME::LoadProjectFile() } -void CVPCB_MAINFRAME::SaveProjectFile( wxCommandEvent& aEvent ) +void CVPCB_MAINFRAME::SaveProjectFile() { PROJECT& prj = Prj(); wxFileName fn = prj.GetProjectFullName(); diff --git a/cvpcb/class_footprints_listbox.cpp b/cvpcb/class_footprints_listbox.cpp index cc3ab0eb9e..c59352f3b8 100644 --- a/cvpcb/class_footprints_listbox.cpp +++ b/cvpcb/class_footprints_listbox.cpp @@ -34,6 +34,7 @@ #include #include #include +#include FOOTPRINTS_LISTBOX::FOOTPRINTS_LISTBOX( CVPCB_MAINFRAME* parent, @@ -124,12 +125,17 @@ void FOOTPRINTS_LISTBOX::SetSelection( int index, bool State ) void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& aLibName, - COMPONENT* aComponent, const wxString &footPrintName, int aFilterType ) + COMPONENT* aComponent, + const wxString &aFootPrintFilterPattern, + int aFilterType ) { wxArrayString newList; wxString msg; wxString oldSelection; + EDA_PATTERN_MATCH_WILDCARD patternFilter; + patternFilter.SetPattern( aFootPrintFilterPattern.Lower() ); // Use case insensitive search + if( GetSelection() >= 0 && GetSelection() < (int)m_footprintList.GetCount() ) oldSelection = m_footprintList[ GetSelection() ]; @@ -156,11 +162,15 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a && aComponent->GetNetCount() != aList.GetItem( ii ).GetUniquePadCount() ) continue; - wxString itemsName = aList.GetItem( ii ).GetNickname().Lower () + - aList.GetItem (ii).GetFootprintName().Lower (); + // We can search (Using case insensitive search) in full FPID or only + // in the fp name itself. + // After tests, only in the fp name itself looks better. + // However, the code to take in account the nickname is just commented, no removed. + wxString currname = //aList.GetItem( ii ).GetNickname().Lower() + ":" + + aList.GetItem( ii ).GetFootprintName().Lower(); - if( (aFilterType & FILTERING_BY_NAME) && !footPrintName.IsEmpty() - && itemsName.Find (footPrintName.Lower ()) == wxNOT_FOUND) + if( (aFilterType & FILTERING_BY_NAME) && !aFootPrintFilterPattern.IsEmpty() + && patternFilter.Find( currname ) == EDA_PATTERN_NOT_FOUND ) { continue; } diff --git a/cvpcb/cvpcb_id.h b/cvpcb/cvpcb_id.h index 9de30e40b9..a5794c0725 100644 --- a/cvpcb/cvpcb_id.h +++ b/cvpcb/cvpcb_id.h @@ -57,5 +57,6 @@ enum id_cvpcb_frm ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, ID_CVPCB_LIBRARY_LIST, ID_CVPCB_EQUFILES_LIST_EDIT, - ID_CVPCB_LIB_TABLE_EDIT + ID_CVPCB_LIB_TABLE_EDIT, + ID_CVPCB_FILTER_TEXT_EDIT }; diff --git a/cvpcb/cvpcb_mainframe.cpp b/cvpcb/cvpcb_mainframe.cpp index 299f50d5dd..002f5480f3 100644 --- a/cvpcb/cvpcb_mainframe.cpp +++ b/cvpcb/cvpcb_mainframe.cpp @@ -66,7 +66,6 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, KIWAY_PLAYER ) EVT_MENU( wxID_EXIT, CVPCB_MAINFRAME::OnQuit ) EVT_MENU( wxID_HELP, CVPCB_MAINFRAME::GetKicadHelp ) EVT_MENU( wxID_ABOUT, CVPCB_MAINFRAME::GetKicadAbout ) - EVT_MENU( ID_FIND_ITEMS, CVPCB_MAINFRAME::OnMenuSearch ) EVT_MENU( ID_PREFERENCES_CONFIGURE_PATHS, CVPCB_MAINFRAME::OnConfigurePaths ) EVT_MENU( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, CVPCB_MAINFRAME::OnKeepOpenOnSave ) EVT_MENU( ID_CVPCB_EQUFILES_LIST_EDIT, CVPCB_MAINFRAME::OnEditEquFilesList ) @@ -88,7 +87,8 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, KIWAY_PLAYER ) EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, CVPCB_MAINFRAME::OnSelectFilteringFootprint ) EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME, - CVPCB_MAINFRAME::OnToolbarSearch ) + CVPCB_MAINFRAME::OnSelectFilteringFootprint ) + EVT_TEXT( ID_CVPCB_FILTER_TEXT_EDIT, OnEnterFilteringText ) // Frame events EVT_CLOSE( CVPCB_MAINFRAME::OnCloseWindow ) @@ -120,6 +120,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) : m_undefinedComponentCnt = 0; m_skipComponentSelect = false; m_filteringOptions = 0; + m_tcFilterString = NULL; /* Name of the document footprint list * usually located in share/modules/footprints_doc @@ -481,54 +482,13 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event ) libraryName = m_libListBox->GetSelectedLibrary(); m_footprintListBox->SetFootprints( m_FootprintsList, libraryName, component, - m_currentSearch, m_filteringOptions); + m_currentSearchPattern, m_filteringOptions); - RefreshAfterComponentSearch (component); -} - -void CVPCB_MAINFRAME::OnToolbarSearch( wxCommandEvent& aEvent ) -{ - if( m_skipComponentSelect ) - return; - - if(m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME ) ) - { - m_filteringOptions |= FOOTPRINTS_LISTBOX::FILTERING_BY_NAME; - SearchDialogAndStore (); - } - else - { - m_filteringOptions &= ~FOOTPRINTS_LISTBOX::FILTERING_BY_NAME; - m_currentSearch = ""; - } - - OnSelectFilteringFootprint( aEvent ); -} - -void CVPCB_MAINFRAME::OnMenuSearch( wxCommandEvent& aEvent ) -{ - if( m_skipComponentSelect ) - return; - - m_filteringOptions |= FOOTPRINTS_LISTBOX::FILTERING_BY_NAME; - SearchDialogAndStore(); - OnSelectFilteringFootprint( aEvent ); -} - -void CVPCB_MAINFRAME::SearchDialogAndStore() -{ - wxTextEntryDialog myDialog( this, _("Find footprint"), _("Find"), "" ); - - if( myDialog.ShowModal() == wxID_OK ) - { - m_currentSearch = myDialog.GetValue(); - } - - m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME, !m_currentSearch.empty() ); + refreshAfterComponentSearch (component); } -void CVPCB_MAINFRAME::RefreshAfterComponentSearch (COMPONENT* component) +void CVPCB_MAINFRAME::refreshAfterComponentSearch( COMPONENT* component ) { // Tell AuiMgr that objects are changed ! if( m_auimgr.GetManagedWindow() ) // Be sure Aui Manager is initialized @@ -602,6 +562,7 @@ void CVPCB_MAINFRAME::OnSelectFilteringFootprint( wxCommandEvent& event ) break; case ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME: + m_currentSearchPattern = m_tcFilterString->GetValue(); option = FOOTPRINTS_LISTBOX::FILTERING_BY_NAME; break; } @@ -621,6 +582,7 @@ void CVPCB_MAINFRAME::OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event ) event.Check( m_keepCvpcbOpen ); } + void CVPCB_MAINFRAME::OnFilterFPbyKeywords( wxUpdateUIEvent& event ) { event.Check( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_KEYWORD ); @@ -645,6 +607,21 @@ void CVPCB_MAINFRAME::OnFilterFPbyKeyName( wxUpdateUIEvent& event ) } +void CVPCB_MAINFRAME::OnEnterFilteringText( wxCommandEvent& aEvent ) +{ + // Called when changing the filter string in main toolbar. + // If the option FOOTPRINTS_LISTBOX::FILTERING_BY_NAME is set, update the list of + // available footprints which match the filter + + m_currentSearchPattern = m_tcFilterString->GetValue(); + + if( ( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_NAME ) == 0 ) + return; + + OnSelectFilteringFootprint( aEvent ); +} + + void CVPCB_MAINFRAME::DisplayStatus() { wxString msg; diff --git a/cvpcb/cvpcb_mainframe.h b/cvpcb/cvpcb_mainframe.h index 801c6f9f07..d62747ef22 100644 --- a/cvpcb/cvpcb_mainframe.h +++ b/cvpcb/cvpcb_mainframe.h @@ -58,7 +58,7 @@ class CVPCB_MAINFRAME : public KIWAY_PLAYER friend struct CV::IFACE; wxArrayString m_footprintListEntries; - wxString m_currentSearch; + wxString m_currentSearchPattern; bool m_keepCvpcbOpen; NETLIST m_netlist; int m_filteringOptions; @@ -66,6 +66,7 @@ class CVPCB_MAINFRAME : public KIWAY_PLAYER FOOTPRINTS_LISTBOX* m_footprintListBox; LIBRARY_LISTBOX* m_libListBox; COMPONENTS_LISTBOX* m_compListBox; + wxTextCtrl* m_tcFilterString; public: wxArrayString m_ModuleLibNames; @@ -103,15 +104,12 @@ public: */ void OnSelectComponent( wxListEvent& event ); - void OnToolbarSearch (wxCommandEvent& aEvent); - void OnMenuSearch (wxCommandEvent& aEvent); - /** - * Function OnEditFootrprintLibraryTable + * Function OnEditFootprintLibraryTable * displays the footprint library table editing dialog and updates the global and local * footprint tables accordingly. */ - void OnEditFootrprintLibraryTable( wxCommandEvent& event ); + void OnEditFootprintLibraryTable( wxCommandEvent& event ); void OnQuit( wxCommandEvent& event ); void OnCloseWindow( wxCloseEvent& Event ); @@ -130,15 +128,8 @@ public: */ void DelAssociations( wxCommandEvent& event ); - void SaveProjectFile( wxCommandEvent& aEvent ); void SaveQuitCvpcb( wxCommandEvent& event ); - /** - * Function OnEditLibraryTable - * envokes the footprint library table edit dialog. - */ - void OnEditFootprintLibraryTable( wxCommandEvent& aEvent ); - void OnConfigurePaths( wxCommandEvent& aEvent ); /** @@ -169,11 +160,10 @@ public: void OnSelectFilteringFootprint( wxCommandEvent& event ); /** - * Function OnUpdateKeepOpenOnSave - * Command event handler to choose if CvPcb will be closed as soon as the footprint - * association is saved, or if it is left open. + * Function OnEnterFilteringText + * Is called each time the text of m_tcFilterString is changed. */ - void OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event ); + void OnEnterFilteringText( wxCommandEvent& event ); /** * Function SetNewPkg @@ -212,10 +202,16 @@ public: /** * Function LoadProjectFile - * reads the configuration parameter from the project (.pro) file \a aFileName + * reads the CvPcb configuration parameter from the project (.pro) file \a aFileName */ void LoadProjectFile(); + /** + * Function SaveProjectFile + * Saves the CvPcb configuration parameter from the project (.pro) file \a aFileName + */ + void SaveProjectFile(); + void LoadSettings( wxConfigBase* aCfg ); // override virtual void SaveSettings( wxConfigBase* aCfg ); // override virtual @@ -289,7 +285,9 @@ public: const wxString GetSelectedFootprint(); private: - // UI event handlers + // UI event handlers. + // Keep consistent the display state of toggle menus or tools in toolbar + void OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event ); void OnFilterFPbyKeywords( wxUpdateUIEvent& event ); void OnFilterFPbyPinCount( wxUpdateUIEvent& event ); void OnFilterFPbyLibrary( wxUpdateUIEvent& event ); @@ -304,9 +302,7 @@ private: */ int buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList, wxString * aErrorMessages = NULL ); - void RefreshAfterComponentSearch (COMPONENT* component); - void SearchDialogAndStore(); - + void refreshAfterComponentSearch (COMPONENT* component); DECLARE_EVENT_TABLE() }; diff --git a/cvpcb/dialogs/dialog_config_equfiles.cpp b/cvpcb/dialogs/dialog_config_equfiles.cpp index 3ae03fd680..80b26b5f8e 100644 --- a/cvpcb/dialogs/dialog_config_equfiles.cpp +++ b/cvpcb/dialogs/dialog_config_equfiles.cpp @@ -116,12 +116,6 @@ void DIALOG_CONFIG_EQUFILES::OnEditEquFile( wxCommandEvent& event ) } -void DIALOG_CONFIG_EQUFILES::OnCancelClick( wxCommandEvent& event ) -{ - EndModal( wxID_CANCEL ); -} - - void DIALOG_CONFIG_EQUFILES::OnOkClick( wxCommandEvent& event ) { // Save new equ file list if the files list was modified @@ -134,7 +128,7 @@ void DIALOG_CONFIG_EQUFILES::OnOkClick( wxCommandEvent& event ) m_Parent->m_EquFilesNames.Add( m_ListEquiv->GetString( ii ) ); wxCommandEvent evt( ID_SAVE_PROJECT ); - m_Parent->SaveProjectFile( evt ); + m_Parent->SaveProjectFile(); } EndModal( wxID_OK ); diff --git a/cvpcb/dialogs/dialog_config_equfiles.h b/cvpcb/dialogs/dialog_config_equfiles.h index aeb4868050..1dbbf47e77 100644 --- a/cvpcb/dialogs/dialog_config_equfiles.h +++ b/cvpcb/dialogs/dialog_config_equfiles.h @@ -46,7 +46,6 @@ private: // Virtual event handlers void OnCloseWindow( wxCloseEvent& event ); void OnOkClick( wxCommandEvent& event ); - void OnCancelClick( wxCommandEvent& event ); void OnAddFiles( wxCommandEvent& event ); void OnEditEquFile( wxCommandEvent& event ); void OnRemoveFiles( wxCommandEvent& event ); diff --git a/cvpcb/dialogs/dialog_config_equfiles_base.cpp b/cvpcb/dialogs/dialog_config_equfiles_base.cpp index e4b8a8cc0c..84a6f71004 100644 --- a/cvpcb/dialogs/dialog_config_equfiles_base.cpp +++ b/cvpcb/dialogs/dialog_config_equfiles_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 5 2014) +// C++ code generated with wxFormBuilder (version Jan 1 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -22,7 +22,7 @@ DIALOG_CONFIG_EQUFILES_BASE::DIALOG_CONFIG_EQUFILES_BASE( wxWindow* parent, wxWi wxBoxSizer* bSizerFlist; bSizerFlist = new wxBoxSizer( wxVERTICAL ); - m_ListEquiv = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE ); + m_ListEquiv = new wxListBox( sbEquivChoiceSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE ); m_ListEquiv->SetMinSize( wxSize( 350,-1 ) ); bSizerFlist->Add( m_ListEquiv, 1, wxRIGHT|wxLEFT|wxEXPAND, 5 ); @@ -33,21 +33,21 @@ DIALOG_CONFIG_EQUFILES_BASE::DIALOG_CONFIG_EQUFILES_BASE( wxWindow* parent, wxWi wxBoxSizer* bSizerButtons; bSizerButtons = new wxBoxSizer( wxVERTICAL ); - m_buttonAddEqu = new wxButton( this, ID_ADD_EQU, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonAddEqu = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_ADD_EQU, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtons->Add( m_buttonAddEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_buttonRemoveEqu = new wxButton( this, ID_REMOVE_EQU, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonRemoveEqu = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_REMOVE_EQU, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonRemoveEqu->SetToolTip( _("Unload the selected library") ); bSizerButtons->Add( m_buttonRemoveEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_buttonMoveUp = new wxButton( this, ID_EQU_UP, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonMoveUp = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_EQU_UP, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtons->Add( m_buttonMoveUp, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_buttonMoveDown = new wxButton( this, ID_EQU_DOWN, _("Move Down"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonMoveDown = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_EQU_DOWN, _("Move Down"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtons->Add( m_buttonMoveDown, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_buttonEdit = new wxButton( this, wxID_ANY, _("Edit Equ File"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonEdit = new wxButton( sbEquivChoiceSizer->GetStaticBox(), wxID_ANY, _("Edit Equ File"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtons->Add( m_buttonEdit, 0, wxALL|wxEXPAND, 5 ); @@ -132,7 +132,6 @@ DIALOG_CONFIG_EQUFILES_BASE::DIALOG_CONFIG_EQUFILES_BASE( wxWindow* parent, wxWi m_buttonMoveUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnButtonMoveUp ), NULL, this ); m_buttonMoveDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnButtonMoveDown ), NULL, this ); m_buttonEdit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnEditEquFile ), NULL, this ); - m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnCancelClick ), NULL, this ); m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnOkClick ), NULL, this ); } @@ -145,7 +144,6 @@ DIALOG_CONFIG_EQUFILES_BASE::~DIALOG_CONFIG_EQUFILES_BASE() m_buttonMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnButtonMoveUp ), NULL, this ); m_buttonMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnButtonMoveDown ), NULL, this ); m_buttonEdit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnEditEquFile ), NULL, this ); - m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnCancelClick ), NULL, this ); m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnOkClick ), NULL, this ); } diff --git a/cvpcb/dialogs/dialog_config_equfiles_base.fbp b/cvpcb/dialogs/dialog_config_equfiles_base.fbp index 38e625e402..bf12b5a872 100644 --- a/cvpcb/dialogs/dialog_config_equfiles_base.fbp +++ b/cvpcb/dialogs/dialog_config_equfiles_base.fbp @@ -103,6 +103,7 @@ sbEquivChoiceSizer wxHORIZONTAL + 1 none @@ -1093,7 +1094,7 @@ m_sdbSizer protected - OnCancelClick + diff --git a/cvpcb/dialogs/dialog_config_equfiles_base.h b/cvpcb/dialogs/dialog_config_equfiles_base.h index 2220da5987..a6112e798b 100644 --- a/cvpcb/dialogs/dialog_config_equfiles_base.h +++ b/cvpcb/dialogs/dialog_config_equfiles_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 5 2014) +// C++ code generated with wxFormBuilder (version Jan 1 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -68,7 +68,6 @@ class DIALOG_CONFIG_EQUFILES_BASE : public DIALOG_SHIM virtual void OnButtonMoveUp( wxCommandEvent& event ) { event.Skip(); } virtual void OnButtonMoveDown( wxCommandEvent& event ) { event.Skip(); } virtual void OnEditEquFile( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } diff --git a/cvpcb/listview_classes.h b/cvpcb/listview_classes.h index 3bb57933e1..c5f2474bcf 100644 --- a/cvpcb/listview_classes.h +++ b/cvpcb/listview_classes.h @@ -118,12 +118,11 @@ public: * @param aLibName is wxString containing the name of the selected library. Can be * wxEmptyString. * @param aComponent is the #COMPONENT used by the filtering criteria. Can be NULL. + * @param aFootPrintFilterPattern = a filter used to filter list by names * @param aFilterType defines the criteria to filter \a aList. */ void SetFootprints( FOOTPRINT_LIST& aList, const wxString& aLibName, - COMPONENT* aComponent, const wxString &footPrintName, int aFilterType ); - -// void searchByName (FOOTPRINT_LIST& aList, const wxString &footPrintName); + COMPONENT* aComponent, const wxString &aFootPrintFilterPattern, int aFilterType ); wxString GetSelectedFootprint(); diff --git a/cvpcb/menubar.cpp b/cvpcb/menubar.cpp index 224b0190b3..a8cc333d7a 100644 --- a/cvpcb/menubar.cpp +++ b/cvpcb/menubar.cpp @@ -75,14 +75,6 @@ void CVPCB_MAINFRAME::ReCreateMenuBar() _( "&Close" ), _( "Close CvPcb" ), KiBitmap( exit_xpm ) ); - // Find menu - wxMenu* findMenu = new wxMenu; - - AddMenuItem( findMenu, ID_FIND_ITEMS, - _( "&Find footprint\tCtrl+F" ), - _( "Find footprint by its name\nor filter the footprint list by the partial name" ), - KiBitmap( info_xpm )); - // Preferences Menu : wxMenu* preferencesMenu = new wxMenu; @@ -141,7 +133,6 @@ void CVPCB_MAINFRAME::ReCreateMenuBar() // Create the menubar and append all submenus menuBar->Append( filesMenu, _( "&Save" ) ); - menuBar->Append( findMenu, _( "&Find" ) ); menuBar->Append( preferencesMenu, _( "&Preferences" ) ); menuBar->Append( helpMenu, _( "&Help" ) ); diff --git a/cvpcb/tool_cvpcb.cpp b/cvpcb/tool_cvpcb.cpp index c28259072e..8170ccb69d 100644 --- a/cvpcb/tool_cvpcb.cpp +++ b/cvpcb/tool_cvpcb.cpp @@ -103,6 +103,7 @@ void CVPCB_MAINFRAME::ReCreateHToolbar() _( "Filter footprint list by library" ), wxEmptyString ); + m_mainToolBar->AddSeparator(); m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME, KiBitmap( module_name_filtered_list_xpm ), wxNullBitmap, true, NULL, @@ -110,6 +111,12 @@ void CVPCB_MAINFRAME::ReCreateHToolbar() "Ctrl+F to call the dialog to enter the filter string" ), wxEmptyString ); + if( m_tcFilterString == NULL ) + m_tcFilterString = new wxTextCtrl( m_mainToolBar, ID_CVPCB_FILTER_TEXT_EDIT ); + + m_mainToolBar->AddControl( m_tcFilterString ); + + // after adding the buttons to the toolbar, must call Realize() to reflect the changes m_mainToolBar->Realize(); }