23#include <wx/settings.h>
58 default:
return wxT(
"unknown column" );
86 return wxT(
"bad wxWidgets!" );
103 wxFAIL_MSG( wxString::Format( wxT(
"column %d doesn't hold a bool value" ), aCol ) );
122 rowData.
label = aValue;
126 wxFAIL_MSG( wxString::Format( wxT(
"column %d doesn't hold a string value" ), aCol ) );
129 GetView()->Refresh();
145 wxFAIL_MSG( wxString::Format( wxT(
"column %d doesn't hold a bool value" ), aCol ) );
151 bool aShow,
bool aGroupBy )
155 if( wxGrid*
grid = GetView() )
157 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
158 grid->ProcessTableMessage( msg );
169 if( wxGrid*
grid = GetView() )
171 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aRow, 1 );
172 grid->ProcessTableMessage( msg );
179 wxCHECK( aRow >= 0 && aRow <
GetNumberRows(), wxEmptyString );
193 rowData.
name = aName;
202 bool aAddedByUser,
const wxString& aVariantName )
208 m_cols.push_back( { aFieldName, aLabel, aAddedByUser,
false,
false } );
216 const wxString& aFieldName,
217 const wxString& aVariantName )
232 if( field->IsPrivate() )
269 if( wxGrid*
grid = GetView() )
271 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_COLS_DELETED, aCol, 1 );
272 grid->ProcessTableMessage( msg );
287 node.key() = newName;
292 m_cols[aCol].m_fieldName = newName;
293 m_cols[aCol].m_label = newName;
299 for(
size_t i = 0; i <
m_cols.size(); i++ )
301 if(
m_cols[i].m_fieldName == aFieldName )
302 return static_cast<int>( i );
311 std::vector<BOM_FIELD> fields;
314 fields.push_back( { col.m_fieldName, col.m_label, col.m_show, col.m_group } );
322 size_t foundCount = 0;
324 for(
const wxString& newField : aNewOrder )
326 if( foundCount >=
m_cols.size() )
331 if( col.m_fieldName == newField )
333 std::swap(
m_cols[foundCount], col );
345 for(
int col = 0; col < aCol; ++col )
364 wxGridCellAttr* attr =
nullptr;
365 bool needsUrlEditor =
false;
366 bool needsVariantHighlight =
false;
367 wxColour highlightColor;
374 needsUrlEditor =
true;
379 && aCol >= 0 && aCol < (
int)
m_cols.size() )
381 const wxString& fieldName =
m_cols[aCol].m_fieldName;
398 symbolKey.push_back( symbol->m_Uuid );
402 wxString currentValue;
407 if( currentValue != defaultValue )
409 needsVariantHighlight =
true;
412 wxColour bg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
413 bool isDark = ( bg.Red() + bg.Green() + bg.Blue() ) < 384;
416 highlightColor = wxColour( 80, 80, 40 );
418 highlightColor = wxColour( 255, 255, 200 );
427 if( !needsUrlEditor && !needsVariantHighlight )
433 if( needsVariantHighlight )
437 attr->SetBackgroundColour( highlightColor );
457 attr =
new wxGridCellAttr();
460 attr->SetBackgroundColour( highlightColor );
467 const wxString& refDelimiter,
468 const wxString& refRangeDelimiter,
470 bool listMixedValues )
472 std::vector<SCH_REFERENCE> references;
473 std::set<wxString> mixedValues;
480 references.push_back( ref );
499 else if( refFieldValue.Contains( wxT(
"${" ) ) )
503 std::function<bool( wxString* )> symbolResolver =
504 [&]( wxString* token ) ->
bool
509 refFieldValue =
ExpandTextVars( refFieldValue, & symbolResolver );
513 if( listMixedValues )
514 mixedValues.insert( refFieldValue );
515 else if( &ref == &
group.m_Refs.front() )
516 fieldValue = refFieldValue;
517 else if( fieldValue != refFieldValue )
522 if( listMixedValues )
524 fieldValue = wxEmptyString;
526 for(
const wxString& value : mixedValues )
528 if( value.IsEmpty() )
530 else if( fieldValue.IsEmpty() )
533 fieldValue +=
"," + value;
540 std::sort( references.begin(), references.end(),
543 wxString l_ref( l.GetRef() << l.GetRefNumber() );
544 wxString r_ref( r.GetRef() << r.GetRefNumber() );
545 return StrNumCmp( l_ref, r_ref, true ) < 0;
548 auto logicalEnd = std::unique( references.begin(), references.end(),
553 if( l.GetRefNumber() == wxT(
"?" ) )
556 wxString l_ref( l.GetRef() << l.GetRefNumber() );
557 wxString r_ref( r.GetRef() << r.GetRefNumber() );
558 return l_ref == r_ref;
561 references.erase( logicalEnd, references.end() );
567 fieldValue = wxString::Format( wxT(
"%d" ), (
int) references.size() );
569 fieldValue = wxString::Format( wxT(
"%d" ),
group.m_ItemNumber );
577 wxCHECK_RET( aCol >= 0 && aCol <
static_cast<int>(
m_cols.size() ), wxS(
"Invalid column number" ) );
589 bool isSharedInstance =
false;
598 screen =
static_cast<const SCH_SCREEN*
>( symbol->GetParent() );
600 isSharedInstance = ( screen && ( screen->
GetRefCount() > 1 ) );
601 sharedSymbol = symbol;
614 if( row.m_ItemNumber == aRow + 1 )
634 wxCHECK( aCol >= 0 && aCol <
static_cast<int>(
m_cols.size() ),
false );
641 wxCHECK( aCol >= 0 && aCol <
static_cast<int>(
m_cols.size() ),
false );
648 wxCHECK( aCol >= 0 && aCol <
static_cast<int>(
m_cols.size() ),
false );
655 wxCHECK( aCol >= 0 && aCol <
static_cast<int>(
m_cols.size() ),
false );
662 wxCHECK( aCol >= 0 && aCol <
static_cast<int>(
m_cols.size() ),
false );
673 if( lhGroup.
m_Refs.size() == 0 )
675 else if( rhGroup.
m_Refs.size() == 0 )
681 [ ascending ](
const auto a,
const auto b )
693 wxString lhs = dataModel->
GetValue( lhGroup, sortCol ).Trim(
true ).Trim(
false );
694 wxString rhs = dataModel->
GetValue( rhGroup, sortCol ).Trim(
true ).Trim(
false );
698 wxString lhRef = lhGroup.
m_Refs[0].GetRef() + lhGroup.
m_Refs[0].GetRefNumber();
699 wxString rhRef = rhGroup.
m_Refs[0].GetRef() + rhGroup.
m_Refs[0].GetRefNumber();
700 return local_cmp(
StrNumCmp( lhRef, rhRef,
true ), 0 );
717 std::sort( row.m_Refs.begin(), row.m_Refs.end(),
720 wxString lhs_ref( lhs.GetRef() << lhs.GetRefNumber() );
721 wxString rhs_ref( rhs.GetRef() << rhs.GetRefNumber() );
722 return StrNumCmp( lhs_ref, rhs_ref, true ) < 0;
729 return cmp( lhs, rhs, this, m_sortColumn, m_sortAscending );
737 row.m_ItemNumber = itemNumber++;
757 bool matchFound =
false;
764 if(
m_cols[refCol].m_group )
777 for(
size_t i = 0; i <
m_cols.size(); ++i )
780 if(
static_cast<int>( i ) == refCol )
822 const wxString& aFieldName )
829 return wxEmptyString;
841 std::function<bool( wxString* )> symbolResolver =
842 [&]( wxString* token ) ->
bool
850 return wxEmptyString;
856 return aFieldName == wxS(
"${DNP}" )
857 || aFieldName == wxS(
"${EXCLUDE_FROM_BOARD}" )
858 || aFieldName == wxS(
"${EXCLUDE_FROM_BOM}" )
859 || aFieldName == wxS(
"${EXCLUDE_FROM_SIM}" );
864 const wxString& aVariantName )
866 if( aAttributeName == wxS(
"${DNP}" ) )
867 return aRef.
GetSymbolDNP( aVariantName ) ? wxS(
"1" ) : wxS(
"0" );
869 if( aAttributeName == wxS(
"${EXCLUDE_FROM_BOARD}" ) )
872 if( aAttributeName == wxS(
"${EXCLUDE_FROM_BOM}" ) )
875 if( aAttributeName == wxS(
"${EXCLUDE_FROM_SIM}" ) )
883 const wxString& aFieldName )
888 return wxEmptyString;
897 if( field->IsPrivate() )
898 return wxEmptyString;
902 field->GetText( &aRef.
GetSheetPath(), wxEmptyString ) );
910 return wxEmptyString;
915 const wxString& aAttributeName,
916 const wxString& aValue,
917 const wxString& aVariantName )
919 bool attrChanged =
false;
920 bool newValue = aValue == wxS(
"1" );
922 if( aAttributeName == wxS(
"${DNP}" ) )
924 attrChanged = aRef.
GetSymbolDNP( aVariantName ) != newValue;
927 else if( aAttributeName == wxS(
"${EXCLUDE_FROM_BOARD}" ) )
932 else if( aAttributeName == wxS(
"${EXCLUDE_FROM_BOM}" ) )
937 else if( aAttributeName == wxS(
"${EXCLUDE_FROM_SIM}" ) )
968 static_cast<WX_GRID*
>( GetView() )->CommitPendingChanges(
true );
970 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, 0,
m_rows.size() );
971 GetView()->ProcessTableMessage( msg );
1013 bool isExcluded =
false;
1040 || (
m_scope == SCOPE::SCOPE_SHEET_RECURSIVE
1046 bool matchFound =
false;
1064 row.m_Refs.push_back( ref );
1070 row.m_Refs.push_back( ref );
1082 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED,
m_rows.size() );
1083 GetView()->ProcessTableMessage( msg );
1092 std::vector<DATA_MODEL_ROW> children;
1096 bool matchFound =
false;
1106 child.m_Refs.push_back( ref );
1115 if( children.size() < 2 )
1118 std::sort( children.begin(), children.end(),
1121 return cmp( lhs, rhs, this, m_sortColumn, m_sortAscending );
1125 m_rows.insert(
m_rows.begin() + aRow + 1, children.begin(), children.end() );
1127 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_INSERTED, aRow, children.size() );
1128 GetView()->ProcessTableMessage( msg );
1134 auto firstChild =
m_rows.begin() + aRow + 1;
1135 auto afterLastChild = firstChild;
1138 while( afterLastChild !=
m_rows.end() && afterLastChild->m_Flag == CHILD_ITEM )
1145 m_rows.erase( firstChild, afterLastChild );
1147 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aRow + 1, deleted );
1148 GetView()->ProcessTableMessage( msg );
1165 for(
size_t i = 0; i <
m_rows.size(); ++i )
1178 for(
size_t i = 0; i <
m_rows.size(); ++i )
1187 const wxString& aVariantName )
1189 bool symbolModified =
false;
1190 std::unique_ptr<SCH_SYMBOL> symbolCopy;
1201 symbolCopy = std::make_unique<SCH_SYMBOL>( *symbol );
1204 const std::map<wxString, wxString>& fieldStore =
m_dataStore[key];
1206 for(
const auto& [srcName, srcValue] : fieldStore )
1222 if( destField && destField->
IsPrivate() )
1224 if( srcValue.IsEmpty() )
1231 bool userAdded = ( col != -1 &&
m_cols[col].m_userAdded );
1234 bool createField = !destField && ( !srcValue.IsEmpty() || userAdded );
1242 destField->
SetVisible( srcTemplate->m_Visible );
1247 symbolModified =
true;
1262 if( !createField && ( previousValue != srcValue ) )
1263 symbolModified =
true;
1266 for(
int ii =
static_cast<int>( symbol->
GetFields().size() ) - 1; ii >= 0; ii-- )
1271 if( fieldStore.count( symbol->
GetFields()[ii].GetName() ) == 0 )
1274 symbolModified =
true;
1278 if( symbolModified && ( symbol != nextSymbol ) )
1282 if( symbol != nextSymbol )
1285 symbolCopy = std::make_unique<SCH_SYMBOL>( *nextSymbol );
1287 symbolCopy.reset(
nullptr );
1289 symbolModified =
false;
1310 for(
unsigned symbolRef = 0; symbolRef <
m_symbolsList.GetCount(); ++symbolRef )
1327 for(
size_t i = 0; i <
m_cols.size(); i++ )
1333 std::set<wxString> seen;
1334 std::vector<wxString> order;
1340 if( !field.
name || seen.count( field.
name ) )
1343 seen.insert( field.
name );
1344 order.emplace_back( field.
name );
1415 for(
size_t col = 0; col <
m_cols.size(); col++ )
1418 last_col =
static_cast<int>( col );
1422 if( last_col == -1 )
1426 [&]( wxString field,
bool last ) -> wxString
1430 field.Replace( wxS(
"\r" ), wxS(
"" ) );
1431 field.Replace( wxS(
"\n" ), wxS(
"" ) );
1436 field.Replace( wxS(
"\t" ), wxS(
"" ) );
1450 for(
size_t col = 0; col <
m_cols.size(); col++ )
1452 if( !
m_cols[col].m_show )
1455 out.Append( formatField(
m_cols[col].m_label, col ==
static_cast<size_t>( last_col ) ) );
1459 for(
size_t row = 0; row <
m_rows.size(); row++ )
1462 if(
GetRowFlags(
static_cast<int>( row ) ) == CHILD_ITEM )
1465 for(
size_t col = 0; col <
m_cols.size(); col++ )
1467 if( !
m_cols[col].m_show )
1471 out.Append( formatField(
GetExportValue(
static_cast<int>( row ),
static_cast<int>( col ),
1473 col ==
static_cast<size_t>( last_col ) ) );
1483 bool refListChanged =
false;
1498 if( !field.IsPrivate() )
1500 wxString
name = field.GetCanonicalName();
1507 refListChanged =
true;
1511 if( refListChanged )
1525 std::vector<KIID_PATH> keysToRemove;
1529 if( !key.empty() && ( key.back() == symbolUuid ) )
1530 keysToRemove.push_back( key );
1533 for(
const KIID_PATH& key : keysToRemove )
1540 return ref.GetSymbol()->m_Uuid == aSymbol.m_Uuid;
1563 const wxString& aVariantName )
1565 bool refListChanged =
false;
1582 refListChanged =
true;
1586 if( refListChanged )
1593 size_t curNumRows =
m_rows.size();
1595 if( aPosition >= curNumRows )
1597 wxFAIL_MSG( wxString::Format( wxT(
"Called FIELDS_EDITOR_GRID_DATA_MODEL::DeleteRows(aPosition=%lu, "
1598 "aNumRows=%lu)\nPosition value is invalid for present table with %lu rows" ),
1599 (
unsigned long) aPosition, (
unsigned long) aNumRows,
1600 (
unsigned long) curNumRows ) );
1605 if( aNumRows > curNumRows - aPosition )
1607 aNumRows = curNumRows - aPosition;
1610 if( aNumRows >= curNumRows )
1617 const auto first =
m_rows.begin() + aPosition;
1618 std::vector<SCH_REFERENCE> dataMapRefs = first->m_Refs;
1619 m_rows.erase( first, first + aNumRows );
1627 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aPosition, aNumRows );
1628 GetView()->ProcessTableMessage( msg );
COMMIT & Modified(EDA_ITEM *aItem, EDA_ITEM *aCopy, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
bool Find(const wxString &aTerm, int &aMatchersTriggered, int &aPosition)
Look in all existing matchers, return the earliest match of any of the existing.
const EDA_ANGLE & GetTextAngle() const
void SetTextPos(const VECTOR2I &aPoint)
virtual void SetVisible(bool aVisible)
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
int GetFieldNameCol(const wxString &aFieldName) const
void AddColumn(const wxString &aFieldName, const wxString &aLabel, bool aAddedByUser, const wxString &aVariantName)
wxString GetColFieldName(int aCol)
std::vector< DATA_MODEL_ROW > m_rows
void SetFieldsOrder(const std::vector< wxString > &aNewOrder)
SCH_REFERENCE_LIST m_symbolsList
The flattened by hierarchy list of symbols.
void SetGroupingEnabled(bool group)
void UpdateReferences(const SCH_REFERENCE_LIST &aRefs, const wxString &aVariantName)
bool ColIsItemNumber(int aCol)
int GetNumberCols() override
bool ColIsQuantity(int aCol)
wxString m_currentVariant
Current variant name for highlighting.
bool DeleteRows(size_t aPosition=0, size_t aNumRows=1) override
bool groupMatch(const SCH_REFERENCE &lhRef, const SCH_REFERENCE &rhRef)
wxGridCellAttr * m_urlEditor
void updateDataStoreSymbolField(const SCH_REFERENCE &aSymbolRef, const wxString &aFieldName, const wxString &aVariantName)
BOM_PRESET GetBomSettings()
bool unitMatch(const SCH_REFERENCE &lhRef, const SCH_REFERENCE &rhRef)
wxString getAttributeValue(const SCH_REFERENCE &aRef, const wxString &aAttributeName, const wxString &aVariantNames)
bool ColIsReference(int aCol)
wxString GetExportValue(int aRow, int aCol, const wxString &refDelimiter, const wxString &refRangeDelimiter)
bool GetGroupingEnabled()
wxString getDefaultFieldValue(const SCH_REFERENCE &aRef, const wxString &aFieldName)
Get the default (non-variant) value for a field.
int GetNumberRows() override
void CollapseRow(int aRow)
wxString getFieldShownText(const SCH_REFERENCE &aRef, const wxString &aFieldName)
void RenameColumn(int aCol, const wxString &newName)
FIELDS_EDITOR_GRID_DATA_MODEL(const SCH_REFERENCE_LIST &aSymbolsList, wxGridCellAttr *aURLEditor)
bool IsExpanderColumn(int aCol) const override
wxString Export(const BOM_FMT_PRESET &settings)
std::vector< wxString > m_variantNames
Variant names for multi-variant DNP filtering.
std::vector< DATA_MODEL_COL > m_cols
void SetSorting(int aCol, bool ascending)
void ExpandCollapseRow(int aRow)
wxGridCellAttr * GetAttr(int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind) override
void SetFilter(const wxString &aFilter)
bool setAttributeValue(SCH_REFERENCE &aRef, const wxString &aAttributeName, const wxString &aValue, const wxString &aVariantName=wxEmptyString)
Set the attribute value.
static bool cmp(const DATA_MODEL_ROW &lhGroup, const DATA_MODEL_ROW &rhGroup, FIELDS_EDITOR_GRID_DATA_MODEL *dataModel, int sortCol, bool ascending)
void ApplyBomPreset(const BOM_PRESET &preset, const wxString &aVariantName)
static const wxString ITEM_NUMBER_VARIABLE
void SetIncludeExcludedFromBOM(bool include)
bool isAttribute(const wxString &aFieldName)
wxString GetValue(int aRow, int aCol) override
int GetDataWidth(int aCol)
void RemoveColumn(int aCol)
GROUP_TYPE GetRowFlags(int aRow)
const wxString & GetFilter()
static const wxString QUANTITY_VARIABLE
bool ColIsValue(int aCol)
void SetGroupColumn(int aCol, bool group)
void SetExcludeDNP(bool exclude)
void RemoveSymbol(const SCH_SYMBOL &aSymbol)
std::vector< BOM_FIELD > GetFieldsOrdered()
void SetValue(int aRow, int aCol, const wxString &aValue) override
std::map< KIID_PATH, std::map< wxString, wxString > > m_dataStore
bool ColIsAttribute(int aCol)
void ApplyData(SCH_COMMIT &aCommit, TEMPLATES &aTemplateFieldnames, const wxString &aVariantName)
void SetColLabelValue(int aCol, const wxString &aLabel) override
void SetCurrentVariant(const wxString &aVariantName)
Set the current variant name for highlighting purposes.
void RemoveReferences(const SCH_REFERENCE_LIST &aRefs)
bool GetIncludeExcludedFromBOM()
void SetShowColumn(int aCol, bool show)
void AddReferences(const SCH_REFERENCE_LIST &aRefs)
wxString ConvertKIIDsToRefs(const wxString &aSource) const
wxString ConvertRefsToKIIDs(const wxString &aSource) const
virtual const wxString & GetText() const override
Return the string associated with the text object.
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0, const wxString &aVariantName=wxEmptyString) const
void SetText(const wxString &aText) override
void SetPrivate(bool aPrivate)
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
static wxString Shorthand(std::vector< SCH_REFERENCE > aList, const wxString &refDelimiter, const wxString &refRangeDelimiter)
Return a shorthand string representing all the references in the list.
A helper to define a symbol's reference designator in a schematic.
void SetSymbolExcludedFromBoard(bool aEnable)
const SCH_SHEET_PATH & GetSheetPath() const
void SetSymbolExcludedFromBOM(bool aEnable, const wxString &aVariant=wxEmptyString)
bool GetSymbolExcludedFromBOM(const wxString &aVariant=wxEmptyString) const
bool GetSymbolDNP(const wxString &aVariant=wxEmptyString) const
SCH_SYMBOL * GetSymbol() const
void SetSymbolExcludedFromSim(bool aEnable, const wxString &aVariant=wxEmptyString)
bool GetSymbolExcludedFromBoard() const
wxString GetFullRef(bool aIncludeUnit=true) const
Return reference name with unit altogether.
bool GetSymbolExcludedFromSim(const wxString &aVariant=wxEmptyString) const
wxString GetRefNumber() const
void SetSymbolDNP(bool aEnable, const wxString &aVariant=wxEmptyString)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
bool GetExcludedFromBOM() const
KIID_PATH Path() const
Get the sheet path as an KIID_PATH.
bool IsContainedWithin(const SCH_SHEET_PATH &aSheetPathToTest) const
Check if this path is contained inside aSheetPathToTest.
bool GetExcludedFromBOM(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly) const override
Populate a std::vector with SCH_FIELDs, sorted in ordinal order.
VECTOR2I GetPosition() const override
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the symbol.
SCH_FIELD * AddField(const SCH_FIELD &aField)
Add a field to the symbol.
virtual bool GetDNP(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
Set or clear the 'Do Not Populate' flag.
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
const TEMPLATE_FIELDNAME * GetFieldName(const wxString &aName)
Search for aName in the template field name list.
void SetValueAsBool(int aRow, int aCol, bool aValue) override
wxString GetCanonicalFieldName(int aRow)
wxString GetColLabelValue(int aCol) override
std::vector< BOM_FIELD > m_fields
void SetValue(int aRow, int aCol, const wxString &aValue) override
int GetNumberRows() override
void AppendRow(const wxString &aFieldName, const wxString &aBOMName, bool aShow, bool aGroupBy)
bool GetValueAsBool(int aRow, int aCol) override
void SetCanonicalFieldName(int aRow, const wxString &aName)
wxString GetValue(int aRow, int aCol) override
wxGridCellAttr * enhanceAttr(wxGridCellAttr *aInputAttr, int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind)
std::map< int, wxGridCellAttr * > m_colAttrs
wxGridCellAttr * GetAttr(int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind) override
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
bool IsGeneratedField(const wxString &aSource)
Returns true if the string is generated, e.g contains a single text var reference.
static KIID_PATH makeDataStoreKey(const SCH_SHEET_PATH &aSheetPath, const SCH_SYMBOL &aSymbol)
Create a unique key for the data store by combining the KIID_PATH from the SCH_SHEET_PATH with the sy...
#define DISPLAY_NAME_COLUMN
#define SHOW_FIELD_COLUMN
KICOMMON_API wxSize GetTextSize(const wxString &aSingleLine, wxWindow *aWindow)
Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currentl...
int StrNumCmp(const wxString &aString1, const wxString &aString2, bool aIgnoreCase)
Compare two strings with alphanumerical content.
int ValueStringCompare(const wxString &strFWord, const wxString &strSWord)
Compare strings like the strcmp function but handle numbers and modifiers within the string text corr...
bool IsURL(wxString aStr)
Performs a URL sniff-test on a string.
wxString refRangeDelimiter
std::vector< BOM_FIELD > fieldsOrdered
bool includeExcludedFromBOM
std::vector< SCH_REFERENCE > m_Refs
Hold a name of a symbol's field, field value, and default visibility.
wxString GetDefaultFieldName(FIELD_T aFieldId, bool aTranslateForHI)
Return a default symbol field name for a mandatory field type.
FIELD_T
The set of all field indices assuming an array like sequence that a SCH_COMPONENT or LIB_PART can hol...
@ USER
The field ID hasn't been set yet; field is invalid.
@ DATASHEET
name of datasheet
@ REFERENCE
Field Reference of part, i.e. "IC21".
@ VALUE
Field Value of part, i.e. "3.3K".
wxString GetCanonicalFieldName(FIELD_T aFieldType)
#define INDETERMINATE_STATE
Used for holding indeterminate values, such as with multiple selections holding different values or c...
GROUP_COLLAPSED_DURING_SORT