Code formatting
This commit is contained in:
parent
5e70810161
commit
25abe30c72
|
@ -763,8 +763,8 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet )
|
|||
AddMenuItem( PopMenu, ID_SCH_DRAG_ITEM, msg, KiBitmap( drag_xpm ) );
|
||||
|
||||
PopMenu->AppendSeparator();
|
||||
msg = AddHotkeyName( _( "Select Items On PCB"), g_Schematic_Hokeys_Descr, HK_SELECT_ITEMS_ON_PCB );
|
||||
AddMenuItem( PopMenu, ID_POPUP_SCH_SELECT_ON_PCB, msg, KiBitmap( select_same_sheet_xpm ));
|
||||
msg = AddHotkeyName( _( "Select Items On PCB" ), g_Schematic_Hokeys_Descr, HK_SELECT_ITEMS_ON_PCB );
|
||||
AddMenuItem( PopMenu, ID_POPUP_SCH_SELECT_ON_PCB, msg, KiBitmap( select_same_sheet_xpm ) );
|
||||
PopMenu->AppendSeparator();
|
||||
|
||||
wxMenu* orientmenu = new wxMenu;
|
||||
|
|
|
@ -833,6 +833,7 @@ void SCH_EDIT_FRAME::PrepareMoveItem( SCH_ITEM* aItem, wxDC* aDC )
|
|||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::SelectAllFromSheet( wxCommandEvent& aEvent )
|
||||
{
|
||||
SCH_SCREEN* screen = GetScreen();
|
||||
|
@ -841,24 +842,24 @@ void SCH_EDIT_FRAME::SelectAllFromSheet( wxCommandEvent& aEvent )
|
|||
if( item != NULL )
|
||||
{
|
||||
item = LocateAndShowItem( item->GetPosition() );
|
||||
SendMessageToPCBNEW(item, NULL);
|
||||
SendMessageToPCBNEW( item, NULL );
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we didn't get here by a hot key, then something has gone wrong.
|
||||
if( aEvent.GetInt() == 0 )
|
||||
return;
|
||||
|
||||
EDA_HOTKEY_CLIENT_DATA* data = (EDA_HOTKEY_CLIENT_DATA*) aEvent.GetClientObject();
|
||||
|
||||
wxCHECK_RET( data != NULL, wxT( "Invalid hot key client object." ) );
|
||||
|
||||
item = LocateAndShowItem( data->GetPosition() );
|
||||
SendMessageToPCBNEW(item, NULL);
|
||||
|
||||
SendMessageToPCBNEW( item, NULL );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::OnRotate( wxCommandEvent& aEvent )
|
||||
{
|
||||
SCH_SCREEN* screen = GetScreen();
|
||||
|
|
|
@ -1564,17 +1564,20 @@ D_PAD* BOARD::GetPad( TRACK* aTrace, ENDPOINT_T aEndPoint )
|
|||
|
||||
}
|
||||
|
||||
|
||||
std::list<TRACK*> BOARD::GetTracksByPosition( const wxPoint& aPosition, PCB_LAYER_ID aLayer ) const
|
||||
{
|
||||
std::list<TRACK*> tracks;
|
||||
for( TRACK *track = GetFirstTrack( m_Track); track; track = GetFirstTrack( track->Next() ) )
|
||||
|
||||
for( TRACK* track = GetFirstTrack( m_Track ); track; track = GetFirstTrack( track->Next() ) )
|
||||
{
|
||||
if( ( ( track->GetStart() == aPosition) || track->GetEnd() == aPosition ) &&
|
||||
if( ( ( track->GetStart() == aPosition ) || track->GetEnd() == aPosition ) &&
|
||||
( track->GetState( BUSY | IS_DELETED ) == 0 ) &&
|
||||
( ( aLayer == UNDEFINED_LAYER ) || ( track->IsOnLayer( aLayer ) ) ) )
|
||||
|
||||
tracks.push_back( track );
|
||||
}
|
||||
|
||||
return tracks;
|
||||
}
|
||||
|
||||
|
|
|
@ -498,6 +498,9 @@ inline VIA* GetFirstVia( TRACK* aTrk, const TRACK* aStopPoint = NULL )
|
|||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/// Scan a track list for the first TRACK object. Returns NULL if not found (or NULL passed)
|
||||
inline TRACK* GetFirstTrack( TRACK* aTrk, const TRACK* aStopPoint = NULL )
|
||||
{
|
||||
while( aTrk && ( aTrk != aStopPoint ) && ( aTrk->Type() != PCB_TRACE_T ) )
|
||||
|
|
|
@ -915,10 +915,12 @@ void SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetpath )
|
|||
|
||||
// auto select trivial connections segments which are launched from the pads
|
||||
std::list<TRACK*> launchTracks;
|
||||
|
||||
for( auto pad : padList )
|
||||
{
|
||||
launchTracks = board()->GetTracksByPosition( pad->GetPosition() );
|
||||
for ( auto track : launchTracks )
|
||||
|
||||
for( auto track : launchTracks )
|
||||
{
|
||||
selectAllItemsConnectedToTrack( *track );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue