64 wxString check = board->GroupsSanityCheck();
65 wxCHECK_RET( check == wxEmptyString,
_(
"Group is in inconsistent state:" ) + wxS(
" " ) + check );
79 m_propertiesDialog( nullptr ),
80 m_selectionTool( nullptr )
87 m_frame = getEditFrame<PCB_BASE_EDIT_FRAME>();
90 m_commit = std::make_unique<BOARD_COMMIT>(
this );
96 m_frame = getEditFrame<PCB_BASE_EDIT_FRAME>();
106 std::shared_ptr<GROUP_CONTEXT_MENU> groupMenu = std::make_shared<GROUP_CONTEXT_MENU>();
107 groupMenu->SetTool(
this );
144 statusPopup.SetText(
_(
"Click on new member..." ) );
147 [&](
const VECTOR2D& aPoint ) ->
bool
164 EDA_ITEM* elem = sel.Front();
166 if( !m_isFootprintEditor )
168 while( elem->GetParent() && elem->GetParent()->Type() != PCB_T )
169 elem = elem->GetParent();
179 picker->SetMotionHandler(
185 picker->SetCancelHandler(
188 if( m_propertiesDialog )
189 m_propertiesDialog->Show(
true );
194 picker->SetFinalizeHandler(
195 [&](
const int& aFinalState )
202 canvas()->SetStatusPopup( statusPopup.GetPanel() );
215 canvas()->SetStatusPopup(
nullptr );
239 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
244 aCollector.
Remove( item );
254 bool lockGroup =
false;
274 if( item->IsLocked() )
277 group->AddItem( item );
285 group->SetLocked(
true );
301 std::vector<BOARD_ITEM*> members;
320 members.push_back( member );
334 group->SetSelected();
338 EDA_ITEMS mem( members.begin(), members.end() );
357 std::map<PCB_GROUP*, std::vector<BOARD_ITEM*>> groupMap;
365 groupMap[
group ].push_back( boardItem );
368 for( std::pair<
PCB_GROUP*, std::vector<BOARD_ITEM*>> pair : groupMap )
370 commit.
Modify( pair.first );
373 pair.first->RemoveItem( item );
376 commit.
Push( wxT(
"Remove Group Items" ) );
static TOOL_ACTION pickerTool
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
PCB_GROUP * GetParentGroup() const
FOOTPRINT * GetParentFootprint() const
Information pertinent to a Pcbnew printed circuit board.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
void Remove(BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
int GetCount() const
Return the number of objects in the list.
void Remove(int aIndex)
Remove the item at aIndex (first position is 0).
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
void DoAddMember(EDA_ITEM *aItem)
bool Show(bool show) override
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.
virtual void Remove(VIEW_ITEM *aItem) override
Remove a VIEW_ITEM from the view.
static TOOL_ACTION selectionCursor
Select a single item under the cursor position.
static TOOL_ACTION groupLeave
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION ungroup
static TOOL_ACTION groupProperties
static TOOL_ACTION pickNewGroupMember
static TOOL_ACTION groupEnter
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
static TOOL_ACTION removeFromGroup
Common, abstract interface for edit frames.
void SaveCopyInUndoList(EDA_ITEM *aItemToCopy, UNDO_REDO aTypeCommand) override
Create a new entry in undo list of commands.
void OnModify() override
Must be called after a change in order to set the "modify" flag and update other data structures and ...
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
A set of BOARD_ITEMs (i.e., without duplicates).
A holder to handle information on schematic or board items.
void PushItem(const ITEM_PICKER &aItem)
Push aItem to the top of the list.
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.
Class to handle a set of BOARD_ITEMs.
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs