66 int selectionCount = 0;
67 bool hasGroup =
false;
68 bool hasMember =
false;
69 bool onlyOneGroup =
false;
70 bool hasUngroupedItems =
false;
89 else if( !item->GetParentGroup() )
90 hasUngroupedItems =
true;
92 if( item->GetParentGroup() )
131 std::shared_ptr<GROUP_CONTEXT_MENU> groupMenu = std::make_shared<GROUP_CONTEXT_MENU>();
132 groupMenu->SetTool(
this );
162 if( selection.
Empty() )
172 group->AsEdaItem()->SetSelected();
178 toSelect.push_back( member );
208 if(
group !=
nullptr )
213 else if( !item->GetParentGroup() )
215 toAdd.push_back( item );
219 if( !
group || toAdd.empty() )
228 EDA_GROUP* existingGroup = item->GetParentGroup();
230 if( existingGroup !=
group )
237 group->AddItem( item );
241 m_commit->Push(
_(
"Add Items to Group" ) );
255 if( selection.
Empty() )
258 std::set<EDA_GROUP*> affectedGroups;
266 group->RemoveItem( item );
267 affectedGroups.insert(
group );
273 if(
group->GetItems().size() < 2 )
280 m_commit->Push(
_(
"Remove Group Items" ) );
293 if( selection.
GetSize() == 1 &&
static TOOL_ACTION pickNewGroupMember
static TOOL_ACTION selectionCursor
Select a single item under the cursor position.
static TOOL_ACTION groupEnter
static TOOL_ACTION groupProperties
static TOOL_ACTION ungroup
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION addToGroup
static TOOL_ACTION removeFromGroup
static TOOL_ACTION groupLeave
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
A set of EDA_ITEMs (i.e., without duplicates).
virtual EDA_ITEM * AsEdaItem()=0
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.
static bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
virtual unsigned int GetSize() const override
Return the number of stored items.
bool Empty() const
Checks if there is anything selected.
std::vector< EDA_ITEM * > EDA_ITEMS
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs