Commit aa5e1cd0 authored by lifekidyeaa's avatar lifekidyeaa

* backspace should not be allowed to delete modules (in order to

re-insert them, you may have to edit the .brd file directly)
parent 3c7846db
...@@ -1365,6 +1365,7 @@ void WinEDA_PcbFrame::SwitchLayer(wxDC *DC, int layer) ...@@ -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; ...@@ -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; ...@@ -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 ) || ...@@ -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;
......
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