43#include <wx/textdlg.h>
63 const wxString& aVariantName )
65 std::vector<LIB_SYMBOL*> symbols;
79 libSymbol = variantSymbol;
82 symbols.push_back( libSymbol );
115 bool toggleCell(
int aRow,
int aCol,
bool aPreserveSelection =
false )
override
125 int row =
m_grid->GetGridCursorRow();
126 int col =
m_grid->GetGridCursorCol();
128 if( row >= 0 && col >= 0 )
133 aMenu.AppendSeparator();
138 aMenu.AppendSeparator();
145 std::vector<SCH_REFERENCE> refs =
m_dataModel->GetRowReferences( row );
147 if( refs.size() == 1 && refs[0].GetSymbol() )
149 aMenu.AppendSeparator();
152 const SCH_SYMBOL* symbol = refs[0].GetSymbol();
154 auto variant = symbol->
GetVariant( refs[0].GetSheetPath(), variantName );
156 if( variant && variant->m_SymbolOverride )
167 int row =
m_grid->GetGridCursorRow();
168 int col =
m_grid->GetGridCursorCol();
173 wxString fpid =
m_grid->GetCellValue( row, col );
179 m_grid->SetCellValue( row, col, fpid );
183 wxString datasheetUri =
m_grid->GetCellValue( row, col );
195 std::vector<SCH_REFERENCE> refs =
m_dataModel->GetRowReferences( row );
197 if( refs.size() != 1 || !refs[0].GetSymbol() )
201 std::vector<SCH_ITEM*> items = { refs[0].GetSymbol() };
202 selectionTool->
SyncSelection( refs[0].GetSheetPath(),
nullptr, items );
211 if( !
m_grid->CommitPendingChanges(
false ) )
219 m_dlg->ShowHideColumn( col, show );
221 wxString fieldName =
m_dataModel->GetColFieldName( col );
248 aParent->Schematic().Settings(), aJob ),
259 if(
resolver.ShowModal() != wxID_OK )
271 m_grid->UseNativeColHeader(
true );
279 m_grid->SetSelectionMode( wxGrid::wxGridSelectCells );
288 wxString variantToSelect;
291 variantToSelect =
m_job->GetSelectedVariant();
293 variantToSelect =
m_parent->Schematic().GetCurrentVariant();
295 if( !variantToSelect.IsEmpty() )
299 if( toSelect == wxNOT_FOUND )
312 SetTitle(
m_job->GetSettingsDialogTitle() );
314 SetTitle(
_(
"Symbol Fields Table" ) );
353 m_parent->Schematic().AddListener(
this );
358 m_grid->EnableEditing(
false );
381 m_grid->PopEventHandler(
true );
407 if( !wxDialog::TransferDataToWindow() )
445 if( selection.GetSize() == 1 )
457 for(
int row = 0; row <
m_dataModel->GetNumberRows(); ++row )
459 std::vector<SCH_REFERENCE> references =
m_dataModel->GetRowReferences( row );
464 if( ref.GetSymbol() == symbol )
478 for(
int col = 0; col <
m_dataModel->GetNumberCols(); col++ )
484 else if( anyCol == -1 &&
m_dataModel->GetShowColumn( col ) )
488 if( valueCol != -1 &&
m_dataModel->GetShowColumn( valueCol ) )
489 m_grid->GoToCell( row, valueCol );
490 else if( refCol != -1 &&
m_dataModel->GetShowColumn( refCol ) )
491 m_grid->GoToCell( row, refCol );
492 else if( anyCol != -1 )
493 m_grid->GoToCell( row, anyCol );
511 if( !
m_grid->CommitPendingChanges() )
514 if( !wxDialog::TransferDataFromWindow() )
525 wxString currentVariant =
m_parent->Schematic().GetCurrentVariant();
529 if( !commit.
Empty() )
531 commit.
Push( wxS(
"Symbol Fields Table Edit" ) );
536 m_parent->SetCurrentSheet( currentSheet );
546 auto addMandatoryField =
547 [&](
FIELD_T aFieldId,
bool aShow,
bool aGroupBy )
568 std::set<wxString> userFieldNames;
576 if( !field.IsMandatory() && !field.IsPrivate() )
577 userFieldNames.insert( field.GetName() );
581 for(
const wxString& fieldName : userFieldNames )
587 if( userFieldNames.count( templateField.m_Name ) == 0 )
598 if( aScope == SCOPE::SCOPE_SELECTION )
607 std::unordered_set<KIID_PATH> selectionItems;
612 auto addSelectionItem = [&](
EDA_ITEM* aItem )
618 else if( aItem->GetParent() && aItem->GetParent()->Type() ==
SCH_SYMBOL_T )
619 symbol =
static_cast<SCH_SYMBOL*
>( aItem->GetParent() );
625 selectionItems.insert(
path );
642 if( ref.GetSymbol() )
645 path.push_back( ref.GetSymbol()->m_Uuid );
646 selectionItems.insert(
path );
657 addSelectionItem( item );
666 switch( aEvent.GetSelection() )
668 case 0:
setScope( SCOPE::SCOPE_ALL );
break;
669 case 1:
setScope( SCOPE::SCOPE_SHEET );
break;
670 case 2:
setScope( SCOPE::SCOPE_SHEET_RECURSIVE );
break;
671 case 3:
setScope( SCOPE::SCOPE_SELECTION );
break;
682 _(
"Show symbols marked 'DNP' in the table. This setting also controls whether or not 'DNP' "
683 "symbols are included on export." ),
688 _(
"Show symbols marked 'Exclude from BOM' in the table. Symbols marked 'Exclude from BOM' "
689 "are never included on export." ),
693 menu.AppendSeparator();
696 _(
"Highlight corresponding item on canvas when it is selected in the table" ),
701 _(
"Select corresponding item on canvas when it is selected in the table" ),
706 int menuId =
m_bMenu->GetPopupMenuSelectionFromUser( menu );
749 if(
m_dataModel->GetScope() == SCOPE::SCOPE_SELECTION )
754 std::set<SCH_REFERENCE> refs;
755 std::set<SCH_ITEM*> symbols;
757 for(
int row : aRows )
764 symbols.insert( ref.GetSymbol() );
770 if( refs.size() > 0 )
774 wxString symbolPath = refs.begin()->GetFullPath();
787 std::vector<SCH_ITEM*> items( symbols.begin(), symbols.end() );
789 if( refs.size() > 0 )
790 selectionTool->
SyncSelection( refs.begin()->GetSheetPath(),
nullptr, items );
812 EndModal( wxID_CANCEL );
854 m_grid->CommitPendingChanges(
true );
873 m_parent->Schematic().RemoveListener(
this );
876 wxCommandEvent*
event =
new wxCommandEvent( EDA_EVT_CLOSE_DIALOG_SYMBOL_FIELDS_TABLE, wxID_ANY );
878 if( wxWindow* parentWindow = GetParent() )
879 wxQueueEvent( parentWindow, event );
903 if( !field.IsMandatory() && !field.IsPrivate() )
904 AddField( field.GetUntranslatedName(), field.GetName(),
true,
false,
false );
911 std::set<SCH_SYMBOL*> symbols;
915 symbols.insert( ref.GetSymbol() );
920 for(
SCH_FIELD& field : symbol->GetFields() )
922 if( !field.IsMandatory() && !field.IsPrivate() )
923 AddField( field.GetUntranslatedName(), field.GetName(),
true,
false,
false );
971 if( !field.IsMandatory() && !field.IsPrivate() )
972 AddField( field.GetUntranslatedName(), field.GetName(),
true,
false,
false );
979 std::set<SCH_SYMBOL*> symbols;
983 symbols.insert( ref.GetSymbol() );
988 for(
SCH_FIELD& field : symbol->GetFields() )
990 if( !field.IsMandatory() && !field.IsPrivate() )
991 AddField( field.GetUntranslatedName(), field.GetName(),
true,
false,
false );
1014 if(
m_dataModel->GetScope() == SCOPE::SCOPE_SELECTION )
1029 if(
m_dataModel->GetScope() == SCOPE::SCOPE_SELECTION )
1044 for(
size_t i = 0; i < aCachedRefs.
GetCount(); i++ )
1071 if( basePath.Path() == instance.m_Path )
1079 subSheets.push_back( sheetPath );
1097 if( !
m_parent->ShowAddVariantDialog(
this ) )
1100 wxArrayString ctrlContents;
1103 for(
const wxString& variant :
m_parent->Schematic().GetVariantNames() )
1104 ctrlContents.Add( variant );
1109 wxString currentVariant =
m_parent->Schematic().GetCurrentVariant();
1113 if( newSelection != wxNOT_FOUND )
1125 if( ( selection == wxNOT_FOUND ) || ( selection == 0 ) )
1127 m_parent->GetInfoBar()->ShowMessageFor(
_(
"Cannot delete the default variant." ),
1128 10000, wxICON_ERROR );
1137 m_parent->Schematic().DeleteVariant( variantName, &commit );
1139 if( !commit.
Empty() )
1140 commit.
Push( wxString::Format( wxS(
"Delete Variant '%s'" ), variantName ) );
1144 int newSelection = std::max( 0, selection - 1 );
1148 m_parent->SetCurrentVariant( selectedVariant );
1150 if(
m_grid->CommitPendingChanges(
true ) )
1152 m_dataModel->SetCurrentVariant( selectedVariant );
1163 m_parent->UpdateVariantSelectionCtrl(
m_parent->Schematic().GetVariantNamesForUI() );
1172 if( ( selection == wxNOT_FOUND ) || ( selection == 0 ) )
1174 m_parent->GetInfoBar()->ShowMessageFor(
_(
"Cannot rename the default variant." ),
1175 10000, wxICON_ERROR );
1181 wxTextEntryDialog dlg(
this,
_(
"Enter new variant name:" ),
_(
"Rename Design Variant" ),
1182 oldVariantName, wxOK | wxCANCEL | wxCENTER );
1184 if( dlg.ShowModal() == wxID_CANCEL )
1187 wxString newVariantName = dlg.GetValue().Trim().Trim(
false );
1190 if( newVariantName.IsEmpty() )
1192 m_parent->GetInfoBar()->ShowMessageFor(
_(
"Variant name cannot be empty." ), 10000, wxICON_ERROR );
1199 m_parent->GetInfoBar()->ShowMessageFor( wxString::Format(
_(
"'%s' is a reserved variant name." ),
1201 10000, wxICON_ERROR );
1206 if( newVariantName == oldVariantName )
1210 for(
const wxString& existingName :
m_parent->Schematic().GetVariantNames() )
1212 if( existingName.CmpNoCase( newVariantName ) == 0
1213 && existingName.CmpNoCase( oldVariantName ) != 0 )
1215 m_parent->GetInfoBar()->ShowMessageFor( wxString::Format(
_(
"Variant '%s' already exists." ),
1217 0000, wxICON_ERROR );
1222 m_parent->Schematic().RenameVariant( oldVariantName, newVariantName );
1226 ctrlContents.Remove( oldVariantName );
1227 ctrlContents.Add( newVariantName );
1233 if( newSelection != wxNOT_FOUND )
1237 m_parent->UpdateVariantSelectionCtrl(
m_parent->Schematic().GetVariantNamesForUI() );
1246 if( ( selection == wxNOT_FOUND ) || ( selection == 0 ) )
1248 m_parent->GetInfoBar()->ShowMessageFor(
_(
"Cannot copy the default variant." ),
1249 10000, wxICON_ERROR );
1255 wxTextEntryDialog dlg(
this,
_(
"Enter name for the copied variant:" ),
_(
"Copy Design Variant" ),
1256 sourceVariantName + wxS(
"_copy" ), wxOK | wxCANCEL | wxCENTER );
1258 if( dlg.ShowModal() == wxID_CANCEL )
1261 wxString newVariantName = dlg.GetValue().Trim().Trim(
false );
1264 if( newVariantName.IsEmpty() )
1266 m_parent->GetInfoBar()->ShowMessageFor(
_(
"Variant name cannot be empty." ), 10000, wxICON_ERROR );
1273 m_parent->GetInfoBar()->ShowMessageFor( wxString::Format(
_(
"Variant '%s' already exists." ),
1275 10000, wxICON_ERROR );
1279 m_parent->Schematic().CopyVariant( sourceVariantName, newVariantName );
1283 ctrlContents.Add( newVariantName );
1289 if( newSelection != wxNOT_FOUND )
1293 m_parent->UpdateVariantSelectionCtrl(
m_parent->Schematic().GetVariantNamesForUI() );
1301 if( ( selection == wxNOT_FOUND ) || ( selection == 0 ) )
1303 m_parent->GetInfoBar()->ShowMessageFor(
_(
"Cannot edit the default variant description." ), 10000,
1309 wxString currentDesc =
m_parent->Schematic().GetVariantDescription( variantName );
1311 wxDialog dlg(
this, wxID_ANY, wxString::Format(
_(
"Edit Description for '%s'" ), variantName ), wxDefaultPosition,
1312 wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER );
1314 wxBoxSizer* mainSizer =
new wxBoxSizer( wxVERTICAL );
1316 wxStaticText* label =
new wxStaticText( &dlg, wxID_ANY,
_(
"Description:" ) );
1317 mainSizer->Add( label, 0, wxLEFT | wxRIGHT | wxTOP | wxEXPAND, 10 );
1319 mainSizer->AddSpacer( 3 );
1321 wxTextCtrl* descCtrl =
1322 new wxTextCtrl( &dlg, wxID_ANY, currentDesc, wxDefaultPosition, wxSize( 300, 60 ), wxTE_MULTILINE );
1323 mainSizer->Add( descCtrl, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 10 );
1325 wxStdDialogButtonSizer* btnSizer =
new wxStdDialogButtonSizer();
1326 btnSizer->AddButton(
new wxButton( &dlg, wxID_OK ) );
1327 btnSizer->AddButton(
new wxButton( &dlg, wxID_CANCEL ) );
1328 btnSizer->Realize();
1329 mainSizer->Add( btnSizer, 0, wxALL | wxALIGN_RIGHT, 5 );
1331 dlg.SetSizer( mainSizer );
1335 if( dlg.ShowModal() == wxID_CANCEL )
1338 wxString newDesc = descCtrl->GetValue().Trim().Trim(
false );
1340 m_parent->Schematic().SetVariantDescription( variantName, newDesc );
1347 wxString currentVariant;
1354 m_grid->CommitPendingChanges(
true );
1357 m_parent->SetCurrentVariant( selectedVariant );
1359 m_dataModel->SetCurrentVariant( selectedVariant );
1374 currentVariant =
m_parent->Schematic().GetCurrentVariant();
1376 if( currentVariant != selectedVariant )
1377 m_parent->SetCurrentVariant( selectedVariant );
1380 if( currentVariant != selectedVariant )
1382 m_grid->CommitPendingChanges(
true );
1388 if( !commit.
Empty() )
1390 commit.
Push( wxS(
"Symbol Fields Table Edit" ) );
1395 m_dataModel->SetCurrentVariant( selectedVariant );
1414 bool canModify = ( selection != wxNOT_FOUND ) && ( selection != 0 );
1429 return m_parent->Schematic().GetCurrentVariant();
STD_BITMAP_BUTTON * m_renameVariantButton
wxTextCtrl * m_outputFileName
wxChoice * m_cbBomFmtPresets
wxButton * m_buttonExport
STD_BITMAP_BUTTON * m_copyVariantButton
STD_BITMAP_BUTTON * m_bMenu
STD_BITMAP_BUTTON * m_deleteVariantButton
STD_BITMAP_BUTTON * m_editVariantDescButton
WX_GRID * m_viewControlsGrid
wxListBox * m_variantListBox
wxChoice * m_cbBomPresets
wxCheckBox * m_groupSymbolsBox
void saveJobSettings(JOB_EXPORT_BOM &aJob)
void SetUserBomFmtPresets(std::vector< BOM_FMT_PRESET > &aPresetList)
wxSize GetDefaultDialogSize() const
void syncBomFmtPresetSelection()
void OnColMove(wxGridEvent &aEvent)
void EnableSelectionEvents()
void DisableSelectionEvents()
void OnColSort(wxGridEvent &aEvent)
void OnGridMouseMove(wxMouseEvent &aEvent)
bool savePresets(bool aSaveCurrentSettings)
wxString getSelectedVariant() const
void RestorePanelLayout()
void RestoreGridSelection(const std::set< KIID_PATH > &aItemKeys)
Restore a selection previously returned by SaveGridSelection().
std::map< FIELD_T, int > m_mandatoryFieldListIndexes
void onBomFmtPresetChanged(wxCommandEvent &aEvent)
void SetUserBomPresets(std::vector< BOM_PRESET > &aPresetList)
void ApplyBomFmtPreset(const wxString &aPresetName)
DIALOG_FIELDS_TABLE(wxWindow *aParent, FIELDS_TABLE_SETTINGS &aPanelSettings, FIELDS_TABLE_BOM_SETTINGS &aBomSettings, JOB_EXPORT_BOM *aJob)
FIELDS_TABLE_BOM_SETTINGS & m_cfgBomSettings
static void loadJobBomFmtPreset(const JOB_EXPORT_BOM &aJob, BOM_FMT_PRESET &aPreset)
FIELDS_TABLE_SETTINGS & m_cfgDialogSettings
static void loadJobBomPreset(const JOB_EXPORT_BOM &aJob, BOM_PRESET &aPreset)
void onBomPresetChanged(wxCommandEvent &aEvent)
std::set< KIID_PATH > SaveGridSelection()
Save the grid selection by stable item identity so it can survive a row rebuild.
void ApplyBomPreset(const wxString &aPresetName)
void syncBomPresetSelection()
VIEW_CONTROLS_GRID_DATA_MODEL * m_viewControlsDataModel
void AddField(const wxString &aFieldName, const wxString &aLabelValue, bool aShow, bool aGroupBy, bool aAddedByUser=false)
void ExcludeFromControlUndoRedo(wxWindow *aWindow)
Opt a control out of the dialog's generic Ctrl+Z/Ctrl+Y undo/redo.
void OptOut(wxWindow *aWindow)
Opt out of control state saving.
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
void OnSaveAndContinue(wxCommandEvent &aEvent) override
void OnSchItemsRemoved(SCHEMATIC &aSch, std::vector< SCH_ITEM * > &aSchItem) override
void onAddVariant(wxCommandEvent &aEvent) override
SCH_REFERENCE_LIST getSheetSymbolReferences(SCH_SHEET &aSheet)
wxGridCellEditor * createDatasheetEditor() override
void OnOk(wxCommandEvent &aEvent) override
~DIALOG_SYMBOL_FIELDS_TABLE() override
void OnSchSelectionChanged(SCHEMATIC &aSch) override
void OnSchItemsAdded(SCHEMATIC &aSch, std::vector< SCH_ITEM * > &aSchItem) override
void OnSchItemsChanged(SCHEMATIC &aSch, std::vector< SCH_ITEM * > &aSchItem) override
SCH_EDIT_FRAME * m_parent
bool TransferDataFromWindow() override
void OnTableSelectionChanged(const std::set< int > &aRows) override
SCH_REFERENCE_LIST m_symbolsList
void updateSelectionItems()
SYMBOL_FIELDS_EDITOR_GRID_DATA_MODEL * m_dataModel
void onVariantSelectionChange(wxCommandEvent &aEvent) override
void OnClose(wxCloseEvent &aEvent) override
void OnSchSheetChanged(SCHEMATIC &aSch) override
void onCopyVariant(wxCommandEvent &aEvent) override
void setScope(SYMBOL_FIELDS_EDITOR_GRID_DATA_MODEL::SCOPE aScope)
void onDeleteVariant(wxCommandEvent &aEvent) override
bool TransferDataToWindow() override
DIALOG_SYMBOL_FIELDS_TABLE(SCH_EDIT_FRAME *aParent, JOB_EXPORT_BOM *aJob=nullptr)
wxString resolveVariant() const override
void updateVariantButtonStates()
void OnCancel(wxCommandEvent &aEvent) override
TEMPLATES & m_templateFieldNames
void OnMenu(wxCommandEvent &aEvent) override
SCH_REFERENCE_LIST getSymbolReferences(SCH_SYMBOL *aSymbol, SCH_REFERENCE_LIST &aCachedRefs)
void rebuildRowsPreservingSelection()
bool resolveTextVar(wxString *aToken) const override
void onRenameVariant(wxCommandEvent &aEvent) override
void LoadFieldNames()
Construct the rows of m_fieldsCtrl and the columns of m_dataModel from a union of all field names in ...
void OnScope(wxCommandEvent &aEvent) override
wxGridCellEditor * createFootprintEditor() override
void onEditVariantDescription(wxCommandEvent &aEvent) override
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
EDA_ITEM * GetParent() const
static const wxString QUANTITY_VARIABLE
static const wxString ITEM_NUMBER_VARIABLE
FIELDS_TABLE_GRID_TRICKS(DIALOG_FIELDS_TABLE *aDialog, WX_GRID *aGrid, FIELDS_TABLE_DATA_MODEL_BASE *aDataModel)
static constexpr int FIRST_CLIENT_ID
virtual void doPopupSelection(wxCommandEvent &event)
virtual void showPopupMenu(wxMenu &menu, wxGridEvent &aEvent)
WX_GRID * m_grid
I don't own the grid, but he owns me.
virtual bool toggleCell(int aRow, int aCol, bool aPreserveSelection=false)
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
Define a library symbol object.
static SEARCH_STACK * SchSearchS(PROJECT *aProject)
Accessor for Eeschema search stack.
Holds all the data relating to one schematic.
wxString GetCurrentVariant() const
Return the current variant being edited.
bool ResolveTextVar(const SCH_SHEET_PATH *aSheetPath, wxString *token, int aDepth) const
SCH_SHEET_PATH & CurrentSheet() const
static TOOL_ACTION clearVariantSymbol
static TOOL_ACTION setVariantSymbol
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Execute the changes.
Handle actions specific to the schematic editor.
Schematic editor (Eeschema) main window.
SCHEMATIC & Schematic() const
A set of SCH_ITEMs (i.e., without duplicates).
Base class for any item which can be embedded within the SCHEMATIC container class,...
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
void AddItem(const SCH_REFERENCE &aItem)
A helper to define a symbol's reference designator in a schematic.
void Split()
Attempt to split the reference designator into a name (U) and number (1).
SCH_SYMBOL * GetSymbol() const
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void GetSymbolsWithinPath(SCH_REFERENCE_LIST &aReferences, const SCH_SHEET_PATH &aSheetPath, SYMBOL_FILTER aSymbolFilter, bool aForceIncludeOrphanSymbols=false) const
Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets that are contained wi...
void GetSheetsWithinPath(std::vector< SCH_SHEET_PATH > &aSheets, const SCH_SHEET_PATH &aSheetPath) const
Add a SCH_SHEET_PATH object to aSheets for each sheet in the list that are contained within aSheetPat...
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
const std::vector< SCH_SHEET_INSTANCE > & GetInstances() const
std::optional< SCH_SYMBOL_VARIANT > GetVariant(const SCH_SHEET_PATH &aInstance, const wxString &aVariantName) const
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly) const override
Populate a std::vector with SCH_FIELDs, sorted in ordinal order.
bool IsMissingLibSymbol() const
Check to see if the library symbol is set to the dummy library symbol.
LIB_SYMBOL * GetVariantLibSymbol(const wxString &aVariantName, const SCH_SHEET_PATH &aPath) const
Resolve the alternate library symbol for a given variant.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
bool IsPower() const override
void showFieldsTablePopupMenu(wxMenu &aMenu, wxGridEvent &aEvent) override
SYMBOL_FIELDS_EDITOR_GRID_TRICKS(DIALOG_SYMBOL_FIELDS_TABLE *aParent, WX_GRID *aGrid, VIEW_CONTROLS_GRID_DATA_MODEL *aViewFieldsData, SYMBOL_FIELDS_EDITOR_GRID_DATA_MODEL *aDataModel, EMBEDDED_FILES *aFiles)
DIALOG_SYMBOL_FIELDS_TABLE * m_dlg
SYMBOL_FIELDS_EDITOR_GRID_DATA_MODEL * m_dataModel
void doFieldsTablePopupSelection(wxCommandEvent &aEvent) override
bool toggleCell(int aRow, int aCol, bool aPreserveSelection=false) override
VIEW_CONTROLS_GRID_DATA_MODEL * m_viewControlsDataModel
wxString GetGeneratedFieldDisplayName(const wxString &aSource)
Returns any variables unexpanded, e.g.
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.
This file is part of the common library.
LIB_FIELDS_EDITOR_GRID_DATA_MODEL::SCOPE SCOPE
@ MYID_INCLUDE_EXCLUDED_FROM_BOM
wxDEFINE_EVENT(EDA_EVT_CLOSE_DIALOG_SYMBOL_FIELDS_TABLE, wxCommandEvent)
static wxString getFootprintChooserSymbolNetlist(const std::vector< SCH_REFERENCE > &aReferences, const wxString &aVariantName)
@ MYID_SET_VARIANT_SYMBOL
@ MYID_HIGHLIGHT_ON_CROSS_PROBE
@ MYID_SELECT_ON_CROSS_PROBE
@ MYID_CLEAR_VARIANT_SYMBOL
bool GetAssociatedDocument(wxWindow *aParent, const wxString &aDocName, PROJECT *aProject, SEARCH_STACK *aPaths, std::vector< EMBEDDED_FILES * > aFilesStack)
Open a document (file) with the suitable browser.
This file is part of the common library.
static FILENAME_RESOLVER * resolver
wxString BuildFootprintChooserSymbolNetlist(const LIB_SYMBOL *aSymbol)
#define SHOW_FIELD_COLUMN
bool SelectFootprintFromChooser(DIALOG_SHIM *aDialog, wxString &aFootprint, const wxString &aSymbolNetlist)
@ GRIDTRICKS_FIRST_SHOWHIDE
Class to handle a set of SCH_ITEMs.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
@ SYMBOL_FILTER_NON_POWER
wxString GetDefaultVariantName()
int SortVariantNames(const wxString &aLhs, const wxString &aRhs)
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
A simple container for sheet instance information.
Hold a name of a symbol's field, field value, and default visibility.
std::vector< FIELD_CASE_CONFLICT > DetectFieldCaseConflicts(const SCH_REFERENCE_LIST &aSymbols)
wxString GetDefaultFieldName(FIELD_T aFieldId, TRANSLATION aTranslation)
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...
@ DESCRIPTION
Field Description of part, i.e. "1/4W 1% Metal Film Resistor".
@ FOOTPRINT
Field Name Module PCB, i.e. "16DIP300".
@ DATASHEET
name of datasheet
@ REFERENCE
Field Reference of part, i.e. "IC21".
@ VALUE
Field Value of part, i.e. "3.3K".