KiCad PCB EDA Suite
edit_label.cpp File Reference

Label, global label and text creation and editing. More...

#include <fctsys.h>
#include <gr_basic.h>
#include <base_struct.h>
#include <draw_graphic_text.h>
#include <sch_draw_panel.h>
#include <confirm.h>
#include <sch_edit_frame.h>
#include <kicad_device_context.h>
#include <general.h>
#include <sch_text.h>
#include <eeschema_id.h>

Go to the source code of this file.

Functions

void IncrementLabelMember (wxString &name, int aIncrement)
 

Variables

static PINSHEETLABEL_SHAPE lastGlobalLabelShape = NET_INPUT
 
static int lastTextOrientation = 0
 
static bool lastTextBold = false
 
static bool lastTextItalic = false
 

Detailed Description

Label, global label and text creation and editing.

Definition in file edit_label.cpp.

Function Documentation

void IncrementLabelMember ( wxString &  name,
int  aIncrement 
)

Definition at line 286 of file edit_label.cpp.

Referenced by SCH_TEXT::IncrementLabel(), and LIB_EDIT_FRAME::RepeatPinItem().

287 {
288  int ii, nn;
289  long number = 0;
290 
291  ii = name.Len() - 1; nn = 0;
292 
293  if( !isdigit( name.GetChar( ii ) ) )
294  return;
295 
296  while( (ii >= 0) && isdigit( name.GetChar( ii ) ) )
297  {
298  ii--; nn++;
299  }
300 
301  ii++; /* digits are starting at ii position */
302  wxString litt_number = name.Right( nn );
303 
304  if( litt_number.ToLong( &number ) )
305  {
306  number += aIncrement;
307  name.Remove( ii ); name << number;
308  }
309 }
const char * name
Definition: DXF_plotter.cpp:61

Variable Documentation

PINSHEETLABEL_SHAPE lastGlobalLabelShape = NET_INPUT
static

Definition at line 44 of file edit_label.cpp.

Referenced by SCH_EDIT_FRAME::CreateNewText().

bool lastTextBold = false
static

Definition at line 46 of file edit_label.cpp.

Referenced by SCH_EDIT_FRAME::CreateNewText().

bool lastTextItalic = false
static

Definition at line 47 of file edit_label.cpp.

Referenced by SCH_EDIT_FRAME::CreateNewText().

int lastTextOrientation = 0
static

Definition at line 45 of file edit_label.cpp.

Referenced by SCH_EDIT_FRAME::CreateNewText().