45 aErrorMsg =
_(
"Some selected items cannot be grouped." );
54 aErrorMsg =
_(
"Footprint items cannot be grouped separately from their parent footprint." );
60 aErrorMsg =
_(
"Some selected items cannot be grouped." );
82 statusPopup.SetText(
_(
"Click on new member..." ) );
85 picker->SetSnapping(
false );
86 picker->ClearHandlers();
88 picker->SetClickHandler(
89 [&](
const VECTOR2D& aPoint ) ->
bool
107 if( !isFootprintEditor )
120 picker->SetMotionHandler(
126 picker->SetCancelHandler(
135 picker->SetFinalizeHandler(
136 [&](
const int& aFinalState )
143 m_frame->GetCanvas()->SetStatusPopup( statusPopup.GetPanel() );
156 picker->ClearHandlers();
157 m_frame->GetCanvas()->SetStatusPopup(
nullptr );
173 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
178 aCollector.
Remove( item );
184 if( !errorMsg.IsEmpty() )
185 m_frame->ShowInfoBarWarning( errorMsg );
193 if( isFootprintEditor )
198 for(
EDA_ITEM* eda_item : selection )
200 if( eda_item->IsBOARD_ITEM() )
202 if(
static_cast<BOARD_ITEM*
>( eda_item )->IsLocked() )
203 group->SetLocked(
true );
207 for(
EDA_ITEM* eda_item : selection )
209 if( eda_item->IsBOARD_ITEM() )
211 if(
EDA_GROUP* existingGroup = eda_item->GetParentGroup() )
215 group->AddItem( eda_item );
228 if( !errorMsg.IsEmpty() )
229 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