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 );
263 if( eda_item->IsBOARD_ITEM() )
265 if(
static_cast<BOARD_ITEM*
>( eda_item )->IsLocked() )
266 group->SetLocked(
true );
274 if( eda_item->IsBOARD_ITEM() )
278 commit.
Push(
_(
"Group Items" ) );
311 toSelect.push_back( member );
314 group->SetSelected();
319 commit.
Push(
_(
"Ungroup Items" ) );
348 commit.
Push(
_(
"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.
COMMIT & Stage(EDA_ITEM *aItem, CHANGE_TYPE aChangeType, BASE_SCREEN *aScreen=nullptr) override
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.
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
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 & Remove(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Notify observers that aItem has been removed.
COMMIT & Add(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Notify observers that aItem has been added.
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.
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 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).
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