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

minor code cleaning

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