KiCad PCB EDA Suite
edit_label.cpp File Reference
#include <fctsys.h>
#include <gr_basic.h>
#include <base_struct.h>
#include <gr_text.h>
#include <sch_draw_panel.h>
#include <confirm.h>
#include <sch_edit_frame.h>
#include <tool/tool_manager.h>
#include <tools/ee_actions.h>
#include <general.h>
#include <sch_text.h>
#include <sch_view.h>
#include <wx/tokenzr.h>
#include "invoke_sch_dialog.h"

Go to the source code of this file.

Functions

void IncrementLabelMember (wxString &name, int aIncrement)
 

Function Documentation

◆ IncrementLabelMember()

void IncrementLabelMember ( wxString &  name,
int  aIncrement 
)

Definition at line 131 of file edit_label.cpp.

132 {
133  int ii, nn;
134  long number = 0;
135 
136  ii = name.Len() - 1; nn = 0;
137 
138  if( !wxIsdigit( name.GetChar( ii ) ) )
139  return;
140 
141  while( (ii >= 0) && wxIsdigit( name.GetChar( ii ) ) )
142  {
143  ii--; nn++;
144  }
145 
146  ii++; /* digits are starting at ii position */
147  wxString litt_number = name.Right( nn );
148 
149  if( litt_number.ToLong( &number ) )
150  {
151  number += aIncrement;
152  name.Remove( ii ); name << number;
153  }
154 }
const char * name
Definition: DXF_plotter.cpp:60

References name.

Referenced by SCH_TEXT::IncrementLabel(), and LIB_PIN_TOOL::RepeatPin().