diff --git a/common/dialogs/panel_setup_netclasses.cpp b/common/dialogs/panel_setup_netclasses.cpp index e36716a5f7..c1158d6992 100644 --- a/common/dialogs/panel_setup_netclasses.cpp +++ b/common/dialogs/panel_setup_netclasses.cpp @@ -73,7 +73,8 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, NETCLASSE PANEL_SETUP_NETCLASSES_BASE( aParent->GetTreebook() ), m_Parent( aParent ), m_netclasses( aNetclasses ), - m_netNames( aNetNames ) + m_netNames( aNetNames ), + m_hoveredCol( -1 ) { if( g_lineStyleIcons.empty() ) { @@ -177,6 +178,11 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, NETCLASSE wxGridEventHandler( PANEL_SETUP_NETCLASSES::OnNetclassGridCellChanging ), NULL, this ); + // Handle tooltips for grid + m_netclassGrid->GetGridColLabelWindow()->Bind( wxEVT_MOTION, + &PANEL_SETUP_NETCLASSES::OnNetclassGridMouseEvent, + this ); + m_netclassGrid->EndBatch(); m_membershipGrid->EndBatch(); Thaw(); @@ -441,6 +447,56 @@ void PANEL_SETUP_NETCLASSES::OnNetclassGridCellChanging( wxGridEvent& event ) } +void PANEL_SETUP_NETCLASSES::OnNetclassGridMouseEvent( wxMouseEvent& aEvent ) +{ + int col = m_netclassGrid->XToCol( aEvent.GetPosition().x ); + + if( aEvent.Moving() || aEvent.Entering() ) + { + aEvent.Skip(); + + if( col == wxNOT_FOUND ) + { + m_netclassGrid->GetGridColLabelWindow()->UnsetToolTip(); + return; + } + + if( col == m_hoveredCol ) + return; + + m_hoveredCol = col; + + wxString tip; + + switch( col ) + { + case GRID_CLEARANCE: tip = _( "Minimum copper clearance" ); break; + case GRID_TRACKSIZE: tip = _( "Minimum track width" ); break; + case GRID_VIASIZE: tip = _( "Via pad diameter" ); break; + case GRID_VIADRILL: tip = _( "Via plated hole diameter" ); break; + case GRID_uVIASIZE: tip = _( "Microvia pad diameter" ); break; + case GRID_uVIADRILL: tip = _( "Microvia plated hole diameter" ); break; + case GRID_DIFF_PAIR_WIDTH: tip = _( "Differential pair track width" ); break; + case GRID_DIFF_PAIR_GAP: tip = _( "Differential pair gap" ); break; + case GRID_WIREWIDTH: tip = _( "Schematic wire thickness" ); break; + case GRID_BUSWIDTH: tip = _( "Bus wire thickness" ); break; + case GRID_SCHEMATIC_COLOR: tip = _( "Schematic wire color" ); break; + case GRID_LINESTYLE: tip = _( "Schematic wire line style" ); break; + } + + m_netclassGrid->GetGridColLabelWindow()->UnsetToolTip(); + m_netclassGrid->GetGridColLabelWindow()->SetToolTip( tip ); + } + else if( aEvent.Leaving() ) + { + m_netclassGrid->GetGridColLabelWindow()->UnsetToolTip(); + aEvent.Skip(); + } + + aEvent.Skip(); +} + + void PANEL_SETUP_NETCLASSES::OnAddNetclassClick( wxCommandEvent& event ) { if( !m_netclassGrid->CommitPendingChanges() ) diff --git a/common/dialogs/panel_setup_netclasses_base.cpp b/common/dialogs/panel_setup_netclasses_base.cpp index 8d5086afe5..26f08d466b 100644 --- a/common/dialogs/panel_setup_netclasses_base.cpp +++ b/common/dialogs/panel_setup_netclasses_base.cpp @@ -62,8 +62,6 @@ PANEL_SETUP_NETCLASSES_BASE::PANEL_SETUP_NETCLASSES_BASE( wxWindow* parent, wxWi // Cell Defaults m_netclassGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); - m_netclassGrid->SetToolTip( _("Net Class parameters") ); - sbSizerUpper->Add( m_netclassGrid, 1, wxEXPAND, 5 ); wxBoxSizer* buttonBoxSizer; diff --git a/common/dialogs/panel_setup_netclasses_base.fbp b/common/dialogs/panel_setup_netclasses_base.fbp index 3dd7e6ba77..179af4514c 100644 --- a/common/dialogs/panel_setup_netclasses_base.fbp +++ b/common/dialogs/panel_setup_netclasses_base.fbp @@ -209,7 +209,7 @@ WX_GRID; widgets/wx_grid.h; forward_declare 0 - Net Class parameters + wxBORDER_DEFAULT|wxHSCROLL|wxTAB_TRAVERSAL|wxVSCROLL diff --git a/include/dialogs/panel_setup_netclasses.h b/include/dialogs/panel_setup_netclasses.h index 17aebc987c..947532d00b 100644 --- a/include/dialogs/panel_setup_netclasses.h +++ b/include/dialogs/panel_setup_netclasses.h @@ -42,6 +42,7 @@ private: int* m_originalColWidths; bool m_netclassesDirty; // The netclass drop-down menus need rebuilding wxSize m_membershipSize; // The size needed to show the membership list + int m_hoveredCol; // Column being hovered over, for tooltips private: void OnAddNetclassClick( wxCommandEvent& event ) override; @@ -51,6 +52,7 @@ private: void onmembershipPanelSize( wxSizeEvent& event ) override; void OnUpdateUI( wxUpdateUIEvent &event ) override; void OnNetclassGridCellChanging( wxGridEvent& event ); + void OnNetclassGridMouseEvent( wxMouseEvent& event ); void OnShowAll( wxCommandEvent& event ) override { doApplyFilters( true ); } void OnApplyFilters( wxCommandEvent& event ) override { doApplyFilters( false ); } void OnAssignAll( wxCommandEvent& event ) override { doAssignments( true ); } diff --git a/pcbnew/tools/pcb_actions.cpp b/pcbnew/tools/pcb_actions.cpp index ab14e6e11b..e6630da061 100644 --- a/pcbnew/tools/pcb_actions.cpp +++ b/pcbnew/tools/pcb_actions.cpp @@ -1237,14 +1237,14 @@ TOOL_ACTION PCB_ACTIONS::autoplaceOffboardComponents( "pcbnew.Autoplacer.autopla TOOL_ACTION PCB_ACTIONS::routeSingleTrack( "pcbnew.InteractiveRouter.SingleTrack", AS_GLOBAL, 'X', LEGACY_HK_NAME( "Add New Track" ), - _( "Route Single Track" ), _( "Run push & shove router (single tracks)" ), + _( "Route Single Track" ), _( "Route tracks" ), add_tracks_xpm, AF_ACTIVATE, (void*) PNS::PNS_MODE_ROUTE_SINGLE ); TOOL_ACTION PCB_ACTIONS::routeDiffPair( "pcbnew.InteractiveRouter.DiffPair", AS_GLOBAL, // Don't be tempted to remove "Modern Toolset only". It's in the legacy property name. '6', LEGACY_HK_NAME( "Route Differential Pair (Modern Toolset only)" ), - _( "Route Differential Pair" ), _( "Run push & shove router (differential pairs)" ), + _( "Route Differential Pair" ), _( "Route differential pairs" ), ps_diff_pair_xpm, AF_ACTIVATE, (void*) PNS::PNS_MODE_ROUTE_DIFF_PAIR ); TOOL_ACTION PCB_ACTIONS::routerSettingsDialog( "pcbnew.InteractiveRouter.SettingsDialog",