KiCad PCB EDA Suite
sch_text.cpp File Reference

Code for handling schematic texts (texts, labels, hlabels and global labels). More...

#include <fctsys.h>
#include <gr_basic.h>
#include <macros.h>
#include <trigo.h>
#include <sch_draw_panel.h>
#include <gr_text.h>
#include <sch_edit_frame.h>
#include <plotter.h>
#include <msgpanel.h>
#include <gal/stroke_font.h>
#include <bitmaps.h>
#include <math/util.h>
#include <sch_text.h>
#include <netlist_object.h>
#include <settings/color_settings.h>
#include <trace_helpers.h>
#include <wx/debug.h>

Go to the source code of this file.

Macros

#define V_MARGIN   1.40
 
#define OVERBAR_V_MARGIN   1.2
 

Functions

void IncrementLabelMember (wxString &name, int aIncrement)
 

Variables

static int TemplateIN_HN [] = { 6, 0, 0, -1, -1, -2, -1, -2, 1, -1, 1, 0, 0 }
 
static int TemplateIN_HI [] = { 6, 0, 0, 1, 1, 2, 1, 2, -1, 1, -1, 0, 0 }
 
static int TemplateIN_UP [] = { 6, 0, 0, 1, -1, 1, -2, -1, -2, -1, -1, 0, 0 }
 
static int TemplateIN_BOTTOM [] = { 6, 0, 0, 1, 1, 1, 2, -1, 2, -1, 1, 0, 0 }
 
static int TemplateOUT_HN [] = { 6, -2, 0, -1, 1, 0, 1, 0, -1, -1, -1, -2, 0 }
 
static int TemplateOUT_HI [] = { 6, 2, 0, 1, -1, 0, -1, 0, 1, 1, 1, 2, 0 }
 
static int TemplateOUT_UP [] = { 6, 0, -2, 1, -1, 1, 0, -1, 0, -1, -1, 0, -2 }
 
static int TemplateOUT_BOTTOM [] = { 6, 0, 2, 1, 1, 1, 0, -1, 0, -1, 1, 0, 2 }
 
static int TemplateUNSPC_HN [] = { 5, 0, -1, -2, -1, -2, 1, 0, 1, 0, -1 }
 
static int TemplateUNSPC_HI [] = { 5, 0, -1, 2, -1, 2, 1, 0, 1, 0, -1 }
 
static int TemplateUNSPC_UP [] = { 5, 1, 0, 1, -2, -1, -2, -1, 0, 1, 0 }
 
static int TemplateUNSPC_BOTTOM [] = { 5, 1, 0, 1, 2, -1, 2, -1, 0, 1, 0 }
 
static int TemplateBIDI_HN [] = { 5, 0, 0, -1, -1, -2, 0, -1, 1, 0, 0 }
 
static int TemplateBIDI_HI [] = { 5, 0, 0, 1, -1, 2, 0, 1, 1, 0, 0 }
 
static int TemplateBIDI_UP [] = { 5, 0, 0, -1, -1, 0, -2, 1, -1, 0, 0 }
 
static int TemplateBIDI_BOTTOM [] = { 5, 0, 0, -1, 1, 0, 2, 1, 1, 0, 0 }
 
static int Template3STATE_HN [] = { 5, 0, 0, -1, -1, -2, 0, -1, 1, 0, 0 }
 
static int Template3STATE_HI [] = { 5, 0, 0, 1, -1, 2, 0, 1, 1, 0, 0 }
 
static int Template3STATE_UP [] = { 5, 0, 0, -1, -1, 0, -2, 1, -1, 0, 0 }
 
static int Template3STATE_BOTTOM [] = { 5, 0, 0, -1, 1, 0, 2, 1, 1, 0, 0 }
 
static int * TemplateShape [5][4]
 

Detailed Description

Code for handling schematic texts (texts, labels, hlabels and global labels).

Definition in file sch_text.cpp.

Macro Definition Documentation

◆ OVERBAR_V_MARGIN

#define OVERBAR_V_MARGIN   1.2

◆ V_MARGIN

#define V_MARGIN   1.40

Function Documentation

◆ IncrementLabelMember()

void IncrementLabelMember ( wxString &  name,
int  aIncrement 
)

Definition at line 281 of file edit_label.cpp.

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

Referenced by SCH_TEXT::IncrementLabel().

Variable Documentation

◆ Template3STATE_BOTTOM

int Template3STATE_BOTTOM[] = { 5, 0, 0, -1, 1, 0, 2, 1, 1, 0, 0 }
static

Definition at line 82 of file sch_text.cpp.

◆ Template3STATE_HI

int Template3STATE_HI[] = { 5, 0, 0, 1, -1, 2, 0, 1, 1, 0, 0 }
static

Definition at line 80 of file sch_text.cpp.

◆ Template3STATE_HN

int Template3STATE_HN[] = { 5, 0, 0, -1, -1, -2, 0, -1, 1, 0, 0 }
static

Definition at line 79 of file sch_text.cpp.

◆ Template3STATE_UP

int Template3STATE_UP[] = { 5, 0, 0, -1, -1, 0, -2, 1, -1, 0, 0 }
static

Definition at line 81 of file sch_text.cpp.

◆ TemplateBIDI_BOTTOM

int TemplateBIDI_BOTTOM[] = { 5, 0, 0, -1, 1, 0, 2, 1, 1, 0, 0 }
static

