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.
This commit is contained in:
parent
08e68fce44
commit
53b52b08c9
|
@ -67,7 +67,7 @@ void CVPCB_MAINFRAME::LoadProjectFile()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CVPCB_MAINFRAME::SaveProjectFile( wxCommandEvent& aEvent )
|
void CVPCB_MAINFRAME::SaveProjectFile()
|
||||||
{
|
{
|
||||||
PROJECT& prj = Prj();
|
PROJECT& prj = Prj();
|
||||||
wxFileName fn = prj.GetProjectFullName();
|
wxFileName fn = prj.GetProjectFullName();
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include <cvpcb_mainframe.h>
|
#include <cvpcb_mainframe.h>
|
||||||
#include <listview_classes.h>
|
#include <listview_classes.h>
|
||||||
#include <cvpcb_id.h>
|
#include <cvpcb_id.h>
|
||||||
|
#include <eda_pattern_match.h>
|
||||||
|
|
||||||
|
|
||||||
FOOTPRINTS_LISTBOX::FOOTPRINTS_LISTBOX( CVPCB_MAINFRAME* parent,
|
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,
|
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;
|
wxArrayString newList;
|
||||||
wxString msg;
|
wxString msg;
|
||||||
wxString oldSelection;
|
wxString oldSelection;
|
||||||
|
|
||||||
|
EDA_PATTERN_MATCH_WILDCARD patternFilter;
|
||||||
|
patternFilter.SetPattern( aFootPrintFilterPattern.Lower() ); // Use case insensitive search
|
||||||
|
|
||||||
if( GetSelection() >= 0 && GetSelection() < (int)m_footprintList.GetCount() )
|
if( GetSelection() >= 0 && GetSelection() < (int)m_footprintList.GetCount() )
|
||||||
oldSelection = m_footprintList[ GetSelection() ];
|
oldSelection = m_footprintList[ GetSelection() ];
|
||||||
|
|
||||||
|
@ -156,11 +162,15 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
|
||||||
&& aComponent->GetNetCount() != aList.GetItem( ii ).GetUniquePadCount() )
|
&& aComponent->GetNetCount() != aList.GetItem( ii ).GetUniquePadCount() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
wxString itemsName = aList.GetItem( ii ).GetNickname().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();
|
aList.GetItem( ii ).GetFootprintName().Lower();
|
||||||
|
|
||||||
if( (aFilterType & FILTERING_BY_NAME) && !footPrintName.IsEmpty()
|
if( (aFilterType & FILTERING_BY_NAME) && !aFootPrintFilterPattern.IsEmpty()
|
||||||
&& itemsName.Find (footPrintName.Lower ()) == wxNOT_FOUND)
|
&& patternFilter.Find( currname ) == EDA_PATTERN_NOT_FOUND )
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,5 +57,6 @@ enum id_cvpcb_frm
|
||||||
ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
|
ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
|
||||||
ID_CVPCB_LIBRARY_LIST,
|
ID_CVPCB_LIBRARY_LIST,
|
||||||
ID_CVPCB_EQUFILES_LIST_EDIT,
|
ID_CVPCB_EQUFILES_LIST_EDIT,
|
||||||
ID_CVPCB_LIB_TABLE_EDIT
|
ID_CVPCB_LIB_TABLE_EDIT,
|
||||||
|
ID_CVPCB_FILTER_TEXT_EDIT
|
||||||
};
|
};
|
||||||
|
|
|
@ -66,7 +66,6 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, KIWAY_PLAYER )
|
||||||
EVT_MENU( wxID_EXIT, CVPCB_MAINFRAME::OnQuit )
|
EVT_MENU( wxID_EXIT, CVPCB_MAINFRAME::OnQuit )
|
||||||
EVT_MENU( wxID_HELP, CVPCB_MAINFRAME::GetKicadHelp )
|
EVT_MENU( wxID_HELP, CVPCB_MAINFRAME::GetKicadHelp )
|
||||||
EVT_MENU( wxID_ABOUT, CVPCB_MAINFRAME::GetKicadAbout )
|
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_PREFERENCES_CONFIGURE_PATHS, CVPCB_MAINFRAME::OnConfigurePaths )
|
||||||
EVT_MENU( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, CVPCB_MAINFRAME::OnKeepOpenOnSave )
|
EVT_MENU( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, CVPCB_MAINFRAME::OnKeepOpenOnSave )
|
||||||
EVT_MENU( ID_CVPCB_EQUFILES_LIST_EDIT, CVPCB_MAINFRAME::OnEditEquFilesList )
|
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,
|
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
|
||||||
CVPCB_MAINFRAME::OnSelectFilteringFootprint )
|
CVPCB_MAINFRAME::OnSelectFilteringFootprint )
|
||||||
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME,
|
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME,
|
||||||
CVPCB_MAINFRAME::OnToolbarSearch )
|
CVPCB_MAINFRAME::OnSelectFilteringFootprint )
|
||||||
|
EVT_TEXT( ID_CVPCB_FILTER_TEXT_EDIT, OnEnterFilteringText )
|
||||||
|
|
||||||
// Frame events
|
// Frame events
|
||||||
EVT_CLOSE( CVPCB_MAINFRAME::OnCloseWindow )
|
EVT_CLOSE( CVPCB_MAINFRAME::OnCloseWindow )
|
||||||
|
@ -120,6 +120,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
m_undefinedComponentCnt = 0;
|
m_undefinedComponentCnt = 0;
|
||||||
m_skipComponentSelect = false;
|
m_skipComponentSelect = false;
|
||||||
m_filteringOptions = 0;
|
m_filteringOptions = 0;
|
||||||
|
m_tcFilterString = NULL;
|
||||||
|
|
||||||
/* Name of the document footprint list
|
/* Name of the document footprint list
|
||||||
* usually located in share/modules/footprints_doc
|
* usually located in share/modules/footprints_doc
|
||||||
|
@ -481,54 +482,13 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
|
||||||
libraryName = m_libListBox->GetSelectedLibrary();
|
libraryName = m_libListBox->GetSelectedLibrary();
|
||||||
|
|
||||||
m_footprintListBox->SetFootprints( m_FootprintsList, libraryName, component,
|
m_footprintListBox->SetFootprints( m_FootprintsList, libraryName, component,
|
||||||
m_currentSearch, m_filteringOptions);
|
m_currentSearchPattern, m_filteringOptions);
|
||||||
|
|
||||||
RefreshAfterComponentSearch (component);
|
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() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CVPCB_MAINFRAME::RefreshAfterComponentSearch (COMPONENT* component)
|
void CVPCB_MAINFRAME::refreshAfterComponentSearch( COMPONENT* component )
|
||||||
{
|
{
|
||||||
// Tell AuiMgr that objects are changed !
|
// Tell AuiMgr that objects are changed !
|
||||||
if( m_auimgr.GetManagedWindow() ) // Be sure Aui Manager is initialized
|
if( m_auimgr.GetManagedWindow() ) // Be sure Aui Manager is initialized
|
||||||
|
@ -602,6 +562,7 @@ void CVPCB_MAINFRAME::OnSelectFilteringFootprint( wxCommandEvent& event )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME:
|
case ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME:
|
||||||
|
m_currentSearchPattern = m_tcFilterString->GetValue();
|
||||||
option = FOOTPRINTS_LISTBOX::FILTERING_BY_NAME;
|
option = FOOTPRINTS_LISTBOX::FILTERING_BY_NAME;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -621,6 +582,7 @@ void CVPCB_MAINFRAME::OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event )
|
||||||
event.Check( m_keepCvpcbOpen );
|
event.Check( m_keepCvpcbOpen );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CVPCB_MAINFRAME::OnFilterFPbyKeywords( wxUpdateUIEvent& event )
|
void CVPCB_MAINFRAME::OnFilterFPbyKeywords( wxUpdateUIEvent& event )
|
||||||
{
|
{
|
||||||
event.Check( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_KEYWORD );
|
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()
|
void CVPCB_MAINFRAME::DisplayStatus()
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
|
@ -58,7 +58,7 @@ class CVPCB_MAINFRAME : public KIWAY_PLAYER
|
||||||
friend struct CV::IFACE;
|
friend struct CV::IFACE;
|
||||||
|
|
||||||
wxArrayString m_footprintListEntries;
|
wxArrayString m_footprintListEntries;
|
||||||
wxString m_currentSearch;
|
wxString m_currentSearchPattern;
|
||||||
bool m_keepCvpcbOpen;
|
bool m_keepCvpcbOpen;
|
||||||
NETLIST m_netlist;
|
NETLIST m_netlist;
|
||||||
int m_filteringOptions;
|
int m_filteringOptions;
|
||||||
|
@ -66,6 +66,7 @@ class CVPCB_MAINFRAME : public KIWAY_PLAYER
|
||||||
FOOTPRINTS_LISTBOX* m_footprintListBox;
|
FOOTPRINTS_LISTBOX* m_footprintListBox;
|
||||||
LIBRARY_LISTBOX* m_libListBox;
|
LIBRARY_LISTBOX* m_libListBox;
|
||||||
COMPONENTS_LISTBOX* m_compListBox;
|
COMPONENTS_LISTBOX* m_compListBox;
|
||||||
|
wxTextCtrl* m_tcFilterString;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxArrayString m_ModuleLibNames;
|
wxArrayString m_ModuleLibNames;
|
||||||
|
@ -103,15 +104,12 @@ public:
|
||||||
*/
|
*/
|
||||||
void OnSelectComponent( wxListEvent& event );
|
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
|
* displays the footprint library table editing dialog and updates the global and local
|
||||||
* footprint tables accordingly.
|
* footprint tables accordingly.
|
||||||
*/
|
*/
|
||||||
void OnEditFootrprintLibraryTable( wxCommandEvent& event );
|
void OnEditFootprintLibraryTable( wxCommandEvent& event );
|
||||||
|
|
||||||
void OnQuit( wxCommandEvent& event );
|
void OnQuit( wxCommandEvent& event );
|
||||||
void OnCloseWindow( wxCloseEvent& Event );
|
void OnCloseWindow( wxCloseEvent& Event );
|
||||||
|
@ -130,15 +128,8 @@ public:
|
||||||
*/
|
*/
|
||||||
void DelAssociations( wxCommandEvent& event );
|
void DelAssociations( wxCommandEvent& event );
|
||||||
|
|
||||||
void SaveProjectFile( wxCommandEvent& aEvent );
|
|
||||||
void SaveQuitCvpcb( wxCommandEvent& event );
|
void SaveQuitCvpcb( wxCommandEvent& event );
|
||||||
|
|
||||||
/**
|
|
||||||
* Function OnEditLibraryTable
|
|
||||||
* envokes the footprint library table edit dialog.
|
|
||||||
*/
|
|
||||||
void OnEditFootprintLibraryTable( wxCommandEvent& aEvent );
|
|
||||||
|
|
||||||
void OnConfigurePaths( wxCommandEvent& aEvent );
|
void OnConfigurePaths( wxCommandEvent& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -169,11 +160,10 @@ public:
|
||||||
void OnSelectFilteringFootprint( wxCommandEvent& event );
|
void OnSelectFilteringFootprint( wxCommandEvent& event );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function OnUpdateKeepOpenOnSave
|
* Function OnEnterFilteringText
|
||||||
* Command event handler to choose if CvPcb will be closed as soon as the footprint
|
* Is called each time the text of m_tcFilterString is changed.
|
||||||
* association is saved, or if it is left open.
|
|
||||||
*/
|
*/
|
||||||
void OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event );
|
void OnEnterFilteringText( wxCommandEvent& event );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function SetNewPkg
|
* Function SetNewPkg
|
||||||
|
@ -212,10 +202,16 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function LoadProjectFile
|
* 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();
|
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 LoadSettings( wxConfigBase* aCfg ); // override virtual
|
||||||
|
|
||||||
void SaveSettings( wxConfigBase* aCfg ); // override virtual
|
void SaveSettings( wxConfigBase* aCfg ); // override virtual
|
||||||
|
@ -289,7 +285,9 @@ public:
|
||||||
const wxString GetSelectedFootprint();
|
const wxString GetSelectedFootprint();
|
||||||
|
|
||||||
private:
|
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 OnFilterFPbyKeywords( wxUpdateUIEvent& event );
|
||||||
void OnFilterFPbyPinCount( wxUpdateUIEvent& event );
|
void OnFilterFPbyPinCount( wxUpdateUIEvent& event );
|
||||||
void OnFilterFPbyLibrary( wxUpdateUIEvent& event );
|
void OnFilterFPbyLibrary( wxUpdateUIEvent& event );
|
||||||
|
@ -304,9 +302,7 @@ private:
|
||||||
*/
|
*/
|
||||||
int buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList, wxString * aErrorMessages = NULL );
|
int buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList, wxString * aErrorMessages = NULL );
|
||||||
|
|
||||||
void RefreshAfterComponentSearch (COMPONENT* component);
|
void refreshAfterComponentSearch (COMPONENT* component);
|
||||||
void SearchDialogAndStore();
|
|
||||||
|
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
|
@ -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 )
|
void DIALOG_CONFIG_EQUFILES::OnOkClick( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
// Save new equ file list if the files list was modified
|
// 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 ) );
|
m_Parent->m_EquFilesNames.Add( m_ListEquiv->GetString( ii ) );
|
||||||
|
|
||||||
wxCommandEvent evt( ID_SAVE_PROJECT );
|
wxCommandEvent evt( ID_SAVE_PROJECT );
|
||||||
m_Parent->SaveProjectFile( evt );
|
m_Parent->SaveProjectFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
EndModal( wxID_OK );
|
EndModal( wxID_OK );
|
||||||
|
|
|
@ -46,7 +46,6 @@ private:
|
||||||
// Virtual event handlers
|
// Virtual event handlers
|
||||||
void OnCloseWindow( wxCloseEvent& event );
|
void OnCloseWindow( wxCloseEvent& event );
|
||||||
void OnOkClick( wxCommandEvent& event );
|
void OnOkClick( wxCommandEvent& event );
|
||||||
void OnCancelClick( wxCommandEvent& event );
|
|
||||||
void OnAddFiles( wxCommandEvent& event );
|
void OnAddFiles( wxCommandEvent& event );
|
||||||
void OnEditEquFile( wxCommandEvent& event );
|
void OnEditEquFile( wxCommandEvent& event );
|
||||||
void OnRemoveFiles( wxCommandEvent& event );
|
void OnRemoveFiles( wxCommandEvent& event );
|
||||||
|
|
|
@ -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/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
|
@ -22,7 +22,7 @@ DIALOG_CONFIG_EQUFILES_BASE::DIALOG_CONFIG_EQUFILES_BASE( wxWindow* parent, wxWi
|
||||||
wxBoxSizer* bSizerFlist;
|
wxBoxSizer* bSizerFlist;
|
||||||
bSizerFlist = new wxBoxSizer( wxVERTICAL );
|
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 ) );
|
m_ListEquiv->SetMinSize( wxSize( 350,-1 ) );
|
||||||
|
|
||||||
bSizerFlist->Add( m_ListEquiv, 1, wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
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;
|
wxBoxSizer* bSizerButtons;
|
||||||
bSizerButtons = new wxBoxSizer( wxVERTICAL );
|
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 );
|
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") );
|
m_buttonRemoveEqu->SetToolTip( _("Unload the selected library") );
|
||||||
|
|
||||||
bSizerButtons->Add( m_buttonRemoveEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
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 );
|
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 );
|
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 );
|
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_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_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_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 );
|
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_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_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_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 );
|
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnOkClick ), NULL, this );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,6 +103,7 @@
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="name">sbEquivChoiceSizer</property>
|
<property name="name">sbEquivChoiceSizer</property>
|
||||||
<property name="orient">wxHORIZONTAL</property>
|
<property name="orient">wxHORIZONTAL</property>
|
||||||
|
<property name="parent">1</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
<event name="OnUpdateUI"></event>
|
<event name="OnUpdateUI"></event>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
|
@ -1093,7 +1094,7 @@
|
||||||
<property name="name">m_sdbSizer</property>
|
<property name="name">m_sdbSizer</property>
|
||||||
<property name="permission">protected</property>
|
<property name="permission">protected</property>
|
||||||
<event name="OnApplyButtonClick"></event>
|
<event name="OnApplyButtonClick"></event>
|
||||||
<event name="OnCancelButtonClick">OnCancelClick</event>
|
<event name="OnCancelButtonClick"></event>
|
||||||
<event name="OnContextHelpButtonClick"></event>
|
<event name="OnContextHelpButtonClick"></event>
|
||||||
<event name="OnHelpButtonClick"></event>
|
<event name="OnHelpButtonClick"></event>
|
||||||
<event name="OnNoButtonClick"></event>
|
<event name="OnNoButtonClick"></event>
|
||||||
|
|
|
@ -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/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// 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 OnButtonMoveUp( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void OnButtonMoveDown( wxCommandEvent& event ) { event.Skip(); }
|
virtual void OnButtonMoveDown( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void OnEditEquFile( 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(); }
|
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -118,12 +118,11 @@ public:
|
||||||
* @param aLibName is wxString containing the name of the selected library. Can be
|
* @param aLibName is wxString containing the name of the selected library. Can be
|
||||||
* wxEmptyString.
|
* wxEmptyString.
|
||||||
* @param aComponent is the #COMPONENT used by the filtering criteria. Can be NULL.
|
* @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.
|
* @param aFilterType defines the criteria to filter \a aList.
|
||||||
*/
|
*/
|
||||||
void SetFootprints( FOOTPRINT_LIST& aList, const wxString& aLibName,
|
void SetFootprints( FOOTPRINT_LIST& aList, const wxString& aLibName,
|
||||||
COMPONENT* aComponent, const wxString &footPrintName, int aFilterType );
|
COMPONENT* aComponent, const wxString &aFootPrintFilterPattern, int aFilterType );
|
||||||
|
|
||||||
// void searchByName (FOOTPRINT_LIST& aList, const wxString &footPrintName);
|
|
||||||
|
|
||||||
wxString GetSelectedFootprint();
|
wxString GetSelectedFootprint();
|
||||||
|
|
||||||
|
|
|
@ -75,14 +75,6 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
|
||||||
_( "&Close" ), _( "Close CvPcb" ),
|
_( "&Close" ), _( "Close CvPcb" ),
|
||||||
KiBitmap( exit_xpm ) );
|
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 :
|
// Preferences Menu :
|
||||||
wxMenu* preferencesMenu = new wxMenu;
|
wxMenu* preferencesMenu = new wxMenu;
|
||||||
|
|
||||||
|
@ -141,7 +133,6 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
|
||||||
|
|
||||||
// Create the menubar and append all submenus
|
// Create the menubar and append all submenus
|
||||||
menuBar->Append( filesMenu, _( "&Save" ) );
|
menuBar->Append( filesMenu, _( "&Save" ) );
|
||||||
menuBar->Append( findMenu, _( "&Find" ) );
|
|
||||||
menuBar->Append( preferencesMenu, _( "&Preferences" ) );
|
menuBar->Append( preferencesMenu, _( "&Preferences" ) );
|
||||||
menuBar->Append( helpMenu, _( "&Help" ) );
|
menuBar->Append( helpMenu, _( "&Help" ) );
|
||||||
|
|
||||||
|
|
|
@ -103,6 +103,7 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
|
||||||
_( "Filter footprint list by library" ),
|
_( "Filter footprint list by library" ),
|
||||||
wxEmptyString );
|
wxEmptyString );
|
||||||
|
|
||||||
|
m_mainToolBar->AddSeparator();
|
||||||
m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME,
|
m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME,
|
||||||
KiBitmap( module_name_filtered_list_xpm ),
|
KiBitmap( module_name_filtered_list_xpm ),
|
||||||
wxNullBitmap, true, NULL,
|
wxNullBitmap, true, NULL,
|
||||||
|
@ -110,6 +111,12 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
|
||||||
"Ctrl+F to call the dialog to enter the filter string" ),
|
"Ctrl+F to call the dialog to enter the filter string" ),
|
||||||
wxEmptyString );
|
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
|
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
|
||||||
m_mainToolBar->Realize();
|
m_mainToolBar->Realize();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue