Update the net highlight action to properly use the action parameters
This commit is contained in:
parent
6a2dcd1936
commit
8f3d159905
|
@ -872,17 +872,21 @@ TOOL_ACTION PCB_ACTIONS::highlightNetSelection( "pcbnew.EditorControl.highlightN
|
||||||
TOOL_ACTION PCB_ACTIONS::highlightItem( "pcbnew.EditorControl.highlightItem",
|
TOOL_ACTION PCB_ACTIONS::highlightItem( "pcbnew.EditorControl.highlightItem",
|
||||||
AS_GLOBAL );
|
AS_GLOBAL );
|
||||||
|
|
||||||
TOOL_ACTION PCB_ACTIONS::hideNetInRatsnest( "pcbnew.EditorControl.hideNet",
|
TOOL_ACTION PCB_ACTIONS::hideNetInRatsnest( TOOL_ACTION_ARGS()
|
||||||
AS_GLOBAL, 0, "",
|
.Name( "pcbnew.EditorControl.hideNet" )
|
||||||
_( "Hide Net in Ratsnest" ),
|
.Scope( AS_GLOBAL )
|
||||||
_( "Hide the selected net in the ratsnest of unconnected net lines/arcs" ),
|
.MenuText( _( "Hide Net in Ratsnest" ) )
|
||||||
BITMAPS::hide_ratsnest );
|
.Tooltip( _( "Hide the selected net in the ratsnest of unconnected net lines/arcs" ) )
|
||||||
|
.Icon( BITMAPS::hide_ratsnest )
|
||||||
|
.Parameter( static_cast<int>( 0 ) ) ); // Default to hiding selected net
|
||||||
|
|
||||||
TOOL_ACTION PCB_ACTIONS::showNetInRatsnest( "pcbnew.EditorControl.showNet",
|
TOOL_ACTION PCB_ACTIONS::showNetInRatsnest( TOOL_ACTION_ARGS()
|
||||||
AS_GLOBAL, 0, "",
|
.Name( "pcbnew.EditorControl.showNet" )
|
||||||
_( "Show Net in Ratsnest" ),
|
.Scope( AS_GLOBAL )
|
||||||
_( "Show the selected net in the ratsnest of unconnected net lines/arcs" ),
|
.MenuText( _( "Show Net in Ratsnest" ) )
|
||||||
BITMAPS::show_ratsnest );
|
.Tooltip( _( "Show the selected net in the ratsnest of unconnected net lines/arcs" ) )
|
||||||
|
.Icon( BITMAPS::show_ratsnest )
|
||||||
|
.Parameter( static_cast<int>( 0 ) ) ); // Default to showing selected net
|
||||||
|
|
||||||
TOOL_ACTION PCB_ACTIONS::showEeschema( "pcbnew.EditorControl.showEeschema",
|
TOOL_ACTION PCB_ACTIONS::showEeschema( "pcbnew.EditorControl.showEeschema",
|
||||||
AS_GLOBAL, 0, "",
|
AS_GLOBAL, 0, "",
|
||||||
|
|
|
@ -295,7 +295,7 @@ void NET_GRID_TABLE::updateNetVisibility( const NET_GRID_ENTRY& aNet )
|
||||||
const TOOL_ACTION& action = aNet.visible ? PCB_ACTIONS::showNetInRatsnest
|
const TOOL_ACTION& action = aNet.visible ? PCB_ACTIONS::showNetInRatsnest
|
||||||
: PCB_ACTIONS::hideNetInRatsnest;
|
: PCB_ACTIONS::hideNetInRatsnest;
|
||||||
|
|
||||||
m_frame->GetToolManager()->RunAction( action, true, static_cast<intptr_t>( aNet.code ) );
|
m_frame->GetToolManager()->RunAction( action, true, aNet.code );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2966,20 +2966,17 @@ void APPEARANCE_CONTROLS::onNetContextMenu( wxCommandEvent& aEvent )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_HIGHLIGHT_NET:
|
case ID_HIGHLIGHT_NET:
|
||||||
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::highlightNet, true,
|
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::highlightNet, true, net.code );
|
||||||
static_cast<intptr_t>( net.code ) );
|
|
||||||
m_frame->GetCanvas()->Refresh();
|
m_frame->GetCanvas()->Refresh();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_SELECT_NET:
|
case ID_SELECT_NET:
|
||||||
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectNet, true,
|
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectNet, true, net.code );
|
||||||
static_cast<intptr_t>( net.code ) );
|
|
||||||
m_frame->GetCanvas()->Refresh();
|
m_frame->GetCanvas()->Refresh();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_DESELECT_NET:
|
case ID_DESELECT_NET:
|
||||||
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::deselectNet, true,
|
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::deselectNet, true, net.code );
|
||||||
static_cast<intptr_t>( net.code ) );
|
|
||||||
m_frame->GetCanvas()->Refresh();
|
m_frame->GetCanvas()->Refresh();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -3017,7 +3014,7 @@ void APPEARANCE_CONTROLS::showNetclass( const wxString& aClassName, bool aShow )
|
||||||
m_frame->GetToolManager()->RunAction( aShow ? PCB_ACTIONS::showNetInRatsnest
|
m_frame->GetToolManager()->RunAction( aShow ? PCB_ACTIONS::showNetInRatsnest
|
||||||
: PCB_ACTIONS::hideNetInRatsnest,
|
: PCB_ACTIONS::hideNetInRatsnest,
|
||||||
true,
|
true,
|
||||||
static_cast<intptr_t>( net->GetNetCode() ) );
|
net->GetNetCode() );
|
||||||
|
|
||||||
int row = m_netsTable->GetRowByNetcode( net->GetNetCode() );
|
int row = m_netsTable->GetRowByNetcode( net->GetNetCode() );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue