KiCad PCB EDA Suite
|
Hold a name of a symbol's field, field value, and default visibility. More...
#include <template_fieldnames.h>
Public Member Functions | |
TEMPLATE_FIELDNAME () | |
TEMPLATE_FIELDNAME (const wxString &aName) | |
TEMPLATE_FIELDNAME (const TEMPLATE_FIELDNAME &ref) | |
void | Format (OUTPUTFORMATTER *out) const |
Serialize this object out as text into the given OUTPUTFORMATTER. | |
void | Parse (TEMPLATE_FIELDNAMES_LEXER *aSpec) |
Fill this object from information in the input stream aSpec, which is a #TEMPLATE_FIELDNAMES_LEXER. | |
Static Public Member Functions | |
static const wxString | GetDefaultFieldName (int aFieldNdx, bool aTranslateForHI=false) |
Return a default symbol field name for field aFieldNdx for all components. | |
Public Attributes | |
wxString | m_Name |
bool | m_Visible |
bool | m_URL |
Hold a name of a symbol's field, field value, and default visibility.
Template fieldnames are wanted field names for use in the symbol property editors.
Definition at line 62 of file template_fieldnames.h.
|
inline |
Definition at line 64 of file template_fieldnames.h.
|
inline |
Definition at line 70 of file template_fieldnames.h.
|
inline |
Definition at line 77 of file template_fieldnames.h.
void TEMPLATE_FIELDNAME::Format | ( | OUTPUTFORMATTER * | out | ) | const |
Serialize this object out as text into the given OUTPUTFORMATTER.
Definition at line 82 of file template_fieldnames.cpp.
References m_Name, m_URL, m_Visible, OUTPUTFORMATTER::Print(), and OUTPUTFORMATTER::Quotew().
|
static |
Return a default symbol field name for field aFieldNdx for all components.
These field names are not modifiable but template field names are.
aFieldNdx | The field number index, > 0. |
aTranslateForHI | If true, return the translated field name, else get the canonical name (defualt). Translation is intended only for dialogs |
Definition at line 47 of file template_fieldnames.cpp.
References _, DATASHEET_CANONICAL, DATASHEET_FIELD, DESCRIPTION_CANONICAL, DESCRIPTION_FIELD, FOOTPRINT_CANONICAL, FOOTPRINT_FIELD, REFERENCE_CANONICAL, REFERENCE_FIELD, s_CanonicalDatasheet(), s_CanonicalDescription(), s_CanonicalFootprint(), s_CanonicalReference(), s_CanonicalValue(), VALUE_CANONICAL, and VALUE_FIELD.
Referenced by DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), DIALOG_UPDATE_SYMBOL_FIELDS::DIALOG_UPDATE_SYMBOL_FIELDS(), SCH_EDIT_TOOL::editFieldText(), GetCanonicalFieldName(), SCH_FIELD::GetName(), PCB_FIELD::GetName(), FIELDS_GRID_TABLE::GetValue(), SCH_SYMBOL::Init(), EESCHEMA_JOBS_HANDLER::JobExportBom(), DIALOG_SYMBOL_FIELDS_TABLE::LoadFieldNames(), SCH_IO_KICAD_LEGACY::loadSymbol(), DIALOG_FOOTPRINT_PROPERTIES::OnAddField(), DIALOG_SYMBOL_PROPERTIES::OnAddField(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnAddField(), SCH_IO_KICAD_LEGACY_LIB_CACHE::saveField(), and SCH_FIELD::SCH_FIELD().
void TEMPLATE_FIELDNAME::Parse | ( | TEMPLATE_FIELDNAMES_LEXER * | aSpec | ) |
Fill this object from information in the input stream aSpec, which is a #TEMPLATE_FIELDNAMES_LEXER.
The entire textual element spec is
(field (name yourfieldname)(value yourvalue) visible)). The presence of value is optional, the presence of visible is optional. When this function is called, the input token stream given by aSpec is assumed to be positioned at the '^' in the following example, i.e. just after the identifying keyword and before the content specifying stuff.
(field ^ (....) ).
aSpec | is the input token stream of keywords and symbols. |
Definition at line 96 of file template_fieldnames.cpp.
References From_UTF8(), m_Name, m_URL, and m_Visible.
Referenced by TEMPLATES::parse().
wxString TEMPLATE_FIELDNAME::m_Name |
Definition at line 114 of file template_fieldnames.h.
Referenced by TEMPLATES::AddTemplateFieldName(), Format(), Parse(), TEMPLATES::parse(), and TEMPLATE_FIELDNAME().
bool TEMPLATE_FIELDNAME::m_URL |
Definition at line 116 of file template_fieldnames.h.
Referenced by Format(), FIELDS_GRID_TABLE::GetAttr(), Parse(), SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS(), and TEMPLATE_FIELDNAME().
bool TEMPLATE_FIELDNAME::m_Visible |
Definition at line 115 of file template_fieldnames.h.
Referenced by Format(), PANEL_TEMPLATE_FIELDNAMES::OnAddButtonClick(), Parse(), SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS(), and TEMPLATE_FIELDNAME().