68 int selectionCount = 0;
69 bool hasGroup =
false;
70 bool hasMember =
false;
71 bool onlyOneGroup =
false;
72 bool hasUngroupedItems =
false;
91 else if( !item->GetParentGroup() )
92 hasUngroupedItems =
true;
94 if( item->GetParentGroup() )
133 std::shared_ptr<GROUP_CONTEXT_MENU> groupMenu = std::make_shared<GROUP_CONTEXT_MENU>();
134 groupMenu->SetTool(
this );
164 if( selection.
Empty() )
174 group->AsEdaItem()->SetSelected();
180 toSelect.push_back( member );
211 if(
group !=
nullptr )
216 else if( !item->GetParentGroup() &&
canGroupItem( item, errorMsg ) )
218 toAdd.push_back( item );
222 if( !
group || toAdd.empty() )
224 if( !errorMsg.IsEmpty() )
225 m_frame->ShowInfoBarWarning( errorMsg );
236 EDA_GROUP* existingGroup = item->GetParentGroup();
238 if( existingGroup !=
group )
245 group->AddItem( item );
249 m_commit->Push(
_(
"Add Items to Group" ) );
255 if( !errorMsg.IsEmpty() )
256 m_frame->ShowInfoBarWarning( errorMsg );
266 if( selection.
Empty() )
269 std::set<EDA_GROUP*> affectedGroups;
277 group->RemoveItem( item );
278 affectedGroups.insert(
group );
284 if(
group->GetItems().size() < 2 )
291 m_commit->Push(
_(
"Remove Group Items" ) );
304 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