← Back to team overview

kicad-developers team mailing list archive

[PATCH 2/2] Legacy handling for Via tool

 

This tool isn't available in the Legacy canvas, but we still need to handle
the selection event and show an appropriate error message if the tool is
used.
---
 pcbnew/edit.cpp        | 1 +
 pcbnew/onleftclick.cpp | 1 +
 2 files changed, 2 insertions(+)

diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp
index 694bdd519..e454d7f4d 100644
--- a/pcbnew/edit.cpp
+++ b/pcbnew/edit.cpp
@@ -1526,6 +1526,7 @@ void PCB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
         break;
 
     // collect GAL-only tools here
+    case ID_PCB_DRAW_VIA_BUTT:
     case ID_PCB_MEASUREMENT_TOOL:
         SetToolID( id, wxCURSOR_DEFAULT, _( "Unsupported tool in this canvas" ) );
         break;
diff --git a/pcbnew/onleftclick.cpp b/pcbnew/onleftclick.cpp
index 0da628708..02b90fd82 100644
--- a/pcbnew/onleftclick.cpp
+++ b/pcbnew/onleftclick.cpp
@@ -439,6 +439,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
         m_canvas->DrawGridAxis( aDC, GR_COPY, GetBoard()->GetGridOrigin() );
         break;
 
+    case ID_PCB_DRAW_VIA_BUTT:
     case ID_PCB_MEASUREMENT_TOOL:
         DisplayError( this, _( "This tool is not available in the legacy canvas" ) );
         SetNoToolSelected();

Follow ups

References