diff --git a/common/about_kicad.cpp b/common/about_kicad.cpp index d787509cec..3415442d5c 100644 --- a/common/about_kicad.cpp +++ b/common/about_kicad.cpp @@ -8,7 +8,7 @@ #include "appl_wxstruct.h" -#define BUILD_VERSION "(20090808-unstable)" +#define BUILD_VERSION "(20090827-unstable)" #ifdef HAVE_SVN_VERSION diff --git a/eeschema/block.cpp b/eeschema/block.cpp index 51908abbe8..9227fdf61b 100644 --- a/eeschema/block.cpp +++ b/eeschema/block.cpp @@ -583,7 +583,7 @@ static void CollectStructsToDrag( SCH_SCREEN* screen ) { SCH_ITEM* Struct; EDA_DrawLineStruct* SegmStruct; - + PICKED_ITEMS_LIST* pickedlist = &screen->m_BlockLocate.m_ItemsSelection; if( pickedlist->GetCount() == 0 ) @@ -632,7 +632,7 @@ static void CollectStructsToDrag( SCH_SCREEN* screen ) // Save m_Flags for Undo/redo drag operations: pickedlist->SetPickerFlags(SegmStruct->m_Flags, ii); - + } } diff --git a/eeschema/bus-wire-junction.cpp b/eeschema/bus-wire-junction.cpp index 9ef10fca83..ee7e2ac85e 100644 --- a/eeschema/bus-wire-junction.cpp +++ b/eeschema/bus-wire-junction.cpp @@ -588,12 +588,12 @@ static void AbortCreateNewLine( WinEDA_DrawPanel* Panel, wxDC* DC ) if( Screen->GetCurItem() ) /* trace en cours */ { - Panel->ManageCurseur( Panel, DC, FALSE ); Panel->ManageCurseur = NULL; Panel->ForceCloseManageCurseur = NULL; EraseStruct( (SCH_ITEM*) Screen->GetCurItem(), (SCH_SCREEN*) Screen ); Screen->SetCurItem( NULL ); RestoreOldWires( Screen ); + Panel->Refresh(); } else g_ItemToRepeat = NULL; // Fin de commande generale diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp index 0ccb06a7a9..3cf8efb29e 100644 --- a/eeschema/class_library.cpp +++ b/eeschema/class_library.cpp @@ -124,13 +124,14 @@ LibCmpEntry* LibraryStruct::FindEntry( const wxChar* name, LibrEntryType type ) if( entry != NULL && entry->Type != ROOT && type == ROOT ) { EDA_LibCmpAliasStruct* alias = ( EDA_LibCmpAliasStruct* ) entry; + const wxChar* rootname = alias->m_RootName.GetData(); PQCompFunc( (PQCompFuncType) LibraryEntryCompare ); entry = (LibCmpEntry*) PQFirst( &m_Entries, false ); while( entry ) { - if( entry->m_Name.m_Text.CmpNoCase( name ) == 0 + if( entry->m_Name.m_Text.CmpNoCase( rootname ) == 0 && entry->Type == ROOT ) break; diff --git a/eeschema/class_library.h b/eeschema/class_library.h index e24541e1e3..0934c73852 100644 --- a/eeschema/class_library.h +++ b/eeschema/class_library.h @@ -87,7 +87,7 @@ public: * should give better search capability. * * @param names - String array to place entry names into. - * @parem nameSearch - Name wild card search criteria. + * @param nameSearch - Name wild card search criteria. * @param keySearch - Key word search criteria. * @param sort - Sort names if true. */ diff --git a/eeschema/onrightclick.cpp b/eeschema/onrightclick.cpp index 088dad9e3e..0f90397fe7 100644 --- a/eeschema/onrightclick.cpp +++ b/eeschema/onrightclick.cpp @@ -484,13 +484,14 @@ void AddMenusForWire( wxMenu* PopMenu, EDA_DrawLineStruct* Wire, wxPoint pos = frame->GetScreen()->m_Curseur; if( is_new ) + { ADD_MENUITEM( PopMenu, ID_POPUP_END_LINE, _( "Wire End" ), apply_xpm ); - - ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Wire" ), delete_xpm ); - - if( is_new ) return; + } + ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DRAG_WIRE_REQUEST, _( "Drag Wire" ), move_track_xpm ); + PopMenu->AppendSeparator(); + ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Wire" ), delete_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete Node" ), delete_node_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_CONNECTION, _( "Delete Connection" ), delete_connection_xpm ); @@ -523,13 +524,15 @@ void AddMenusForBus( wxMenu* PopMenu, EDA_DrawLineStruct* Bus, wxPoint pos = frame->GetScreen()->m_Curseur; if( is_new ) + { ADD_MENUITEM( PopMenu, ID_POPUP_END_LINE, _( "Bus End" ), apply_xpm ); + return; + } ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Bus" ), delete_bus_xpm ); - if( !is_new ) - ADD_MENUITEM( PopMenu, ID_POPUP_SCH_BREAK_WIRE, + ADD_MENUITEM( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Bus" ), break_bus_xpm ); PopMenu->AppendSeparator(); diff --git a/eeschema/schedit.cpp b/eeschema/schedit.cpp index 88dc8d6429..49df2553db 100644 --- a/eeschema/schedit.cpp +++ b/eeschema/schedit.cpp @@ -60,6 +60,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_SCH_MOVE_ITEM_REQUEST: case ID_POPUP_SCH_MOVE_CMP_REQUEST: case ID_POPUP_SCH_DRAG_CMP_REQUEST: + case ID_POPUP_SCH_DRAG_WIRE_REQUEST: case ID_POPUP_SCH_EDIT_CMP: case ID_POPUP_SCH_MIROR_X_CMP: case ID_POPUP_SCH_MIROR_Y_CMP: @@ -421,9 +422,10 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_SCH_MOVE_ITEM_REQUEST: DrawPanel->MouseToCursorSchema(); - if( id == ID_POPUP_SCH_DRAG_CMP_REQUEST ) + if( (id == ID_POPUP_SCH_DRAG_CMP_REQUEST ) || + (id == ID_POPUP_SCH_DRAG_WIRE_REQUEST ) ) { - // The easiest way to handle a drag component is simulate a + // The easiest way to handle a drag component is to simulate a // block drag command if( screen->m_BlockLocate.m_State == STATE_NO_BLOCK ) { @@ -437,7 +439,34 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) Process_Move_Item( (SCH_ITEM*) screen->GetCurItem(), &dc ); break; - case ID_POPUP_SCH_EDIT_CMP: + case ID_POPUP_SCH_DRAG_WIRE_REQUEST: + DrawPanel->MouseToCursorSchema(); + // The easiest way to handle a drag component is to simulate a + // block drag command + if( screen->m_BlockLocate.m_State == STATE_NO_BLOCK ) + { + if( !HandleBlockBegin( &dc, BLOCK_DRAG, + screen->m_Curseur ) ) + break; + // Ensure the block selection contains the segment, or one end of the segment + // the initial rect is only one point (w = h = 0) + // The rect must contains one or 2 ends. + // If only one end is selected, this is a drag Node + // if no ends selected, we adjust the rect area to contain the whole segment + // This works fine only for H and V segments and only if they do not cross a component + // TODO: a better way to drag only wires + EDA_DrawLineStruct* segm = (EDA_DrawLineStruct*)screen->GetCurItem(); + if( !screen->m_BlockLocate.Inside(segm->m_Start) && + !screen->m_BlockLocate.Inside(segm->m_End) ) + { + screen->m_BlockLocate.SetOrigin(segm->m_Start); + screen->m_BlockLocate.SetEnd(segm->m_End); + } + HandleBlockEnd( &dc ); + } + break; + + case ID_POPUP_SCH_EDIT_CMP: // Ensure the struct is a component (could be a struct of a // component, like Field, text..) diff --git a/include/id.h b/include/id.h index 1420a52d6c..ba599596d8 100644 --- a/include/id.h +++ b/include/id.h @@ -265,7 +265,7 @@ enum main_id { ID_POPUP_SCH_MOVE_CMP_REQUEST, ID_POPUP_SCH_DELETE_CMP, ID_POPUP_SCH_DRAG_CMP_REQUEST, - ID_POPUP_SCH_UNUSED_1, + ID_POPUP_SCH_DRAG_WIRE_REQUEST, ID_POPUP_SCH_UNUSED_2, ID_POPUP_SCH_ENTRY_SELECT_SLASH, ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH,