63 wxString check = board->GroupsSanityCheck();
64 wxCHECK_RET( check == wxEmptyString,
_(
"Group is in inconsistent state:" ) + wxS(
" " ) + check );
78 m_propertiesDialog( nullptr ),
79 m_selectionTool( nullptr )
86 m_frame = getEditFrame<PCB_BASE_EDIT_FRAME>();
89 m_commit = std::make_unique<BOARD_COMMIT>(
this );
95 m_frame = getEditFrame<PCB_BASE_EDIT_FRAME>();
105 std::shared_ptr<GROUP_CONTEXT_MENU> groupMenu = std::make_shared<GROUP_CONTEXT_MENU>();
106 groupMenu->SetTool(
this );
134 std::string tool =
"pcbnew.EditGroups.selectNewMember";
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(
182 statusPopup.Move( wxGetMousePosition() + wxPoint( 20, -50 ) );
185 picker->SetCancelHandler(
188 if( m_propertiesDialog )
189 m_propertiesDialog->Show(
true );
194 picker->SetFinalizeHandler(
195 [&](
const int& aFinalState )
200 statusPopup.Move( wxGetMousePosition() + wxPoint( 20, -50 ) );
202 canvas()->SetStatusPopup( statusPopup.GetPanel() );
215 canvas()->SetStatusPopup(
nullptr );
239 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
243 switch( item->
Type() )
250 aCollector.
Remove( item );
265 bool lockGroup =
false;
283 group->AddItem( item );
311 group->SetLocked(
true );
327 std::vector<BOARD_ITEM*> members;
357 members.push_back( member );
368 group->SetSelected();
390 std::map<PCB_GROUP*, std::vector<BOARD_ITEM*>> groupMap;
398 groupMap[
group ].push_back( boardItem );
401 for( std::pair<
PCB_GROUP*, std::vector<BOARD_ITEM*>> pair : groupMap )
403 commit.
Modify( pair.first );
406 pair.first->RemoveItem( item );
409 commit.
Push( wxT(
"Remove Group Items" ) );
static TOOL_ACTION pickerTool
virtual void Push(const wxString &aMessage=wxT("A commit"), 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
virtual bool IsLocked() 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)
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.
KICAD_T Type() const
Returns the type of object.
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.
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 ...
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.
@ PCB_FP_SHAPE_T
class FP_SHAPE, a footprint edge
@ PCB_FP_TEXTBOX_T
class FP_TEXTBOX, wrapped text in a footprint
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_FP_ZONE_T
class ZONE, managed by a footprint
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_FP_TEXT_T
class FP_TEXT, text in a footprint