diff --git a/eeschema/eeschema_id.h b/eeschema/eeschema_id.h index 1553182532..2a9ad2ef0d 100644 --- a/eeschema/eeschema_id.h +++ b/eeschema/eeschema_id.h @@ -94,8 +94,7 @@ enum id_eeschema_frm ID_POPUP_SCH_DELETE_CONNECTION, ID_POPUP_SCH_DELETE_NODE, ID_POPUP_SCH_DELETE_CMP, - ID_POPUP_SCH_DRAG_CMP_REQUEST, - ID_POPUP_SCH_DRAG_WIRE_REQUEST, + ID_POPUP_SCH_DRAG_ITEM_REQUEST, ID_POPUP_SCH_UNUSED_2, ID_POPUP_SCH_ENTRY_SELECT_SLASH, ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH, diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index b024e05d89..cafdeb6442 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -165,7 +165,7 @@ static EDA_HOTKEY HkCopyComponentOrText( wxT( "Copy Component or Label" ), ID_POPUP_SCH_COPY_ITEM ); static EDA_HOTKEY HkDrag( wxT( "Drag Schematic Item" ), HK_DRAG, 'G', - ID_POPUP_SCH_DRAG_CMP_REQUEST ); + ID_POPUP_SCH_DRAG_ITEM_REQUEST ); static EDA_HOTKEY HkMove2Drag( wxT( "Move Block -> Drag Block" ), HK_MOVEBLOCK_TO_DRAGBLOCK, '\t' ); static EDA_HOTKEY HkInsert( wxT( "Repeat Last Item" ), HK_REPEAT_LAST, WXK_INSERT ); @@ -717,7 +717,7 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, case SCH_JUNCTION_T: if( ((SCH_ITEM*) aItem )->GetLayer() != LAYER_BUS ) { - cmd.SetId( ID_POPUP_SCH_DRAG_WIRE_REQUEST ); + cmd.SetId( hotKey->m_IdMenuEvent ); wxPostEvent( this, cmd ); } diff --git a/eeschema/onrightclick.cpp b/eeschema/onrightclick.cpp index 121256f7fb..1de316b146 100644 --- a/eeschema/onrightclick.cpp +++ b/eeschema/onrightclick.cpp @@ -280,7 +280,7 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component ) msg = AddHotkeyName( msg, s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM ); AddMenuItem( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) ); msg = AddHotkeyName( _( "Drag Component" ), s_Schematic_Hokeys_Descr, HK_DRAG ); - AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, KiBitmap( move_xpm ) ); + AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_ITEM_REQUEST, msg, KiBitmap( move_xpm ) ); } wxMenu* orientmenu = new wxMenu; @@ -377,7 +377,7 @@ void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel ) AddMenuItem( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, KiBitmap( move_text_xpm ) ); msg = AddHotkeyName( _( "Drag Global Label" ), s_Schematic_Hokeys_Descr, HK_DRAG ); - AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, KiBitmap( move_text_xpm ) ); + AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_ITEM_REQUEST, msg, KiBitmap( move_text_xpm ) ); msg = AddHotkeyName( _( "Copy Global Label" ), s_Schematic_Hokeys_Descr, HK_COPY_COMPONENT_OR_LABEL ); AddMenuItem( PopMenu, ID_POPUP_SCH_COPY_ITEM, msg, KiBitmap( copy_button_xpm ) ); @@ -413,7 +413,7 @@ void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel ) HK_MOVE_COMPONENT_OR_ITEM ); AddMenuItem( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, KiBitmap( move_text_xpm ) ); msg = AddHotkeyName( _( "Drag Hierarchical Label" ), s_Schematic_Hokeys_Descr, HK_DRAG ); - AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, KiBitmap( move_text_xpm ) ); + AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_ITEM_REQUEST, msg, KiBitmap( move_text_xpm ) ); msg = AddHotkeyName( _( "Copy Hierarchical Label" ), s_Schematic_Hokeys_Descr, HK_COPY_COMPONENT_OR_LABEL ); AddMenuItem( PopMenu, ID_POPUP_SCH_COPY_ITEM, msg, KiBitmap( copy_button_xpm ) ); @@ -449,7 +449,7 @@ void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label ) HK_MOVE_COMPONENT_OR_ITEM ); AddMenuItem( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, KiBitmap( move_text_xpm ) ); msg = AddHotkeyName( _( "Drag Label" ), s_Schematic_Hokeys_Descr, HK_DRAG ); - AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, KiBitmap( move_text_xpm ) ); + AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_ITEM_REQUEST, msg, KiBitmap( move_text_xpm ) ); msg = AddHotkeyName( _( "Copy Label" ), s_Schematic_Hokeys_Descr, HK_COPY_COMPONENT_OR_LABEL ); AddMenuItem( PopMenu, ID_POPUP_SCH_COPY_ITEM, msg, KiBitmap( copy_button_xpm ) ); @@ -524,7 +524,7 @@ void SCH_EDIT_FRAME::addJunctionMenuEntries( wxMenu* aMenu, SCH_JUNCTION* aJunct if( !aJunction->IsNew() ) { if( m_collectedItems.IsDraggableJunction() ) - AddMenuItem( aMenu, ID_POPUP_SCH_DRAG_WIRE_REQUEST, _( "Drag Junction" ), + AddMenuItem( aMenu, ID_POPUP_SCH_DRAG_ITEM_REQUEST, _( "Drag Junction" ), KiBitmap( move_xpm ) ); if( screen->GetWire( aJunction->GetPosition(), EXCLUDE_END_POINTS_T ) ) @@ -556,7 +556,7 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame ) } msg = AddHotkeyName( _( "Drag Wire" ), s_Schematic_Hokeys_Descr, HK_DRAG ); - AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_WIRE_REQUEST, msg, KiBitmap( move_track_xpm ) ); + AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_ITEM_REQUEST, msg, KiBitmap( move_track_xpm ) ); PopMenu->AppendSeparator(); msg = AddHotkeyName( _( "Delete Wire" ), s_Schematic_Hokeys_Descr, HK_DELETE ); AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, KiBitmap( delete_xpm ) ); @@ -629,7 +629,7 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet ) AddMenuItem( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, KiBitmap( move_sheet_xpm ) ); msg = AddHotkeyName( _( "Drag Sheet" ), s_Schematic_Hokeys_Descr, HK_DRAG ); - AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, KiBitmap( move_sheet_xpm ) ); + AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_ITEM_REQUEST, msg, KiBitmap( move_sheet_xpm ) ); } if( Sheet->GetFlags() ) diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index 28d7cdfe87..dc17157a06 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -99,8 +99,8 @@ wxString SCH_FIELD::GetText() const wxCHECK_MSG( component != NULL, text, wxT( "No component associated with field" ) + text ); - - text << LIB_COMPONENT::ReturnSubReference( component->GetUnit() ); + if( component->GetPartCount() > 1 ) + text << LIB_COMPONENT::ReturnSubReference( component->GetUnit() ); } return text; diff --git a/eeschema/schedit.cpp b/eeschema/schedit.cpp index 1f99a00725..20345a15ed 100644 --- a/eeschema/schedit.cpp +++ b/eeschema/schedit.cpp @@ -78,8 +78,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_SCH_RESIZE_SHEET: case ID_POPUP_IMPORT_GLABEL: case ID_POPUP_SCH_EDIT_SHEET_PIN: - case ID_POPUP_SCH_DRAG_CMP_REQUEST: - case ID_POPUP_SCH_DRAG_WIRE_REQUEST: + case ID_POPUP_SCH_DRAG_ITEM_REQUEST: case ID_POPUP_SCH_EDIT_CMP: case ID_POPUP_SCH_INIT_CMP: case ID_POPUP_SCH_DISPLAYDOC_CMP: @@ -281,8 +280,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) EditSheetPin( (SCH_SHEET_PIN*) item, &dc ); break; - case ID_POPUP_SCH_DRAG_CMP_REQUEST: - case ID_POPUP_SCH_DRAG_WIRE_REQUEST: + case ID_POPUP_SCH_DRAG_ITEM_REQUEST: DrawPanel->MoveCursorToCrossHair(); // The easiest way to handle a drag component or sheet command