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 <class_drawpanel.h>
#include <drawtxt.h>
#include <schframe.h>
#include <class_plotter.h>
#include <msgpanel.h>
#include <gal/stroke_font.h>
#include <bitmaps.h>
#include <list_operations.h>
#include <sch_text.h>
#include <class_netlist_object.h>

Go to the source code of this file.

Macros

#define DRAW_BBOX   0
 
#define TXT_MARGIN   4
 
#define Y_CORRECTION   1.40
 
#define Y_OVERBAR_CORRECTION   1.2
 

Functions

void IncrementLabelMember (wxString &name, int aIncrement)
 

Variables

const char * SheetLabelType []
 
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

#define DRAW_BBOX   0

Definition at line 51 of file sch_text.cpp.

#define Y_CORRECTION   1.40
#define Y_OVERBAR_CORRECTION   1.2

Function Documentation

void IncrementLabelMember ( wxString &  name,
int  aIncrement 
)

Definition at line 293 of file edit_label.cpp.

Referenced by SCH_TEXT::IncrementLabel().

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

const char* SheetLabelType[]
Initial value:
=
{
"Input",
"Output",
"BiDi",
"3State",
"UnSpc",
"???"
}

Definition at line 57 of file sch_text.cpp.

Referenced by SCH_LEGACY_PLUGIN::loadText(), and SCH_LEGACY_PLUGIN::saveText().

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

Definition at line 95 of file sch_text.cpp.

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

Definition at line 93 of file sch_text.cpp.

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

Definition at line 92 of file sch_text.cpp.

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

Definition at line 94 of file sch_text.cpp.

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

Definition at line 90 of file sch_text.cpp.

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

Definition at line 88 of file sch_text.cpp.

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

Definition at line 87 of file sch_text.cpp.

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

Definition at line 89 of file sch_text.cpp.

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

Definition at line 75 of file sch_text.cpp.

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

Definition at line 73 of file sch_text.cpp.

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

Definition at line 72 of file sch_text.cpp.

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

Definition at line 74 of file sch_text.cpp.

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

Definition at line 80 of file sch_text.cpp.

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

Definition at line 78 of file sch_text.cpp.

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

Definition at line 77 of file sch_text.cpp.

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

Definition at line 79 of file sch_text.cpp.

int* TemplateShape[5][4]
static
Initial value:
=
{
}
static int Template3STATE_HN[]
Definition: sch_text.cpp:92
static int TemplateUNSPC_HN[]
Definition: sch_text.cpp:82
static int Template3STATE_HI[]
Definition: sch_text.cpp:93
static int TemplateUNSPC_HI[]
Definition: sch_text.cpp:83
static int TemplateOUT_UP[]
Definition: sch_text.cpp:79
static int TemplateOUT_HN[]
Definition: sch_text.cpp:77
static int TemplateUNSPC_UP[]
Definition: sch_text.cpp:84
static int TemplateIN_UP[]
Definition: sch_text.cpp:74
static int TemplateOUT_HI[]
Definition: sch_text.cpp:78
static int TemplateBIDI_HI[]
Definition: sch_text.cpp:88
static int Template3STATE_BOTTOM[]
Definition: sch_text.cpp:95
static int TemplateIN_BOTTOM[]
Definition: sch_text.cpp:75
static int TemplateOUT_BOTTOM[]
Definition: sch_text.cpp:80
static int TemplateIN_HI[]
Definition: sch_text.cpp:73
static int Template3STATE_UP[]
Definition: sch_text.cpp:94
static int TemplateBIDI_HN[]
Definition: sch_text.cpp:87
static int TemplateBIDI_BOTTOM[]
Definition: sch_text.cpp:90
static int TemplateBIDI_UP[]
Definition: sch_text.cpp:89
static int TemplateUNSPC_BOTTOM[]
Definition: sch_text.cpp:85
static int TemplateIN_HN[]
Definition: sch_text.cpp:72

Definition at line 97 of file sch_text.cpp.

Referenced by SCH_HIERLABEL::CreateGraphicShape().

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

Definition at line 85 of file sch_text.cpp.

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

Definition at line 83 of file sch_text.cpp.

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

Definition at line 82 of file sch_text.cpp.

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

Definition at line 84 of file sch_text.cpp.