49 aErrorMsg =
_(
"Some selected items cannot be grouped." );
58 aErrorMsg =
_(
"Footprint items cannot be grouped separately from their parent footprint." );
64 aErrorMsg =
_(
"Some selected items cannot be grouped." );
86 statusPopup.SetText(
_(
"Click on new member..." ) );
89 picker->SetSnapping(
false );
90 picker->ClearHandlers();
92 picker->SetClickHandler(
93 [&](
const VECTOR2D& aPoint ) ->
bool
111 if( !isFootprintEditor )
124 picker->SetMotionHandler(
130 picker->SetCancelHandler(
139 picker->SetFinalizeHandler(
140 [&](
const int& aFinalState )
147 m_frame->GetCanvas()->SetStatusPopup( statusPopup.GetPanel() );
160 picker->ClearHandlers();
161 m_frame->GetCanvas()->SetStatusPopup(
nullptr );
177 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
182 aCollector.
Remove( item );
188 if( !errorMsg.IsEmpty() )
189 m_frame->ShowInfoBarWarning( errorMsg );
197 if( isFootprintEditor )
202 for(
EDA_ITEM* eda_item : selection )
204 if( eda_item->IsBOARD_ITEM() )
206 if(
static_cast<BOARD_ITEM*
>( eda_item )->IsLocked() )
207 group->SetLocked(
true );
211 for(
EDA_ITEM* eda_item : selection )
213 if( eda_item->IsBOARD_ITEM() )
215 if(
EDA_GROUP* existingGroup = eda_item->GetParentGroup() )
219 group->AddItem( eda_item );
232 if( !errorMsg.IsEmpty() )
233 m_frame->ShowInfoBarWarning( errorMsg );
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
static TOOL_ACTION pickerTool
static TOOL_ACTION selectionClear
Clear the current selection.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
bool IsGroupableType() const
FOOTPRINT * GetParentFootprint() const
Information pertinent to a Pcbnew printed circuit board.
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
int GetCount() const
Return the number of objects in the list.
void Remove(int aIndex)
Remove the item at aIndex (first position is 0).
A set of EDA_ITEMs (i.e., without duplicates).
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
EDA_ITEM * GetParent() const
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Used when the right click button is pressed, or when the select tool is in effect.
bool IsBOARD_ITEM() const
A set of BOARD_ITEMs (i.e., without duplicates).
virtual unsigned int GetSize() const override
Return the number of stored items.
bool Empty() const
Checks if there is anything selected.
Class to handle a set of BOARD_ITEMs.
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D