diff --git a/bitmaps_png/CMakeLists.txt b/bitmaps_png/CMakeLists.txt index 4f90b2e6e4..ae1fd7a36b 100644 --- a/bitmaps_png/CMakeLists.txt +++ b/bitmaps_png/CMakeLists.txt @@ -379,6 +379,7 @@ set( BMAPS_MID mw_add_stub mw_toolbar net_highlight + net_highlight_schematic netlist net_locked net_unlocked diff --git a/bitmaps_png/cpp_26/net_highlight_schematic.cpp b/bitmaps_png/cpp_26/net_highlight_schematic.cpp new file mode 100644 index 0000000000..480376ea99 --- /dev/null +++ b/bitmaps_png/cpp_26/net_highlight_schematic.cpp @@ -0,0 +1,69 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x03, 0x39, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xb5, 0x96, 0x6b, 0x48, 0x53, + 0x51, 0x1c, 0xc0, 0x8f, 0x8f, 0xd2, 0x06, 0x85, 0xd5, 0x7a, 0x7c, 0x08, 0xa2, 0xb2, 0x90, 0xa0, + 0x4f, 0xeb, 0x83, 0x2b, 0xc2, 0xc7, 0xc6, 0x6c, 0xd6, 0x9d, 0xba, 0xed, 0x4e, 0xd3, 0x39, 0xcd, + 0x0c, 0x1f, 0x61, 0xf4, 0x90, 0xd2, 0x22, 0xb1, 0x32, 0x0a, 0x09, 0x62, 0xc6, 0x36, 0x67, 0xe2, + 0x7c, 0x11, 0x98, 0xa6, 0x56, 0x24, 0xf5, 0x29, 0xa8, 0x89, 0x2b, 0x46, 0xa1, 0x1f, 0xa2, 0xa4, + 0x88, 0x34, 0x08, 0x67, 0x73, 0xd5, 0x87, 0x2d, 0x7b, 0xdc, 0xd3, 0xff, 0xdc, 0xee, 0xd6, 0x55, + 0x27, 0xdd, 0xcd, 0x3c, 0xf0, 0x63, 0x3b, 0xff, 0x73, 0xce, 0xff, 0xb7, 0x73, 0xcf, 0xe3, 0x0e, + 0xa1, 0x99, 0x65, 0x19, 0xf0, 0x64, 0x56, 0x4c, 0x0f, 0xbc, 0xe4, 0xbe, 0x6f, 0x01, 0xbc, 0xc0, + 0x07, 0x60, 0x10, 0x88, 0x05, 0x5e, 0x03, 0x6f, 0x39, 0x52, 0x00, 0x27, 0x12, 0x50, 0x44, 0xc0, + 0xf0, 0xac, 0x58, 0x37, 0x30, 0x0a, 0x24, 0x70, 0xa2, 0x07, 0x5c, 0xfc, 0x1e, 0xb0, 0x95, 0x13, + 0x45, 0xf0, 0xfa, 0x8f, 0x86, 0x23, 0x22, 0xbf, 0x78, 0x04, 0x28, 0x03, 0xaa, 0x79, 0x33, 0x7a, + 0x07, 0xbc, 0x02, 0xa2, 0x39, 0xd1, 0x14, 0xc7, 0xa6, 0x70, 0x45, 0xe9, 0x80, 0x87, 0x4b, 0xfa, + 0x8c, 0x37, 0x23, 0xd2, 0xcf, 0x0a, 0x68, 0x16, 0x32, 0x23, 0x37, 0x97, 0xc4, 0xc8, 0x7d, 0x1a, + 0x80, 0xcd, 0xc0, 0x0b, 0x20, 0x19, 0x18, 0xe7, 0xe2, 0x44, 0xbe, 0x8b, 0x13, 0x59, 0x39, 0xa4, + 0xc0, 0x1b, 0x5e, 0x7d, 0x75, 0x70, 0xcd, 0x23, 0x94, 0x08, 0x43, 0x4f, 0xb3, 0xec, 0x46, 0x95, + 0x48, 0x81, 0xca, 0x51, 0x2f, 0x0c, 0x76, 0x20, 0x09, 0x3a, 0x00, 0x9b, 0xa2, 0x1c, 0xa9, 0x03, + 0xed, 0xd9, 0xf0, 0x03, 0x48, 0x5c, 0x8e, 0x2a, 0x02, 0xb1, 0x4a, 0x44, 0xc1, 0x76, 0x38, 0x1a, + 0xa8, 0x77, 0x42, 0x16, 0x07, 0xbb, 0x8e, 0xbc, 0xe2, 0x40, 0x76, 0x00, 0x07, 0x65, 0x08, 0x61, + 0x71, 0x9b, 0x18, 0xcf, 0xdb, 0xfe, 0x6f, 0x6e, 0xf9, 0x67, 0x12, 0x0b, 0x15, 0x26, 0x58, 0xa7, + 0x48, 0x7b, 0x24, 0x4e, 0x3c, 0xb1, 0x07, 0xcb, 0x95, 0x72, 0x56, 0x18, 0x96, 0xe8, 0x29, 0xfa, + 0xf6, 0x47, 0x64, 0x47, 0xcb, 0x79, 0x0d, 0x3f, 0x01, 0x27, 0x41, 0x34, 0x20, 0x1a, 0x91, 0x19, + 0xd2, 0x7c, 0x57, 0xae, 0x0e, 0x30, 0x54, 0x1e, 0xfd, 0x03, 0x44, 0x4e, 0x7f, 0x5b, 0x48, 0x0c, + 0xc1, 0xe3, 0x0d, 0x22, 0xfa, 0x4a, 0x42, 0x0a, 0x45, 0x8a, 0x24, 0x43, 0xad, 0xfb, 0x68, 0xb5, + 0x8c, 0x30, 0x77, 0x7a, 0xa7, 0xb1, 0x56, 0x9b, 0xef, 0xaa, 0xad, 0xad, 0x8d, 0x44, 0x0b, 0x2a, + 0xb3, 0x44, 0xe9, 0x14, 0xa5, 0xd1, 0xd2, 0xf9, 0xae, 0x8e, 0xd6, 0x31, 0x4c, 0x24, 0xac, 0x88, + 0x36, 0xb8, 0x68, 0x9a, 0x8e, 0xfa, 0x6f, 0xa2, 0xed, 0x75, 0x3b, 0xa6, 0x0b, 0x0b, 0x8f, 0xb9, + 0xbb, 0xbb, 0x3c, 0x01, 0x09, 0x2b, 0xd2, 0x19, 0x5c, 0xc9, 0xc9, 0xc9, 0xd1, 0xfe, 0x21, 0x56, + 0xab, 0xf5, 0x2e, 0x80, 0x05, 0xe0, 0x03, 0x2e, 0x07, 0x44, 0x11, 0x83, 0x11, 0x78, 0x67, 0x95, + 0x14, 0x97, 0x9e, 0xbc, 0xc8, 0xf4, 0xdf, 0xf6, 0xcd, 0x90, 0x10, 0x68, 0xba, 0xc0, 0x25, 0x91, + 0x48, 0x96, 0x90, 0xee, 0x0d, 0x0d, 0x0d, 0x31, 0x4d, 0x4d, 0x4d, 0x8c, 0x40, 0x11, 0x0b, 0xeb, + 0x89, 0x3f, 0x15, 0xbf, 0x21, 0xa9, 0x54, 0x8e, 0xcf, 0x9d, 0x6f, 0x9f, 0x23, 0x08, 0x88, 0x74, + 0x05, 0x13, 0xf0, 0xe8, 0x96, 0x72, 0xa2, 0x15, 0xa1, 0x48, 0x80, 0x87, 0x48, 0x26, 0x93, 0x6d, + 0x53, 0x65, 0x69, 0xc7, 0x8d, 0x46, 0xfb, 0xbc, 0x12, 0xbf, 0x48, 0xa9, 0x54, 0xc6, 0x10, 0x91, + 0xcd, 0x66, 0x8b, 0xe3, 0x25, 0xf9, 0x22, 0x68, 0x79, 0x28, 0x2a, 0xb3, 0x63, 0x7f, 0x46, 0x96, + 0x7b, 0x9f, 0x5e, 0x8d, 0x33, 0x8a, 0x72, 0xb1, 0xae, 0xac, 0x84, 0xb1, 0x98, 0x9e, 0x7f, 0x9f, + 0x23, 0xca, 0x29, 0x9c, 0x80, 0x35, 0x22, 0x97, 0x2c, 0x32, 0x9b, 0xcd, 0x2b, 0x79, 0xa2, 0xcf, + 0x21, 0x6f, 0x86, 0xa8, 0xc7, 0x51, 0x38, 0xa9, 0x58, 0xf6, 0xcb, 0x6a, 0x19, 0x66, 0x93, 0x77, + 0xb4, 0x8f, 0xcf, 0x10, 0x49, 0xa5, 0x52, 0xf2, 0xbe, 0x42, 0xcd, 0xcd, 0xcd, 0xab, 0x78, 0x22, + 0x4f, 0xc8, 0xa2, 0xb8, 0xae, 0x38, 0x9c, 0x5b, 0x7a, 0x84, 0x3d, 0x37, 0x66, 0x93, 0x93, 0x49, + 0x53, 0xee, 0xf5, 0xd5, 0xd4, 0xdc, 0xf4, 0x92, 0xba, 0x2e, 0xe7, 0x60, 0x40, 0x04, 0xc9, 0xc5, + 0x3c, 0x91, 0x3b, 0x34, 0x11, 0x5c, 0x2f, 0xa9, 0x45, 0x0a, 0xdc, 0xde, 0xfa, 0x1e, 0xf7, 0xf5, + 0x78, 0xb1, 0x9a, 0xd6, 0x4f, 0xa6, 0xa6, 0xa7, 0x6e, 0x54, 0x65, 0x6a, 0x5a, 0xcb, 0xca, 0x6b, + 0x3d, 0xb0, 0x46, 0x93, 0x14, 0x45, 0x91, 0xdb, 0x1d, 0xb5, 0xb4, 0xb4, 0xac, 0xe1, 0x89, 0x3e, + 0x85, 0x24, 0x5a, 0x67, 0x5b, 0x8f, 0x8b, 0x8f, 0x9f, 0x65, 0x1f, 0xd3, 0xa5, 0xba, 0xfe, 0x69, + 0x4a, 0xa5, 0x31, 0x07, 0xd6, 0x51, 0xa5, 0xbe, 0x20, 0x57, 0xc8, 0x18, 0xbf, 0xc8, 0x62, 0xb1, + 0xac, 0xe5, 0x89, 0x26, 0x05, 0x39, 0xa0, 0x63, 0x9d, 0xf1, 0x86, 0xd1, 0x97, 0x7a, 0x48, 0x81, + 0x3b, 0xdb, 0xc6, 0x30, 0x39, 0xa8, 0x74, 0xb6, 0x1e, 0x9b, 0x4c, 0xa6, 0x19, 0x5b, 0xb4, 0xbe, + 0xbe, 0x3e, 0xe8, 0xd6, 0x85, 0xf3, 0xe4, 0x11, 0x2a, 0xf2, 0x81, 0x08, 0xc7, 0x5f, 0x4b, 0xc0, + 0xf4, 0xe1, 0x62, 0x9c, 0x57, 0x52, 0x81, 0xab, 0xaa, 0xcf, 0x08, 0x3e, 0x23, 0x8d, 0x8d, 0x8d, + 0x5e, 0xa1, 0xa2, 0xeb, 0x44, 0x44, 0x36, 0x83, 0xe8, 0xbe, 0x08, 0x8b, 0x7b, 0xc4, 0x64, 0xb0, + 0x50, 0x11, 0x03, 0x7d, 0x6d, 0x61, 0x5f, 0xaa, 0x68, 0xd1, 0x8a, 0x13, 0xfe, 0x2b, 0xfc, 0x7d, + 0xf1, 0x4d, 0xa1, 0x45, 0x2d, 0x0e, 0xd4, 0xc7, 0x89, 0x4c, 0x8b, 0x91, 0xfe, 0x37, 0x7d, 0xe3, + 0xfd, 0x9b, 0xc5, 0x5e, 0x7d, 0x41, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, + 0x60, 0x82, +}; + +const BITMAP_OPAQUE net_highlight_schematic_xpm[1] = {{ png, sizeof( png ), "net_highlight_schematic_xpm" }}; + +//EOF diff --git a/bitmaps_png/sources/net_highlight_schematic.svg b/bitmaps_png/sources/net_highlight_schematic.svg new file mode 100644 index 0000000000..8e38861925 --- /dev/null +++ b/bitmaps_png/sources/net_highlight_schematic.svg @@ -0,0 +1,122 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + LABEL + diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 59e714e68c..493bf5ac1f 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -105,6 +105,7 @@ set( EESCHEMA_SRCS getpart.cpp component_tree_search_container.cpp hierarch.cpp + highlight_connection.cpp hotkeys.cpp libarch.cpp libedit.cpp diff --git a/eeschema/eeschema_id.h b/eeschema/eeschema_id.h index 0f879e0ab0..85f50d551c 100644 --- a/eeschema/eeschema_id.h +++ b/eeschema/eeschema_id.h @@ -175,6 +175,8 @@ enum id_eeschema_frm // events (menus, toolbar, context menu, etc.) that result in the same event handler. ID_CANCEL_CURRENT_COMMAND, + ID_HOTKEY_HIGHLIGHT, + /* Library editor main menubar IDs. */ ID_LIBEDIT_DIMENSIONS, diff --git a/eeschema/hierarch.cpp b/eeschema/hierarch.cpp index 3b408b0324..2d9a84c85e 100644 --- a/eeschema/hierarch.cpp +++ b/eeschema/hierarch.cpp @@ -51,8 +51,6 @@ enum class HIERARCHY_NAVIG_DLG; -//Imported function: -int TestDuplicateSheetNames( bool aCreateMarker ); /* This class derived from wxTreeItemData stores the SCH_SHEET_PATH of each * sheet in hierarchy in each TreeItem, in its associated data buffer @@ -307,49 +305,9 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet() RedrawScreen( GetScrollCenterPosition(), true ); } + // Some items (wires, labels) can be highlighted. So prepare the highlight flag: + SetCurrentSheetHighlightFlags(); - // Disable highlight on all items (Note: might be the wrong call if needed for something else than net highlighting) - for( SCH_ITEM* ptr = screen->GetDrawItems(); ptr; ptr = ptr->Next() ) - { - ptr->SetState( BRIGHTENED, false ); - - if( ptr->Type() == SCH_SHEET_T ) - { - for( SCH_SHEET_PIN& pin : static_cast( ptr )->GetPins() ) - pin.SetState( BRIGHTENED, false ); - } - } - - //avoid selection of buses as they are nameless - if( m_SelectedNetName != "" ) - { - if( TestDuplicateSheetNames( false ) ) - SetStatusText( "duplicated sheets names prevent net highlighting" ); - else - { - // Build netlist info to get the proper netnames - std::unique_ptr objectsConnectedList( BuildNetListBase( false ) ); - - // highlight the new items - for( auto obj1 : *objectsConnectedList ) - { - if( obj1->m_SheetPath == *m_CurrentSheet && obj1->GetNetName( true ) == m_SelectedNetName && obj1->m_Comp ) - { - obj1->m_Comp->SetState( BRIGHTENED, true ); - - //if a bus is associated with this net highlight it as well - if( obj1->m_BusNetCode ) - { - for( auto obj2 : *objectsConnectedList ) - { - if( obj2 && obj2->m_Comp && obj2->m_SheetPath == *m_CurrentSheet && obj1->m_BusNetCode == obj2->m_BusNetCode ) - obj2->m_Comp->SetState( BRIGHTENED, true ); - } - } - } - } - } - } // Now refresh m_canvas. Should be not necessary, but because screen has changed // the previous refresh has set all new draw parameters (scroll position ..) // but most of time there were some inconsitencies about cursor parameters diff --git a/eeschema/highlight_connection.cpp b/eeschema/highlight_connection.cpp new file mode 100644 index 0000000000..367bd3e354 --- /dev/null +++ b/eeschema/highlight_connection.cpp @@ -0,0 +1,124 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** + * @file highlight_connection.cpp + * @brief This file contains basic functions related to the command to + * highlight a connection (wires and labels) in a schematic + * (that can be a simple or a complex hierarchy) + */ + +#include +#include +#include +#include + +#include + + +bool SCH_EDIT_FRAME::HighlightConnectionAtPosition( wxPoint aPosition ) +{ + m_SelectedNetName = ""; + bool buildNetlistOk = false; + + // find which connected item is selected + EDA_ITEMS nodeList; + wxPoint gridPosition = GetGridPosition( aPosition ); + + if( GetScreen()->GetNode( gridPosition,nodeList ) ) + { + if( TestDuplicateSheetNames( false ) > 0 ) + wxMessageBox( _( "Error: duplicate sub-sheet names found in current sheet. Fix it" ) ); + else + { + // Build netlist info to get the proper netnames of connected items + std::unique_ptr objectsConnectedList( BuildNetListBase() ); + buildNetlistOk = true; + + for( auto obj : *objectsConnectedList ) + { + if( obj->m_SheetPath == *m_CurrentSheet && obj->m_Comp == nodeList[0] ) + { + m_SelectedNetName = obj->GetNetName( true ); + break; + } + } + } + } + + SetStatusText( "selected net: " + m_SelectedNetName ); + SetCurrentSheetHighlightFlags(); + m_canvas->Refresh(); + + return buildNetlistOk; +} + + +bool SCH_EDIT_FRAME::SetCurrentSheetHighlightFlags() +{ + SCH_SCREEN* screen = m_CurrentSheet->LastScreen(); + + // Disable highlight flag on all items in the current screen + for( SCH_ITEM* ptr = screen->GetDrawItems(); ptr; ptr = ptr->Next() ) + { + ptr->SetState( BRIGHTENED, false ); + + if( ptr->Type() == SCH_SHEET_T ) + { + for( SCH_SHEET_PIN& pin : static_cast( ptr )->GetPins() ) + pin.SetState( BRIGHTENED, false ); + } + } + + if( m_SelectedNetName == "" ) + return true; + + if( TestDuplicateSheetNames( false ) > 0 ) + return false; + + // Build netlist info to get the proper netnames + std::unique_ptr objectsConnectedList( BuildNetListBase( false ) ); + + // highlight the items belonging to this net + for( auto obj1 : *objectsConnectedList ) + { + if( obj1->m_SheetPath == *m_CurrentSheet && + obj1->GetNetName( true ) == m_SelectedNetName && obj1->m_Comp ) + { + obj1->m_Comp->SetState( BRIGHTENED, true ); + + //if a bus is associated with this net highlight it as well + if( obj1->m_BusNetCode ) + { + for( auto obj2 : *objectsConnectedList ) + { + if( obj2 && obj2->m_Comp && obj2->m_SheetPath == *m_CurrentSheet && + obj1->m_BusNetCode == obj2->m_BusNetCode ) + obj2->m_Comp->SetState( BRIGHTENED, true ); + } + } + } + } + + return true; +} diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index bb4d76e43e..43773b5556 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -226,6 +226,9 @@ static EDA_HOTKEY HkAutoplaceFields( _HKI( "Autoplace Fields" ), HK_AUTOPLACE_FI static EDA_HOTKEY HkUpdatePcbFromSch( _HKI( "Update PCB from Schematics" ), HK_UPDATE_PCB_FROM_SCH, WXK_F8 ); +// Higtlight connection +static EDA_HOTKEY HkHighlightConnection( _HKI( "Highlight Connection" ), ID_HOTKEY_HIGHLIGHT, 'X' + GR_KB_CTRL ); + // List of common hotkey descriptors static EDA_HOTKEY* common_Hotkey_List[] = { @@ -303,6 +306,7 @@ static EDA_HOTKEY* schematic_Hotkey_List[] = &HkAutoplaceFields, &HkLeaveSheet, &HkDeleteNode, + &HkHighlightConnection, NULL }; @@ -435,6 +439,11 @@ bool SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, GetScreen()->m_O_Curseur = GetCrossHairPosition(); break; + case ID_HOTKEY_HIGHLIGHT: + if( notBusy ) + HighlightConnectionAtPosition( GetCrossHairPosition() ); + break; + case HK_LEFT_CLICK: case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events if( screen->m_BlockLocate.GetState() == STATE_BLOCK_MOVE ) diff --git a/eeschema/onleftclick.cpp b/eeschema/onleftclick.cpp index 3cd1cc753e..9aec70733c 100644 --- a/eeschema/onleftclick.cpp +++ b/eeschema/onleftclick.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2015 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2011 Wayne Stambaugh * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors. * @@ -50,8 +50,6 @@ #include #include // fo class SCHLIB_FILTER to filter power parts - //Imported function: -int TestDuplicateSheetNames( bool aCreateMarker ); // TODO(hzeller): These pairs of elmenets should be represented by an object, but don't want // to refactor too much right now to not get in the way with other code changes. @@ -114,32 +112,8 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) break; case ID_HIGHLIGHT: - { - m_SelectedNetName = ""; - - //find which item is selected - EDA_ITEMS nodeList; - - if( GetScreen()->GetNode( gridPosition,nodeList ) - && ( !TestDuplicateSheetNames( false ) - || IsOK( NULL, _( "Error: duplicate sheet names. Continue?" ) ) ) ) - { - // Build netlist info to get the proper netnames - std::unique_ptr objectsConnectedList( BuildNetListBase() ); - - for( auto obj : *objectsConnectedList ) - { - if( obj->m_SheetPath == *m_CurrentSheet && obj->m_Comp == nodeList[0] ) - { - m_SelectedNetName = obj->GetNetName( true ); - break; - } - } - } - - SetStatusText( "selected net: " + m_SelectedNetName ); - DisplayCurrentSheet(); - }break; + HighlightConnectionAtPosition( aPosition ); + break; case ID_HIERARCHY_PUSH_POP_BUTT: if( ( item && item->GetFlags() ) || ( g_RootSheet->CountSheets() == 0 ) ) diff --git a/eeschema/schedit.cpp b/eeschema/schedit.cpp index 44c3de6e34..e7daf70f76 100644 --- a/eeschema/schedit.cpp +++ b/eeschema/schedit.cpp @@ -530,7 +530,7 @@ void SCH_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent ) break; case ID_HIGHLIGHT: - SetToolID( id, m_canvas->GetDefaultCursor(), _("click to highlight") ); + SetToolID( id, wxCURSOR_HAND, _("click to highlight") ); break; case ID_ZOOM_SELECTION: diff --git a/eeschema/schframe.h b/eeschema/schframe.h index bebb40ed28..fb58d1c49b 100644 --- a/eeschema/schframe.h +++ b/eeschema/schframe.h @@ -457,6 +457,18 @@ public: */ bool DeleteItemAtCrossHair( wxDC* aDC ); + + /** + * Function HighlightConnectionAtPosition + * Highlight the connection found at aPosition. + * If no connection to highlight is found, clear the current highlighted connect (if any). + * + * @param aPosition is the location of the test point (usually cross hair position). + * @return true if ok, false if there was an issue to build the netlist + * needed to highlight a connection. + */ + bool HighlightConnectionAtPosition( wxPoint aPosition ); + /** * Function FindComponentAndItem * finds a component in the schematic and an item in this component. @@ -619,6 +631,15 @@ public: */ void DisplayCurrentSheet(); + /** + * Function SetCurrentSheetHighlightFlags + * Set/reset the BRIGHTENED of connected objects inside the current sheet, + * according to the highligthed net name. + * @return true if the flags are correctly set, and false if something goes wrong + * (duplicate sheet names) + */ + bool SetCurrentSheetHighlightFlags(); + /** * Function GetUniqueFilenameForCurrentSheet * @return a filename that can be used in plot and print functions diff --git a/eeschema/tool_sch.cpp b/eeschema/tool_sch.cpp index 979d4062a6..86cfd6985d 100644 --- a/eeschema/tool_sch.cpp +++ b/eeschema/tool_sch.cpp @@ -190,7 +190,7 @@ void SCH_EDIT_FRAME::ReCreateVToolbar() m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ), wxEmptyString, wxITEM_CHECK ); - m_drawToolBar->AddTool( ID_HIGHLIGHT, wxEmptyString, KiBitmap( net_highlight_xpm ), + m_drawToolBar->AddTool( ID_HIGHLIGHT, wxEmptyString, KiBitmap( net_highlight_schematic_xpm ), _( "Click to highlight net" ), wxITEM_CHECK ); m_drawToolBar->AddTool( ID_ZOOM_SELECTION, wxEmptyString, KiBitmap( zoom_area_xpm ), diff --git a/include/bitmaps.h b/include/bitmaps.h index b2fc22f700..cf7834d349 100644 --- a/include/bitmaps.h +++ b/include/bitmaps.h @@ -363,6 +363,7 @@ EXTERN_BITMAP( mw_add_stub_arc_xpm ) EXTERN_BITMAP( mw_add_stub_xpm ) EXTERN_BITMAP( mw_toolbar_xpm ) EXTERN_BITMAP( net_highlight_xpm ) +EXTERN_BITMAP( net_highlight_schematic_xpm ) EXTERN_BITMAP( netlist_xpm ) EXTERN_BITMAP( net_locked_xpm ) EXTERN_BITMAP( net_unlocked_xpm )