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 )
118 m_frame->ShowInfoBarWarning( errorMsg );
126 picker->SetMotionHandler(
132 picker->SetCancelHandler(
141 picker->SetFinalizeHandler(
142 [&](
const int& aFinalState )
149 m_frame->GetCanvas()->SetStatusPopup( statusPopup.GetPanel() );
162 picker->ClearHandlers();
163 m_frame->GetCanvas()->SetStatusPopup(
nullptr );
179 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
184 aCollector.
Remove( item );
190 if( !errorMsg.IsEmpty() )
191 m_frame->ShowInfoBarWarning( errorMsg );
199 if( isFootprintEditor )
204 for(
EDA_ITEM* eda_item : selection )
206 if( eda_item->IsBOARD_ITEM() )
208 if(
static_cast<BOARD_ITEM*
>( eda_item )->IsLocked() )
209 group->SetLocked(
true );
213 for(
EDA_ITEM* eda_item : selection )
215 if( eda_item->IsBOARD_ITEM() )
217 if(
EDA_GROUP* existingGroup = eda_item->GetParentGroup() )
221 group->AddItem( eda_item );
234 if( !errorMsg.IsEmpty() )
235 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 item had a property changed (except movement)
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