Pcbnew: add "edit all tracks and vias" command in edit menu.

Previously, this command was accessible only by right clicking on a track and only in the legacy mode.
This commit is contained in:
jean-pierre charras 2016-10-14 21:07:04 +02:00
parent 87eda6180d
commit d167407d1a
11 changed files with 1046 additions and 887 deletions

View File

@ -1,8 +1,8 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2009-2014 Jean-Pierre Charras, jean-pierre.charras at wanadoo.fr * Copyright (C) 2009-2016 Jean-Pierre Charras, jean-pierre.charras at wanadoo.fr
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -44,12 +44,12 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS( PCB_EDIT
int aNetcode ) : int aNetcode ) :
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE( aParent ) DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE( aParent )
{ {
m_Parent = aParent; m_parent = aParent;
m_Netcode = aNetcode; m_curr_netcode = aNetcode;
m_OptionID = 0; m_optionID = 0;
MyInit(); MyInit();
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Layout();
} }
@ -57,45 +57,53 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
{ {
SetFocus(); SetFocus();
wxString msg;
// Display current setup for tracks and vias // Display current setup for tracks and vias
BOARD* board = m_Parent->GetBoard(); m_brd = m_parent->GetBoard();
BOARD_DESIGN_SETTINGS& dsnSettings = board->GetDesignSettings(); buildNetsList();
NETCLASSES& netclasses = dsnSettings.m_NetClasses; updateNetInfo();
m_gridDisplayCurrentSettings->Fit();
}
void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::updateNetInfo()
{
BOARD_DESIGN_SETTINGS& brdSettings = m_brd->GetDesignSettings();
NETCLASSES& netclasses = brdSettings.m_NetClasses;
NETCLASSPTR netclass = netclasses.GetDefault(); NETCLASSPTR netclass = netclasses.GetDefault();
NETINFO_ITEM* net = board->FindNet( m_Netcode ); NETINFO_ITEM* net = m_brd->FindNet( m_curr_netcode );
if( net ) if( net )
{ {
m_CurrentNetName->SetLabel( net->GetNetname() ); netclass = net->GetNetClass();
m_CurrentNetclassName->SetLabel( dsnSettings.GetCurrentNetClassName() ); m_CurrentNetclassName->SetLabel( netclass->GetName() );
netclass = netclasses.Find( dsnSettings.GetCurrentNetClassName() );
} }
/* Disable the option "copy current to net" if we have only default netclass values /* Disable the option "copy current to net" if we have only default netclass values
* i.e. when m_TrackWidthSelector and m_ViaSizeSelector are set to 0 * i.e. when m_TrackWidthSelector and m_ViaSizeSelector are set to 0
*/ */
if( !dsnSettings.GetTrackWidthIndex() && !dsnSettings.GetViaSizeIndex() ) if( !brdSettings.GetTrackWidthIndex() && !brdSettings.GetViaSizeIndex() )
{ {
m_Net2CurrValueButton->Enable( false ); m_Net2CurrValueButton->Enable( false );
m_OptionID = ID_NETCLASS_VALUES_TO_CURRENT_NET; m_optionID = ID_NETCLASS_VALUES_TO_CURRENT_NET;
m_NetUseNetclassValueButton->SetValue(true); m_NetUseNetclassValueButton->SetValue(true);
} }
else else
{ {
m_OptionID = ID_CURRENT_VALUES_TO_CURRENT_NET; m_optionID = ID_CURRENT_VALUES_TO_CURRENT_NET;
m_Net2CurrValueButton->SetValue(true); m_Net2CurrValueButton->SetValue(true);
} }
// Display current values, and current netclass values: // Display current values, and current netclass values:
wxString msg;
int value = netclass->GetTrackWidth(); // Display track width int value = netclass->GetTrackWidth(); // Display track width
msg = StringFromValue( g_UserUnit, value, true ); msg = StringFromValue( g_UserUnit, value, true );
m_gridDisplayCurrentSettings->SetCellValue( 0, 0, msg ); m_gridDisplayCurrentSettings->SetCellValue( 0, 0, msg );
if( dsnSettings.GetTrackWidthIndex() ) if( brdSettings.GetTrackWidthIndex() > 0 )
{ {
value = dsnSettings.GetCurrentTrackWidth(); value = brdSettings.GetCurrentTrackWidth();
msg = StringFromValue( g_UserUnit, value, true ); msg = StringFromValue( g_UserUnit, value, true );
} }
else else
@ -107,44 +115,37 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
msg = StringFromValue( g_UserUnit, value, true ); msg = StringFromValue( g_UserUnit, value, true );
m_gridDisplayCurrentSettings->SetCellValue( 0, 1, msg ); m_gridDisplayCurrentSettings->SetCellValue( 0, 1, msg );
if( dsnSettings.GetViaSizeIndex() ) if( brdSettings.GetViaSizeIndex() > 0 )
{ {
value = dsnSettings.GetCurrentViaSize(); value = brdSettings.GetCurrentViaSize();
msg = StringFromValue( g_UserUnit, value, true ); msg = StringFromValue( g_UserUnit, value, true );
} }
else else
msg = _( "Default" ); msg = _( "Default" );
m_gridDisplayCurrentSettings->SetCellValue( 1, 1, msg ); m_gridDisplayCurrentSettings->SetCellValue( 1, 1, msg );
value = netclass->GetViaDrill(); // Display via drill value = netclass->GetViaDrill(); // Display via drill
msg = StringFromValue( g_UserUnit, value, true ); msg = StringFromValue( g_UserUnit, value, true );
m_gridDisplayCurrentSettings->SetCellValue( 0, 2, msg ); m_gridDisplayCurrentSettings->SetCellValue( 0, 2, msg );
value = dsnSettings.GetCurrentViaDrill(); value = brdSettings.GetCurrentViaDrill();
if( value >= 0 ) if( value >= 0 )
msg = StringFromValue( g_UserUnit, value, true ); msg = StringFromValue( g_UserUnit, value, true );
else else
msg = _( "Default" ); msg = _( "Default" );
m_gridDisplayCurrentSettings->SetCellValue( 1, 2, msg ); m_gridDisplayCurrentSettings->SetCellValue( 1, 2, msg );
value = netclass->GetuViaDiameter(); // Display micro via diameter value = netclass->GetuViaDiameter(); // Display micro via diameter
msg = StringFromValue( g_UserUnit, value, true ); msg = StringFromValue( g_UserUnit, value, true );
m_gridDisplayCurrentSettings->SetCellValue( 0, 3, msg ); m_gridDisplayCurrentSettings->SetCellValue( 0, 3, msg );
#if 0 // Currently we use always the default netclass value
value = board->GetCurrentMicroViaSize();
msg = StringFromValue( g_UserUnit, value, true );
#endif
msg = _( "Default" ); msg = _( "Default" );
m_gridDisplayCurrentSettings->SetCellValue( 1, 3, msg ); m_gridDisplayCurrentSettings->SetCellValue( 1, 3, msg );
value = netclass->GetuViaDrill(); // Display micro via drill value = netclass->GetuViaDrill(); // Display micro via drill
msg = StringFromValue( g_UserUnit, value, true ); msg = StringFromValue( g_UserUnit, value, true );
m_gridDisplayCurrentSettings->SetCellValue( 0, 4, msg ); m_gridDisplayCurrentSettings->SetCellValue( 0, 4, msg );
#if 0 // Currently we use always the default netclass value
value = board->GetCurrentMicroViaDrill();
if( value >= 0 )
msg = StringFromValue( g_UserUnit, value, true );
else
#endif
msg = _( "Default" ); msg = _( "Default" );
m_gridDisplayCurrentSettings->SetCellValue( 1, 4, msg ); m_gridDisplayCurrentSettings->SetCellValue( 1, 4, msg );
@ -155,18 +156,56 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
m_gridDisplayCurrentSettings->SetReadOnly( ii, jj, true ); m_gridDisplayCurrentSettings->SetReadOnly( ii, jj, true );
} }
// needs wxWidgets version >= 2.8.8:
m_gridDisplayCurrentSettings->SetRowLabelSize(wxGRID_AUTOSIZE); m_gridDisplayCurrentSettings->SetRowLabelSize(wxGRID_AUTOSIZE);
m_gridDisplayCurrentSettings->Fit();
} }
void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::buildNetsList()
{
wxString txt;
// Populate the nets list with nets names
for( unsigned netcode = 0; netcode < m_brd->GetNetCount(); netcode++ )
{
NETINFO_ITEM* net = m_brd->GetNetInfo().GetNetItem( netcode );
wxString netname = net->GetNetname();
if( netcode == 0 ) // netcode 0 is the netcode of not connected items
netname = "<no net>";
txt.Printf( _( "net %.3d" ), net->GetNet() );
txt << " " << netname;
m_choiceNetName->Append( txt );
}
if( m_curr_netcode < 0 )
m_curr_netcode = 0;
m_choiceNetName->SetSelection( m_curr_netcode );
updateNetInfo();
}
void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::onNetSelection( wxCommandEvent& event )
{
int idx = m_choiceNetName->GetSelection();
if( idx == wxNOT_FOUND )
return;
m_curr_netcode = idx;
updateNetInfo();
}
#include <ratsnest_data.h>
void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick( wxCommandEvent& event ) void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick( wxCommandEvent& event )
{ {
bool change = false; bool change = false;
switch( m_OptionID ) switch( m_optionID )
{ {
case ID_CURRENT_VALUES_TO_CURRENT_NET: case ID_CURRENT_VALUES_TO_CURRENT_NET:
if( !IsOK( this, if( !IsOK( this,
@ -174,7 +213,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick( wxCommandEvent& event )
return; return;
{ {
wxBusyCursor dummy; wxBusyCursor dummy;
change = m_Parent->Change_Net_Tracks_And_Vias_Sizes( m_Netcode, false ); change = m_parent->Change_Net_Tracks_And_Vias_Sizes( m_curr_netcode, false );
} }
break; break;
@ -184,7 +223,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick( wxCommandEvent& event )
return; return;
{ {
wxBusyCursor dummy; wxBusyCursor dummy;
change = m_Parent->Change_Net_Tracks_And_Vias_Sizes( m_Netcode, true ); change = m_parent->Change_Net_Tracks_And_Vias_Sizes( m_curr_netcode, true );
} }
break; break;
@ -193,7 +232,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick( wxCommandEvent& event )
return; return;
{ {
wxBusyCursor dummy; wxBusyCursor dummy;
change = m_Parent->Reset_All_Tracks_And_Vias_To_Netclass_Values( true, true ); change = m_parent->Reset_All_Tracks_And_Vias_To_Netclass_Values( true, true );
} }
break; break;
@ -202,7 +241,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick( wxCommandEvent& event )
return; return;
{ {
wxBusyCursor dummy; wxBusyCursor dummy;
change = m_Parent->Reset_All_Tracks_And_Vias_To_Netclass_Values( false, true ); change = m_parent->Reset_All_Tracks_And_Vias_To_Netclass_Values( false, true );
} }
break; break;
@ -211,19 +250,22 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick( wxCommandEvent& event )
return; return;
{ {
wxBusyCursor dummy; wxBusyCursor dummy;
change = m_Parent->Reset_All_Tracks_And_Vias_To_Netclass_Values( true, false ); change = m_parent->Reset_All_Tracks_And_Vias_To_Netclass_Values( true, false );
} }
break; break;
} }
EndModal( 1 );
if( change ) if( change )
m_Parent->GetCanvas()->Refresh(); {
} if( m_parent->IsGalCanvasActive() )
{
for( TRACK* track = m_parent->GetBoard()->m_Track; track != NULL; track = track->Next() )
track->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
}
else
m_parent->GetCanvas()->Refresh();
}
// Call the default handler
void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnCancelClick( wxCommandEvent& event ) event.Skip();
{
EndModal( 0 );
} }

View File

@ -27,6 +27,8 @@
#include <dialog_global_edit_tracks_and_vias_base.h> #include <dialog_global_edit_tracks_and_vias_base.h>
class BOARD;
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS /// Class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -34,19 +36,28 @@ class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS :
public DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE public DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
{ {
private: private:
PCB_EDIT_FRAME* m_Parent; PCB_EDIT_FRAME* m_parent;
int m_Netcode; BOARD* m_brd;
int m_OptionID; int m_curr_netcode;
int m_optionID;
public: public:
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS( PCB_EDIT_FRAME* aParent, int aNetcode ); DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS( PCB_EDIT_FRAME* aParent, int aNetcode );
~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS() {}; ~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS() {};
private:
// Virtual event handlers, overided here // Virtual event handlers, overided here
void OnSelectionClick( wxCommandEvent& event ) override { m_OptionID = event.GetId(); } void OnSelectionClick( wxCommandEvent& event ) override
{
m_optionID = event.GetId();
}
void OnOkClick( wxCommandEvent& event ) override; void OnOkClick( wxCommandEvent& event ) override;
void OnCancelClick( wxCommandEvent& event ) override; void onNetSelection( wxCommandEvent& event ) override;
void MyInit(); void MyInit();
void updateNetInfo();
void buildNetsList();
}; };
#endif //__dialog_global_edit_tracks_and_vias__ #endif //__dialog_global_edit_tracks_and_vias__

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version May 6 2016) // C++ code generated with wxFormBuilder (version Sep 8 2016)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -35,29 +35,29 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
bSizerGrids = new wxBoxSizer( wxVERTICAL ); bSizerGrids = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizeNetInfo; wxFlexGridSizer* fgSizeNetInfo;
fgSizeNetInfo = new wxFlexGridSizer( 2, 2, 0, 0 ); fgSizeNetInfo = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizeNetInfo->AddGrowableCol( 1 );
fgSizeNetInfo->SetFlexibleDirection( wxBOTH ); fgSizeNetInfo->SetFlexibleDirection( wxBOTH );
fgSizeNetInfo->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); fgSizeNetInfo->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_CurrentNetText = new wxStaticText( this, wxID_ANY, _("Current Net:"), wxDefaultPosition, wxDefaultSize, 0 ); m_CurrentNetText = new wxStaticText( this, wxID_ANY, _("Current Net:"), wxDefaultPosition, wxDefaultSize, 0 );
m_CurrentNetText->Wrap( -1 ); m_CurrentNetText->Wrap( -1 );
fgSizeNetInfo->Add( m_CurrentNetText, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); fgSizeNetInfo->Add( m_CurrentNetText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_CurrentNetName = new wxStaticText( this, wxID_ANY, _("NetName"), wxDefaultPosition, wxDefaultSize, 0 ); wxArrayString m_choiceNetNameChoices;
m_CurrentNetName->Wrap( -1 ); m_choiceNetName = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceNetNameChoices, 0 );
m_CurrentNetName->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); m_choiceNetName->SetSelection( 0 );
fgSizeNetInfo->Add( m_choiceNetName, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
fgSizeNetInfo->Add( m_CurrentNetName, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_CurrentNetclassText = new wxStaticText( this, wxID_ANY, _("Current NetClass:"), wxDefaultPosition, wxDefaultSize, 0 ); m_CurrentNetclassText = new wxStaticText( this, wxID_ANY, _("Current NetClass:"), wxDefaultPosition, wxDefaultSize, 0 );
m_CurrentNetclassText->Wrap( -1 ); m_CurrentNetclassText->Wrap( -1 );
fgSizeNetInfo->Add( m_CurrentNetclassText, 0, wxALL, 5 ); fgSizeNetInfo->Add( m_CurrentNetclassText, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_CurrentNetclassName = new wxStaticText( this, wxID_ANY, _("NetClassName"), wxDefaultPosition, wxDefaultSize, 0 ); m_CurrentNetclassName = new wxStaticText( this, wxID_ANY, _("unknown"), wxDefaultPosition, wxDefaultSize, 0 );
m_CurrentNetclassName->Wrap( -1 ); m_CurrentNetclassName->Wrap( -1 );
m_CurrentNetclassName->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); m_CurrentNetclassName->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
fgSizeNetInfo->Add( m_CurrentNetclassName, 0, wxALL, 5 ); fgSizeNetInfo->Add( m_CurrentNetclassName, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
bSizerGrids->Add( fgSizeNetInfo, 0, wxEXPAND, 5 ); bSizerGrids->Add( fgSizeNetInfo, 0, wxEXPAND, 5 );
@ -119,7 +119,7 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
m_staticText11->Wrap( -1 ); m_staticText11->Wrap( -1 );
m_staticText11->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); m_staticText11->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
bLowerSizer->Add( m_staticText11, 0, wxALL, 5 ); bLowerSizer->Add( m_staticText11, 0, wxRIGHT|wxLEFT, 5 );
bMainSizer->Add( bLowerSizer, 0, wxALL|wxEXPAND, 5 ); bMainSizer->Add( bLowerSizer, 0, wxALL|wxEXPAND, 5 );
@ -133,21 +133,21 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
wxBoxSizer* bSizerRadioButtons; wxBoxSizer* bSizerRadioButtons;
bSizerRadioButtons = new wxBoxSizer( wxVERTICAL ); bSizerRadioButtons = new wxBoxSizer( wxVERTICAL );
m_Net2CurrValueButton = new wxRadioButton( this, ID_CURRENT_VALUES_TO_CURRENT_NET, _("Set tracks and vias of the current Net to the current value"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_Net2CurrValueButton = new wxRadioButton( this, ID_CURRENT_VALUES_TO_CURRENT_NET, _("Set tracks and vias of the current Net to the current selected user value"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
m_Net2CurrValueButton->SetValue( true ); m_Net2CurrValueButton->SetValue( true );
bSizerRadioButtons->Add( m_Net2CurrValueButton, 0, wxALL, 5 ); bSizerRadioButtons->Add( m_Net2CurrValueButton, 0, wxALL, 5 );
m_NetUseNetclassValueButton = new wxRadioButton( this, ID_NETCLASS_VALUES_TO_CURRENT_NET, _("Set tracks and vias of the current Net to the Netclass value"), wxDefaultPosition, wxDefaultSize, 0 ); m_NetUseNetclassValueButton = new wxRadioButton( this, ID_NETCLASS_VALUES_TO_CURRENT_NET, _("Set tracks and vias of the current Net to the Netclass value"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerRadioButtons->Add( m_NetUseNetclassValueButton, 0, wxALL, 5 ); bSizerRadioButtons->Add( m_NetUseNetclassValueButton, 0, wxALL, 5 );
m_radioBtn3 = new wxRadioButton( this, ID_ALL_TRACKS_VIAS, _("Set all tracks and vias to their Netclass value"), wxDefaultPosition, wxDefaultSize, 0 ); m_radioBtnAll = new wxRadioButton( this, ID_ALL_TRACKS_VIAS, _("Set all tracks and vias to their Netclass value"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerRadioButtons->Add( m_radioBtn3, 0, wxALL, 5 ); bSizerRadioButtons->Add( m_radioBtnAll, 0, wxALL, 5 );
m_radioBtn4 = new wxRadioButton( this, ID_ALL_VIAS, _("Set all vias (no track) to their Netclass value"), wxDefaultPosition, wxDefaultSize, 0 ); m_radioAllVias = new wxRadioButton( this, ID_ALL_VIAS, _("Set all vias (no track) to their Netclass value"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerRadioButtons->Add( m_radioBtn4, 0, wxALL, 5 ); bSizerRadioButtons->Add( m_radioAllVias, 0, wxALL, 5 );
m_radioBtn5 = new wxRadioButton( this, ID_ALL_TRACKS, _("Set all tracks (no via) to their Netclass value"), wxDefaultPosition, wxDefaultSize, 0 ); m_radioAllTracks = new wxRadioButton( this, ID_ALL_TRACKS, _("Set all tracks (no via) to their Netclass value"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerRadioButtons->Add( m_radioBtn5, 0, wxALL, 5 ); bSizerRadioButtons->Add( m_radioAllTracks, 0, wxALL, 5 );
bSizerOptions->Add( bSizerRadioButtons, 1, wxEXPAND, 5 ); bSizerOptions->Add( bSizerRadioButtons, 1, wxEXPAND, 5 );
@ -155,38 +155,41 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
bMainSizer->Add( bSizerOptions, 0, wxEXPAND, 5 ); bMainSizer->Add( bSizerOptions, 0, wxEXPAND, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer(); m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
m_sdbSizer1OK = new wxButton( this, wxID_OK ); bMainSizer->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
bMainSizer->Add( m_sdbSizer1, 0, wxEXPAND|wxALL, 5 ); m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bMainSizer->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( bMainSizer ); this->SetSizer( bMainSizer );
this->Layout(); this->Layout();
// Connect Events // Connect Events
m_choiceNetName->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::onNetSelection ), NULL, this );
m_Net2CurrValueButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this ); m_Net2CurrValueButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this );
m_NetUseNetclassValueButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this ); m_NetUseNetclassValueButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this );
m_radioBtn3->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this ); m_radioBtnAll->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this );
m_radioBtn4->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this ); m_radioAllVias->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this );
m_radioBtn5->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this ); m_radioAllTracks->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this );
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnCancelClick ), NULL, this ); m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnOkClick ), NULL, this );
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnOkClick ), NULL, this );
} }
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE() DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE()
{ {
// Disconnect Events // Disconnect Events
m_choiceNetName->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::onNetSelection ), NULL, this );
m_Net2CurrValueButton->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this ); m_Net2CurrValueButton->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this );
m_NetUseNetclassValueButton->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this ); m_NetUseNetclassValueButton->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this );
m_radioBtn3->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this ); m_radioBtnAll->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this );
m_radioBtn4->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this ); m_radioAllVias->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this );
m_radioBtn5->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this ); m_radioAllTracks->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSelectionClick ), NULL, this );
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnCancelClick ), NULL, this ); m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnOkClick ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnOkClick ), NULL, this );
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version May 6 2016) // C++ code generated with wxFormBuilder (version Sep 8 2016)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -20,6 +20,7 @@ class DIALOG_SHIM;
#include <wx/font.h> #include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/choice.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/grid.h> #include <wx/grid.h>
#include <wx/statline.h> #include <wx/statline.h>
@ -45,7 +46,7 @@ class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE : public DIALOG_SHIM
protected: protected:
wxStaticText* m_staticText12; wxStaticText* m_staticText12;
wxStaticText* m_CurrentNetText; wxStaticText* m_CurrentNetText;
wxStaticText* m_CurrentNetName; wxChoice* m_choiceNetName;
wxStaticText* m_CurrentNetclassText; wxStaticText* m_CurrentNetclassText;
wxStaticText* m_CurrentNetclassName; wxStaticText* m_CurrentNetclassName;
wxGrid* m_gridDisplayCurrentSettings; wxGrid* m_gridDisplayCurrentSettings;
@ -53,22 +54,23 @@ class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE : public DIALOG_SHIM
wxStaticText* m_staticText11; wxStaticText* m_staticText11;
wxRadioButton* m_Net2CurrValueButton; wxRadioButton* m_Net2CurrValueButton;
wxRadioButton* m_NetUseNetclassValueButton; wxRadioButton* m_NetUseNetclassValueButton;
wxRadioButton* m_radioBtn3; wxRadioButton* m_radioBtnAll;
wxRadioButton* m_radioBtn4; wxRadioButton* m_radioAllVias;
wxRadioButton* m_radioBtn5; wxRadioButton* m_radioAllTracks;
wxStdDialogButtonSizer* m_sdbSizer1; wxStaticLine* m_staticline2;
wxButton* m_sdbSizer1OK; wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizer1Cancel; wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void onNetSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSelectionClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnSelectionClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
public: public:
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Global Edition of Tracks and Vias"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 711,376 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Global Edition of Tracks and Vias"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 706,412 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE(); ~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE();
}; };

