selection_tool.* add comments and use better names for 2 similar methods.
This commit is contained in:
parent
5b3d7962bb
commit
7a120ad698
|
@ -82,7 +82,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
||||||
msg.Printf( _( "Selecting all from sheet '%s'" ), FROM_UTF8( text ) );
|
msg.Printf( _( "Selecting all from sheet '%s'" ), FROM_UTF8( text ) );
|
||||||
wxString sheetStamp( FROM_UTF8( text ) );
|
wxString sheetStamp( FROM_UTF8( text ) );
|
||||||
SetStatusText( msg );
|
SetStatusText( msg );
|
||||||
GetToolManager()->RunAction( PCB_ACTIONS::selectOnSheet, true,
|
GetToolManager()->RunAction( PCB_ACTIONS::selectOnSheetFromEeschema, true,
|
||||||
static_cast<void*>( &sheetStamp ) );
|
static_cast<void*>( &sheetStamp ) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,10 +67,10 @@ public:
|
||||||
/// Selects all connections belonging to a single net.
|
/// Selects all connections belonging to a single net.
|
||||||
static TOOL_ACTION selectNet;
|
static TOOL_ACTION selectNet;
|
||||||
|
|
||||||
/// Selects all components on sheet.
|
/// Selects all components on sheet from Eeschema crossprobing.
|
||||||
static TOOL_ACTION selectOnSheet;
|
static TOOL_ACTION selectOnSheetFromEeschema;
|
||||||
|
|
||||||
/// Selects all components on the same sheet.
|
/// Selects all components on the same sheet as the selected footprint.
|
||||||
static TOOL_ACTION selectSameSheet;
|
static TOOL_ACTION selectSameSheet;
|
||||||
|
|
||||||
/// Filters the items in the current selection (invokes dialog)
|
/// Filters the items in the current selection (invokes dialog)
|
||||||
|
|
|
@ -89,12 +89,12 @@ TOOL_ACTION PCB_ACTIONS::selectNet( "pcbnew.InteractiveSelection.SelectNet",
|
||||||
AS_GLOBAL, 0,
|
AS_GLOBAL, 0,
|
||||||
_( "Whole Net" ), _( "Selects all tracks & vias belonging to the same net." ) );
|
_( "Whole Net" ), _( "Selects all tracks & vias belonging to the same net." ) );
|
||||||
|
|
||||||
TOOL_ACTION PCB_ACTIONS::selectOnSheet( "pcbnew.InteractiveSelection.SelectOnSheet",
|
TOOL_ACTION PCB_ACTIONS::selectOnSheetFromEeschema( "pcbnew.InteractiveSelection.SelectOnSheet",
|
||||||
AS_GLOBAL, 0,
|
AS_GLOBAL, 0,
|
||||||
_( "Sheet" ), _( "Selects all modules and tracks in the schematic sheet" ) );
|
_( "Sheet" ), _( "Selects all modules and tracks in the schematic sheet" ) );
|
||||||
|
|
||||||
TOOL_ACTION PCB_ACTIONS::selectSameSheet( "pcbnew.InteractiveSelection.SelectSameSheet",
|
TOOL_ACTION PCB_ACTIONS::selectSameSheet( "pcbnew.InteractiveSelection.SelectSameSheet",
|
||||||
AS_GLOBAL, 'P',
|
AS_GLOBAL, 0,
|
||||||
_( "Items in Same Hierarchical Sheet" ),
|
_( "Items in Same Hierarchical Sheet" ),
|
||||||
_( "Selects all modules and tracks in the same schematic sheet" ) );
|
_( "Selects all modules and tracks in the same schematic sheet" ) );
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ TOOL_ACTION PCB_ACTIONS::findMove( "pcbnew.InteractiveSelection.FindMove",
|
||||||
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_GET_AND_MOVE_FOOTPRINT ) );
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_GET_AND_MOVE_FOOTPRINT ) );
|
||||||
|
|
||||||
TOOL_ACTION PCB_ACTIONS::filterSelection( "pcbnew.InteractiveSelection.FilterSelection",
|
TOOL_ACTION PCB_ACTIONS::filterSelection( "pcbnew.InteractiveSelection.FilterSelection",
|
||||||
AS_GLOBAL, MD_SHIFT + 'F',
|
AS_GLOBAL, 0,
|
||||||
_( "Filter Selection" ), _( "Filter the types of items in the selection" ),
|
_( "Filter Selection" ), _( "Filter the types of items in the selection" ),
|
||||||
nullptr );
|
nullptr );
|
||||||
|
|
||||||
|
@ -547,7 +547,7 @@ void SELECTION_TOOL::SetTransitions()
|
||||||
Go( &SELECTION_TOOL::selectCopper, PCB_ACTIONS::selectCopper.MakeEvent() );
|
Go( &SELECTION_TOOL::selectCopper, PCB_ACTIONS::selectCopper.MakeEvent() );
|
||||||
Go( &SELECTION_TOOL::selectNet, PCB_ACTIONS::selectNet.MakeEvent() );
|
Go( &SELECTION_TOOL::selectNet, PCB_ACTIONS::selectNet.MakeEvent() );
|
||||||
Go( &SELECTION_TOOL::selectSameSheet, PCB_ACTIONS::selectSameSheet.MakeEvent() );
|
Go( &SELECTION_TOOL::selectSameSheet, PCB_ACTIONS::selectSameSheet.MakeEvent() );
|
||||||
Go( &SELECTION_TOOL::selectOnSheet, PCB_ACTIONS::selectOnSheet.MakeEvent() );
|
Go( &SELECTION_TOOL::selectOnSheetFromEeschema, PCB_ACTIONS::selectOnSheetFromEeschema.MakeEvent() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -881,11 +881,13 @@ void SELECTION_TOOL::zoomFitSelection( void )
|
||||||
m_frame->GetGalCanvas()->ForceRefresh();
|
m_frame->GetGalCanvas()->ForceRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
int SELECTION_TOOL::selectOnSheet( const TOOL_EVENT& aEvent )
|
|
||||||
|
int SELECTION_TOOL::selectOnSheetFromEeschema( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
clearSelection();
|
clearSelection();
|
||||||
wxString* sheet = aEvent.Parameter<wxString*>();
|
wxString* sheetpath = aEvent.Parameter<wxString*>();
|
||||||
selectAllItemsOnSheet( *sheet );
|
|
||||||
|
selectAllItemsOnSheet( *sheetpath );
|
||||||
|
|
||||||
zoomFitSelection();
|
zoomFitSelection();
|
||||||
|
|
||||||
|
@ -896,6 +898,7 @@ int SELECTION_TOOL::selectOnSheet( const TOOL_EVENT& aEvent )
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SELECTION_TOOL::selectSameSheet( const TOOL_EVENT& aEvent )
|
int SELECTION_TOOL::selectSameSheet( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
if( !selectCursor( true ) )
|
if( !selectCursor( true ) )
|
||||||
|
|
|
@ -195,10 +195,12 @@ private:
|
||||||
*/
|
*/
|
||||||
void selectAllItemsOnSheet( wxString& aSheetpath );
|
void selectAllItemsOnSheet( wxString& aSheetpath );
|
||||||
|
|
||||||
///> Selects all modules belonging to same sheet.
|
///> Selects all modules belonging to same sheet, from Eeschema,
|
||||||
int selectOnSheet( const TOOL_EVENT& aEvent );
|
///> using crossprobing
|
||||||
|
int selectOnSheetFromEeschema( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
///> Selects all modules belonging to same sheet.
|
///> Selects all modules belonging to same hierarchical sheet
|
||||||
|
///> as the selected footprint.
|
||||||
int selectSameSheet( const TOOL_EVENT& aEvent );
|
int selectSameSheet( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
///> Find dialog callback.
|
///> Find dialog callback.
|
||||||
|
|
Loading…
Reference in New Issue