KiCad PCB EDA Suite
CADSTAR_ARCHIVE_PARSER::TEXTCODE Struct Reference

#include <cadstar_archive_parser.h>

Inheritance diagram for CADSTAR_ARCHIVE_PARSER::TEXTCODE:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

void Parse (XNODE *aNode, PARSER_CONTEXT *aContext) override
 

Public Attributes

TEXTCODE_ID ID
 
wxString Name
 
long LineWidth
 
long Height
 
long Width
 Defaults to 0 if using system fonts or, if using CADSTAR font, default to equal height (1:1 aspect ratio). More...
 
FONT Font
 

Detailed Description

Definition at line 328 of file cadstar_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_ARCHIVE_PARSER::TEXTCODE::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 284 of file cadstar_archive_parser.cpp.

285 {
286  wxASSERT( aNode->GetName() == wxT( "TEXTCODE" ) );
287 
288  ID = GetXmlAttributeIDString( aNode, 0 );
289  Name = GetXmlAttributeIDString( aNode, 1 );
290 
291  LineWidth = GetXmlAttributeIDLong( aNode, 2 );
292  Height = GetXmlAttributeIDLong( aNode, 3 );
293  Width = GetXmlAttributeIDLong( aNode, 4 );
294 
295  XNODE* cNode = aNode->GetChildren();
296 
297  if( cNode )
298  {
299  if( cNode->GetName() == wxT( "FONT" ) )
300  Font.Parse( cNode, aContext );
301  else
302  THROW_UNKNOWN_NODE_IO_ERROR( cNode->GetName(), aNode->GetName() );
303  }
304 }
XNODE * GetChildren() const
Definition: xnode.h:62
long Width
Defaults to 0 if using system fonts or, if using CADSTAR font, default to equal height (1:1 aspect ra...
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Hold an XML or S-expression element.
Definition: xnode.h:43
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override

References XNODE::GetChildren(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), and THROW_UNKNOWN_NODE_IO_ERROR.

Referenced by CADSTAR_ARCHIVE_PARSER::CODEDEFS::ParseSubNode().

Member Data Documentation

◆ Font

FONT CADSTAR_ARCHIVE_PARSER::TEXTCODE::Font

◆ Height

◆ ID

TEXTCODE_ID CADSTAR_ARCHIVE_PARSER::TEXTCODE::ID

◆ LineWidth

◆ Name

wxString CADSTAR_ARCHIVE_PARSER::TEXTCODE::Name

Definition at line 331 of file cadstar_archive_parser.h.

◆ Width

long CADSTAR_ARCHIVE_PARSER::TEXTCODE::Width

Defaults to 0 if using system fonts or, if using CADSTAR font, default to equal height (1:1 aspect ratio).

Allows for system fonts to be rendered in a different aspect ratio.

Definition at line 334 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute(), CADSTAR_PCB_ARCHIVE_LOADER::applyDimensionSettings(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), and CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText().


The documentation for this struct was generated from the following files: