diff --git a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp index 9505824b11..336dc62045 100644 --- a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp +++ b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp @@ -140,7 +140,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( SCH_EDIT m_cmp = aComponent; m_part = GetParent()->GetLibPart( m_cmp->GetLibId(), true ); - m_fields = new FIELDS_GRID_TABLE( this, false, m_part ); + m_fields = new FIELDS_GRID_TABLE( this, aParent, m_part ); m_delayedFocusRow = REFERENCE; m_delayedFocusColumn = FDC_VALUE; diff --git a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp index 360195d779..198b649055 100644 --- a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp +++ b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp @@ -123,7 +123,7 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB( LIB_EDIT m_parent = aParent; m_libEntry = aLibEntry; - m_fields = new FIELDS_GRID_TABLE( this, true, m_libEntry ); + m_fields = new FIELDS_GRID_TABLE( this, aParent, m_libEntry ); m_delayedFocusRow = REFERENCE; m_delayedFocusColumn = FDC_VALUE; diff --git a/eeschema/dialogs/panel_eeschema_template_fieldnames.cpp b/eeschema/dialogs/panel_eeschema_template_fieldnames.cpp index 43b6317617..fa2e0ade6f 100644 --- a/eeschema/dialogs/panel_eeschema_template_fieldnames.cpp +++ b/eeschema/dialogs/panel_eeschema_template_fieldnames.cpp @@ -105,14 +105,19 @@ bool PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::TransferDataToGrid() { m_grid->SetCellValue( row, 0, m_fields[row].m_Name ); m_grid->SetCellValue( row, 1, m_fields[row].m_Visible ? wxT( "1" ) : wxEmptyString ); + m_grid->SetCellValue( row, 2, m_fields[row].m_URL ? wxT( "1" ) : wxEmptyString ); // Set cell properties m_grid->SetCellAlignment( row, 0, wxALIGN_LEFT, wxALIGN_CENTRE ); - // Render the Visible column as a check box + // Render the Visible and URL columns as check boxes m_grid->SetCellRenderer( row, 1, new wxGridCellBoolRenderer() ); m_grid->SetReadOnly( row, 1 ); // Not really; we delegate interactivity to GRID_TRICKS m_grid->SetCellAlignment( row, 1, wxALIGN_CENTRE, wxALIGN_CENTRE ); + + m_grid->SetCellRenderer( row, 2, new wxGridCellBoolRenderer() ); + m_grid->SetReadOnly( row, 2 ); // Not really; we delegate interactivity to GRID_TRICKS + m_grid->SetCellAlignment( row, 2, wxALIGN_CENTRE, wxALIGN_CENTRE ); } m_grid->Thaw(); @@ -130,6 +135,7 @@ bool PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::TransferDataFromGrid() { m_fields[row].m_Name = m_grid->GetCellValue( row, 0 ); m_fields[row].m_Visible = ( m_grid->GetCellValue( row, 1 ) != wxEmptyString ); + m_fields[row].m_URL = ( m_grid->GetCellValue( row, 2 ) != wxEmptyString ); } return true; @@ -158,8 +164,9 @@ void PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::AdjustGridColumns( int aWidth ) // Account for scroll bars aWidth -= ( m_grid->GetSize().x - m_grid->GetClientSize().x ); - m_grid->SetColSize( 0, aWidth - m_checkboxColWidth ); + m_grid->SetColSize( 0, aWidth - 2 * m_checkboxColWidth ); m_grid->SetColSize( 1, m_checkboxColWidth ); + m_grid->SetColSize( 2, m_checkboxColWidth ); } diff --git a/eeschema/dialogs/panel_eeschema_template_fieldnames_base.cpp b/eeschema/dialogs/panel_eeschema_template_fieldnames_base.cpp index 24231de29a..838b82ab64 100644 --- a/eeschema/dialogs/panel_eeschema_template_fieldnames_base.cpp +++ b/eeschema/dialogs/panel_eeschema_template_fieldnames_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 2 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -22,7 +22,7 @@ PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE m_grid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE ); // Grid - m_grid->CreateGrid( 0, 2 ); + m_grid->CreateGrid( 0, 3 ); m_grid->EnableEditing( true ); m_grid->EnableGridLines( true ); m_grid->EnableDragGridSize( false ); @@ -31,11 +31,13 @@ PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE // Columns m_grid->SetColSize( 0, 300 ); m_grid->SetColSize( 1, 60 ); + m_grid->SetColSize( 2, 60 ); m_grid->EnableDragColMove( false ); m_grid->EnableDragColSize( true ); m_grid->SetColLabelSize( 22 ); m_grid->SetColLabelValue( 0, _("Name") ); m_grid->SetColLabelValue( 1, _("Visible") ); + m_grid->SetColLabelValue( 2, _("URL") ); m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); // Rows diff --git a/eeschema/dialogs/panel_eeschema_template_fieldnames_base.fbp b/eeschema/dialogs/panel_eeschema_template_fieldnames_base.fbp index 5b18ba5ca5..b10dac25b5 100644 --- a/eeschema/dialogs/panel_eeschema_template_fieldnames_base.fbp +++ b/eeschema/dialogs/panel_eeschema_template_fieldnames_base.fbp @@ -1,475 +1,440 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - panel_eeschema_template_fieldnames_base - 1000 - none - - 1 - PanelEeschemaTemplateFieldnames - - . - - 1 - 1 - 1 - 1 - UI - 1 - 0 - - 0 - wxAUI_MGR_DEFAULT - - - 1 - 1 - impl_virtual - - - 0 - wxID_ANY - - - PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE - - -1,-1 - ; forward_declare - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bPanelSizer - wxHORIZONTAL - none - - 10 - wxEXPAND|wxRIGHT|wxLEFT - 1 - - - bMargins - wxVERTICAL - none - - 2 - wxEXPAND|wxTOP - 1 - - 1 - 1 - 1 - 1 - - - - - 0 - 0 - - - - 1 - - - wxALIGN_LEFT - - wxALIGN_TOP - 0 - 1 - wxALIGN_CENTRE - 22 - "Name" "Visible" - wxALIGN_CENTRE - 2 - 300,60 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - 0 - 1 - 1 - 1 - - 1 - - - 1 - 0 - 0 - wxID_ANY - - - - 0 - 0 - - 0 - - - 0 - - 1 - m_grid - 1 - - - protected - 1 - - Resizable - wxALIGN_CENTRE - 0 - - wxALIGN_CENTRE - - 0 - 1 - - WX_GRID; widgets/wx_grid.h; forward_declare - 0 - - - - wxBORDER_SIMPLE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnSizeGrid - - - - - 5 - wxEXPAND - 0 - - - bSizer10 - wxHORIZONTAL - none - - 5 - wxTOP|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Add Field - - 0 - - 0 - - - 0 - 29,29 - 1 - m_addFieldButton - 1 - - - protected - 1 - - - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - OnAddButtonClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Delete Field - - 0 - - 0 - - - 0 - 29,29 - 1 - m_deleteFieldButton - 1 - - - protected - 1 - - - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - OnDeleteButtonClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + panel_eeschema_template_fieldnames_base + 1000 + none + 1 + PanelEeschemaTemplateFieldnames + + . + + 1 + 1 + 1 + 1 + UI + 1 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE + + -1,-1 + ; forward_declare + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bPanelSizer + wxHORIZONTAL + none + + 10 + wxEXPAND|wxRIGHT|wxLEFT + 1 + + + bMargins + wxVERTICAL + none + + 2 + wxEXPAND|wxTOP + 1 + + 1 + 1 + 1 + 1 + + + + + 0 + 0 + + + + 1 + + + wxALIGN_LEFT + + wxALIGN_TOP + 0 + 1 + wxALIGN_CENTRE + 22 + "Name" "Visible" "URL" + wxALIGN_CENTRE + 3 + 300,60,60 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + 0 + 1 + 1 + 1 + + 1 + + + 1 + 0 + 0 + wxID_ANY + + + + 0 + 0 + + 0 + + + 0 + + 1 + m_grid + 1 + + + protected + 1 + + Resizable + wxALIGN_CENTRE + 0 + + wxALIGN_CENTRE + + 0 + 1 + + WX_GRID; widgets/wx_grid.h; forward_declare + 0 + + + + wxBORDER_SIMPLE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnSizeGrid + + + + + 5 + wxEXPAND + 0 + + + bSizer10 + wxHORIZONTAL + none + + 5 + wxTOP|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + + wxID_ANY + Add Field + + 0 + + + 0 + 29,29 + 1 + m_addFieldButton + 1 + + + protected + 1 + + Resizable + + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + + wxID_ANY + Delete Field + + 0 + + + 0 + 29,29 + 1 + m_deleteFieldButton + 1 + + + protected + 1 + + Resizable + + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnDeleteButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eeschema/dialogs/panel_eeschema_template_fieldnames_base.h b/eeschema/dialogs/panel_eeschema_template_fieldnames_base.h index 18e3e5c5d7..e2583852df 100644 --- a/eeschema/dialogs/panel_eeschema_template_fieldnames_base.h +++ b/eeschema/dialogs/panel_eeschema_template_fieldnames_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 2 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -19,10 +19,10 @@ class WX_GRID; #include #include #include -#include #include #include #include +#include #include #include #include diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 273f5c32a9..819f5be857 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -479,13 +479,12 @@ void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg ) try { - m_TemplateFieldNames.Parse( &lexer ); + m_templateFieldNames.Parse( &lexer ); } catch( const IO_ERROR& DBG( e ) ) { // @todo show error msg - DBG( printf( "templatefieldnames parsing error: '%s'\n", - TO_UTF8( e.What() ) ); ) + DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); ) } } } @@ -552,7 +551,7 @@ void SCH_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg ) // Save template fieldnames STRING_FORMATTER sf; - m_TemplateFieldNames.Format( &sf, 0 ); + m_templateFieldNames.Format( &sf, 0 ); wxString record = FROM_UTF8( sf.GetString().c_str() ); record.Replace( wxT("\n"), wxT(""), true ); // strip all newlines @@ -582,6 +581,23 @@ void LIB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg ) step.y = aCfg->Read( repeatLibStepYEntry, (long)DEFAULT_REPEAT_OFFSET_Y ); SetRepeatStep( step ); m_showPinElectricalTypeName = aCfg->Read( showPinElectricalType, true ); + + wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString ); + + if( !templateFieldNames.IsEmpty() ) + { + TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) ); + + try + { + m_templateFieldNames.Parse( &lexer ); + } + catch( const IO_ERROR& DBG( e ) ) + { + // @todo show error msg + DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); ) + } + } } diff --git a/eeschema/fields_grid_table.cpp b/eeschema/fields_grid_table.cpp index a1979d54e5..448fd4c621 100644 --- a/eeschema/fields_grid_table.cpp +++ b/eeschema/fields_grid_table.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -32,7 +33,6 @@ #include #include #include -#include #include "eda_doc.h" @@ -45,12 +45,13 @@ enum template -FIELDS_GRID_TABLE::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, bool aInLibEdit, LIB_PART* aPart ) : +FIELDS_GRID_TABLE::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* aFrame, + LIB_PART* aPart ) : + m_frame( aFrame ), m_userUnits( aDialog->GetUserUnits() ), m_part( aPart ), - m_inLibEdit( aInLibEdit ), - m_fieldNameValidator( aInLibEdit, FIELD_NAME ), - m_referenceValidator( aInLibEdit, REFERENCE ) + m_fieldNameValidator( aFrame->IsType( FRAME_SCH_LIB_EDITOR ), FIELD_NAME ), + m_referenceValidator( aFrame->IsType( FRAME_SCH_LIB_EDITOR ), REFERENCE ) { // Build the various grid cell attributes. @@ -176,8 +177,6 @@ bool FIELDS_GRID_TABLE::CanSetValueAs( int aRow, int aCol, const wxString& aT template wxGridCellAttr* FIELDS_GRID_TABLE::GetAttr( int aRow, int aCol, wxGridCellAttr::wxAttrKind ) { - static wxRegEx urlPrefix( wxT( "((https?)|(file)):\/\/" ) ); - switch( aCol ) { case FDC_NAME: @@ -200,7 +199,7 @@ wxGridCellAttr* FIELDS_GRID_TABLE::GetAttr( int aRow, int aCol, wxGridCellAtt } else if( aRow == VALUE ) { - if( m_inLibEdit ) + if( m_frame->IsType( FRAME_SCH_LIB_EDITOR ) ) { // This field is the lib name and the default value when loading this component // in schematic. The value is now not editable here (in this dialog) because @@ -227,11 +226,16 @@ wxGridCellAttr* FIELDS_GRID_TABLE::GetAttr( int aRow, int aCol, wxGridCellAtt m_urlAttr->IncRef(); return m_urlAttr; } - else if( urlPrefix.Matches( GetValue( aRow, aCol ) ) ) + else { - // Treat any user-defined field that starts with http:// or https:// as a URL - m_urlAttr->IncRef(); - return m_urlAttr; + wxString fieldname = GetValue( aRow, FDC_NAME ); + const TEMPLATE_FIELDNAME* templateFn = m_frame->GetTemplateFieldName( fieldname ); + + if( templateFn && templateFn->m_URL ) + { + m_urlAttr->IncRef(); + return m_urlAttr; + } } return nullptr; diff --git a/eeschema/fields_grid_table.h b/eeschema/fields_grid_table.h index e63e3aa464..43cdf56b1e 100644 --- a/eeschema/fields_grid_table.h +++ b/eeschema/fields_grid_table.h @@ -30,6 +30,10 @@ #include #include +class SCH_BASE_FRAME; +class DIALOG_SHIM; + + class FIELDS_GRID_TRICKS : public GRID_TRICKS { public: @@ -67,7 +71,7 @@ template class FIELDS_GRID_TABLE : public wxGridTableBase, public std::vector { public: - FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, bool aInLibEdit, LIB_PART* aPart ); + FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* aFrame, LIB_PART* aPart ); ~FIELDS_GRID_TABLE(); int GetNumberRows() override { return (int) this->size(); } @@ -91,10 +95,10 @@ public: void SetValueAsBool( int aRow, int aCol, bool aValue ) override; private: + SCH_BASE_FRAME* m_frame; EDA_UNITS_T m_userUnits; LIB_PART* m_part; - bool m_inLibEdit; SCH_FIELD_VALIDATOR m_fieldNameValidator; SCH_FIELD_VALIDATOR m_referenceValidator; diff --git a/eeschema/sch_base_frame.h b/eeschema/sch_base_frame.h index 6001299a2e..314a375a7d 100644 --- a/eeschema/sch_base_frame.h +++ b/eeschema/sch_base_frame.h @@ -29,6 +29,7 @@ #include #include +#include "template_fieldnames.h" class PAGE_INFO; class TITLE_BLOCK; @@ -77,10 +78,12 @@ LIB_PART* SchGetLibPart( const LIB_ID& aLibId, SYMBOL_LIB_TABLE* aLibTable, class SCH_BASE_FRAME : public EDA_DRAW_FRAME { protected: - wxPoint m_repeatStep; ///< the increment value of the position of an item - ///< when it is repeated - int m_repeatDeltaLabel; ///< the increment value of labels like bus members - ///< when they are repeated + TEMPLATES m_templateFieldNames; + + wxPoint m_repeatStep; ///< the increment value of the position of an item + ///< when it is repeated + int m_repeatDeltaLabel; ///< the increment value of labels like bus members + ///< when they are repeated public: @@ -206,6 +209,25 @@ public: void OnConfigurePaths( wxCommandEvent& aEvent ); + /** + * Return a template field names list for read only access. + */ + const TEMPLATE_FIELDNAMES& GetTemplateFieldNames() const + { + return m_templateFieldNames.GetTemplateFieldNames(); + } + + /** + * Search for \a aName in the the template field name list. + * + * @param aName A wxString object containing the field name to search for. + * @return the template fieldname if found; NULL otherwise. + */ + const TEMPLATE_FIELDNAME* GetTemplateFieldName( const wxString& aName ) const + { + return m_templateFieldNames.GetFieldName( aName ); + } + virtual void OnEditSymbolLibTable( wxCommandEvent& aEvent ); /** diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h index c257b70739..7a8931c133 100644 --- a/eeschema/sch_edit_frame.h +++ b/eeschema/sch_edit_frame.h @@ -181,8 +181,6 @@ private: static wxPoint m_lastSheetPinPosition; ///< Last sheet pin position. protected: - TEMPLATES m_TemplateFieldNames; - /** * Initializing accessor for the pin text size */ @@ -313,25 +311,7 @@ public: */ int AddTemplateFieldName( const TEMPLATE_FIELDNAME& aFieldName ) { - return m_TemplateFieldNames.AddTemplateFieldName( aFieldName ); - } - - - /** - * Return a template field names list for read only access. - */ - const TEMPLATE_FIELDNAMES& GetTemplateFieldNames() - { - return m_TemplateFieldNames.GetTemplateFieldNames(); - } - - - /** - * Return the field names template for read only access. - */ - const TEMPLATES& GetTemplates() - { - return m_TemplateFieldNames; + return m_templateFieldNames.AddTemplateFieldName( aFieldName ); } /** @@ -339,7 +319,7 @@ public: */ void DeleteAllTemplateFieldNames() { - m_TemplateFieldNames.DeleteAllTemplateFieldNames(); + m_templateFieldNames.DeleteAllTemplateFieldNames(); } /** diff --git a/eeschema/template_fieldnames.cpp b/eeschema/template_fieldnames.cpp index 1505fd7100..26be93d556 100644 --- a/eeschema/template_fieldnames.cpp +++ b/eeschema/template_fieldnames.cpp @@ -82,12 +82,12 @@ void TEMPLATE_FIELDNAME::Format( OUTPUTFORMATTER* out, int nestLevel ) const { out->Print( nestLevel, "(field (name %s)", out->Quotew( m_Name ).c_str() ); - if( !m_Value.IsEmpty() ) - out->Print( 0, "(value %s)", out->Quotew( m_Value ).c_str() ); - if( m_Visible ) out->Print( 0, " visible" ); + if( m_URL ) + out->Print( 0, " url" ); + out->Print( 0, ")\n" ); } @@ -116,8 +116,8 @@ void TEMPLATE_FIELDNAME::Parse( TEMPLATE_FIELDNAMES_LEXER* in ) switch( tok ) { case T_value: + // older format; silently skip in->NeedSYMBOLorNUMBER(); - m_Value = FROM_UTF8( in->CurText() ); in->NeedRIGHT(); break; @@ -125,8 +125,12 @@ void TEMPLATE_FIELDNAME::Parse( TEMPLATE_FIELDNAMES_LEXER* in ) m_Visible = true; break; + case T_url: + m_URL = true; + break; + default: - in->Expecting( "value|visible" ); + in->Expecting( "value|url|visible" ); break; } } @@ -219,14 +223,14 @@ int TEMPLATES::AddTemplateFieldName( const TEMPLATE_FIELDNAME& aFieldName ) } -bool TEMPLATES::HasFieldName( const wxString& aName ) const +const TEMPLATE_FIELDNAME* TEMPLATES::GetFieldName( const wxString& aName ) const { - for( size_t i=0; i