Loading eeschema/CMakeLists.txt +1 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ set(EESCHEMA_SRCS eeschema.cpp eeschema_config.cpp erc.cpp events_called_functions_for_edit.cpp files-io.cpp find.cpp getpart.cpp Loading eeschema/eeschema_id.h +2 −1 Original line number Diff line number Diff line Loading @@ -45,6 +45,8 @@ enum id_eeschema_frm ID_SCHEMATIC_VERTICAL_TOOLBAR_END, /* Schematic editor context menu IDs. */ ID_POPUP_SCH_COPY_ITEM, ID_POPUP_START_RANGE, ID_POPUP_SCH_DELETE, ID_POPUP_SCH_BREAK_WIRE, Loading Loading @@ -84,7 +86,6 @@ enum id_eeschema_frm ID_POPUP_SCH_EDIT_REF_CMP, ID_POPUP_SCH_EDIT_FOOTPRINT_CMP, ID_POPUP_SCH_EDIT_CONVERT_CMP, ID_POPUP_SCH_COPY_COMPONENT_CMP, ID_POPUP_SCH_SELECT_UNIT_CMP, ID_POPUP_SCH_SELECT_UNIT1, ID_POPUP_SCH_SELECT_UNIT2, Loading eeschema/events_called_functions_for_edit.cpp 0 → 100644 +60 −0 Original line number Diff line number Diff line /* * events_called_functions.cpp * some events functions */ #include "fctsys.h" #include "gr_basic.h" #include "common.h" #include "class_drawpanel.h" #include "program.h" #include "general.h" #include "kicad_device_context.h" #include "protos.h" /** Event function WinEDA_SchematicFrame::OnCopySchematicItemRequest * duplicate the current located item */ void WinEDA_SchematicFrame::OnCopySchematicItemRequest( wxCommandEvent& event ) { SCH_ITEM * curr_item = GetScreen()->GetCurItem(); if( !curr_item || curr_item->m_Flags ) return; INSTALL_DC( dc, DrawPanel ); switch( curr_item->Type() ) { case TYPE_SCH_COMPONENT: { SCH_COMPONENT* newitem; newitem = ((SCH_COMPONENT*) curr_item)->GenCopy(); newitem->m_TimeStamp = GetTimeStamp(); newitem->ClearAnnotation( NULL ); newitem->m_Flags = IS_NEW; StartMovePart( newitem, &dc ); /* Redraw the original part, because StartMovePart() erased * it from screen */ RedrawOneStruct( DrawPanel, &dc, curr_item, GR_DEFAULT_DRAWMODE ); } break; case TYPE_SCH_TEXT: case TYPE_SCH_LABEL: case TYPE_SCH_GLOBALLABEL: case TYPE_SCH_HIERLABEL: { SCH_TEXT* newitem = ((SCH_TEXT*) curr_item)->GenCopy(); newitem->m_Flags = IS_NEW; StartMoveTexte( newitem, &dc ); /* Redraw the original part in XOR mode */ RedrawOneStruct( DrawPanel, &dc, curr_item, g_XorMode ); } break; default: break; } } eeschema/hotkeys.cpp +20 −5 Original line number Diff line number Diff line Loading @@ -83,9 +83,14 @@ static Ki_HotkeyInfo HkEditComponentValue( wxT( "Edit Component Value" ), static Ki_HotkeyInfo HkEditComponentFootprint( wxT( "Edit Component Footprint" ), HK_EDIT_COMPONENT_FOOTPRINT, 'F' ); static Ki_HotkeyInfo HkMoveComponent( wxT( "Move Component or Label" ), static Ki_HotkeyInfo HkMoveComponentOrText( wxT( "Move Component or Label" ), HK_MOVE_COMPONENT_OR_LABEL, 'M', ID_POPUP_SCH_MOVE_CMP_REQUEST ); static Ki_HotkeyInfo HkCopyComponentOrText( wxT( "Copy Component or Label" ), HK_COPY_COMPONENT_OR_LABEL, 'C', ID_POPUP_SCH_COPY_ITEM ); static Ki_HotkeyInfo HkDragComponent( wxT( "Drag Component" ), HK_DRAG_COMPONENT, 'G', ID_POPUP_SCH_DRAG_CMP_REQUEST ); Loading Loading @@ -122,7 +127,8 @@ Ki_HotkeyInfo* s_Schematic_Hotkey_List[] = { &HkNextSearch, &HkDelete, &HkInsert, &HkMove2Drag, &HkMoveComponent, &HkDragComponent, &HkAddComponent, &HkMoveComponentOrText, &HkCopyComponentOrText, &HkDragComponent, &HkAddComponent, &HkRotateComponent, &HkMirrorXComponent, &HkMirrorYComponent, &HkOrientNormalComponent, &HkEditComponent,&HkEditComponentValue,&HkEditComponentFootprint, Loading Loading @@ -415,8 +421,9 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, } break; case HK_DRAG_COMPONENT: // Start drag Component case HK_MOVE_COMPONENT_OR_LABEL: // Start move Component case HK_DRAG_COMPONENT: // Start drag component case HK_MOVE_COMPONENT_OR_LABEL: // Start move component or text/label case HK_COPY_COMPONENT_OR_LABEL: // Duplicate component or text/label if( ItemInEdit ) break; Loading @@ -433,6 +440,14 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, break; } if( HK_Descr->m_Idcommand == HK_COPY_COMPONENT_OR_LABEL ) { GetScreen()->SetCurItem( (SCH_ITEM*) DrawStruct ); wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED, HK_Descr->m_IdMenuEvent ); wxPostEvent( this, event ); break; } switch( DrawStruct->Type() ) { Loading eeschema/hotkeys.h +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ enum hotkey_id_commnand { HK_MIRROR_Y_COMPONENT, HK_ORIENT_NORMAL_COMPONENT, HK_MOVE_COMPONENT_OR_LABEL, HK_COPY_COMPONENT_OR_LABEL, HK_DRAG_COMPONENT, HK_ADD_NEW_COMPONENT, HK_BEGIN_WIRE Loading Loading
eeschema/CMakeLists.txt +1 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ set(EESCHEMA_SRCS eeschema.cpp eeschema_config.cpp erc.cpp events_called_functions_for_edit.cpp files-io.cpp find.cpp getpart.cpp Loading
eeschema/eeschema_id.h +2 −1 Original line number Diff line number Diff line Loading @@ -45,6 +45,8 @@ enum id_eeschema_frm ID_SCHEMATIC_VERTICAL_TOOLBAR_END, /* Schematic editor context menu IDs. */ ID_POPUP_SCH_COPY_ITEM, ID_POPUP_START_RANGE, ID_POPUP_SCH_DELETE, ID_POPUP_SCH_BREAK_WIRE, Loading Loading @@ -84,7 +86,6 @@ enum id_eeschema_frm ID_POPUP_SCH_EDIT_REF_CMP, ID_POPUP_SCH_EDIT_FOOTPRINT_CMP, ID_POPUP_SCH_EDIT_CONVERT_CMP, ID_POPUP_SCH_COPY_COMPONENT_CMP, ID_POPUP_SCH_SELECT_UNIT_CMP, ID_POPUP_SCH_SELECT_UNIT1, ID_POPUP_SCH_SELECT_UNIT2, Loading
eeschema/events_called_functions_for_edit.cpp 0 → 100644 +60 −0 Original line number Diff line number Diff line /* * events_called_functions.cpp * some events functions */ #include "fctsys.h" #include "gr_basic.h" #include "common.h" #include "class_drawpanel.h" #include "program.h" #include "general.h" #include "kicad_device_context.h" #include "protos.h" /** Event function WinEDA_SchematicFrame::OnCopySchematicItemRequest * duplicate the current located item */ void WinEDA_SchematicFrame::OnCopySchematicItemRequest( wxCommandEvent& event ) { SCH_ITEM * curr_item = GetScreen()->GetCurItem(); if( !curr_item || curr_item->m_Flags ) return; INSTALL_DC( dc, DrawPanel ); switch( curr_item->Type() ) { case TYPE_SCH_COMPONENT: { SCH_COMPONENT* newitem; newitem = ((SCH_COMPONENT*) curr_item)->GenCopy(); newitem->m_TimeStamp = GetTimeStamp(); newitem->ClearAnnotation( NULL ); newitem->m_Flags = IS_NEW; StartMovePart( newitem, &dc ); /* Redraw the original part, because StartMovePart() erased * it from screen */ RedrawOneStruct( DrawPanel, &dc, curr_item, GR_DEFAULT_DRAWMODE ); } break; case TYPE_SCH_TEXT: case TYPE_SCH_LABEL: case TYPE_SCH_GLOBALLABEL: case TYPE_SCH_HIERLABEL: { SCH_TEXT* newitem = ((SCH_TEXT*) curr_item)->GenCopy(); newitem->m_Flags = IS_NEW; StartMoveTexte( newitem, &dc ); /* Redraw the original part in XOR mode */ RedrawOneStruct( DrawPanel, &dc, curr_item, g_XorMode ); } break; default: break; } }
eeschema/hotkeys.cpp +20 −5 Original line number Diff line number Diff line Loading @@ -83,9 +83,14 @@ static Ki_HotkeyInfo HkEditComponentValue( wxT( "Edit Component Value" ), static Ki_HotkeyInfo HkEditComponentFootprint( wxT( "Edit Component Footprint" ), HK_EDIT_COMPONENT_FOOTPRINT, 'F' ); static Ki_HotkeyInfo HkMoveComponent( wxT( "Move Component or Label" ), static Ki_HotkeyInfo HkMoveComponentOrText( wxT( "Move Component or Label" ), HK_MOVE_COMPONENT_OR_LABEL, 'M', ID_POPUP_SCH_MOVE_CMP_REQUEST ); static Ki_HotkeyInfo HkCopyComponentOrText( wxT( "Copy Component or Label" ), HK_COPY_COMPONENT_OR_LABEL, 'C', ID_POPUP_SCH_COPY_ITEM ); static Ki_HotkeyInfo HkDragComponent( wxT( "Drag Component" ), HK_DRAG_COMPONENT, 'G', ID_POPUP_SCH_DRAG_CMP_REQUEST ); Loading Loading @@ -122,7 +127,8 @@ Ki_HotkeyInfo* s_Schematic_Hotkey_List[] = { &HkNextSearch, &HkDelete, &HkInsert, &HkMove2Drag, &HkMoveComponent, &HkDragComponent, &HkAddComponent, &HkMoveComponentOrText, &HkCopyComponentOrText, &HkDragComponent, &HkAddComponent, &HkRotateComponent, &HkMirrorXComponent, &HkMirrorYComponent, &HkOrientNormalComponent, &HkEditComponent,&HkEditComponentValue,&HkEditComponentFootprint, Loading Loading @@ -415,8 +421,9 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, } break; case HK_DRAG_COMPONENT: // Start drag Component case HK_MOVE_COMPONENT_OR_LABEL: // Start move Component case HK_DRAG_COMPONENT: // Start drag component case HK_MOVE_COMPONENT_OR_LABEL: // Start move component or text/label case HK_COPY_COMPONENT_OR_LABEL: // Duplicate component or text/label if( ItemInEdit ) break; Loading @@ -433,6 +440,14 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, break; } if( HK_Descr->m_Idcommand == HK_COPY_COMPONENT_OR_LABEL ) { GetScreen()->SetCurItem( (SCH_ITEM*) DrawStruct ); wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED, HK_Descr->m_IdMenuEvent ); wxPostEvent( this, event ); break; } switch( DrawStruct->Type() ) { Loading
eeschema/hotkeys.h +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ enum hotkey_id_commnand { HK_MIRROR_Y_COMPONENT, HK_ORIENT_NORMAL_COMPONENT, HK_MOVE_COMPONENT_OR_LABEL, HK_COPY_COMPONENT_OR_LABEL, HK_DRAG_COMPONENT, HK_ADD_NEW_COMPONENT, HK_BEGIN_WIRE Loading