Commit 2a14f2d5 authored by jean-pierre charras's avatar jean-pierre charras

minor code cleaning

parent 883d5b51
...@@ -36,35 +36,12 @@ wxString ModulesMaskSelection = wxT( "*" ); ...@@ -36,35 +36,12 @@ wxString ModulesMaskSelection = wxT( "*" );
void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
INSTALL_DC( dc, DrawPanel );
bool on_state; bool on_state;
if( m_HToolBar == NULL ) if( m_HToolBar == NULL )
return; return;
switch( id ) INSTALL_DC( dc, DrawPanel );
{
case ID_TOOLBARH_PCB_AUTOPLACE:
case ID_TOOLBARH_PCB_AUTOROUTE:
break;
case ID_POPUP_CANCEL_CURRENT_COMMAND:
if( DrawPanel->ManageCurseur
&& DrawPanel->ForceCloseManageCurseur )
{
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
}
break;
default: // Abort a current command (if any)
DrawPanel->UnManageCursor( 0, wxCURSOR_ARROW );
break;
}
/* Erase ratsnest if needed */
if( GetBoard()->IsElementVisible(RATSNEST_VISIBLE) )
DrawGeneralRatsnest( &dc );
GetBoard()->m_Status_Pcb |= DO_NOT_SHOW_GENERAL_RASTNEST;
switch( id ) switch( id )
{ {
...@@ -77,7 +54,7 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) ...@@ -77,7 +54,7 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event )
} }
else else
m_HTOOL_current_state = 0; m_HTOOL_current_state = 0;
break; return;
case ID_TOOLBARH_PCB_AUTOROUTE: case ID_TOOLBARH_PCB_AUTOROUTE:
on_state = m_HToolBar->GetToolState( ID_TOOLBARH_PCB_AUTOROUTE ); on_state = m_HToolBar->GetToolState( ID_TOOLBARH_PCB_AUTOROUTE );
...@@ -88,24 +65,48 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) ...@@ -88,24 +65,48 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event )
} }
else else
m_HTOOL_current_state = 0; m_HTOOL_current_state = 0;
break; return;
case ID_POPUP_PCB_AUTOROUTE_SELECT_LAYERS:
return;
case ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE: case ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE:
FixeModule( (MODULE*) GetScreen()->GetCurItem(), TRUE ); FixeModule( (MODULE*) GetScreen()->GetCurItem(), TRUE );
break; return;
case ID_POPUP_PCB_AUTOPLACE_FREE_MODULE: case ID_POPUP_PCB_AUTOPLACE_FREE_MODULE:
FixeModule( (MODULE*) GetScreen()->GetCurItem(), FALSE ); FixeModule( (MODULE*) GetScreen()->GetCurItem(), FALSE );
break; return;
case ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES: case ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES:
FixeModule( NULL, FALSE ); FixeModule( NULL, FALSE );
break; return;
case ID_POPUP_PCB_AUTOPLACE_FIXE_ALL_MODULES: case ID_POPUP_PCB_AUTOPLACE_FIXE_ALL_MODULES:
FixeModule( NULL, TRUE ); FixeModule( NULL, TRUE );
return;
case ID_POPUP_CANCEL_CURRENT_COMMAND:
if( DrawPanel->ManageCurseur
&& DrawPanel->ForceCloseManageCurseur )
{
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
}
break; break;
default: // Abort a current command (if any)
DrawPanel->UnManageCursor( 0, wxCURSOR_ARROW );
break;
}
/* Erase ratsnest if needed */
if( GetBoard()->IsElementVisible(RATSNEST_VISIBLE) )
DrawGeneralRatsnest( &dc );
GetBoard()->m_Status_Pcb |= DO_NOT_SHOW_GENERAL_RASTNEST;
switch( id )
{
case ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE: case ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE:
AutoPlaceModule( (MODULE*) GetScreen()->GetCurItem(), AutoPlaceModule( (MODULE*) GetScreen()->GetCurItem(),
PLACE_1_MODULE, &dc ); PLACE_1_MODULE, &dc );
...@@ -155,9 +156,6 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) ...@@ -155,9 +156,6 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event )
Reset_Noroutable( &dc ); Reset_Noroutable( &dc );
break; break;
case ID_POPUP_PCB_AUTOROUTE_SELECT_LAYERS:
break;
default: default:
DisplayError( this, wxT( "AutoPlace command error" ) ); DisplayError( this, wxT( "AutoPlace command error" ) );
break; break;
...@@ -165,7 +163,6 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) ...@@ -165,7 +163,6 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event )
GetBoard()->m_Status_Pcb &= ~DO_NOT_SHOW_GENERAL_RASTNEST; GetBoard()->m_Status_Pcb &= ~DO_NOT_SHOW_GENERAL_RASTNEST;
Compile_Ratsnest( &dc, true ); Compile_Ratsnest( &dc, true );
SetToolbars();
} }
......
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