dialog edit footprint properties: Generate an error message if a parameter is incorrect.

(previously when happens, no message but the dialog cannot be closed)
This commit is contained in:
jp-charras 2016-08-24 17:18:51 +02:00
parent 4a3cb050ed
commit d0fbd32bee
2 changed files with 20 additions and 8 deletions

View File

@ -585,13 +585,18 @@ void DIALOG_MODULE_BOARD_EDITOR::BrowseAndAdd3DShapeFile()
bool DIALOG_MODULE_BOARD_EDITOR::TransferDataToWindow()
{
if( !wxDialog::TransferDataToWindow() )
if( !wxDialog::TransferDataToWindow() ||
!m_PanelProperties->TransferDataToWindow() )
{
wxMessageBox( _( "Error: invalid footprint parameter" ) );
return false;
}
if( !m_PanelProperties->TransferDataToWindow() )
return false;
if( !m_Panel3D->TransferDataToWindow() )
{
wxMessageBox( _( "Error: invalid 3D parameter" ) );
return false;
}
InitModeditProperties();
InitBoardProperties();
@ -605,13 +610,18 @@ bool DIALOG_MODULE_BOARD_EDITOR::TransferDataFromWindow()
wxPoint modpos;
wxString msg;
if( !Validate() || !DIALOG_MODULE_BOARD_EDITOR_BASE::TransferDataFromWindow() )
if( !Validate() || !DIALOG_MODULE_BOARD_EDITOR_BASE::TransferDataFromWindow() ||
!m_PanelProperties->TransferDataFromWindow() )
{
wxMessageBox( _( "Error: invalid or missing footprint parameter" ) );
return false;
}
if( !m_PanelProperties->TransferDataFromWindow() )
return false;
if( !m_Panel3D->TransferDataFromWindow() )
{
wxMessageBox( _( "Error: invalid or missing 3D parameter" ) );
return false;
}
if( m_CurrentModule->GetFlags() == 0 ) // this is a simple edition, we
// must create an undo entry

View File

@ -175,9 +175,11 @@ void DIALOG_MODULE_MODULE_EDITOR::initModeditProperties()
m_AttributsCtrl->SetItemToolTip( 0, _( "Use this attribute for most non SMD components" ) );
m_AttributsCtrl->SetItemToolTip( 1,
_( "Use this attribute for SMD components.\nOnly components with this option are put in the footprint position list file" ) );
_( "Use this attribute for SMD components.\n"
"Only components with this option are put in the footprint position list file" ) );
m_AttributsCtrl->SetItemToolTip( 2,
_( "Use this attribute for \"virtual\" components drawn on board (like a old ISA PC bus connector)" ) );
_( "Use this attribute for \"virtual\" components"
" drawn on board(like a old ISA PC bus connector)" ) );
// Controls on right side of the dialog
switch( m_currentModule->GetAttributes() & 255 )