77 auto& ctxMenu =
m_menu->GetMenu();
81 ctxMenu.AddSeparator( 1 );
112 static const std::vector<KICAD_T> incrementable = {
SCH_LABEL_T,
125 if( selection.Empty() )
128 KICAD_T type = selection.Front()->Type();
129 bool allSameType =
true;
133 if( item->Type() != type )
156 commit = &localCommit;
158 const auto modifyItem =
169 switch( item->Type() )
179 if( bbox && bbox->Contains( mousePosition ) )
181 std::optional<wxString> nextNumber = incrementer.
Increment(
pin.GetNumber(), param.
Delta,
187 pin.SetNumber( *nextNumber );
197 if( bbox && bbox->Contains( mousePosition ) )
199 std::optional<wxString> nextName = incrementer.
Increment(
pin.GetName(), param.
Delta,
205 pin.SetName( *nextName );
239 commit->
Push(
_(
"Increment" ) );
241 if( selection.IsHover() )
262 [
this](
const VECTOR2D& aPosition ) ->
bool
285 for(
int i = collector.GetCount() - 1; i >= 0; --i )
287 if( !selectionTool->
Selectable( collector[ i ] ) )
288 collector.Remove( i );
291 if( collector.GetCount() > 1 )
294 EDA_ITEM* item = collector.GetCount() == 1 ? collector[ 0 ] :
nullptr;
309 [
this](
const int& aFinalState )
329 m_frame->UpdateItem( aItem,
false, aUpdateRTree );
348 symbolEditFrame->SaveCopyInUndoList( wxEmptyString,
dynamic_cast<LIB_SYMBOL*
>( item ) );
352 schematicFrame->SaveCopyInUndoList( schematicFrame->GetScreen(), item,
UNDO_REDO::CHANGED, aAppend );
354 if( aDirtyConnectivity )
358 && ( item->
Connection()->
Name() == schematicFrame->GetHighlightedConnection()
361 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