CvPcb: fix broken event ID for configuration button on toolbar.

* Remap configuration button on toolbar to launch footprint library table
  editor.
* Remove legacy footprint library path dialog from CVPCB_MAINFRAME.
* Remove unused event ID ID_CVPCB_CREATE_CONFIGWINDOW.
* Minor coding policy fixes.
This commit is contained in:
Wayne Stambaugh 2014-08-13 15:26:31 -04:00
parent c8d69f19c8
commit c63459653a
5 changed files with 56 additions and 80 deletions

View File

@ -68,17 +68,14 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, EDA_BASE_FRAME )
EVT_MENU( wxID_EXIT, CVPCB_MAINFRAME::OnQuit )
EVT_MENU( wxID_HELP, CVPCB_MAINFRAME::GetKicadHelp )
EVT_MENU( wxID_ABOUT, CVPCB_MAINFRAME::GetKicadAbout )
EVT_MENU( wxID_PREFERENCES, CVPCB_MAINFRAME::ConfigCvpcb )
EVT_MENU( ID_SAVE_PROJECT, CVPCB_MAINFRAME::SaveProjectFile )
EVT_MENU( ID_SAVE_PROJECT_AS, CVPCB_MAINFRAME::SaveProjectFile )
EVT_MENU( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, CVPCB_MAINFRAME::OnKeepOpenOnSave )
EVT_MENU( ID_CVPCB_LIB_TABLE_EDIT, CVPCB_MAINFRAME::OnEditFootprintLibraryTable )
// Toolbar events
EVT_TOOL( ID_CVPCB_QUIT, CVPCB_MAINFRAME::OnQuit )
EVT_TOOL( ID_CVPCB_READ_INPUT_NETLIST, CVPCB_MAINFRAME::LoadNetList )
EVT_TOOL( ID_CVPCB_CREATE_CONFIGWINDOW, CVPCB_MAINFRAME::ConfigCvpcb )
EVT_TOOL( ID_CVPCB_LIB_TABLE_EDIT, CVPCB_MAINFRAME::OnEditFootprintLibraryTable )
EVT_TOOL( ID_CVPCB_CREATE_SCREENCMP, CVPCB_MAINFRAME::DisplayModule )
EVT_TOOL( ID_CVPCB_GOTO_FIRSTNA, CVPCB_MAINFRAME::ToFirstNA )
EVT_TOOL( ID_CVPCB_GOTO_PREVIOUSNA, CVPCB_MAINFRAME::ToPreviousNA )
@ -144,7 +141,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
// Set minimal frame width and height
SetSizeHints( FRAME_MIN_SIZE_X, FRAME_MIN_SIZE_Y, -1, -1, -1, -1 );
// Framesize and position
// Frame size and position
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
// create the status bar
@ -205,7 +202,7 @@ void CVPCB_MAINFRAME::LoadSettings( wxConfigBase* aCfg )
aCfg->Read( KeepCvpcbOpenEntry, &m_KeepCvpcbOpen, true );
aCfg->Read( FootprintDocFileEntry, &m_DocModulesFileName,
DEFAULT_FOOTPRINTS_LIST_FILENAME );
DEFAULT_FOOTPRINTS_LIST_FILENAME );
}
@ -459,18 +456,6 @@ bool CVPCB_MAINFRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, i
}
void CVPCB_MAINFRAME::ConfigCvpcb( wxCommandEvent& event )
{
/* This is showing FOOTPRINT search paths, which are obsoleted.
I am removing this for the time being, since cvpcb will soon be part of pcbnew.
DIALOG_CVPCB_CONFIG dlg( this );
dlg.ShowModal();
*/
}
void CVPCB_MAINFRAME::OnEditFootprintLibraryTable( wxCommandEvent& aEvent )
{
bool tableChanged = false;
@ -487,8 +472,8 @@ void CVPCB_MAINFRAME::OnEditFootprintLibraryTable( wxCommandEvent& aEvent )
}
catch( const IO_ERROR& ioe )
{
wxString msg = wxString::Format( _(
"Error occurred saving the global footprint library table:\n'%s'\n%s" ),
wxString msg = wxString::Format(
_( "Error occurred saving the global footprint library table:\n'%s'\n%s" ),
GetChars( fileName ),
GetChars( ioe.errorText )
);
@ -507,8 +492,8 @@ void CVPCB_MAINFRAME::OnEditFootprintLibraryTable( wxCommandEvent& aEvent )
}
catch( const IO_ERROR& ioe )
{
wxString msg = wxString::Format( _(
"Error occurred saving the project footprint library table:\n'%s'\n%s" ),
wxString msg = wxString::Format(
_( "Error occurred saving the project footprint library table:\n'%s'\n%s" ),
GetChars( fileName ),
GetChars( ioe.errorText )
);
@ -917,15 +902,15 @@ void CVPCB_MAINFRAME::BuildFOOTPRINTS_LISTBOX()
if( m_footprintListBox == NULL )
{
m_footprintListBox = new FOOTPRINTS_LISTBOX( this, ID_CVPCB_FOOTPRINT_LIST,
wxDefaultPosition, wxDefaultSize );
wxDefaultPosition, wxDefaultSize );
m_footprintListBox->SetFont( wxFont( guiFont.GetPointSize(),
wxFONTFAMILY_MODERN,
wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL ) );
wxFONTFAMILY_MODERN,
wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL ) );
}
m_footprintListBox->SetFootprints( m_footprints, wxEmptyString, NULL,
FOOTPRINTS_LISTBOX::UNFILTERED );
FOOTPRINTS_LISTBOX::UNFILTERED );
DisplayStatus();
}
@ -939,11 +924,11 @@ void CVPCB_MAINFRAME::BuildCmpListBox()
if( m_compListBox == NULL )
{
m_compListBox = new COMPONENTS_LISTBOX( this, ID_CVPCB_COMPONENT_LIST,
wxDefaultPosition, wxDefaultSize );
wxDefaultPosition, wxDefaultSize );
m_compListBox->SetFont( wxFont( guiFont.GetPointSize(),
wxFONTFAMILY_MODERN,
wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL ) );
wxFONTFAMILY_MODERN,
wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL ) );
}
m_compListBox->m_ComponentList.Clear();
@ -986,11 +971,11 @@ void CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX()
if( m_libListBox == NULL )
{
m_libListBox = new LIBRARY_LISTBOX( this, ID_CVPCB_LIBRARY_LIST,
wxDefaultPosition, wxDefaultSize );
wxDefaultPosition, wxDefaultSize );
m_libListBox->SetFont( wxFont( guiFont.GetPointSize(),
wxFONTFAMILY_MODERN,
wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL ) );
wxFONTFAMILY_MODERN,
wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL ) );
}
FP_LIB_TABLE* tbl = Prj().PcbFootprintLibs();

