50 statusPopup.SetText(
_(
"Click on new member..." ) );
52 picker->SetCursor( KICURSOR::BULLSEYE );
53 picker->SetSnapping(
false );
54 picker->ClearHandlers();
56 picker->SetClickHandler(
57 [&](
const VECTOR2D& aPoint ) ->
bool
73 EDA_ITEM* elem = sel.Front();
75 if( !isFootprintEditor )
77 while( elem->GetParent() && elem->GetParent()->Type() != PCB_T )
78 elem = elem->GetParent();
88 picker->SetMotionHandler(
94 picker->SetCancelHandler(
97 if( m_propertiesDialog )
98 m_propertiesDialog->Show(
true );
103 picker->SetFinalizeHandler(
104 [&](
const int& aFinalState )
111 m_frame->GetCanvas()->SetStatusPopup( statusPopup.GetPanel() );
124 m_frame->GetCanvas()->SetStatusPopup(
nullptr );
136 if( isFootprintEditor )
142 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
147 aCollector.
Remove( item );
157 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
162 aCollector.
Remove( item );
165 aCollector.
Remove( item );
170 if( selection.Empty() )
173 BOARD* board = getModel<BOARD>();
176 if( isFootprintEditor )
181 for(
EDA_ITEM* eda_item : selection )
183 if( eda_item->IsBOARD_ITEM() )
185 if(
static_cast<BOARD_ITEM*
>( eda_item )->IsLocked() )
186 group->SetLocked(
true );
190 for(
EDA_ITEM* eda_item : selection )
192 if( eda_item->IsBOARD_ITEM() )
194 if(
EDA_GROUP* existingGroup = eda_item->GetParentGroup() )
195 m_commit->Modify( existingGroup->AsEdaItem(),
nullptr, RECURSE_MODE::NO_RECURSE );
198 group->AddItem( eda_item );
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).
void DoAddMember(EDA_ITEM *aItem)
bool Show(bool show) override
FRAME_T GetFrameType() const
virtual void OnModify()
Must be called after a model change in order to set the "modify" flag and do other frame-specific pro...
A set of EDA_ITEMs (i.e., without duplicates).
A base class for most all the KiCad significant classes used in schematics and boards.
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.
A set of BOARD_ITEMs (i.e., without duplicates).
bool Empty() const
Checks if there is anything selected.
Class to handle a set of BOARD_ITEMs.