Definition at line 77 of file sch_text.cpp.

◆ TemplateBIDI_HI

int TemplateBIDI_HI[] = { 5, 0, 0, 1, -1, 2, 0, 1, 1, 0, 0 }
static

Definition at line 75 of file sch_text.cpp.

◆ TemplateBIDI_HN

int TemplateBIDI_HN[] = { 5, 0, 0, -1, -1, -2, 0, -1, 1, 0, 0 }
static

Definition at line 74 of file sch_text.cpp.

◆ TemplateBIDI_UP

int TemplateBIDI_UP[] = { 5, 0, 0, -1, -1, 0, -2, 1, -1, 0, 0 }
static

Definition at line 76 of file sch_text.cpp.

◆ TemplateIN_BOTTOM

int TemplateIN_BOTTOM[] = { 6, 0, 0, 1, 1, 1, 2, -1, 2, -1, 1, 0, 0 }
static

Definition at line 62 of file sch_text.cpp.

◆ TemplateIN_HI

int TemplateIN_HI[] = { 6, 0, 0, 1, 1, 2, 1, 2, -1, 1, -1, 0, 0 }
static

Definition at line 60 of file sch_text.cpp.

◆ TemplateIN_HN

int TemplateIN_HN[] = { 6, 0, 0, -1, -1, -2, -1, -2, 1, -1, 1, 0, 0 }
static

Definition at line 59 of file sch_text.cpp.

◆ TemplateIN_UP

int TemplateIN_UP[] = { 6, 0, 0, 1, -1, 1, -2, -1, -2, -1, -1, 0, 0 }
static

Definition at line 61 of file sch_text.cpp.

◆ TemplateOUT_BOTTOM

int TemplateOUT_BOTTOM[] = { 6, 0, 2, 1, 1, 1, 0, -1, 0, -1, 1, 0, 2 }
static

Definition at line 67 of file sch_text.cpp.

◆ TemplateOUT_HI

int TemplateOUT_HI[] = { 6, 2, 0, 1, -1, 0, -1, 0, 1, 1, 1, 2, 0 }
static

Definition at line 65 of file sch_text.cpp.

◆ TemplateOUT_HN

int TemplateOUT_HN[] = { 6, -2, 0, -1, 1, 0, 1, 0, -1, -1, -1, -2, 0 }
static

Definition at line 64 of file sch_text.cpp.

◆ TemplateOUT_UP

int TemplateOUT_UP[] = { 6, 0, -2, 1, -1, 1, 0, -1, 0, -1, -1, 0, -2 }
static

Definition at line 66 of file sch_text.cpp.

◆ TemplateShape

int* TemplateShape[5][4]
static
Initial value:
=
{
}
static int Template3STATE_HN[]
Definition: sch_text.cpp:79
static int TemplateUNSPC_HN[]
Definition: sch_text.cpp:69
static int Template3STATE_HI[]
Definition: sch_text.cpp:80
static int TemplateUNSPC_HI[]
Definition: sch_text.cpp:70
static int TemplateOUT_UP[]
Definition: sch_text.cpp:66
static int TemplateOUT_HN[]
Definition: sch_text.cpp:64
static int TemplateUNSPC_UP[]
Definition: sch_text.cpp:71
static int TemplateIN_UP[]
Definition: sch_text.cpp:61
static int TemplateOUT_HI[]
Definition: sch_text.cpp:65
static int TemplateBIDI_HI[]
Definition: sch_text.cpp:75
static int Template3STATE_BOTTOM[]
Definition: sch_text.cpp:82
static int TemplateIN_BOTTOM[]
Definition: sch_text.cpp:62
static int TemplateOUT_BOTTOM[]
Definition: sch_text.cpp:67
static int TemplateIN_HI[]
Definition: sch_text.cpp:60
static int Template3STATE_UP[]
Definition: sch_text.cpp:81
static int TemplateBIDI_HN[]
Definition: sch_text.cpp:74
static int TemplateBIDI_BOTTOM[]
Definition: sch_text.cpp:77
static int TemplateBIDI_UP[]
Definition: sch_text.cpp:76
static int TemplateUNSPC_BOTTOM[]
Definition: sch_text.cpp:72
static int TemplateIN_HN[]
Definition: sch_text.cpp:59

Definition at line 84 of file sch_text.cpp.

Referenced by SCH_HIERLABEL::CreateGraphicShape().

◆ TemplateUNSPC_BOTTOM

int TemplateUNSPC_BOTTOM[] = { 5, 1, 0, 1, 2, -1, 2, -1, 0, 1, 0 }
static

Definition at line 72 of file sch_text.cpp.

◆ TemplateUNSPC_HI

int TemplateUNSPC_HI[] = { 5, 0, -1, 2, -1, 2, 1, 0, 1, 0, -1 }
static

Definition at line 70 of file sch_text.cpp.

◆ TemplateUNSPC_HN

int TemplateUNSPC_HN[] = { 5, 0, -1, -2, -1, -2, 1, 0, 1, 0, -1 }
static

Definition at line 69 of file sch_text.cpp.

◆ TemplateUNSPC_UP

int TemplateUNSPC_UP[] = { 5, 1, 0, 1, -2, -1, -2, -1, 0, 1, 0 }
static

Definition at line 71 of file sch_text.cpp.