View File

@ -18,7 +18,6 @@ enum id_cvpcb_frm
ID_CVPCB_QUIT = ID_END_LIST,
ID_CVPCB_READ_INPUT_NETLIST,
ID_CVPCB_SAVEQUITCVPCB,
ID_CVPCB_CREATE_CONFIGWINDOW,
ID_CVPCB_CREATE_SCREENCMP,
ID_CVPCB_GOTO_FIRSTNA,
ID_CVPCB_GOTO_PREVIOUSNA,

View File

@ -135,8 +135,6 @@ public:
*/
void LoadNetList( wxCommandEvent& event );
void ConfigCvpcb( wxCommandEvent& event );
/**
* Function OnEditLibraryTable
* envokes the footpirnt library table edit dialog.

View File

@ -52,13 +52,12 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
m_mainToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString,
KiBitmap( open_document_xpm ), LOAD_FILE_HELP );
m_mainToolBar->AddTool( wxID_SAVE, wxEmptyString, KiBitmap( save_xpm ),
SAVE_HLP_MSG );
m_mainToolBar->AddTool( wxID_SAVE, wxEmptyString, KiBitmap( save_xpm ), SAVE_HLP_MSG );
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString,
m_mainToolBar->AddTool( ID_CVPCB_LIB_TABLE_EDIT, wxEmptyString,
KiBitmap( config_xpm ),
_( "Set CvPcb config (paths and equ files)" ) );
_( "Edit footprint library table" ) );
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString,

View File

@ -40,17 +40,17 @@ wxString DRC_ITEM::GetErrorText() const
switch( m_ErrorCode )
{
case DRCE_UNCONNECTED_PADS:
return wxString( _("Unconnected pads") );
return wxString( _( "Unconnected pads" ) );
case DRCE_TRACK_NEAR_THROUGH_HOLE:
return wxString( _("Track near thru-hole") );
return wxString( _( "Track near thru-hole" ) );
case DRCE_TRACK_NEAR_PAD:
return wxString( _("Track near pad") );
return wxString( _( "Track near pad" ) );
case DRCE_TRACK_NEAR_VIA:
return wxString( _("Track near via") );
return wxString( _( "Track near via" ) );
case DRCE_VIA_NEAR_VIA:
return wxString( _("Via near via") );
return wxString( _( "Via near via" ) );
case DRCE_VIA_NEAR_TRACK:
return wxString( _("Via near track") );
return wxString( _( "Via near track" ) );
case DRCE_TRACK_ENDS1:
case DRCE_TRACK_ENDS2:
case DRCE_TRACK_ENDS3:
@ -60,72 +60,68 @@ wxString DRC_ITEM::GetErrorText() const
case DRCE_ENDS_PROBLEM3:
case DRCE_ENDS_PROBLEM4:
case DRCE_ENDS_PROBLEM5:
return wxString( _("Two track ends too close") );
return wxString( _( "Two track ends too close" ) );
case DRCE_TRACK_SEGMENTS_TOO_CLOSE:
return wxString( _("Two parallel track segments too close") );
return wxString( _( "Two parallel track segments too close" ) );
case DRCE_TRACKS_CROSSING:
return wxString( _("Tracks crossing") );
return wxString( _( "Tracks crossing" ) );
case DRCE_PAD_NEAR_PAD1:
return wxString( _("Pad near pad") );
return wxString( _( "Pad near pad" ) );
case DRCE_VIA_HOLE_BIGGER:
return wxString( _("Via hole > diameter"));
return wxString( _( "Via hole > diameter" ) );
case DRCE_MICRO_VIA_INCORRECT_LAYER_PAIR:
return wxString( _("Micro Via: incorrect layer pairs (not adjacent)"));
return wxString( _( "Micro Via: incorrect layer pairs (not adjacent)" ) );
case COPPERAREA_INSIDE_COPPERAREA:
return wxString( _("Copper area inside copper area"));
return wxString( _( "Copper area inside copper area" ) );
case COPPERAREA_CLOSE_TO_COPPERAREA:
return wxString( _("Copper areas intersect or are too close"));
return wxString( _( "Copper areas intersect or are too close" ) );
case DRCE_NON_EXISTANT_NET_FOR_ZONE_OUTLINE:
return wxString( _("Copper area has a nonexistent net name"));
return wxString( _( "Copper area has a nonexistent net name" ) );
case DRCE_HOLE_NEAR_PAD:
return wxString( _("Hole near pad"));
return wxString( _( "Hole near pad" ) );
case DRCE_HOLE_NEAR_TRACK:
return wxString( _("Hole near track"));
return wxString( _( "Hole near track" ) );
case DRCE_TOO_SMALL_TRACK_WIDTH:
return wxString( _("Too small track width"));
return wxString( _( "Too small track width" ) );
case DRCE_TOO_SMALL_VIA:
return wxString( _("Too small via size"));
return wxString( _( "Too small via size" ) );
case DRCE_TOO_SMALL_MICROVIA:
return wxString( _("Too small micro via size"));
return wxString( _( "Too small micro via size" ) );
// use &lt; since this is text ultimately embedded in HTML
case DRCE_NETCLASS_TRACKWIDTH:
return wxString( _("NetClass Track Width &lt; global limit"));
return wxString( _( "NetClass Track Width &lt; global limit" ) );
case DRCE_NETCLASS_CLEARANCE:
return wxString( _("NetClass Clearance &lt; global limit"));
return wxString( _( "NetClass Clearance &lt; global limit" ) );
case DRCE_NETCLASS_VIASIZE:
return wxString( _("NetClass Via Dia &lt; global limit"));
return wxString( _( "NetClass Via Dia &lt; global limit" ) );
case DRCE_NETCLASS_VIADRILLSIZE:
return wxString( _("NetClass Via Drill &lt; global limit"));
return wxString( _( "NetClass Via Drill &lt; global limit" ) );
case DRCE_NETCLASS_uVIASIZE:
return wxString( _("NetClass uVia Dia &lt; global limit"));
return wxString( _( "NetClass uVia Dia &lt; global limit" ) );
case DRCE_NETCLASS_uVIADRILLSIZE:
return wxString( _("NetClass uVia Drill &lt; global limit"));
return wxString( _( "NetClass uVia Drill &lt; global limit" ) );
case DRCE_VIA_INSIDE_KEEPOUT:
return wxString( _("Via inside a keepout area"));
return wxString( _( "Via inside a keepout area" ) );
case DRCE_TRACK_INSIDE_KEEPOUT:
return wxString( _("Track inside a keepout area"));
return wxString( _( "Track inside a keepout area" ) );
case DRCE_PAD_INSIDE_KEEPOUT:
return wxString( _("Pad inside a keepout area"));
return wxString( _( "Pad inside a keepout area" ) );
case DRCE_VIA_INSIDE_TEXT:
return wxString( _("Via inside a text"));
return wxString( _( "Via inside a text" ) );
case DRCE_TRACK_INSIDE_TEXT:
return wxString( _("Track inside a text"));
return wxString( _( "Track inside a text" ) );
case DRCE_PAD_INSIDE_TEXT:
return wxString( _("Pad inside a text"));
return wxString( _( "Pad inside a text" ) );
default:
{
wxString msg;
msg.Printf( wxT( "Unknown DRC error code %d" ), m_ErrorCode );
return ( msg );
}
return wxString::Format( wxT( "Unknown DRC error code %d" ), m_ErrorCode );
}
}
@ -137,4 +133,3 @@ wxString DRC_ITEM::ShowCoord( const wxPoint& aPos )
ret << aPos;
return ret;
}