* backspace should not be allowed to delete modules (in order to
re-insert them, you may have to edit the .brd file directly)
This commit is contained in:
parent
3c7846db7a
commit
aa5e1cd09b
|
@ -1365,6 +1365,7 @@ void WinEDA_PcbFrame::SwitchLayer(wxDC *DC, int layer)
|
||||||
Other_Layer_Route( (TRACK *) GetScreen()->m_CurrentItem, DC);
|
Other_Layer_Route( (TRACK *) GetScreen()->m_CurrentItem, DC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GetScreen()->m_Active_Layer = layer;
|
GetScreen()->m_Active_Layer = layer;
|
||||||
|
|
||||||
if ( DisplayOpt.ContrastModeDisplay )
|
if ( DisplayOpt.ContrastModeDisplay )
|
||||||
|
|
|
@ -46,7 +46,7 @@ MODULE* module = NULL;
|
||||||
case WXK_NUMPAD_DELETE:
|
case WXK_NUMPAD_DELETE:
|
||||||
OnHotkeyDeleteItem(DC, DrawStruct);
|
OnHotkeyDeleteItem(DC, DrawStruct);
|
||||||
break;
|
break;
|
||||||
case WXK_BACK:{
|
case WXK_BACK:{
|
||||||
if( m_ID_current_state == ID_TRACK_BUTT &&
|
if( m_ID_current_state == ID_TRACK_BUTT &&
|
||||||
GetScreen()->m_Active_Layer <= CMP_N ){
|
GetScreen()->m_Active_Layer <= CMP_N ){
|
||||||
bool ItemFree = (GetScreen()->m_CurrentItem == NULL ) ||
|
bool ItemFree = (GetScreen()->m_CurrentItem == NULL ) ||
|
||||||
|
@ -54,7 +54,9 @@ MODULE* module = NULL;
|
||||||
if ( ItemFree ){
|
if ( ItemFree ){
|
||||||
//no track is currently being edited - select a segment and remove it.
|
//no track is currently being edited - select a segment and remove it.
|
||||||
DrawStruct = PcbGeneralLocateAndDisplay();
|
DrawStruct = PcbGeneralLocateAndDisplay();
|
||||||
if ( DrawStruct )
|
//don't let backspace delete modules!!
|
||||||
|
if ( DrawStruct && (DrawStruct->m_StructType == TYPETRACK
|
||||||
|
|| DrawStruct->m_StructType == TYPEVIA))
|
||||||
Delete_Segment(DC, (TRACK*)DrawStruct);
|
Delete_Segment(DC, (TRACK*)DrawStruct);
|
||||||
GetScreen()->SetModify();
|
GetScreen()->SetModify();
|
||||||
}
|
}
|
||||||
|
@ -217,6 +219,7 @@ bool ItemFree = (GetScreen()->m_CurrentItem == NULL ) ||
|
||||||
{
|
{
|
||||||
MODULE * module = Locate_Prefered_Module(m_Pcb, CURSEUR_ON_GRILLE);
|
MODULE * module = Locate_Prefered_Module(m_Pcb, CURSEUR_ON_GRILLE);
|
||||||
if ( module == NULL ) return FALSE;
|
if ( module == NULL ) return FALSE;
|
||||||
|
if( ! IsOK(this, _("Delete module?")) ) return FALSE;
|
||||||
RemoveStruct(module, DC);
|
RemoveStruct(module, DC);
|
||||||
}
|
}
|
||||||
else return FALSE;
|
else return FALSE;
|
||||||
|
|
Loading…
Reference in New Issue