74 auto& ctxMenu =
m_menu->GetMenu();
78 ctxMenu.AddSeparator( 1 );
109 static const std::vector<KICAD_T> incrementable = {
SCH_LABEL_T,
122 if( selection.Empty() )
125 KICAD_T type = selection.Front()->Type();
126 bool allSameType =
true;
130 if( item->Type() != type )
153 commit = &localCommit;
155 const auto modifyItem =
166 switch( item->Type() )
176 if( bbox && bbox->Contains( mousePosition ) )
178 std::optional<wxString> nextNumber = incrementer.
Increment(
pin.GetNumber(), param.
Delta,
184 pin.SetNumber( *nextNumber );
194 if( bbox && bbox->Contains( mousePosition ) )
196 std::optional<wxString> nextName = incrementer.
Increment(
pin.GetName(), param.
Delta,
202 pin.SetName( *nextName );
236 commit->
Push(
_(
"Increment" ) );
238 if( selection.IsHover() )
259 [
this](
const VECTOR2D& aPosition ) ->
bool
282 for(
int i = collector.GetCount() - 1; i >= 0; --i )
284 if( !selectionTool->
Selectable( collector[ i ] ) )
285 collector.Remove( i );
288 if( collector.GetCount() > 1 )
291 EDA_ITEM* item = collector.GetCount() == 1 ? collector[ 0 ] :
nullptr;
306 [
this](
const int& aFinalState )
321 template <
class F = SCH_BASE_FRAME>
346 m_frame->UpdateItem( aItem,
false, aUpdateRTree );
365 symbolEditFrame->SaveCopyInUndoList( wxEmptyString,
dynamic_cast<LIB_SYMBOL*
>( item ) );
369 schematicFrame->SaveCopyInUndoList( schematicFrame->GetScreen(), item,
UNDO_REDO::CHANGED, aAppend );
371 if( aDirtyConnectivity )
375 && ( item->
Connection()->
Name() == schematicFrame->GetHighlightedConnection()
378 schematicFrame->DirtyHighlightedConnection();
std::optional< BOX2I > OPT_BOX2I
static TOOL_ACTION cancelInteractive
static TOOL_ACTION pickerTool
static TOOL_ACTION selectionActivate
Activation of the selection tool.
static TOOL_ACTION doDelete
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION refreshPreview
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
A base class for most all the KiCad significant classes used in schematics and boards.
bool HasFlag(EDA_ITEM_FLAGS aFlag) const
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual void SetText(const wxString &aText)
virtual VECTOR2D GetMousePosition(bool aWorldCoordinates=true) const =0
Return the current mouse pointer position.
Define a library symbol object.
A pin layout helper is a class that manages the layout of the parts of a pin on a schematic symbol:
OPT_BOX2I GetPinNumberBBox()
Get the bounding box of the pin number, if there is one.
OPT_BOX2I GetPinNameBBox()
Get the bounding box of the pin name, if there is one.
static const std::vector< KICAD_T > DeletableItems
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Execute the changes.
bool HasDriverChanged() const
wxString Name(bool aIgnoreSheet=false) const
Schematic editor (Eeschema) main window.
Base class for any item which can be embedded within the SCHEMATIC container class,...
void SetConnectivityDirty(bool aDirty=true)
bool IsConnectivityDirty() const
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
Heuristically increment a string's n'th part from the right.
void SetSkipIOSQXZ(bool aSkip)
If a alphabetic part is found, skip the letters I, O, S, Q, X, Z.
std::optional< wxString > Increment(const wxString &aStr, int aDelta, size_t aRightIndex) const
Increment the n-th part from the right of the given string.
The symbol library editor main window.
#define SELECTED_BY_DRAG
Item was algorithmically selected as a dragged item.
@ FRAME_SCH_SYMBOL_EDITOR
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D