63 bool canGroup =
false;
64 bool hasGroup =
false;
65 bool hasMember =
false;
66 bool onlyOneGroup =
false;
67 bool hasUngroupedItems =
false;
86 else if( !item->GetParentGroup() )
87 hasUngroupedItems =
true;
89 if( item->GetParentGroup() )
112 m_frame = getEditFrame<EDA_DRAW_FRAME>();
119 m_frame = getEditFrame<EDA_DRAW_FRAME>();
128 std::shared_ptr<GROUP_CONTEXT_MENU> groupMenu = std::make_shared<GROUP_CONTEXT_MENU>();
129 groupMenu->SetTool(
this );
159 if( selection.
Empty() )
169 group->AsEdaItem()->SetSelected();
175 toSelect.push_back( member );
205 if(
group !=
nullptr )
210 else if( !item->GetParentGroup() )
212 toAdd.push_back( item );
216 if( !
group || toAdd.empty() )
225 EDA_GROUP* existingGroup = item->GetParentGroup();
227 if( existingGroup !=
group )
234 group->AddItem( item );
238 m_commit->Push(
_(
"Add Items to Group" ) );
252 if( selection.
Empty() )
261 group->RemoveItem( item );
265 m_commit->Push(
_(
"Remove Group Items" ) );
278 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)
bool Show(bool show) override
virtual void OnModify()
Must be called after a model change in order to set the "modify" flag and do other frame-specific pro...
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
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
Define list of drawing items for screens.
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs