& aFileSet, int aCtl=0 ); // overload KIWAY_PLAYER
+
+ void KiwayMailIn( KIWAY_EXPRESS& aEvent ); // override virtual from KIWAY_PLAYER
+
+ /**
+ * @return a pointer on the Footprint Viewer frame, if exists, or NULL
+ */
+ DISPLAY_FOOTPRINTS_FRAME* GetFpViewerFrame();
+
+ /**
+ * Function OnSelectComponent
+ * Called when clicking on a component in component list window
+ * * Updates the filtered footprint list, if the filtered list option is selected
+ * * Updates the current selected footprint in footprint list
+ * * Updates the footprint shown in footprint display window (if opened)
+ */
+ void OnSelectComponent( wxListEvent& event );
+
+ /**
+ * Function OnEditFootrprintLibraryTable
+ * displays the footprint library table editing dialog and updates the global and local
+ * footprint tables accordingly.
+ */
+ void OnEditFootrprintLibraryTable( wxCommandEvent& event );
+
+ void OnQuit( wxCommandEvent& event );
+ void OnCloseWindow( wxCloseEvent& Event );
+ void OnSize( wxSizeEvent& SizeEvent );
+ void ReCreateHToolbar();
+ virtual void ReCreateMenuBar();
+
+ void ChangeFocus( bool aMoveRight );
+
+ void ToFirstNA( wxCommandEvent& event );
+ void ToPreviousNA( wxCommandEvent& event );
+
+ /**
+ * Function DelAssociations
+ * removes all component footprint associations already made
+ */
+ void DelAssociations( wxCommandEvent& event );
+
+ void SaveProjectFile( wxCommandEvent& aEvent );
+ void SaveQuitCvpcb( wxCommandEvent& event );
+
+ /**
+ * Function LoadNetList
+ * reads a netlist selected by user when clicking on load netlist button or any entry
+ * in the file history menu.
+ */
+ void LoadNetList( wxCommandEvent& event );
+
+ /**
+ * Function OnEditLibraryTable
+ * envokes the footprint library table edit dialog.
+ */
+ void OnEditFootprintLibraryTable( wxCommandEvent& aEvent );
+
+ void OnConfigurePaths( wxCommandEvent& aEvent );
+
+ /**
+ * Function OnEditEquFilesList
+ * envokes the equ files list edit dialog.
+ */
+ void OnEditEquFilesList( wxCommandEvent& aEvent );
+
+ void OnKeepOpenOnSave( wxCommandEvent& event );
+ void DisplayModule( wxCommandEvent& event );
+
+ /**
+ * Called by the automatic association button
+ * Read *.equ files to try to find corresponding footprint
+ * for each component that is not already linked to a footprint ( a "free"
+ * component )
+ * format of a line:
+ * 'cmp_ref' 'footprint_name'
+ */
+ void AutomaticFootprintMatching( wxCommandEvent& event );
+
+ /**
+ * Function OnSelectFilteringFootprint
+ * is the command event handler for enabling and disabling footprint filtering.
+ */
+ void OnSelectFilteringFootprint( wxCommandEvent& event );
+
+ void OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event );
+
+ /**
+ * Function SetNewPkg
+ * set the footprint name for all selected components in component list
+ * and selects the next component.
+ * @param aFootprintName = the new footprint name
+ */
+ void SetNewPkg( const wxString& aFootprintName );
+
+ /**
+ * Function SetNewPkg
+ * Set the footprint name for the component of position aIndex in the component list
+ *
+ * @param aFootprintName = the new footprint name
+ * @param aIndex = the index of the component to modify in the component list
+ */
+ void SetNewPkg( const wxString& aFootprintName, int aIndex );
+
+ void BuildCmpListBox();
+ void BuildFOOTPRINTS_LISTBOX();
+ void BuildLIBRARY_LISTBOX();
+
+ /**
+ * Create or Update the frame showing the current highlighted footprint
+ * and (if showed) the 3D display frame
+ */
+ void CreateScreenCmp();
+
+ /**
+ * Function SaveEdits
+ * saves the edits that the user has done by sending them back to eeschema
+ * via the kiway.
+ */
+ void SaveEdits();
+
+ /**
+ * Function ReadNetList
+ * reads the netlist (.net) file defined by #m_NetlistFileName.
+ * and the corresponding cmp to footprint (.cmp) link file
+ * @param aNetlist is the netlist from eeschema in kicad s-expr format.
+ */
+ bool ReadNetListAndLinkFiles( const std::string& aNetlist );
+
+ int ReadSchematicNetlist( const std::string& aNetlist );
+
+ /**
+ * Function LoadProjectFile
+ * reads the configuration parameter from the project (.pro) file \a aFileName
+ */
+ void LoadProjectFile();
+
+ void LoadSettings( wxConfigBase* aCfg ); // override virtual
+
+ void SaveSettings( wxConfigBase* aCfg ); // override virtual
+
+ /**
+ * Function DisplayStatus
+ * updates the information displayed on the status bar at bottom of the main frame.
+ *
+ * When the library or component list controls have the focus, the footprint assignment
+ * status of the components is displayed in the first status bar pane and the list of
+ * filters for the selected component is displayed in the second status bar pane. When
+ * the footprint list control has the focus, the description of the selected footprint is
+ * displayed in the first status bar pane and the key words for the selected footprint are
+ * displayed in the second status bar pane. The third status bar pane always displays the
+ * current footprint list filtering.
+ */
+ void DisplayStatus();
+
+ /**
+ * Function LoadFootprintFiles
+ * reads the list of footprint (*.mod files) and generate the list of footprints.
+ * for each module are stored
+ * the module name
+ * documentation string
+ * associated keywords
+ * m_ModuleLibNames is the list of library that must be read (loaded)
+ * fills m_footprints
+ * @return true if libraries are found, false otherwise.
+ */
+ bool LoadFootprintFiles();
+
+ /**
+ * Function GetProjectFileParameters
+ * return project file parameter list for CvPcb.
+ *
+ * Populate the project file parameter array specific to CvPcb if it hasn't
+ * already been populated and return a reference to the array to the caller.
+ * Creating the parameter list at run time has the advantage of being able
+ * to define local variables. The old method of statically building the array
+ * at compile time requiring global variable definitions.
+ *
+ *
+ * @return A reference to a PARAM_CFG_ARRAY contain the project settings for CvPcb.
+ */
+ PARAM_CFG_ARRAY& GetProjectFileParameters( void );
+
+ /**
+ * Function UpdateTitle
+ * sets the main window title bar text.
+ *
+ * If file name defined by CVPCB_MAINFRAME::m_NetlistFileName is not set, the title is
+ * set to the application name appended with no file. Otherwise, the title is set to
+ * the full path and file name and read only is appended to the title if the user does
+ * not have write access to the file.
+ */
+ void UpdateTitle();
+
+ /**
+ * Function SendMessageToEESCHEMA
+ * Send a remote command to Eeschema via a socket,
+ * Commands are
+ * $PART: "reference" put cursor on component anchor
+ */
+ void SendMessageToEESCHEMA();
+
+ COMPONENT* GetSelectedComponent();
+
+private:
+
+ /**
+ * read the .equ files and populate the list of equvalents
+ * @param aList the list to populate
+ * @param aErrorMessages is a pointer to a wxString to store error messages
+ * (can be NULL)
+ * @return the error count ( 0 = no error)
+ */
+ int buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList, wxString * aErrorMessages = NULL );
+
+ DECLARE_EVENT_TABLE()
+};
+
+#endif //#ifndef _CVPCB_MAINFRAME_H_
diff --git a/cvpcb/cvstruct.h b/cvpcb/cvstruct.h
new file mode 100644
index 0000000..90eb4ef
--- /dev/null
+++ b/cvpcb/cvstruct.h
@@ -0,0 +1,240 @@
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you may find one here:
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * or you may search the http://www.gnu.org website for the version 2 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/**
+ * @file cvstruct.h
+ */
+
+#ifndef CVSTRUCT_H
+#define CVSTRUCT_H
+
+#include
+
+
+/* Forward declarations of all top-level window classes. */
+class CVPCB_MAINFRAME;
+class COMPONENT;
+class FOOTPRINT_LIST;
+
+#define LISTBOX_STYLE ( wxSUNKEN_BORDER | wxLC_NO_HEADER | wxLC_REPORT | wxLC_VIRTUAL | \
+ wxVSCROLL | wxHSCROLL )
+
+/*********************************************************************/
+/* ListBox (base class) to display lists of components or footprints */
+/*********************************************************************/
+class ITEMS_LISTBOX_BASE : public wxListView
+{
+public:
+ ITEMS_LISTBOX_BASE( CVPCB_MAINFRAME* aParent, wxWindowID aId,
+ const wxPoint& aLocation, const wxSize& aSize,
+ long aStyle = 0 );
+
+ ~ITEMS_LISTBOX_BASE();
+
+ /**
+ * @return the index of the selected item in lists allowing only one item selected
+ * and the index of the first selected item in lists allowing many selection
+ */
+ int GetSelection();
+
+ /**
+ * Removes all selection in lists which can have more than one item selected
+ */
+ void DeselectAll();
+
+ virtual CVPCB_MAINFRAME* GetParent() const;
+
+ /* Function UpdateWidth
+ *
+ * Update the width of the column based on its contents.
+ *
+ * @param aLine is the line to calculate the width from. If positive, the
+ * width will only be increased if needed. If negative, we start from
+ * scratch and all lines are considered, i.e., the column may be shrunk.
+ */
+ void UpdateWidth( int aLine = -1 );
+
+private:
+ void UpdateLineWidth( unsigned aLine );
+
+ int columnWidth;
+};
+
+
+/******************************************/
+/* ListBox showing the list of footprints */
+/******************************************/
+class FOOTPRINTS_LISTBOX : public ITEMS_LISTBOX_BASE
+{
+private:
+ wxArrayString m_footprintList;
+
+public:
+ enum FP_FILTER_T
+ {
+ UNFILTERED = 0,
+ BY_COMPONENT = 0x0001,
+ BY_PIN_COUNT = 0x0002,
+ BY_LIBRARY = 0x0004,
+ };
+
+ FOOTPRINTS_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id,
+ const wxPoint& loc, const wxSize& size );
+ ~FOOTPRINTS_LISTBOX();
+
+ int GetCount();
+ void SetSelection( int index, bool State = true );
+ void SetString( unsigned linecount, const wxString& text );
+ void AppendLine( const wxString& text );
+
+ /**
+ * Function SetFootprints
+ * populates the wxListCtrl with the footprints from \a aList that meet the filter
+ * criteria defined by \a aFilterType.
+ *
+ * @param aList is a #FOOTPRINT_LIST item containing the footprints.
+ * @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 aFilterType defines the criteria to filter \a aList.
+ */
+ void SetFootprints( FOOTPRINT_LIST& aList, const wxString& aLibName,
+ COMPONENT* aComponent, int aFilterType );
+
+ wxString GetSelectedFootprint();
+
+ /**
+ * Function OnGetItemText
+ * this overloaded function MUST be provided for the wxLC_VIRTUAL mode
+ * because real data is not handled by ITEMS_LISTBOX_BASE
+ */
+ wxString OnGetItemText( long item, long column ) const;
+
+ // Events functions:
+ void OnLeftClick( wxListEvent& event );
+ void OnLeftDClick( wxListEvent& event );
+ void OnChar( wxKeyEvent& event );
+
+ DECLARE_EVENT_TABLE()
+};
+
+
+/******************************************/
+/* ListBox showing the list of library */
+/******************************************/
+class LIBRARY_LISTBOX : public ITEMS_LISTBOX_BASE
+{
+ wxArrayString m_libraryList;
+
+public:
+ LIBRARY_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id,
+ const wxPoint& loc, const wxSize& size );
+ ~LIBRARY_LISTBOX();
+
+ int GetCount();
+ void SetSelection( int index, bool State = true );
+ void SetString( unsigned linecount, const wxString& text );
+ void AppendLine( const wxString& text );
+ void SetLibraryList( const wxArrayString& aList );
+
+ wxString GetSelectedLibrary();
+ wxString OnGetItemText( long item, long column ) const;
+
+ // Events functions:
+ void OnLeftClick( wxListEvent& event );
+
+ void OnSelectLibrary( wxListEvent& event );
+
+ /**
+ * Function OnChar
+ * called on a key pressed
+ * Call default handler for some special keys,
+ * and for "ascii" keys, select the first footprint
+ * that the name starts by the letter.
+ * This is the defaut behaviour of a listbox, but because we use
+ * virtual lists, the listbox does not know anything to what is displayed,
+ * we must handle this behaviour here.
+ * Furthermore the footprint name is not at the beginning of
+ * displayed lines (the first word is the line number)
+ */
+ void OnChar( wxKeyEvent& event );
+
+ DECLARE_EVENT_TABLE()
+};
+
+
+/****************************************************/
+/* ListBox showing the list of schematic components */
+/****************************************************/
+class COMPONENTS_LISTBOX : public ITEMS_LISTBOX_BASE
+{
+public:
+ wxArrayString m_ComponentList;
+
+public:
+
+ COMPONENTS_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id,
+ const wxPoint& loc, const wxSize& size );
+
+ ~COMPONENTS_LISTBOX();
+
+ void Clear();
+ int GetCount();
+
+ /**
+ * Function OnGetItemText
+ * this overloaded function MUST be provided for the wxLC_VIRTUAL mode
+ * because real data is not handled by ITEMS_LISTBOX_BASE
+ */
+ wxString OnGetItemText( long item, long column ) const;
+
+ /*
+ * Enable or disable an item
+ */
+ void SetSelection( int index, bool State = true );
+ void SetString( unsigned linecount, const wxString& text );
+ void AppendLine( const wxString& text );
+
+ // Events functions:
+
+ /**
+ * Function OnChar
+ * called on a key pressed
+ * Call default handler for some special keys,
+ * and for "ascii" keys, select the first component
+ * that the name starts by the letter.
+ * This is the default behavior of a listbox, but because we use
+ * virtual lists, the listbox does not know anything to what is displayed,
+ * we must handle this behavior here.
+ * Furthermore the reference of components is not at the beginning of
+ * displayed lines (the first word is the line number)
+ */
+ void OnChar( wxKeyEvent& event );
+
+ void OnSelectComponent( wxListEvent& event );
+
+ DECLARE_EVENT_TABLE()
+};
+
+
+#endif //#ifndef CVSTRUCT_H
diff --git a/cvpcb/dialogs/dialog_config_equfiles.cpp b/cvpcb/dialogs/dialog_config_equfiles.cpp
new file mode 100644
index 0000000..3ae03fd
--- /dev/null
+++ b/cvpcb/dialogs/dialog_config_equfiles.cpp
@@ -0,0 +1,308 @@
+/**
+ * @file dialog_config_equfiles.cpp
+ */
+
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
+ * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you may find one here:
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * or you may search the http://www.gnu.org website for the version 2 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include // For PROJECT_VAR_NAME definition
+#include // For KISYSMOD definition
+
+#include
+#include
+
+#include
+#include
+
+
+DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES( CVPCB_MAINFRAME* aParent ) :
+ DIALOG_CONFIG_EQUFILES_BASE( aParent )
+{
+ m_Parent = aParent;
+ m_Config = Pgm().CommonSettings();
+
+ PROJECT& prj = Prj();
+ SetTitle( wxString::Format( _( "Project file: '%s'" ), GetChars( prj.GetProjectFullName() ) ) );
+
+ Init( );
+
+ GetSizer()->SetSizeHints( this );
+ Center();
+}
+
+void CVPCB_MAINFRAME::OnEditEquFilesList( wxCommandEvent& aEvent )
+{
+ DIALOG_CONFIG_EQUFILES dlg( this );
+
+ dlg.ShowModal();
+}
+
+
+void DIALOG_CONFIG_EQUFILES::Init()
+{
+ m_sdbSizerOK->SetDefault();
+ m_ListChanged = false;
+ m_ListEquiv->InsertItems( m_Parent->m_EquFilesNames, 0 );
+
+ if( getEnvVarCount() < 2 )
+ m_gridEnvVars->AppendRows(2 - getEnvVarCount() );
+
+ wxString evValue;
+ int row = 0;
+
+ m_gridEnvVars->SetCellValue( row++, 0, PROJECT_VAR_NAME );
+ m_gridEnvVars->SetCellValue( row, 0, FP_LIB_TABLE::GlobalPathEnvVariableName() );
+
+ for( row = 0; row < getEnvVarCount(); row++ )
+ {
+ if( wxGetEnv( m_gridEnvVars->GetCellValue( row, 0 ), &evValue ) )
+ m_gridEnvVars->SetCellValue( row, 1, evValue );
+ }
+
+ m_gridEnvVars->AutoSizeColumns();
+
+}
+
+void DIALOG_CONFIG_EQUFILES::OnEditEquFile( wxCommandEvent& event )
+{
+ wxString editorname = Pgm().GetEditorName();
+
+ if( editorname.IsEmpty() )
+ {
+ wxMessageBox( _( "No editor defined in Kicad. Please chose it" ) );
+ return;
+ }
+
+ wxArrayInt selections;
+ m_ListEquiv->GetSelections( selections );
+
+ wxString fullFileNames, tmp;
+
+ for( unsigned ii = 0; ii < selections.GetCount(); ii++ )
+ {
+ tmp = m_ListEquiv->GetString( selections[ii] );
+ fullFileNames << wxT( " \"" ) << wxExpandEnvVars( tmp ) << wxT( "\"" );
+ m_ListChanged = true;
+ }
+
+ ExecuteFile( this, editorname, fullFileNames );
+}
+
+
+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
+ if( m_ListChanged )
+ {
+ // Recreate equ list
+ m_Parent->m_EquFilesNames.Clear();
+
+ for( unsigned ii = 0; ii < m_ListEquiv->GetCount(); ii++ )
+ m_Parent->m_EquFilesNames.Add( m_ListEquiv->GetString( ii ) );
+
+ wxCommandEvent evt( ID_SAVE_PROJECT );
+ m_Parent->SaveProjectFile( evt );
+ }
+
+ EndModal( wxID_OK );
+}
+
+
+void DIALOG_CONFIG_EQUFILES::OnCloseWindow( wxCloseEvent& event )
+{
+ EndModal( wxID_CANCEL );
+}
+
+
+/********************************************************************/
+void DIALOG_CONFIG_EQUFILES::OnButtonMoveUp( wxCommandEvent& event )
+/********************************************************************/
+{
+ wxArrayInt selections;
+
+ m_ListEquiv->GetSelections( selections );
+
+ if ( selections.GetCount() <= 0 ) // No selection.
+ return;
+
+ if( selections[0] == 0 ) // The first lib is selected. cannot move up it
+ return;
+
+ wxArrayString libnames = m_ListEquiv->GetStrings();
+
+ for( size_t ii = 0; ii < selections.GetCount(); ii++ )
+ {
+ int jj = selections[ii];
+ std::swap( libnames[jj], libnames[jj-1] );
+ }
+
+ m_ListEquiv->Set( libnames );
+
+ // Reselect previously selected names
+ for( size_t ii = 0; ii < selections.GetCount(); ii++ )
+ {
+ int jj = selections[ii];
+ m_ListEquiv->SetSelection( jj-1 );
+ }
+
+ m_ListChanged = true;
+}
+
+
+/*********************************************************************/
+void DIALOG_CONFIG_EQUFILES::OnButtonMoveDown( wxCommandEvent& event )
+/*********************************************************************/
+{
+ wxArrayInt selections;
+ m_ListEquiv->GetSelections( selections );
+
+ if ( selections.GetCount() <= 0 ) // No selection.
+ return;
+
+ // The last lib is selected. cannot move down it
+ if( selections.Last() == int( m_ListEquiv->GetCount()-1 ) )
+ return;
+
+ wxArrayString libnames = m_ListEquiv->GetStrings();
+
+ for( int ii = selections.GetCount()-1; ii >= 0; ii-- )
+ {
+ int jj = selections[ii];
+ std::swap( libnames[jj], libnames[jj+1]);
+ }
+
+ m_ListEquiv->Set( libnames );
+
+ // Reselect previously selected names
+ for( size_t ii = 0; ii < selections.GetCount(); ii++ )
+ {
+ int jj = selections[ii];
+ m_ListEquiv->SetSelection(jj+1);
+ }
+
+ m_ListChanged = true;
+}
+
+
+/* Remove a library to the library list.
+ * The real list (g_LibName_List) is not changed, so the change can be canceled
+ */
+void DIALOG_CONFIG_EQUFILES::OnRemoveFiles( wxCommandEvent& event )
+{
+ wxArrayInt selections;
+ m_ListEquiv->GetSelections( selections );
+
+ std::sort( selections.begin(), selections.end() );
+
+ for( int ii = selections.GetCount()-1; ii >= 0; ii-- )
+ {
+ m_ListEquiv->Delete(selections[ii] );
+ m_ListChanged = true;
+ }
+}
+
+
+/* Insert or add a library to the library list:
+ * The new library is put in list before (insert button) the selection,
+ * or added (add button) to end of list
+ */
+void DIALOG_CONFIG_EQUFILES::OnAddFiles( wxCommandEvent& event )
+{
+ wxString equFilename, wildcard;
+ wxFileName fn;
+
+ wildcard = EquFilesWildcard;
+ wxListBox* list = m_ListEquiv;
+
+ // Get a default path to open the file dialog:
+ wxString libpath;
+ wxArrayInt selectedRows = m_gridEnvVars->GetSelectedRows();
+
+ int row = selectedRows.GetCount() ? selectedRows[0] :
+ m_gridEnvVars->GetGridCursorRow();
+
+ libpath = m_gridEnvVars->GetCellValue( wxGridCellCoords( row, 1 ) );
+
+ wxFileDialog FilesDialog( this, _( "Equ files:" ), libpath,
+ wxEmptyString, wildcard,
+ wxFD_DEFAULT_STYLE | wxFD_MULTIPLE );
+
+ if( FilesDialog.ShowModal() != wxID_OK )
+ return;
+
+ wxArrayString Filenames;
+ FilesDialog.GetPaths( Filenames );
+
+ for( unsigned jj = 0; jj < Filenames.GetCount(); jj++ )
+ {
+ fn = Filenames[jj];
+ equFilename.Empty();
+
+ if( isPathRelativeAllowed() ) // try to use relative path
+ {
+ for( row = 0; row < getEnvVarCount(); row++ )
+ {
+ libpath = m_gridEnvVars->GetCellValue( wxGridCellCoords( row, 1 ) );
+
+ if( fn.MakeRelativeTo( libpath ) )
+ {
+ equFilename.Printf( wxT("${%s}%c%s"),
+ GetChars( m_gridEnvVars->GetCellValue( wxGridCellCoords( row, 0 ) ) ),
+ fn.GetPathSeparator(),
+ GetChars( fn.GetFullPath() ) );
+ break;
+ }
+ }
+ }
+
+ if( equFilename.IsEmpty() )
+ equFilename = Filenames[jj];
+
+ // Add or insert new library name, if not already in list
+ if( list->FindString( equFilename, fn.IsCaseSensitive() ) == wxNOT_FOUND )
+ {
+ m_ListChanged = true;
+ equFilename.Replace( wxT("\\"), wxT("/") ); // Use unix separators only.
+ list->Append( equFilename );
+ }
+ else
+ {
+ wxString msg;
+ msg.Printf( _( "File '%s' already exists in list" ), equFilename.GetData() );
+ DisplayError( this, msg );
+ }
+ }
+}
diff --git a/cvpcb/dialogs/dialog_config_equfiles.h b/cvpcb/dialogs/dialog_config_equfiles.h
new file mode 100644
index 0000000..aeb4868
--- /dev/null
+++ b/cvpcb/dialogs/dialog_config_equfiles.h
@@ -0,0 +1,71 @@
+/**
+ * @file dialog_config_equfiles.h
+ */
+
+/*
+ * This program source code file is part of KICAD, a free EDA CAD application.
+ *
+ * Copyright (C) 2010-2015 Jean-Pierre Charras jp.charras at wanadoo.fr
+ * Copyright (C) 1992-2015 Kicad Developers, see CHANGELOG.TXT for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you may find one here:
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * or you may search the http://www.gnu.org website for the version 2 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _DIALOG_CONFIG_EQUFILES_H_
+#define _DIALOG_CONFIG_EQUFILES_H_
+
+#include
+
+class DIALOG_CONFIG_EQUFILES : public DIALOG_CONFIG_EQUFILES_BASE
+{
+private:
+ CVPCB_MAINFRAME* m_Parent;
+ wxConfigBase* m_Config;
+ wxString m_UserLibDirBufferImg;
+
+ bool m_ListChanged;
+
+private:
+ void Init();
+
+ // 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 );
+ void OnButtonMoveUp( wxCommandEvent& event );
+ void OnButtonMoveDown( wxCommandEvent& event );
+
+ int getEnvVarCount() // Get the number of rows in env var table
+ {
+ return m_gridEnvVars->GetTable()->GetRowsCount();
+ }
+
+ bool isPathRelativeAllowed()
+ {
+ return m_rbPathOptionChoice->GetSelection() == 1;
+ }
+
+public:
+ DIALOG_CONFIG_EQUFILES( CVPCB_MAINFRAME* parent );
+ ~DIALOG_CONFIG_EQUFILES() {};
+};
+
+#endif // _DIALOG_CONFIG_EQUFILES_H_
diff --git a/cvpcb/dialogs/dialog_config_equfiles_base.cpp b/cvpcb/dialogs/dialog_config_equfiles_base.cpp
new file mode 100644
index 0000000..e4b8a8c
--- /dev/null
+++ b/cvpcb/dialogs/dialog_config_equfiles_base.cpp
@@ -0,0 +1,151 @@
+///////////////////////////////////////////////////////////////////////////
+// C++ code generated with wxFormBuilder (version Jun 5 2014)
+// http://www.wxformbuilder.org/
+//
+// PLEASE DO "NOT" EDIT THIS FILE!
+///////////////////////////////////////////////////////////////////////////
+
+#include "dialog_config_equfiles_base.h"
+
+///////////////////////////////////////////////////////////////////////////
+
+DIALOG_CONFIG_EQUFILES_BASE::DIALOG_CONFIG_EQUFILES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
+{
+ this->SetSizeHints( wxDefaultSize, wxDefaultSize );
+
+ wxBoxSizer* bMainSizer;
+ bMainSizer = new wxBoxSizer( wxVERTICAL );
+
+ wxStaticBoxSizer* sbEquivChoiceSizer;
+ sbEquivChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint/Component equ files (.equ files)") ), wxHORIZONTAL );
+
+ 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->SetMinSize( wxSize( 350,-1 ) );
+
+ bSizerFlist->Add( m_ListEquiv, 1, wxRIGHT|wxLEFT|wxEXPAND, 5 );
+
+
+ sbEquivChoiceSizer->Add( bSizerFlist, 1, wxEXPAND, 5 );
+
+ wxBoxSizer* bSizerButtons;
+ bSizerButtons = new wxBoxSizer( wxVERTICAL );
+
+ m_buttonAddEqu = new wxButton( this, 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->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 );
+ 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 );
+ 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 );
+ bSizerButtons->Add( m_buttonEdit, 0, wxALL|wxEXPAND, 5 );
+
+
+ sbEquivChoiceSizer->Add( bSizerButtons, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+
+ bMainSizer->Add( sbEquivChoiceSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
+
+ wxBoxSizer* bSizerLower;
+ bSizerLower = new wxBoxSizer( wxHORIZONTAL );
+
+ wxBoxSizer* bSizerEnvVar;
+ bSizerEnvVar = new wxBoxSizer( wxVERTICAL );
+
+ m_staticText2 = new wxStaticText( this, wxID_ANY, _("Available environment variables for relative paths:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText2->Wrap( -1 );
+ bSizerEnvVar->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
+
+ m_gridEnvVars = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
+
+ // Grid
+ m_gridEnvVars->CreateGrid( 2, 2 );
+ m_gridEnvVars->EnableEditing( true );
+ m_gridEnvVars->EnableGridLines( true );
+ m_gridEnvVars->EnableDragGridSize( false );
+ m_gridEnvVars->SetMargins( 0, 0 );
+
+ // Columns
+ m_gridEnvVars->EnableDragColMove( false );
+ m_gridEnvVars->EnableDragColSize( true );
+ m_gridEnvVars->SetColLabelSize( 25 );
+ m_gridEnvVars->SetColLabelValue( 0, _("Name") );
+ m_gridEnvVars->SetColLabelValue( 1, _("Value") );
+ m_gridEnvVars->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
+
+ // Rows
+ m_gridEnvVars->AutoSizeRows();
+ m_gridEnvVars->EnableDragRowSize( true );
+ m_gridEnvVars->SetRowLabelSize( 30 );
+ m_gridEnvVars->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
+
+ // Label Appearance
+
+ // Cell Defaults
+ m_gridEnvVars->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
+ bSizerEnvVar->Add( m_gridEnvVars, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
+
+
+ bSizerLower->Add( bSizerEnvVar, 1, wxEXPAND, 5 );
+
+ wxString m_rbPathOptionChoiceChoices[] = { _("Absolute path"), _("Relative path") };
+ int m_rbPathOptionChoiceNChoices = sizeof( m_rbPathOptionChoiceChoices ) / sizeof( wxString );
+ m_rbPathOptionChoice = new wxRadioBox( this, wxID_ANY, _("Path option:"), wxDefaultPosition, wxDefaultSize, m_rbPathOptionChoiceNChoices, m_rbPathOptionChoiceChoices, 1, wxRA_SPECIFY_COLS );
+ m_rbPathOptionChoice->SetSelection( 1 );
+ bSizerLower->Add( m_rbPathOptionChoice, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
+
+
+ bMainSizer->Add( bSizerLower, 0, wxEXPAND, 5 );
+
+ m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
+ bMainSizer->Add( m_staticline2, 0, wxEXPAND|wxALL, 5 );
+
+ m_sdbSizer = new wxStdDialogButtonSizer();
+ m_sdbSizerOK = new wxButton( this, wxID_OK );
+ m_sdbSizer->AddButton( m_sdbSizerOK );
+ m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
+ m_sdbSizer->AddButton( m_sdbSizerCancel );
+ m_sdbSizer->Realize();
+
+ bMainSizer->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 );
+
+
+ this->SetSizer( bMainSizer );
+ this->Layout();
+
+ this->Centre( wxBOTH );
+
+ // Connect Events
+ this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnCloseWindow ) );
+ m_buttonAddEqu->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnAddFiles ), NULL, this );
+ m_buttonRemoveEqu->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnRemoveFiles ), 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_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 );
+}
+
+DIALOG_CONFIG_EQUFILES_BASE::~DIALOG_CONFIG_EQUFILES_BASE()
+{
+ // Disconnect Events
+ this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnCloseWindow ) );
+ m_buttonAddEqu->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnAddFiles ), NULL, this );
+ m_buttonRemoveEqu->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnRemoveFiles ), 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_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
new file mode 100644
index 0000000..38e625e
--- /dev/null
+++ b/cvpcb/dialogs/dialog_config_equfiles_base.fbp
@@ -0,0 +1,1108 @@
+
+
+
+
+
diff --git a/cvpcb/dialogs/dialog_config_equfiles_base.h b/cvpcb/dialogs/dialog_config_equfiles_base.h
new file mode 100644
index 0000000..2220da5
--- /dev/null
+++ b/cvpcb/dialogs/dialog_config_equfiles_base.h
@@ -0,0 +1,82 @@
+///////////////////////////////////////////////////////////////////////////
+// C++ code generated with wxFormBuilder (version Jun 5 2014)
+// http://www.wxformbuilder.org/
+//
+// PLEASE DO "NOT" EDIT THIS FILE!
+///////////////////////////////////////////////////////////////////////////
+
+#ifndef __DIALOG_CONFIG_EQUFILES_BASE_H__
+#define __DIALOG_CONFIG_EQUFILES_BASE_H__
+
+#include
+#include
+#include
+class DIALOG_SHIM;
+
+#include "dialog_shim.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+///////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////////////////
+/// Class DIALOG_CONFIG_EQUFILES_BASE
+///////////////////////////////////////////////////////////////////////////////
+class DIALOG_CONFIG_EQUFILES_BASE : public DIALOG_SHIM
+{
+ private:
+
+ protected:
+ enum
+ {
+ ID_ADD_EQU = 1000,
+ ID_REMOVE_EQU,
+ ID_EQU_UP,
+ ID_EQU_DOWN
+ };
+
+ wxListBox* m_ListEquiv;
+ wxButton* m_buttonAddEqu;
+ wxButton* m_buttonRemoveEqu;
+ wxButton* m_buttonMoveUp;
+ wxButton* m_buttonMoveDown;
+ wxButton* m_buttonEdit;
+ wxStaticText* m_staticText2;
+ wxGrid* m_gridEnvVars;
+ wxRadioBox* m_rbPathOptionChoice;
+ wxStaticLine* m_staticline2;
+ wxStdDialogButtonSizer* m_sdbSizer;
+ wxButton* m_sdbSizerOK;
+ wxButton* m_sdbSizerCancel;
+
+ // Virtual event handlers, overide them in your derived class
+ virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
+ virtual void OnAddFiles( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnRemoveFiles( wxCommandEvent& event ) { event.Skip(); }
+ 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(); }
+
+
+ public:
+
+ DIALOG_CONFIG_EQUFILES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 454,338 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+ ~DIALOG_CONFIG_EQUFILES_BASE();
+
+};
+
+#endif //__DIALOG_CONFIG_EQUFILES_BASE_H__
diff --git a/cvpcb/dialogs/dialog_cvpcb_config_fbp.h b/cvpcb/dialogs/dialog_cvpcb_config_fbp.h
new file mode 100644
index 0000000..7481dcd
--- /dev/null
+++ b/cvpcb/dialogs/dialog_cvpcb_config_fbp.h
@@ -0,0 +1,100 @@
+///////////////////////////////////////////////////////////////////////////
+// C++ code generated with wxFormBuilder (version Apr 10 2012)
+// http://www.wxformbuilder.org/
+//
+// PLEASE DO "NOT" EDIT THIS FILE!
+///////////////////////////////////////////////////////////////////////////
+
+#ifndef __DIALOG_CVPCB_CONFIG_FBP_H__
+#define __DIALOG_CVPCB_CONFIG_FBP_H__
+
+#include
+#include
+#include
+#include "dialog_shim.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+///////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////////////////
+/// Class DIALOG_CVPCB_CONFIG_FBP
+///////////////////////////////////////////////////////////////////////////////
+class DIALOG_CVPCB_CONFIG_FBP : public DIALOG_SHIM
+{
+ private:
+
+ protected:
+ enum
+ {
+ ID_ADD_LIB = 1000,
+ ID_INSERT_LIB,
+ ID_REMOVE_LIB,
+ ID_LIB_UP,
+ ID_LIB_DOWN,
+ ID_ADD_EQU,
+ ID_INSERT_EQU,
+ ID_REMOVE_EQU,
+ ID_EQU_UP,
+ ID_EQU_DOWN,
+ ID_BROWSE_MOD_DOC,
+ ID_LIB_PATH_SEL,
+ ID_INSERT_PATH,
+ ID_REMOVE_PATH
+ };
+
+ wxListBox* m_ListLibr;
+ wxButton* m_buttonAddLib;
+ wxButton* m_buttonInsLib;
+ wxButton* m_buttonRemoveLib;
+ wxButton* m_buttonLibUp;
+ wxButton* m_buttonLibDown;
+ wxListBox* m_ListEquiv;
+ wxButton* m_buttonAddEqu;
+ wxButton* m_buttonInsEqu;
+ wxButton* m_buttonRemoveEqu;
+ wxButton* m_buttonEquUp;
+ wxButton* m_buttonEquDown;
+ wxTextCtrl* m_TextHelpModulesFileName;
+ wxButton* m_buttonModDoc;
+ wxListBox* m_listUserPaths;
+ wxButton* m_buttonAddPath;
+ wxButton* m_buttonInsPath;
+ wxButton* m_buttonRemovePath;
+ wxListBox* m_DefaultLibraryPathslistBox;
+ wxStaticLine* m_staticline2;
+ wxStdDialogButtonSizer* m_sdbSizer2;
+ wxButton* m_sdbSizer2OK;
+ wxButton* m_sdbSizer2Cancel;
+
+ // Virtual event handlers, overide them in your derived class
+ virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
+ virtual void OnAddOrInsertLibClick( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnRemoveLibClick( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnButtonUpClick( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnButtonDownClick( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnBrowseModDocFile( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnAddOrInsertPath( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnRemoveUserPath( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
+
+
+ public:
+
+ DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 570,625 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+ ~DIALOG_CVPCB_CONFIG_FBP();
+
+};
+
+#endif //__DIALOG_CVPCB_CONFIG_FBP_H__
diff --git a/cvpcb/dialogs/dialog_display_options.cpp b/cvpcb/dialogs/dialog_display_options.cpp
new file mode 100644
index 0000000..9911ebc
--- /dev/null
+++ b/cvpcb/dialogs/dialog_display_options.cpp
@@ -0,0 +1,136 @@
+/**
+ * @file cvpcb/dialogs/dialog_display_options.cpp
+ */
+
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you may find one here:
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * or you may search the http://www.gnu.org website for the version 2 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+
+void DISPLAY_FOOTPRINTS_FRAME::InstallOptionsDisplay( wxCommandEvent& event )
+{
+ DIALOG_FOOTPRINTS_DISPLAY_OPTIONS* OptionWindow =
+ new DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( this );
+
+ OptionWindow->ShowModal();
+ OptionWindow->Destroy();
+}
+
+
+DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( PCB_BASE_FRAME* parent )
+ : DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( parent )
+{
+ m_Parent = parent;
+
+ initDialog();
+ m_sdbSizer1OK->SetDefault();
+ GetSizer()->SetSizeHints( this );
+ Centre();
+}
+
+DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::~DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( )
+{
+}
+
+
+/*!
+ * Control creation for DIALOG_FOOTPRINTS_DISPLAY_OPTIONS
+ */
+
+void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::initDialog()
+{
+ /* mandatory to use escape key as cancel under wxGTK. */
+ SetFocus();
+
+ DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)m_Parent->GetDisplayOptions();
+
+ m_EdgesDisplayOption->SetValue( not displ_opts->m_DisplayModEdgeFill );
+ m_TextDisplayOption->SetValue( not displ_opts->m_DisplayModTextFill );
+ m_ShowPadSketch->SetValue( not displ_opts->m_DisplayPadFill );
+ m_ShowPadNum->SetValue( displ_opts->m_DisplayPadNum );
+ m_IsZoomNoCenter->SetValue( m_Parent->GetCanvas()->GetEnableZoomNoCenter() );
+ m_IsMiddleButtonPan->SetValue( m_Parent->GetCanvas()->GetEnableMiddleButtonPan() );
+ m_IsMiddleButtonPanLimited->SetValue( m_Parent->GetCanvas()->GetMiddleButtonPanLimited() );
+ m_IsMiddleButtonPanLimited->Enable( m_IsMiddleButtonPan->GetValue() );
+}
+
+
+
+/*!
+ * Update settings related to edges, text strings, and pads
+ */
+
+void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings( void )
+{
+ DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)m_Parent->GetDisplayOptions();
+
+ displ_opts->m_DisplayModEdgeFill = not m_EdgesDisplayOption->GetValue();
+ displ_opts->m_DisplayModTextFill = not m_TextDisplayOption->GetValue();
+ displ_opts->m_DisplayPadNum = m_ShowPadNum->GetValue();
+ displ_opts->m_DisplayPadFill = not m_ShowPadSketch->GetValue();
+ m_Parent->GetCanvas()->SetEnableZoomNoCenter( m_IsZoomNoCenter->GetValue() );
+ m_Parent->GetCanvas()->SetEnableMiddleButtonPan( m_IsMiddleButtonPan->GetValue() );
+ m_Parent->GetCanvas()->SetMiddleButtonPanLimited( m_IsMiddleButtonPanLimited->GetValue() );
+ m_Parent->GetCanvas()->Refresh();
+}
+
+
+/*!
+ * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
+ */
+
+void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::OnOkClick( wxCommandEvent& event )
+{
+ UpdateObjectSettings();
+ EndModal( 1 );
+}
+
+
+/*!
+ * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
+ */
+
+void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::OnCancelClick( wxCommandEvent& event )
+{
+ EndModal( -1 );
+}
+
+
+/*!
+ * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_APPLY
+ */
+
+void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::OnApplyClick( wxCommandEvent& event )
+{
+ UpdateObjectSettings();
+}
diff --git a/cvpcb/dialogs/dialog_display_options.h b/cvpcb/dialogs/dialog_display_options.h
new file mode 100644
index 0000000..fada3f0
--- /dev/null
+++ b/cvpcb/dialogs/dialog_display_options.h
@@ -0,0 +1,61 @@
+/**
+ * @file cvpcb/dialogs/dialog_display_options.h
+ */
+
+#ifndef _DIALOG_DISPLAY_OPTIONS_H_
+#define _DIALOG_DISPLAY_OPTIONS_H_
+
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you may find one here:
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * or you may search the http://www.gnu.org website for the version 2 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include
+
+/* Class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS
+ * derived from DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE,
+ * created by wxformBuilder
+*/
+
+class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS :
+ public DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
+{
+private:
+PCB_BASE_FRAME * m_Parent;
+
+public:
+ DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( PCB_BASE_FRAME* parent );
+ ~DIALOG_FOOTPRINTS_DISPLAY_OPTIONS();
+
+
+private:
+ void initDialog( );
+ void UpdateObjectSettings( void );
+ void OnApplyClick( wxCommandEvent& event );
+ void OnCancelClick( wxCommandEvent& event );
+ void OnOkClick( wxCommandEvent& event );
+ void OnMiddleBtnPanEnbl( wxCommandEvent& event )
+ {
+ m_IsMiddleButtonPanLimited->Enable( m_IsMiddleButtonPan->GetValue() );
+ }
+};
+
+#endif // _DIALOG_DISPLAY_OPTIONS_H_
diff --git a/cvpcb/dialogs/dialog_display_options_base.cpp b/cvpcb/dialogs/dialog_display_options_base.cpp
new file mode 100644
index 0000000..99be007
--- /dev/null
+++ b/cvpcb/dialogs/dialog_display_options_base.cpp
@@ -0,0 +1,93 @@
+///////////////////////////////////////////////////////////////////////////
+// C++ code generated with wxFormBuilder (version Jun 5 2014)
+// http://www.wxformbuilder.org/
+//
+// PLEASE DO "NOT" EDIT THIS FILE!
+///////////////////////////////////////////////////////////////////////////
+
+#include "dialog_display_options_base.h"
+
+///////////////////////////////////////////////////////////////////////////
+
+DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
+{
+ this->SetSizeHints( wxDefaultSize, wxDefaultSize );
+
+ wxBoxSizer* bSizerMain;
+ bSizerMain = new wxBoxSizer( wxVERTICAL );
+
+ wxBoxSizer* bUpperSizer;
+ bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
+
+ wxStaticBoxSizer* sbSizerDrawMode;
+ sbSizerDrawMode = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Draw options") ), wxVERTICAL );
+
+ m_EdgesDisplayOption = new wxCheckBox( this, wxID_ANY, _("Graphic items sketch mode"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbSizerDrawMode->Add( m_EdgesDisplayOption, 0, wxALL, 5 );
+
+ m_TextDisplayOption = new wxCheckBox( this, wxID_ANY, _("Texts sketch mode"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbSizerDrawMode->Add( m_TextDisplayOption, 0, wxALL, 5 );
+
+ m_ShowPadSketch = new wxCheckBox( this, ID_PADFILL_OPT, _("Pad sketch mode"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbSizerDrawMode->Add( m_ShowPadSketch, 0, wxEXPAND|wxALL, 5 );
+
+ m_ShowPadNum = new wxCheckBox( this, wxID_ANY, _("Show pad &number"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbSizerDrawMode->Add( m_ShowPadNum, 0, wxALL|wxEXPAND, 5 );
+
+
+ bUpperSizer->Add( sbSizerDrawMode, 1, wxEXPAND|wxALL, 5 );
+
+ wxStaticBoxSizer* sbSizerViewOpt;
+ sbSizerViewOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pan and Zoom") ), wxVERTICAL );
+
+ m_IsZoomNoCenter = new wxCheckBox( this, wxID_ANY, _("Do not center and warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_IsZoomNoCenter->SetToolTip( _("Keep the cursor at its current location when zooming") );
+
+ sbSizerViewOpt->Add( m_IsZoomNoCenter, 0, wxEXPAND|wxALL, 5 );
+
+ m_IsMiddleButtonPan = new wxCheckBox( this, wxID_ANY, _("Use middle mouse button to pan"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbSizerViewOpt->Add( m_IsMiddleButtonPan, 0, wxEXPAND|wxALL, 5 );
+
+ m_IsMiddleButtonPanLimited = new wxCheckBox( this, wxID_ANY, _("Limit panning to scroll size"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbSizerViewOpt->Add( m_IsMiddleButtonPanLimited, 0, wxALL|wxEXPAND, 5 );
+
+
+ bUpperSizer->Add( sbSizerViewOpt, 1, wxALL|wxEXPAND, 5 );
+
+
+ bSizerMain->Add( bUpperSizer, 1, wxEXPAND, 5 );
+
+ m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
+ bSizerMain->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
+
+ m_sdbSizer1 = new wxStdDialogButtonSizer();
+ m_sdbSizer1OK = new wxButton( this, wxID_OK );
+ m_sdbSizer1->AddButton( m_sdbSizer1OK );
+ m_sdbSizer1Apply = new wxButton( this, wxID_APPLY );
+ m_sdbSizer1->AddButton( m_sdbSizer1Apply );
+ m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
+ m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
+ m_sdbSizer1->Realize();
+
+ bSizerMain->Add( m_sdbSizer1, 0, wxEXPAND|wxALL, 5 );
+
+
+ this->SetSizer( bSizerMain );
+ this->Layout();
+
+ // Connect Events
+ m_IsMiddleButtonPan->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnMiddleBtnPanEnbl ), NULL, this );
+ m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnApplyClick ), NULL, this );
+ m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnCancelClick ), NULL, this );
+ m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnOkClick ), NULL, this );
+}
+
+DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::~DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE()
+{
+ // Disconnect Events
+ m_IsMiddleButtonPan->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnMiddleBtnPanEnbl ), NULL, this );
+ m_sdbSizer1Apply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnApplyClick ), NULL, this );
+ m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnCancelClick ), NULL, this );
+ m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnOkClick ), NULL, this );
+
+}
diff --git a/cvpcb/dialogs/dialog_display_options_base.fbp b/cvpcb/dialogs/dialog_display_options_base.fbp
new file mode 100644
index 0000000..1a7fb17
--- /dev/null
+++ b/cvpcb/dialogs/dialog_display_options_base.fbp
@@ -0,0 +1,861 @@
+
+
+
+
+
+ C++
+ 1
+ source_name
+ 0
+ 0
+ res
+ UTF-8
+ connect
+ dialog_display_options_base
+ 1000
+ none
+ 1
+ dialog_display_options_base
+
+ .
+
+ 1
+ 1
+ 1
+ 1
+ UI
+ 0
+ 0
+
+ 0
+ wxAUI_MGR_DEFAULT
+
+
+
+ 1
+ 1
+ impl_virtual
+
+
+
+ 0
+ wxID_ANY
+
+
+ DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
+
+ 425,206
+ wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER
+ DIALOG_SHIM; dialog_shim.h
+ Display Options
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ bSizerMain
+ wxVERTICAL
+ none
+
+ 5
+ wxEXPAND
+ 1
+
+
+ bUpperSizer
+ wxHORIZONTAL
+ none
+
+ 5
+ wxEXPAND|wxALL
+ 1
+
+ wxID_ANY
+ Draw options
+
+ sbSizerDrawMode
+ wxVERTICAL
+ none
+
+
+ 5
+ wxALL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Graphic items sketch mode
+
+ 0
+
+
+ 0
+
+ 1
+ m_EdgesDisplayOption
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxALL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Texts sketch mode
+
+ 0
+
+
+ 0
+
+ 1
+ m_TextDisplayOption
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxEXPAND|wxALL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ ID_PADFILL_OPT
+ Pad sketch mode
+
+ 0
+
+
+ 0
+
+ 1
+ m_ShowPadSketch
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxALL|wxEXPAND
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Show pad &number
+
+ 0
+
+
+ 0
+
+ 1
+ m_ShowPadNum
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxALL|wxEXPAND
+ 1
+
+ wxID_ANY
+ Pan and Zoom
+
+ sbSizerViewOpt
+ wxVERTICAL
+ none
+
+
+ 5
+ wxEXPAND|wxALL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Do not center and warp cursor on zoom
+
+ 0
+
+
+ 0
+
+ 1
+ m_IsZoomNoCenter
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+ Keep the cursor at its current location when zooming
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxEXPAND|wxALL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Use middle mouse button to pan
+
+ 0
+
+
+ 0
+
+ 1
+ m_IsMiddleButtonPan
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+ OnMiddleBtnPanEnbl
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxALL|wxEXPAND
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Limit panning to scroll size
+
+ 0
+
+
+ 0
+
+ 1
+ m_IsMiddleButtonPanLimited
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxEXPAND | wxALL
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+
+ 0
+
+
+ 0
+
+ 1
+ m_staticline1
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+ wxLI_HORIZONTAL
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxEXPAND|wxALL
+ 0
+
+ 1
+ 1
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+
+ m_sdbSizer1
+ protected
+ OnApplyClick
+ OnCancelClick
+
+
+
+ OnOkClick
+
+
+
+
+
+
+
+
diff --git a/cvpcb/dialogs/dialog_display_options_base.h b/cvpcb/dialogs/dialog_display_options_base.h
new file mode 100644
index 0000000..febdd1f
--- /dev/null
+++ b/cvpcb/dialogs/dialog_display_options_base.h
@@ -0,0 +1,68 @@
+///////////////////////////////////////////////////////////////////////////
+// C++ code generated with wxFormBuilder (version Jun 5 2014)
+// http://www.wxformbuilder.org/
+//
+// PLEASE DO "NOT" EDIT THIS FILE!
+///////////////////////////////////////////////////////////////////////////
+
+#ifndef __DIALOG_DISPLAY_OPTIONS_BASE_H__
+#define __DIALOG_DISPLAY_OPTIONS_BASE_H__
+
+#include
+#include
+#include
+class DIALOG_SHIM;
+
+#include "dialog_shim.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+///////////////////////////////////////////////////////////////////////////
+
+#define ID_PADFILL_OPT 1000
+
+///////////////////////////////////////////////////////////////////////////////
+/// Class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
+///////////////////////////////////////////////////////////////////////////////
+class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM
+{
+ private:
+
+ protected:
+ wxCheckBox* m_EdgesDisplayOption;
+ wxCheckBox* m_TextDisplayOption;
+ wxCheckBox* m_ShowPadSketch;
+ wxCheckBox* m_ShowPadNum;
+ wxCheckBox* m_IsZoomNoCenter;
+ wxCheckBox* m_IsMiddleButtonPan;
+ wxCheckBox* m_IsMiddleButtonPanLimited;
+ wxStaticLine* m_staticline1;
+ wxStdDialogButtonSizer* m_sdbSizer1;
+ wxButton* m_sdbSizer1OK;
+ wxButton* m_sdbSizer1Apply;
+ wxButton* m_sdbSizer1Cancel;
+
+ // Virtual event handlers, overide them in your derived class
+ virtual void OnMiddleBtnPanEnbl( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnApplyClick( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
+
+
+ public:
+
+ DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Display Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 425,206 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+ ~DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE();
+
+};
+
+#endif //__DIALOG_DISPLAY_OPTIONS_BASE_H__
diff --git a/cvpcb/dialogs/fp_conflict_assignment_selector.cpp b/cvpcb/dialogs/fp_conflict_assignment_selector.cpp
new file mode 100644
index 0000000..35dcd8f
--- /dev/null
+++ b/cvpcb/dialogs/fp_conflict_assignment_selector.cpp
@@ -0,0 +1,190 @@
+/**
+ * @file fp_conflict_assignment_selector.cpp
+ */
+
+/*
+ * This program source code file is part of KICAD, a free EDA CAD application.
+ *
+ * Copyright (C) 2010-2014 Jean-Pierre Charras
+ * Copyright (C) 1992-2014 Kicad Developers, see CHANGELOG.TXT for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you may find one here:
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * or you may search the http://www.gnu.org website for the version 2 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include
+
+#include
+
+
+DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR( wxWindow* aParent )
+ : DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE( aParent )
+{
+ m_listFp->AppendColumn( _( "Ref" ) );
+ m_listFp->AppendColumn( _( "Schematic assignment" ) );
+ m_listFp->AppendColumn( wxT( "<=" ) );
+ m_listFp->AppendColumn( wxT( "=>" ) );
+ m_listFp->AppendColumn( _( "Cmp file assignment" ) );
+
+ m_lineCount = 0;
+}
+
+void DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::Add( const wxString& aRef, const wxString& aFpSchName,
+ const wxString& aFpCmpName )
+{
+ long idx = m_listFp->InsertItem(m_lineCount, aRef );
+
+ m_listFp->SetItem(idx, COL_FPSCH, aFpSchName );
+ m_listFp->SetItem(idx, COL_SELSCH, wxT("") );
+ m_listFp->SetItem(idx, COL_SELCMP, wxT("X") );
+ m_listFp->SetItem(idx, COL_FPCMP, aFpCmpName );
+
+ m_lineCount ++;
+}
+
+int DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::GetSelection( const wxString& aReference )
+{
+ // Find Reference
+ for( int ii = 0; ii < m_listFp->GetItemCount(); ii++ )
+ {
+ if( m_listFp->GetItemText( ii, COL_REF ) == aReference )
+ {
+ if( m_listFp->GetItemText( ii, COL_SELSCH ) != wxT("X") )
+ return 1;
+
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
+void DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::OnColumnClick( wxListEvent& event )
+{
+ // When clicking on the column title:
+ // when it is the COL_SELCMP column, set all item choices to cmp file assigment.
+ // when it is the COL_SELSCH column, set all item choices to schematic assigment.
+
+ wxListItem item = event.GetItem();
+
+ int column = event.GetColumn();
+ int colclr, colset;
+
+ switch( column )
+ {
+ case COL_SELSCH:
+ colclr = COL_SELCMP;
+ colset = COL_SELSCH;
+ break;
+
+ case COL_SELCMP:
+ colclr = COL_SELSCH;
+ colset = COL_SELCMP;
+ break;
+
+ default:
+ return;
+ }
+
+ for( int i = 0; i < m_listFp->GetItemCount(); i++ )
+ {
+ m_listFp->SetItem( i, colclr, wxT("") );
+ m_listFp->SetItem( i, colset, wxT("X") );
+ }
+}
+
+void DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::OnItemClicked( wxMouseEvent& event )
+{
+ wxPoint pos = event.GetPosition();
+ int flgs = wxLIST_HITTEST_ONITEMLABEL;
+ long idx = m_listFp->HitTest( pos, flgs );
+
+ // Try to find the column clicked (must be COL_SELCMP or COL_SELSCH)
+ int colclr = -1, colset;
+ int minpx = m_listFp->GetColumnWidth( 0 ) + m_listFp->GetColumnWidth( 1 );
+ int maxpx = minpx + m_listFp->GetColumnWidth( 2 );
+
+ if( pos.x > minpx && pos.x < maxpx )
+ {
+ colclr = COL_SELCMP;
+ colset = COL_SELSCH;
+ }
+
+ else
+ {
+ minpx = maxpx;
+ int maxpx = minpx + m_listFp->GetColumnWidth( 3 );
+
+ if( pos.x > minpx && pos.x < maxpx )
+ {
+ colclr = COL_SELSCH;
+ colset = COL_SELCMP;
+ }
+ }
+
+ if( colclr < 0 )
+ return;
+
+ // Move selection to schematic or cmp file choice
+ // according to the column position (COL_SELCMP or COL_SELSCH)
+ m_listFp->SetItem( idx, colclr, wxT("") );
+ m_listFp->SetItem( idx, colset, wxT("X") );
+
+ event.Skip();
+}
+
+
+void DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::OnSize( wxSizeEvent& aEvent )
+{
+ recalculateColumns();
+ aEvent.Skip();
+}
+
+
+void DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::recalculateColumns()
+{
+ const int margin = 16;
+ int totalLength = 0;
+ int sel_length = GetTextSize( wxT("XX"), m_listFp ).x;
+ int maxRefLength = GetTextSize( wxT("XXX"), m_listFp ).x;
+
+ sel_length += margin;
+ m_listFp->SetColumnWidth( COL_SELSCH, sel_length );
+ m_listFp->SetColumnWidth( COL_SELCMP, sel_length );
+
+ // Find max character width of column Reference
+ for( int i = 0; i < m_listFp->GetItemCount(); i++ )
+ {
+ int length = GetTextSize( m_listFp->GetItemText( i, COL_REF ), m_listFp ).x;
+
+ if( length > maxRefLength )
+ maxRefLength = length;
+ }
+
+
+ // Use the lengths of column texts to create a scale of the max list width
+ // to set the column widths
+ maxRefLength += margin;
+ totalLength = maxRefLength + sel_length + sel_length;
+
+ int cwidth = (GetClientSize().x - totalLength) / 2;
+
+ m_listFp->SetColumnWidth( COL_REF, maxRefLength );
+ m_listFp->SetColumnWidth( COL_FPSCH, cwidth - 2 );
+ m_listFp->SetColumnWidth( COL_FPCMP, cwidth );
+}
+
diff --git a/cvpcb/dialogs/fp_conflict_assignment_selector.h b/cvpcb/dialogs/fp_conflict_assignment_selector.h
new file mode 100644
index 0000000..9beeb3f
--- /dev/null
+++ b/cvpcb/dialogs/fp_conflict_assignment_selector.h
@@ -0,0 +1,79 @@
+/**
+ * @file fp_conflict_assignment_selector.h
+ */
+
+/*
+ * This program source code file is part of KICAD, a free EDA CAD application.
+ *
+ * Copyright (C) 2010-2014 Jean-Pierre Charras
+ * Copyright (C) 1992-2014 Kicad Developers, see CHANGELOG.TXT for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you may find one here:
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * or you may search the http://www.gnu.org website for the version 2 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include
+
+
+class DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR : public DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE
+{
+ private:
+ enum COL_ID
+ {
+ COL_REF, COL_FPSCH, COL_SELSCH, COL_SELCMP, COL_FPCMP,
+ COL_COUNT
+ };
+
+ int m_lineCount;
+
+ public:
+
+ DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR( wxWindow* parent );
+
+ /**
+ * Add a line to the selection list.
+ * @param aRef = component reference text
+ * @param aFpSchName = fpid text from the netlist
+ * @param aFpCmpName = fpid text from the .cmp file
+ */
+ void Add( const wxString& aRef, const wxString& aFpSchName,
+ const wxString& aFpCmpName );
+
+ /**
+ * @return the selection option:
+ * 0 for fpid text from the netlist
+ * 1 for fpid text from the cmp file
+ * -1 on error
+ * @param aReference = the compoent schematic reference
+ */
+ int GetSelection( const wxString& aReference );
+
+ private:
+ void OnSize( wxSizeEvent& event );
+
+ // Virtual: called when clicking on the column title:
+ // when it is a column choice, set all item choices.
+ void OnColumnClick( wxListEvent& event );
+
+ void OnItemClicked( wxMouseEvent& event );
+
+ void OnCancelClick( wxCommandEvent& event ) { EndModal( wxID_CANCEL ); }
+ void OnOKClick( wxCommandEvent& event ) { EndModal( wxID_OK ); }
+
+ void recalculateColumns();
+
+};
diff --git a/cvpcb/dialogs/fp_conflict_assignment_selector_base.cpp b/cvpcb/dialogs/fp_conflict_assignment_selector_base.cpp
new file mode 100644
index 0000000..8f0d9f7
--- /dev/null
+++ b/cvpcb/dialogs/fp_conflict_assignment_selector_base.cpp
@@ -0,0 +1,58 @@
+///////////////////////////////////////////////////////////////////////////
+// C++ code generated with wxFormBuilder (version Jun 5 2014)
+// http://www.wxformbuilder.org/
+//
+// PLEASE DO "NOT" EDIT THIS FILE!
+///////////////////////////////////////////////////////////////////////////
+
+#include "fp_conflict_assignment_selector_base.h"
+
+///////////////////////////////////////////////////////////////////////////
+
+DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE::DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
+{
+ this->SetSizeHints( wxDefaultSize, wxDefaultSize );
+
+ wxBoxSizer* bSizerMain;
+ bSizerMain = new wxBoxSizer( wxVERTICAL );
+
+ m_staticTextInfo = new wxStaticText( this, wxID_ANY, wxT("Footprint assignments from schematic netlist and from .cmp file are conflicting\nPlease choose the assignment."), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
+ m_staticTextInfo->Wrap( -1 );
+ bSizerMain->Add( m_staticTextInfo, 0, wxALL|wxEXPAND, 5 );
+
+ m_listFp = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES );
+ bSizerMain->Add( m_listFp, 1, wxALL|wxEXPAND, 5 );
+
+ m_sdbSizer = new wxStdDialogButtonSizer();
+ m_sdbSizerOK = new wxButton( this, wxID_OK );
+ m_sdbSizer->AddButton( m_sdbSizerOK );
+ m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
+ m_sdbSizer->AddButton( m_sdbSizerCancel );
+ m_sdbSizer->Realize();
+
+ bSizerMain->Add( m_sdbSizer, 0, wxALIGN_RIGHT, 5 );
+
+
+ this->SetSizer( bSizerMain );
+ this->Layout();
+
+ this->Centre( wxBOTH );
+
+ // Connect Events
+ this->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE::OnSize ) );
+ m_listFp->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE::OnItemClicked ), NULL, this );
+ m_listFp->Connect( wxEVT_COMMAND_LIST_COL_CLICK, wxListEventHandler( DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE::OnColumnClick ), NULL, this );
+ m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE::OnCancelClick ), NULL, this );
+ m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE::OnOKClick ), NULL, this );
+}
+
+DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE::~DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE()
+{
+ // Disconnect Events
+ this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE::OnSize ) );
+ m_listFp->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE::OnItemClicked ), NULL, this );
+ m_listFp->Disconnect( wxEVT_COMMAND_LIST_COL_CLICK, wxListEventHandler( DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE::OnColumnClick ), NULL, this );
+ m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE::OnCancelClick ), NULL, this );
+ m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE::OnOKClick ), NULL, this );
+
+}
diff --git a/cvpcb/dialogs/fp_conflict_assignment_selector_base.fbp b/cvpcb/dialogs/fp_conflict_assignment_selector_base.fbp
new file mode 100644
index 0000000..fb57694
--- /dev/null
+++ b/cvpcb/dialogs/fp_conflict_assignment_selector_base.fbp
@@ -0,0 +1,313 @@
+
+
+
+
+
+ C++
+ 1
+ source_name
+ 0
+ 0
+ res
+ UTF-8
+ connect
+ fp_conflict_assignment_selector_base
+ 1000
+ none
+ 0
+ fp_conflict_assignment_selector
+
+ .
+
+ 1
+ 1
+ 1
+ 1
+ UI
+ 0
+ 0
+
+ 0
+ wxAUI_MGR_DEFAULT
+
+ wxBOTH
+
+ 1
+ 1
+ impl_virtual
+
+
+
+ 0
+ wxID_ANY
+
+
+ DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE
+
+ 478,294
+ wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER
+ DIALOG_SHIM; dialog_shim.h
+ Footprint Assignment Conflicts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OnSize
+
+
+
+ bSizerMain
+ wxVERTICAL
+ none
+
+ 5
+ wxALL|wxEXPAND
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Footprint assignments from schematic netlist and from .cmp file are conflicting
Please choose the assignment.
+
+ 0
+
+
+ 0
+
+ 1
+ m_staticTextInfo
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+ wxALIGN_CENTRE
+
+ 0
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxALL|wxEXPAND
+ 1
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+
+ 0
+
+
+ 0
+
+ 1
+ m_listFp
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+ wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES
+
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+
+
+
+
+
+
+
+ OnItemClicked
+
+
+
+
+
+
+ OnColumnClick
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxALIGN_RIGHT
+ 0
+
+ 0
+ 1
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+
+ m_sdbSizer
+ protected
+
+ OnCancelClick
+
+
+
+ OnOKClick
+
+
+
+
+
+
+
+
diff --git a/cvpcb/dialogs/fp_conflict_assignment_selector_base.h b/cvpcb/dialogs/fp_conflict_assignment_selector_base.h
new file mode 100644
index 0000000..b56df23
--- /dev/null
+++ b/cvpcb/dialogs/fp_conflict_assignment_selector_base.h
@@ -0,0 +1,59 @@
+///////////////////////////////////////////////////////////////////////////
+// C++ code generated with wxFormBuilder (version Jun 5 2014)
+// http://www.wxformbuilder.org/
+//
+// PLEASE DO "NOT" EDIT THIS FILE!
+///////////////////////////////////////////////////////////////////////////
+
+#ifndef __FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE_H__
+#define __FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE_H__
+
+#include
+#include
+class DIALOG_SHIM;
+
+#include "dialog_shim.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+///////////////////////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////////////////////////
+/// Class DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE
+///////////////////////////////////////////////////////////////////////////////
+class DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE : public DIALOG_SHIM
+{
+ private:
+
+ protected:
+ wxStaticText* m_staticTextInfo;
+ wxListCtrl* m_listFp;
+ wxStdDialogButtonSizer* m_sdbSizer;
+ wxButton* m_sdbSizerOK;
+ wxButton* m_sdbSizerCancel;
+
+ // Virtual event handlers, overide them in your derived class
+ virtual void OnSize( wxSizeEvent& event ) { event.Skip(); }
+ virtual void OnItemClicked( wxMouseEvent& event ) { event.Skip(); }
+ virtual void OnColumnClick( wxListEvent& event ) { event.Skip(); }
+ virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnOKClick( wxCommandEvent& event ) { event.Skip(); }
+
+
+ public:
+
+ DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Footprint Assignment Conflicts"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 478,294 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+ ~DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE();
+
+};
+
+#endif //__FP_CONFLICT_ASSIGNMENT_SELECTOR_BASE_H__
diff --git a/cvpcb/listboxes.cpp b/cvpcb/listboxes.cpp
new file mode 100644
index 0000000..e06c039
--- /dev/null
+++ b/cvpcb/listboxes.cpp
@@ -0,0 +1,122 @@
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you may find one here:
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * or you may search the http://www.gnu.org website for the version 2 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/**
+ * @file listboxes.cpp
+ * @brief Implementation of class for displaying footprint list and component lists.
+ */
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+
+/******************************************************************************
+* Basic class (from wxListView) to display component and footprint lists
+* Not directly used: the 2 list boxes actually used are derived from it
+******************************************************************************/
+
+ITEMS_LISTBOX_BASE::ITEMS_LISTBOX_BASE( CVPCB_MAINFRAME* aParent, wxWindowID aId,
+ const wxPoint& aLocation, const wxSize& aSize,
+ long aStyle) :
+ wxListView( aParent, aId, aLocation, aSize, LISTBOX_STYLE | aStyle ), columnWidth(0)
+{
+ InsertColumn( 0, wxEmptyString );
+}
+
+
+ITEMS_LISTBOX_BASE::~ITEMS_LISTBOX_BASE()
+{
+}
+
+
+void ITEMS_LISTBOX_BASE::UpdateWidth( int aLine )
+{
+ // Less than zero: recalculate width of all items.
+ if( aLine < 0 )
+ {
+ columnWidth = 0;
+ for( int ii = 0; ii < GetItemCount(); ii++ )
+ {
+ UpdateLineWidth( (unsigned)ii );
+ }
+ }
+
+ // Zero or above: update from a single line.
+ else
+ {
+ if( aLine < GetItemCount() )
+ UpdateLineWidth( (unsigned)aLine );
+ }
+}
+
+
+/*
+ * Calculate the width of the given line, and increase the column width
+ * if needed. This is effectively the wxListCtrl code for autosizing.
+ * NB. it relies on the caller checking the given line number is valid.
+ */
+void ITEMS_LISTBOX_BASE::UpdateLineWidth( unsigned aLine )
+{
+ wxClientDC dc( this );
+ wxCoord w;
+ int newWidth = 10; // Value of AUTOSIZE_COL_MARGIN from wxWidgets source.
+
+ dc.SetFont( GetFont() );
+ dc.GetTextExtent( GetItemText( aLine, 0 ) + " ", &w, NULL );
+ newWidth += w;
+
+ if( newWidth > columnWidth )
+ {
+ columnWidth = newWidth;
+ SetColumnWidth( 0, columnWidth );
+ }
+}
+
+
+/*
+ * Return an index for the selected item
+ */
+int ITEMS_LISTBOX_BASE::GetSelection()
+{
+ return GetFirstSelected();
+}
+
+/* Removes all selection in list
+*/
+void ITEMS_LISTBOX_BASE::DeselectAll()
+{
+ for( int i = 0; i < GetItemCount(); i++ )
+ Select( i, false );
+}
+
+
+CVPCB_MAINFRAME* ITEMS_LISTBOX_BASE::GetParent() const
+{
+ return (CVPCB_MAINFRAME*) wxListView::GetParent();
+}
diff --git a/cvpcb/menubar.cpp b/cvpcb/menubar.cpp
new file mode 100644
index 0000000..9be8744
--- /dev/null
+++ b/cvpcb/menubar.cpp
@@ -0,0 +1,153 @@
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
+ * Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you may find one here:
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * or you may search the http://www.gnu.org website for the version 2 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/**
+ * @file cvpcb/menubar.cpp
+ * @brief (Re)Create the menubar for CvPcb
+ */
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+
+
+/**
+ * @brief (Re)Create the menubar for the CvPcb mainframe
+ */
+void CVPCB_MAINFRAME::ReCreateMenuBar()
+{
+ // Create and try to get the current menubar
+ wxMenuItem* item;
+ wxMenuBar* menuBar = GetMenuBar();
+
+ if( ! menuBar ) // Delete all menus
+ menuBar = new wxMenuBar();
+
+ // Delete all existing menus so they can be rebuilt.
+ // This allows language changes of the menu text on the fly.
+ menuBar->Freeze();
+
+ while( menuBar->GetMenuCount() )
+ delete menuBar->Remove( 0 );
+
+ // Recreate all menus:
+
+ // Menu File:
+ wxMenu* filesMenu = new wxMenu;
+
+ // Save the footprints back into eeschema
+ AddMenuItem( filesMenu, wxID_SAVE,
+ _( "&Save Edits\tCtrl+S" ), SAVE_HLP_MSG, KiBitmap( save_xpm ) );
+
+ // Separator
+ filesMenu->AppendSeparator();
+
+ // Quit
+ AddMenuItem( filesMenu, wxID_EXIT,
+ _( "&Close" ), _( "Close CvPcb" ),
+ KiBitmap( exit_xpm ) );
+
+ // Menu Preferences:
+ wxMenu* preferencesMenu = new wxMenu;
+
+ AddMenuItem( preferencesMenu, ID_CVPCB_LIB_TABLE_EDIT,
+ _( "Footprint Li&braries" ), _( "Configure footprint libraries" ),
+ KiBitmap( library_table_xpm ) );
+
+ // Path configuration edit dialog.
+ AddMenuItem( preferencesMenu,
+ ID_PREFERENCES_CONFIGURE_PATHS,
+ _( "Configure Pa&ths" ),
+ _( "Edit path configuration environment variables" ),
+ KiBitmap( editor_xpm ) );
+
+ AddMenuItem( preferencesMenu, ID_CVPCB_EQUFILES_LIST_EDIT,
+ _( "Footprint &Association Files" ),
+ _( "Configure footprint association file (.equ) list."
+ "These files are used to automatically assign"
+ "the footprint name from the component value" ),
+ KiBitmap( library_table_xpm ) );
+
+ // Language submenu
+ Pgm().AddMenuLanguageList( preferencesMenu );
+
+ // Keep open on save
+ item = new wxMenuItem( preferencesMenu, ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
+ _( "&Keep Open On Save" ),
+ _( "Prevent CvPcb from exiting after saving netlist file" ),
+ wxITEM_CHECK );
+ preferencesMenu->Append( item );
+ SETBITMAPS( window_close_xpm );
+
+ // Separator
+ preferencesMenu->AppendSeparator();
+ AddMenuItem( preferencesMenu, ID_SAVE_PROJECT,
+ _( "&Save Project File" ),
+ _( "Save changes to the project configuration file" ),
+ KiBitmap( save_setup_xpm ) );
+
+ // Menu Help:
+ wxMenu* helpMenu = new wxMenu;
+
+ // Version info
+ AddHelpVersionInfoMenuEntry( helpMenu );
+
+ // Manual Contents
+ AddMenuItem( helpMenu, wxID_HELP, _( "CvPcb &Manual" ),
+ _( "Open CvPcb Manual" ),
+ KiBitmap( online_help_xpm ) );
+
+ AddMenuItem( helpMenu,
+ wxID_INDEX,
+ _( "&Getting Started in KiCad" ),
+ _( "Open \"Getting Started in KiCad\" guide for beginners" ),
+ KiBitmap( help_xpm ) );
+
+ // About CvPcb
+ AddMenuItem( helpMenu, wxID_ABOUT,
+ _( "&About Kicad" ),
+ _( "About KiCad" ),
+ KiBitmap( info_xpm ) );
+
+ // Create the menubar and append all submenus
+ menuBar->Append( filesMenu, _( "&File" ) );
+ menuBar->Append( preferencesMenu, _( "&Preferences" ) );
+ menuBar->Append( helpMenu, _( "&Help" ) );
+
+ menuBar->Thaw();
+
+ // Associate the menu bar with the frame, if no previous menubar
+ if( GetMenuBar() == NULL )
+ SetMenuBar( menuBar );
+ else
+ menuBar->Refresh();
+}
diff --git a/cvpcb/readwrite_dlgs.cpp b/cvpcb/readwrite_dlgs.cpp
new file mode 100644
index 0000000..9e298e6
--- /dev/null
+++ b/cvpcb/readwrite_dlgs.cpp
@@ -0,0 +1,402 @@
+/**
+ * @file cvpcb/readwrite_dlgs.cpp
+ */
+
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 2015 Jean-Pierre Charras, jean-pierre.charras
+ * Copyright (C) 2011 Wayne Stambaugh
+ * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you may find one here:
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * or you may search the http://www.gnu.org website for the version 2 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+
+void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
+{
+ COMPONENT* component;
+ int componentIndex;
+
+ if( m_netlist.IsEmpty() )
+ return;
+
+ // If no component is selected, select the first one
+ if( m_compListBox->GetFirstSelected() < 0 )
+ {
+ componentIndex = 0;
+ m_compListBox->SetSelection( componentIndex, true );
+ }
+
+ // iterate over the selection
+ while( m_compListBox->GetFirstSelected() != -1 )
+ {
+ // Get the component for the current iteration
+ componentIndex = m_compListBox->GetFirstSelected();
+ component = m_netlist.GetComponent( componentIndex );
+
+ if( component == NULL )
+ return;
+
+ SetNewPkg( aFootprintName, componentIndex );
+
+ m_compListBox->SetSelection( componentIndex, false );
+ }
+
+ // Mark this "session" as modified
+ m_modified = true;
+
+ // select the next component, if there is one
+ if( componentIndex < (m_compListBox->GetCount() - 1) )
+ componentIndex++;
+
+ m_compListBox->SetSelection( componentIndex, true );
+
+ // update the statusbar
+ DisplayStatus();
+}
+
+
+void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName, int aIndex )
+{
+ COMPONENT* component;
+
+ if( m_netlist.IsEmpty() )
+ return;
+
+ component = m_netlist.GetComponent( aIndex );
+
+ if( component == NULL )
+ return;
+
+ // Check to see if the component has already a footprint set.
+ bool hasFootprint = !component->GetFPID().empty();
+
+ FPID fpid;
+
+ if( !aFootprintName.IsEmpty() )
+ {
+ wxCHECK_RET( fpid.Parse( aFootprintName ) < 0,
+ wxString::Format( wxT( "<%s> is not a valid FPID." ),
+ GetChars( aFootprintName ) ) );
+ }
+
+ component->SetFPID( fpid );
+
+ // create the new component description
+ wxString description = wxString::Format( CMP_FORMAT, aIndex + 1,
+ GetChars( component->GetReference() ),
+ GetChars( component->GetValue() ),
+ GetChars( FROM_UTF8( component->GetFPID().Format().c_str() ) ) );
+
+ // If the component hasn't had a footprint associated with it
+ // it now has, so we decrement the count of components without
+ // a footprint assigned.
+ if( !hasFootprint )
+ m_undefinedComponentCnt -= 1;
+
+ // Set the new description and deselect the processed component
+ m_compListBox->SetString( aIndex, description );
+
+ // Mark this "session" as modified
+ m_modified = true;
+
+ // update the statusbar
+ DisplayStatus();
+}
+
+
+/// Return true if the resultant FPID has a certain nickname. The guess
+/// is only made if this footprint resides in only one library.
+/// @return int - 0 on success, 1 on not found, 2 on ambiguous i.e. multiple matches
+static int guessNickname( FP_LIB_TABLE* aTbl, FPID* aFootprintId )
+{
+ if( aFootprintId->GetLibNickname().size() )
+ return 0;
+
+ wxString nick;
+ wxString fpname = aFootprintId->GetFootprintName();
+
+ std::vector nicks = aTbl->GetLogicalLibs();
+
+ // Search each library going through libraries alphabetically.
+ for( unsigned libNdx = 0; libNdxFootprintEnumerate( nicks[libNdx] );
+
+ for( unsigned nameNdx = 0; nameNdxSetLibNickname( nick );
+ return 0;
+ }
+
+ return 1;
+}
+
+
+bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles( const std::string& aNetlist )
+{
+ wxString msg;
+ bool hasMissingNicks = false;
+
+ ReadSchematicNetlist( aNetlist );
+
+ if( m_compListBox == NULL )
+ return false;
+
+ LoadProjectFile();
+ LoadFootprintFiles();
+
+ BuildFOOTPRINTS_LISTBOX();
+ BuildLIBRARY_LISTBOX();
+
+ m_compListBox->Clear();
+ m_undefinedComponentCnt = 0;
+
+ if( m_netlist.AnyFootprintsLinked() )
+ {
+ for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
+ {
+ COMPONENT* component = m_netlist.GetComponent( i );
+
+ if( component->GetFPID().empty() )
+ continue;
+
+ if( component->GetFPID().IsLegacy() )
+ hasMissingNicks = true;
+ }
+ }
+
+ // Check if footprint links were generated before the footprint library table was implemented.
+ if( hasMissingNicks )
+ {
+ msg = _(
+ "Some of the assigned footprints are legacy entries (are missing lib nicknames). "
+ "Would you like CvPcb to attempt to convert them to the new required FPID format? "
+ "(If you answer no, then these assignments will be cleared out and you will "
+ "have to re-assign these footprints yourself.)"
+ );
+
+ if( IsOK( this, msg ) )
+ {
+ msg.Clear();
+
+ try
+ {
+ for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
+ {
+ COMPONENT* component = m_netlist.GetComponent( i );
+
+ if( component->GetFPID().IsLegacy() )
+ {
+ // get this first here, it's possibly obsoleted if we get it too soon.
+ FP_LIB_TABLE* tbl = Prj().PcbFootprintLibs();
+
+ int guess = guessNickname( tbl, (FPID*) &component->GetFPID() );
+
+ switch( guess )
+ {
+ case 0:
+ DBG(printf("%s: guessed OK ref:%s fpid:%s\n", __func__,
+ TO_UTF8( component->GetReference() ), component->GetFPID().Format().c_str() );)
+ m_modified = true;
+ break;
+
+ case 1:
+ msg += wxString::Format( _(
+ "Component '%s' footprint '%s' was not found in any library.\n" ),
+ GetChars( component->GetReference() ),
+ GetChars( component->GetFPID().GetFootprintName() )
+ );
+ break;
+
+ case 2:
+ msg += wxString::Format( _(
+ "Component '%s' footprint '%s' was found in multiple libraries.\n" ),
+ GetChars( component->GetReference() ),
+ GetChars( component->GetFPID().GetFootprintName() )
+ );
+ break;
+ }
+ }
+ }
+ }
+ catch( const IO_ERROR& ioe )
+ {
+ wxString msg = ioe.errorText;
+ msg += wxT( "\n\n" );
+ msg += _( "First check your footprint library table entries." );
+
+ wxMessageBox( msg, _( "Problematic Footprint Library Tables" ) );
+ return false;
+ }
+
+ if( msg.size() )
+ {
+ HTML_MESSAGE_BOX dlg( this, wxEmptyString );
+
+ dlg.MessageSet( _( "The following errors occurred attempting to convert the "
+ "footprint assignments:\n\n" ) );
+ dlg.ListSet( msg );
+ dlg.MessageSet( _( "\nYou will need to reassign them manually if you want them "
+ "to be updated correctly the next time you import the "
+ "netlist in Pcbnew." ) );
+
+#if 1
+ dlg.ShowModal();
+#else
+ dlg.Fit();
+ dlg.Show( true ); // modeless lets user watch while fixing the problems, but its not working.
+#endif
+ }
+ }
+ else
+ {
+ // Clear the legacy footprint assignments.
+ for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
+ {
+ COMPONENT* component = m_netlist.GetComponent( i );
+
+ if( component->GetFPID().IsLegacy() )
+ {
+ component->SetFPID( FPID() /* empty */ );
+ m_modified = true;
+ }
+ }
+ }
+ }
+
+
+ // Display a dialog to select footprint selection, if the netlist
+ // and the .cmp file give 2 different valid footprints
+ std::vector m_indexes; // indexes of footprints in netlist
+
+ for( unsigned ii = 0; ii < m_netlist.GetCount(); ii++ )
+ {
+ COMPONENT* component = m_netlist.GetComponent( ii );
+
+ if( component->GetAltFPID().empty() )
+ continue;
+
+ if( component->GetFPID().IsLegacy() || component->GetAltFPID().IsLegacy())
+ continue;
+
+ m_indexes.push_back( ii );
+ }
+
+ // If a n assignment conflict is found,
+ // open a dialog to chose between schematic assignment
+ // and .cmp file assignment:
+ if( m_indexes.size() > 0 )
+ {
+ DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR dlg( this );
+
+ for( unsigned ii = 0; ii < m_indexes.size(); ii++ )
+ {
+ COMPONENT* component = m_netlist.GetComponent( m_indexes[ii] );
+
+ wxString cmpfpid = component->GetFPID().Format();
+ wxString schfpid = component->GetAltFPID().Format();
+
+ dlg.Add( component->GetReference(), schfpid, cmpfpid );
+ }
+
+ if( dlg.ShowModal() == wxID_OK )
+ {
+
+ // Update the fp selection:
+ for( unsigned ii = 0; ii < m_indexes.size(); ii++ )
+ {
+ COMPONENT* component = m_netlist.GetComponent( m_indexes[ii] );
+
+ int choice = dlg.GetSelection( component->GetReference() );
+
+ if( choice == 0 ) // the schematic (alt fpid) is chosen:
+ component->SetFPID( component->GetAltFPID() );
+ }
+ }
+ }
+
+ // Populates the component list box:
+ for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
+ {
+ COMPONENT* component = m_netlist.GetComponent( i );
+
+ msg.Printf( CMP_FORMAT, m_compListBox->GetCount() + 1,
+ GetChars( component->GetReference() ),
+ GetChars( component->GetValue() ),
+ GetChars( FROM_UTF8( component->GetFPID().Format().c_str() ) ) );
+
+ m_compListBox->AppendLine( msg );
+
+ if( component->GetFPID().empty() )
+ {
+ m_undefinedComponentCnt += 1;
+ continue;
+ }
+ }
+
+ if( !m_netlist.IsEmpty() )
+ m_compListBox->SetSelection( 0, true );
+
+ DisplayStatus();
+
+ UpdateTitle();
+ return true;
+}
+
+
+void CVPCB_MAINFRAME::SaveEdits()
+{
+ STRING_FORMATTER sf;
+
+ m_netlist.FormatBackAnnotation( &sf );
+
+ Kiway().ExpressMail( FRAME_SCH, MAIL_BACKANNOTATE_FOOTPRINTS, sf.GetString() );
+
+ SetStatusText( _("Edits sent to Eeschema") );
+}
diff --git a/cvpcb/tool_cvpcb.cpp b/cvpcb/tool_cvpcb.cpp
new file mode 100644
index 0000000..222059f
--- /dev/null
+++ b/cvpcb/tool_cvpcb.cpp
@@ -0,0 +1,115 @@
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
+ * Copyright (C) 2011-2016 Wayne Stambaugh
+ * Copyright (C) 2007-2016 KiCad Developers, see AUTHORS.txt for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you may find one here:
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * or you may search the http://www.gnu.org website for the version 2 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/**
+ * @file tool_cvpcb.cpp
+ */
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+
+
+void CVPCB_MAINFRAME::ReCreateHToolbar()
+{
+ wxConfigBase* config = Kiface().KifaceSettings();
+
+ if( m_mainToolBar != NULL )
+ return;
+
+ m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
+ wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
+
+ m_mainToolBar->AddTool( wxID_SAVE, wxEmptyString, KiBitmap( save_xpm ), SAVE_HLP_MSG );
+
+ m_mainToolBar->AddSeparator();
+ m_mainToolBar->AddTool( ID_CVPCB_LIB_TABLE_EDIT, wxEmptyString,
+ KiBitmap( config_xpm ),
+ _( "Edit footprint library table" ) );
+
+ m_mainToolBar->AddSeparator();
+ m_mainToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString,
+ KiBitmap( show_footprint_xpm ),
+ _( "View selected footprint" ) );
+
+ m_mainToolBar->AddSeparator();
+ m_mainToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString,
+ KiBitmap( left_xpm ),
+ _( "Select previous unlinked component" ) );
+
+ m_mainToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxEmptyString,
+ KiBitmap( right_xpm ),
+ _( "Select next unlinked component" ) );
+
+ m_mainToolBar->AddSeparator();
+ m_mainToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString,
+ KiBitmap( auto_associe_xpm ),
+ _( "Perform automatic footprint association" ) );
+
+ m_mainToolBar->AddTool( ID_CVPCB_DEL_ASSOCIATIONS, wxEmptyString,
+ KiBitmap( delete_association_xpm ),
+ _( "Delete all associations (links)" ) );
+
+ m_mainToolBar->AddSeparator();
+ m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
+ KiBitmap( module_filtered_list_xpm ),
+ wxNullBitmap,
+ true, NULL,
+ _( "Filter footprint list by keywords" ),
+ wxEmptyString );
+
+ m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
+ KiBitmap( module_pin_filtered_list_xpm ),
+ wxNullBitmap,
+ true, NULL,
+ _( "Filter footprint list by pin count" ),
+ wxEmptyString );
+
+ m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
+ KiBitmap( module_library_list_xpm ),
+ wxNullBitmap, true, NULL,
+ _( "Filter footprint list by library" ),
+ wxEmptyString );
+
+ if( config )
+ {
+ wxString key = wxT( FILTERFOOTPRINTKEY );
+ int opt = config->Read( key, (long) 1 );
+
+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, opt & 4 );
+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, opt & 2 );
+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, opt & 1 );
+ }
+
+ // after adding the buttons to the toolbar, must call Realize() to reflect the changes
+ m_mainToolBar->Realize();
+}
--
cgit