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 <drawtxt.h>
#include <class_drawpanel.h>
#include <confirm.h>
#include <schframe.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 293 of file edit_label.cpp.

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

294 {
295  int ii, nn;
296  long number = 0;
297 
298  ii = name.Len() - 1; nn = 0;
299 
300  if( !isdigit( name.GetChar( ii ) ) )
301  return;
302 
303  while( (ii >= 0) && isdigit( name.GetChar( ii ) ) )
304  {
305  ii--; nn++;
306  }
307 
308  ii++; /* digits are starting at ii position */
309  wxString litt_number = name.Right( nn );
310 
311  if( litt_number.ToLong( &number ) )
312  {
313  number += aIncrement;
314  name.Remove( ii ); name << number;
315  }
316 }
const char * name

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().