53 GetSizer()->SetSizeHints(
this );
86 if( wxGetEnv(
m_gridEnvVars->GetCellValue( row, 0 ), &evValue ) )
97 wxString editorname =
Pgm().GetEditorName();
99 if( editorname.IsEmpty() )
101 wxMessageBox(
_(
"No editor defined in KiCad. Please choose it." ) );
105 wxArrayInt selections;
108 wxString fullFileNames, tmp;
110 for(
unsigned ii = 0; ii < selections.GetCount(); ii++ )
113 fullFileNames << wxT(
" \"" ) << wxExpandEnvVars( tmp ) << wxT(
"\"" );
131 for(
unsigned ii = 0; ii <
m_ListEquiv->GetCount(); ii++ )
135 Pgm().GetSettingsManager().SaveProject();
144 EndModal( wxID_CANCEL );
150 wxArrayInt selections;
154 if ( selections.GetCount() <= 0 )
157 if( selections[0] == 0 )
160 wxArrayString libnames =
m_ListEquiv->GetStrings();
162 for(
size_t ii = 0; ii < selections.GetCount(); ii++ )
164 int jj = selections[ii];
165 std::swap( libnames[jj], libnames[jj-1] );
171 for(
size_t ii = 0; ii < selections.GetCount(); ii++ )
173 int jj = selections[ii];
183 wxArrayInt selections;
186 if ( selections.GetCount() <= 0 )
190 if( selections.Last() == int(
m_ListEquiv->GetCount()-1 ) )
193 wxArrayString libnames =
m_ListEquiv->GetStrings();
195 for(
int ii = selections.GetCount()-1; ii >= 0; ii-- )
197 int jj = selections[ii];
198 std::swap( libnames[jj], libnames[jj+1] );
204 for(
size_t ii = 0; ii < selections.GetCount(); ii++ )
206 int jj = selections[ii];
219 wxArrayInt selections;
222 std::sort( selections.begin(), selections.end() );
224 for(
int ii = selections.GetCount()-1; ii >= 0; ii-- )
234 wxString equFilename;
243 int row = selectedRows.GetCount() ? selectedRows[0] :
246 libpath =
m_gridEnvVars->GetCellValue( wxGridCellCoords( row, 1 ) );
248 wxFileDialog FilesDialog(
this,
_(
"Footprint Association File" ), libpath,
250 wxFD_DEFAULT_STYLE | wxFD_MULTIPLE );
252 if( FilesDialog.ShowModal() != wxID_OK )
255 wxArrayString Filenames;
256 FilesDialog.GetPaths( Filenames );
258 for(
unsigned jj = 0; jj < Filenames.GetCount(); jj++ )
267 libpath =
m_gridEnvVars->GetCellValue( wxGridCellCoords( row, 1 ) );
269 if( fn.MakeRelativeTo( libpath ) )
271 equFilename.Printf( wxT(
"${%s}%c%s" ),
273 fn.GetPathSeparator(), fn.GetFullPath() );
279 if( equFilename.IsEmpty() )
280 equFilename = Filenames[jj];
283 if( list->FindString( equFilename, fn.IsCaseSensitive() ) == wxNOT_FOUND )
286 equFilename.Replace( wxT(
"\\" ), wxT(
"/" ) );
287 list->Append( equFilename );
292 msg.Printf(
_(
"File \"%s\" already exists in list" ), equFilename.GetData() );
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Container for project specific data.
This file is part of the common library TODO brief description.
This file is part of the common library.
virtual PROJECT_FILE & GetProjectFile() const
#define PROJECT_VAR_NAME
A variable name whose value holds the current project directory.
void OnEditEquFile(wxCommandEvent &event) override
void OnAddFiles(wxCommandEvent &event) override
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
PROJECT_FILE is the backing store for a PROJECT, in JSON format.
wxString EquFileWildcard()
void OnCloseWindow(wxCloseEvent &event) override
static const wxString GlobalPathEnvVariableName()
Return the name of the environment variable used to hold the directory of locally installed "KiCad sp...
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
void OnButtonMoveUp(wxCommandEvent &event) override
std::vector< wxString > m_EquivalenceFiles
CvPcb params.
Definition of file extensions used in Kicad.
virtual const wxString GetProjectFullName() const
Return the full path and name of the project.
bool isPathRelativeAllowed()
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Class DIALOG_CONFIG_EQUFILES_BASE.
CVPCB_MAINFRAME * m_Parent
void OnButtonMoveDown(wxCommandEvent &event) override
void OnOkClick(wxCommandEvent &event) override
DIALOG_CONFIG_EQUFILES(CVPCB_MAINFRAME *parent)
int ExecuteFile(wxWindow *frame, const wxString &ExecFile, const wxString ¶m, wxProcess *callback)
Call the executable file ExecFile with the command line parameters param.
void OnRemoveFiles(wxCommandEvent &event) override
The CvPcb application main window.