Commit 80f6a4f2 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: fix ver minor issues. ModEdit: fix issue in GAL mode: when importing a...

Pcbnew: fix ver minor issues. ModEdit: fix issue in GAL mode: when importing a footprint from the footprint wizard, the new footprint was not shown.
parent 07db7c8d
...@@ -110,8 +110,7 @@ void FOOTPRINT_WIZARD_FRAME::ReloadFootprint() ...@@ -110,8 +110,7 @@ void FOOTPRINT_WIZARD_FRAME::ReloadFootprint()
if( module ) if( module )
{ {
// Add the object to board // Add the object to board
module->SetParent( (EDA_ITEM*) GetBoard() ); GetBoard()->Add( module, ADD_APPEND );
GetBoard()->m_Modules.Append( module );
module->SetPosition( wxPoint( 0, 0 ) ); module->SetPosition( wxPoint( 0, 0 ) );
} }
else else
......
...@@ -120,8 +120,8 @@ BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode ) ...@@ -120,8 +120,8 @@ BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode )
{ {
wxMenu itemMenu; wxMenu itemMenu;
// Give a title to the selection menu. This is also a cancel menu item * // Give a title to the selection menu. It also allow to close the popup menu without any action
wxMenuItem* item_title = new wxMenuItem( &itemMenu, -1, _( "Selection Clarification" ) ); wxMenuItem* item_title = new wxMenuItem( &itemMenu, wxID_NONE, _( "Selection Clarification" ) );
#ifdef __WINDOWS__ #ifdef __WINDOWS__
wxFont bold_font( *wxNORMAL_FONT ); wxFont bold_font( *wxNORMAL_FONT );
...@@ -195,7 +195,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -195,7 +195,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
wxPoint pos; wxPoint pos;
bool redraw = false;
INSTALL_UNBUFFERED_DC( dc, m_canvas ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
...@@ -308,7 +307,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -308,7 +307,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
// module the defaults are used) // module the defaults are used)
// This is mandatory to handle and draw pads // This is mandatory to handle and draw pads
GetBoard()->BuildListOfNets(); GetBoard()->BuildListOfNets();
redraw = true;
module->SetPosition( wxPoint( 0, 0 ) ); module->SetPosition( wxPoint( 0, 0 ) );
if( GetBoard()->m_Modules ) if( GetBoard()->m_Modules )
...@@ -320,6 +318,8 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -320,6 +318,8 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
if( IsGalCanvasActive() ) if( IsGalCanvasActive() )
updateView(); updateView();
m_canvas->Refresh();
GetScreen()->ClrModify(); GetScreen()->ClrModify();
} }
break; break;
...@@ -349,18 +349,18 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -349,18 +349,18 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
SetCrossHairPosition( wxPoint( 0, 0 ) ); SetCrossHairPosition( wxPoint( 0, 0 ) );
// Add the new object to board // Add the new object to board
module->SetParent( (EDA_ITEM*)GetBoard() ); GetBoard()->Add( module, ADD_APPEND );
GetBoard()->m_Modules.Append( module );
// Initialize data relative to nets and netclasses (for a new // Initialize data relative to nets and netclasses (for a new
// module the defaults are used) // module the defaults are used)
// This is mandatory to handle and draw pads // This is mandatory to handle and draw pads
GetBoard()->BuildListOfNets(); GetBoard()->BuildListOfNets();
redraw = true;
module->SetPosition( wxPoint( 0, 0 ) ); module->SetPosition( wxPoint( 0, 0 ) );
module->ClearFlags(); module->ClearFlags();
Zoom_Automatique( false ); Zoom_Automatique( false );
updateView();
m_canvas->Refresh();
if( m_Draw3DFrame ) if( m_Draw3DFrame )
m_Draw3DFrame->NewDisplay(); m_Draw3DFrame->NewDisplay();
...@@ -492,13 +492,13 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -492,13 +492,13 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
SetCrossHairPosition( wxPoint( 0, 0 ) ); SetCrossHairPosition( wxPoint( 0, 0 ) );
Import_Module(); Import_Module();
redraw = true;
if( GetBoard()->m_Modules ) if( GetBoard()->m_Modules )
GetBoard()->m_Modules->ClearFlags(); GetBoard()->m_Modules->ClearFlags();
GetScreen()->ClrModify(); GetScreen()->ClrModify();
Zoom_Automatique( false ); Zoom_Automatique( false );
m_canvas->Refresh();
if( m_Draw3DFrame ) if( m_Draw3DFrame )
m_Draw3DFrame->NewDisplay(); m_Draw3DFrame->NewDisplay();
...@@ -532,7 +532,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -532,7 +532,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
SetCrossHairPosition( wxPoint( 0, 0 ) ); SetCrossHairPosition( wxPoint( 0, 0 ) );
LoadModuleFromLibrary( GetCurrentLib(), Prj().PcbFootprintLibs(), true ); LoadModuleFromLibrary( GetCurrentLib(), Prj().PcbFootprintLibs(), true );
redraw = true;
if( GetBoard()->m_Modules ) if( GetBoard()->m_Modules )
GetBoard()->m_Modules->ClearFlags(); GetBoard()->m_Modules->ClearFlags();
...@@ -563,6 +562,8 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -563,6 +562,8 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
if( m_Draw3DFrame ) if( m_Draw3DFrame )
m_Draw3DFrame->NewDisplay(); m_Draw3DFrame->NewDisplay();
m_canvas->Refresh();
GetScreen()->ClrModify(); GetScreen()->ClrModify();
updateView(); updateView();
...@@ -600,23 +601,21 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -600,23 +601,21 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE: case ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE:
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
Rotate_Module( NULL, (MODULE*) GetScreen()->GetCurItem(), 900, true ); Rotate_Module( NULL, (MODULE*) GetScreen()->GetCurItem(), 900, true );
redraw = true; m_canvas->Refresh();
break; break;
case ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE: case ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE:
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
Rotate_Module( NULL, (MODULE*) GetScreen()->GetCurItem(), -900, true ); Rotate_Module( NULL, (MODULE*) GetScreen()->GetCurItem(), -900, true );
redraw = true; m_canvas->Refresh();
break; break;
case ID_POPUP_PCB_EDIT_MODULE_PRMS: case ID_POPUP_PCB_EDIT_MODULE_PRMS:
{ {
DIALOG_MODULE_MODULE_EDITOR dialog( this, (MODULE*) GetScreen()->GetCurItem() ); DIALOG_MODULE_MODULE_EDITOR dialog( this, (MODULE*) GetScreen()->GetCurItem() );
int ret = dialog.ShowModal(); dialog.ShowModal();
GetScreen()->GetCurItem()->ClearFlags(); GetScreen()->GetCurItem()->ClearFlags();
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
if( ret > 0 )
m_canvas->Refresh(); m_canvas->Refresh();
} }
break; break;
...@@ -696,6 +695,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -696,6 +695,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_MODEDIT_ENTER_EDGE_WIDTH: case ID_POPUP_MODEDIT_ENTER_EDGE_WIDTH:
{ {
EDGE_MODULE* edge = NULL; EDGE_MODULE* edge = NULL;
if( GetScreen()->GetCurItem() if( GetScreen()->GetCurItem()
&& ( GetScreen()->GetCurItem()->Type() == PCB_MODULE_EDGE_T ) ) && ( GetScreen()->GetCurItem()->Type() == PCB_MODULE_EDGE_T ) )
{ {
...@@ -739,7 +739,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -739,7 +739,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_MODEDIT_MODULE_MIRROR: case ID_MODEDIT_MODULE_MIRROR:
SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT ); SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT );
Transform( (MODULE*) GetScreen()->GetCurItem(), id ); Transform( (MODULE*) GetScreen()->GetCurItem(), id );
redraw = true; m_canvas->Refresh();
break; break;
case ID_PCB_DRAWINGS_WIDTHS_SETUP: case ID_PCB_DRAWINGS_WIDTHS_SETUP:
...@@ -811,9 +811,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -811,9 +811,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
wxT( "FOOTPRINT_EDIT_FRAME::Process_Special_Functions error" ) ); wxT( "FOOTPRINT_EDIT_FRAME::Process_Special_Functions error" ) );
break; break;
} }
if( redraw )
m_canvas->Refresh();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment