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 347 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 291 of file cadstar_archive_parser.cpp.

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

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

long CADSTAR_ARCHIVE_PARSER::TEXTCODE::LineWidth

◆ Name

wxString CADSTAR_ARCHIVE_PARSER::TEXTCODE::Name

Definition at line 350 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 353 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::applyTextCode(), and CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings().


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