View File

@ -336,6 +336,13 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
OnModify(); OnModify();
break; break;
case ID_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE:
{
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS dlg( this, GetBoard()->GetHighLightNetCode() );
dlg.ShowModal();
}
break;
case ID_POPUP_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE: case ID_POPUP_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE:
if( GetCurItem() == NULL ) if( GetCurItem() == NULL )
break; break;

View File

@ -1,8 +1,8 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2007-2014 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr * Copyright (C) 2007-2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -30,7 +30,6 @@
#include <fctsys.h> #include <fctsys.h>
#include <gr_basic.h> #include <gr_basic.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>
#include <confirm.h>
#include <wxPcbStruct.h> #include <wxPcbStruct.h>
#include <class_board.h> #include <class_board.h>
@ -38,22 +37,19 @@
#include <pcbnew.h> #include <pcbnew.h>
#include <drc_stuff.h> #include <drc_stuff.h>
#include <protos.h>
/**
* Function SetTrackSegmentWidth
* Modify one track segment width or one via diameter and drill (using DRC control).
* Basic routine used by other routines when editing tracks or vias
* @param aTrackItem = the track segment or via to modify
* @param aItemsListPicker = the list picker to use for an undo command (can be NULL)
* @param aUseNetclassValue = true to use NetClass value, false to use BOARD::m_designSettings value
* @return true if done, false if no not change (because DRC error)
*/
bool PCB_EDIT_FRAME::SetTrackSegmentWidth( TRACK* aTrackItem, bool PCB_EDIT_FRAME::SetTrackSegmentWidth( TRACK* aTrackItem,
PICKED_ITEMS_LIST* aItemsListPicker, PICKED_ITEMS_LIST* aItemsListPicker,
bool aUseNetclassValue ) bool aUseNetclassValue )
{ {
/* Modify one track segment width or one via diameter and drill (using DRC control).
* Basic function used by other routines when editing tracks or vias
* aTrackItem = the track segment or via to modify
* aItemsListPicker = the list picker to use for an undo command (can be NULL)
* aUseNetclassValue = true to use NetClass value, false to use BOARD::m_designSettings value
* return true if done, false if no not change (due to DRC error)
*/
int initial_width, new_width; int initial_width, new_width;
int initial_drill = -1,new_drill = -1; int initial_drill = -1,new_drill = -1;
bool change_ok = false; bool change_ok = false;
@ -201,16 +197,14 @@ void PCB_EDIT_FRAME::Edit_TrackSegm_Width( wxDC* aDC, TRACK* aTrackItem )
} }
/**
* Function Edit_Track_Width
* Modify a full track width (using DRC control).
* a full track is the set of track segments between 2 ends: pads or a point that has
* more than 2 segments ends connected
* @param aDC = the curred device context (can be NULL)
* @param aTrackSegment = a segment or via on the track to change
*/
void PCB_EDIT_FRAME::Edit_Track_Width( wxDC* aDC, TRACK* aTrackSegment ) void PCB_EDIT_FRAME::Edit_Track_Width( wxDC* aDC, TRACK* aTrackSegment )
{ {
/* Modify a full track (a trace) width (using DRC control).
* a full track is the set of track segments between 2 nodes: pads or a node that has
* more than 2 segments connected
* aDC = the curred device context (can be NULL)
* aTrackSegment = a via or a track belonging to the trace to change
*/
TRACK* pt_track; TRACK* pt_track;
int nb_segm; int nb_segm;
@ -244,6 +238,8 @@ void PCB_EDIT_FRAME::Edit_Track_Width( wxDC* aDC, TRACK* aTrackSegment )
segm->Draw( m_canvas, aDC, GR_XOR ); // Erase old track shape segm->Draw( m_canvas, aDC, GR_XOR ); // Erase old track shape
segm = (TRACK*) itemsListPicker.GetPickedItem( ii ); segm = (TRACK*) itemsListPicker.GetPickedItem( ii );
segm->Draw( m_canvas, aDC, GR_OR ); // Display new track shape segm->Draw( m_canvas, aDC, GR_OR ); // Display new track shape
segm->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
} }
m_canvas->CrossHairOn( aDC ); // Display cursor shape m_canvas->CrossHairOn( aDC ); // Display cursor shape
@ -253,15 +249,13 @@ void PCB_EDIT_FRAME::Edit_Track_Width( wxDC* aDC, TRACK* aTrackSegment )
} }
/**
* Function Change_Net_Tracks_And_Vias_Sizes
* Reset all tracks width and vias diameters and drill
* to their default Netclass value or current values
* @param aNetcode : the netcode of the net to edit
* @param aUseNetclassValue : bool. True to use netclass values, false to use current values
*/
bool PCB_EDIT_FRAME::Change_Net_Tracks_And_Vias_Sizes( int aNetcode, bool aUseNetclassValue ) bool PCB_EDIT_FRAME::Change_Net_Tracks_And_Vias_Sizes( int aNetcode, bool aUseNetclassValue )
{ {
/* Reset all tracks width and vias diameters and drill
* to their default Netclass value or current values
* aNetcode : the netcode of the net to edit
* aUseNetclassValue = true to use netclass values, false to use current values
*/
TRACK* pt_segm; TRACK* pt_segm;
if( aNetcode <= 0 ) if( aNetcode <= 0 )

View File

@ -300,7 +300,20 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
AddMenuItem( editMenu, ID_FIND_ITEMS, text, HELP_FIND , KiBitmap( find_xpm ) ); AddMenuItem( editMenu, ID_FIND_ITEMS, text, HELP_FIND , KiBitmap( find_xpm ) );
editMenu->AppendSeparator(); editMenu->AppendSeparator();
AddMenuItem( editMenu, ID_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE,
_( "Edit All Tracks and Vias" ), KiBitmap( width_track_via_xpm ) );
AddMenuItem( editMenu, ID_MENU_PCB_RESET_TEXTMODULE_FIELDS_SIZES,
_( "Set Footp&rint Field Sizes" ),
_( "Set text size and width of footprint fields." ),
KiBitmap( reset_text_xpm ) );
AddMenuItem( editMenu, ID_MENU_PCB_SWAP_LAYERS,
_( "&Swap Layers" ),
_( "Swap tracks on copper layers or drawings on other layers" ),
KiBitmap( swap_layer_xpm ) );
editMenu->AppendSeparator();
AddMenuItem( editMenu, ID_PCB_GLOBAL_DELETE, AddMenuItem( editMenu, ID_PCB_GLOBAL_DELETE,
_( "&Global Deletions" ), _( "&Global Deletions" ),
_( "Delete tracks, footprints, texts... on board" ), _( "Delete tracks, footprints, texts... on board" ),
@ -311,16 +324,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
_( "Clean stubs, vias, delete break points, or unconnected tracks to pads and vias" ), _( "Clean stubs, vias, delete break points, or unconnected tracks to pads and vias" ),
KiBitmap( delete_xpm ) ); KiBitmap( delete_xpm ) );
AddMenuItem( editMenu, ID_MENU_PCB_SWAP_LAYERS,
_( "&Swap Layers" ),
_( "Swap tracks on copper layers or drawings on other layers" ),
KiBitmap( swap_layer_xpm ) );
AddMenuItem( editMenu, ID_MENU_PCB_RESET_TEXTMODULE_FIELDS_SIZES,
_( "Set Footp&rint Field Sizes" ),
_( "Set text size and width of footprint fields." ),
KiBitmap( reset_text_xpm ) );
//----- View menu ----------------------------------------------------------- //----- View menu -----------------------------------------------------------
wxMenu* viewMenu = new wxMenu; wxMenu* viewMenu = new wxMenu;

View File

@ -170,6 +170,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
// menu Miscellaneous // menu Miscellaneous
EVT_MENU( ID_MENU_LIST_NETS, PCB_EDIT_FRAME::ListNetsAndSelect ) EVT_MENU( ID_MENU_LIST_NETS, PCB_EDIT_FRAME::ListNetsAndSelect )
EVT_MENU( ID_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_MENU( ID_PCB_GLOBAL_DELETE, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_PCB_GLOBAL_DELETE, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_MENU( ID_MENU_PCB_CLEAN, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_MENU_PCB_CLEAN, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_MENU( ID_MENU_PCB_SWAP_LAYERS, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_MENU_PCB_SWAP_LAYERS, PCB_EDIT_FRAME::Process_Special_Functions )

View File

@ -259,6 +259,7 @@ enum pcbnew_ids
ID_MENU_CREATE_LIBRARY_AND_ARCHIVE_MODULES, ID_MENU_CREATE_LIBRARY_AND_ARCHIVE_MODULES,
ID_MENU_MICELLANOUS, ID_MENU_MICELLANOUS,
ID_MENU_LIST_NETS, ID_MENU_LIST_NETS,
ID_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE,
ID_MENU_PCB_CLEAN, ID_MENU_PCB_CLEAN,
ID_MENU_PCB_SWAP_LAYERS, ID_MENU_PCB_SWAP_LAYERS,
ID_MENU_PCB_RESET_TEXTMODULE_FIELDS_SIZES, ID_MENU_PCB_RESET_TEXTMODULE_FIELDS_SIZES,

View File

@ -747,7 +747,8 @@ int PCB_EDITOR_CONTROL::DrillOrigin( const TOOL_EVENT& aEvent )
static bool highlightNet( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition ) static bool highlightNet( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition )
{ {
KIGFX::RENDER_SETTINGS* render = aToolMgr->GetView()->GetPainter()->GetSettings(); KIGFX::RENDER_SETTINGS* render = aToolMgr->GetView()->GetPainter()->GetSettings();
GENERAL_COLLECTORS_GUIDE guide = static_cast<PCB_BASE_FRAME*>( aToolMgr->GetEditFrame() )->GetCollectorsGuide(); GENERAL_COLLECTORS_GUIDE guide =
static_cast<PCB_BASE_FRAME*>( aToolMgr->GetEditFrame() )->GetCollectorsGuide();
BOARD* board = static_cast<BOARD*>( aToolMgr->GetModel() ); BOARD* board = static_cast<BOARD*>( aToolMgr->GetModel() );
GENERAL_COLLECTOR collector; GENERAL_COLLECTOR collector;
int net = -1; int net = -1;
@ -771,6 +772,12 @@ static bool highlightNet( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition )
aToolMgr->GetView()->UpdateAllLayersColor(); aToolMgr->GetView()->UpdateAllLayersColor();
} }
// Store the highlighted netcode in the current board (for dialogs for instance)
if( enableHighlight && net >= 0 )
board->SetHighLightNet( net );
else
board->ResetHighLight();
return true; return true;
} }