43 #include <wx/clipbrd.h> 44 #include <wx/filedlg.h> 58 m_simpleSaveAs =
new wxRadioButton(
this, wxID_ANY,
_(
"Normal save as operation" ),
59 wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
60 m_simpleSaveAs->SetToolTip(
_(
"Do not perform any additional operations after saving " 63 _(
"Replace library table entry" ) );
65 "\n\nThe original library will no longer be available " 68 _(
"Add new global library table entry" ) );
70 "\n\nThe symbol library table nickname is suffixed " 71 "with\nan integer to ensure no duplicate table " 74 _(
"Add new project library table entry" ) );
76 "\n\nThe symbol library table nickname is suffixed " 77 "with\nan integer to ensure no duplicate table " 80 wxBoxSizer* sizer =
new wxBoxSizer( wxHORIZONTAL );
81 sizer->Add(
m_simpleSaveAs, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 5 );
86 SetSizerAndFit( sizer );
101 return SAH_TYPE::NORMAL_SAVE_AS;
103 return SAH_TYPE::REPLACE_TABLE_ENTRY;
120 static wxWindow*
Create( wxWindow* aParent )
122 wxCHECK( aParent,
nullptr );
146 title += wxS(
" " ) +
_(
"[from schematic]" );
156 title += wxS(
" " ) +
_(
"[Read Only Library]" );
160 title =
_(
"[no symbol loaded]" );
163 title += wxT(
" \u2014 " ) +
_(
"Symbol Editor" );
170 wxString selectedLib = aLibrary;
172 if( selectedLib.empty() )
175 if( !selectedLib.empty() )
186 if( prj.SchSymbolLibTable()->IsEmpty() )
189 return wxEmptyString;
192 wxArrayString headers;
194 headers.Add(
_(
"Library" ) );
196 std::vector< wxArrayString > itemsToDisplay;
197 std::vector< wxString > libNicknames = prj.SchSymbolLibTable()->GetLogicalLibs();
200 for(
const wxString&
name : libNicknames )
209 itemsToDisplay.push_back( item );
214 EDA_LIST_DIALOG dlg(
this,
_(
"Select Symbol Library" ), headers, itemsToDisplay, oldLibName );
216 if( dlg.ShowModal() != wxID_OK )
217 return wxEmptyString;
221 if( !libName.empty() )
223 if( prj.SchSymbolLibTable()->HasLibrary( libName ) )
226 libName = wxEmptyString;
324 alias =
Prj().SchSymbolLibTable()->LoadSymbol(
GetCurLib(), aAliasName );
330 msg.Printf(
_(
"Error loading symbol %s from library '%s'." ),
355 int aUnit,
int aConvert )
357 wxString msg, rootName;
358 bool rebuildMenuAndToolbar =
false;
360 if( !aEntry || aLibrary.empty() )
363 if( aEntry->
GetName().IsEmpty() )
365 wxLogWarning( wxT(
"Symbol in library '%s' has empty name field." ), aLibrary );
381 rebuildMenuAndToolbar =
true;
385 wxCHECK( lib_symbol,
false );
387 m_unit = aUnit > 0 ? aUnit : 1;
397 if( rebuildMenuAndToolbar )
430 wxArrayString rootSymbols;
446 dlg.SetMinSize( dlg.GetSize() );
448 if( dlg.ShowModal() == wxID_CANCEL )
453 wxMessageBox(
_(
"This new symbol has no name and cannot be created." ) );
460 name.Replace( wxT(
" " ), wxT(
"_" ) );
465 wxString msg =
wxString::Format(
_(
"Symbol '%s' already exists in library '%s'." ),
469 KIDIALOG errorDlg(
this, msg,
_(
"Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
470 errorDlg.SetOKLabel(
_(
"Overwrite" ) );
473 if( errorDlg.
ShowModal() == wxID_CANCEL )
481 if( parentSymbolName.IsEmpty() )
529 wxCHECK( parentField, );
531 *field = *parentField;
548 field->
SetText( wxEmptyString );
598 wxString msg2 =
_(
"You must save to a different location." );
644 wxArrayString headers;
645 std::vector< wxArrayString > itemsToDisplay;
648 headers.Add(
_(
"Nickname" ) );
649 headers.Add(
_(
"Description" ) );
651 for(
const wxString&
name : libNicknames )
656 itemsToDisplay.push_back( item );
659 EDA_LIST_DIALOG dlg(
this,
_(
"Save Symbol As" ), headers, itemsToDisplay, old_lib );
663 wxBoxSizer* bNameSizer =
new wxBoxSizer( wxHORIZONTAL );
665 wxStaticText* label =
new wxStaticText( &dlg, wxID_ANY,
_(
"Name:" ),
666 wxDefaultPosition, wxDefaultSize, 0 );
667 bNameSizer->Add( label, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
669 wxTextCtrl* nameTextCtrl =
new wxTextCtrl( &dlg, wxID_ANY, old_name,
670 wxDefaultPosition, wxDefaultSize, 0 );
671 bNameSizer->Add( nameTextCtrl, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
673 wxSizer* mainSizer = dlg.GetSizer();
674 mainSizer->Prepend( bNameSizer, 0, wxEXPAND|wxTOP|wxLEFT|wxRIGHT, 5 );
677 if( dlg.GetChildren().DeleteObject( nameTextCtrl ) )
678 dlg.GetChildren().Insert( nameTextCtrl );
683 mainSizer->Fit( &dlg );
685 if( dlg.ShowModal() != wxID_OK )
690 if( new_lib.IsEmpty() )
692 DisplayError(
this,
_(
"No library specified. Symbol could not be saved." ) );
699 if( symbol->
IsAlias() && new_lib != old_lib )
701 DisplayError(
this,
_(
"Derived symbols must be saved in the same library as their " 702 "parent symbol." ) );
706 wxString new_name = nameTextCtrl->GetValue();
707 new_name.Trim(
true );
708 new_name.Trim(
false );
709 new_name.Replace( wxT(
" " ), wxT(
"_" ) );
711 if( new_name.IsEmpty() )
720 wxString msg =
wxString::Format(
_(
"Symbol '%s' already exists in library '%s'" ),
724 KIDIALOG errorDlg(
this, msg,
_(
"Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
725 errorDlg.SetOKLabel(
_(
"Overwrite" ) );
728 if( errorDlg.
ShowModal() == wxID_CANCEL )
733 new_symbol.
SetName( new_name );
788 "Do you want to remove it from the library?" ),
798 msg.Printf(
_(
"The symbol %s is used to derive other symbols.\n" 799 "Deleting this symbol will delete all of the symbols derived from it.\n\n" 800 "Do you wish to delete this symbol and all of its derivatives?" ),
803 wxMessageDialog::ButtonLabel yesButtonLabel(
_(
"Delete Symbol" ) );
804 wxMessageDialog::ButtonLabel noButtonLabel(
_(
"Keep Symbol" ) );
806 wxMessageDialog dlg(
this, msg,
_(
"Warning" ),
807 wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION | wxCENTER );
808 dlg.SetYesNoLabels( yesButtonLabel, noButtonLabel );
810 if( dlg.ShowModal() == wxID_NO )
833 std::unique_ptr< LIB_SYMBOL> tmp = symbol->
Flatten();
839 auto clipboard = wxTheClipboard;
840 wxClipboardLocker clipboardLock( clipboard );
842 if( !clipboardLock || !clipboard->IsOpened() )
845 auto data =
new wxTextDataObject( wxString( formatter.
GetString().c_str(), wxConvUTF8 ) );
846 clipboard->SetData( data );
867 auto clipboard = wxTheClipboard;
868 wxClipboardLocker clipboardLock( clipboard );
871 || !( clipboard->IsSupported( wxDF_TEXT )
872 || clipboard->IsSupported( wxDF_UNICODETEXT ) ) )
877 wxTextDataObject data;
878 clipboard->GetData( data );
879 wxString symbolSource = data.GetText();
889 wxLogMessage( wxT(
"Can not paste: %s" ), e.
Problem() );
897 wxCHECK( srcSymbol, );
904 std::shared_ptr< LIB_SYMBOL > srcParent = srcSymbol->
GetParent().lock();
906 wxCHECK( srcParent, );
932 wxString newName = aSymbol->
GetName();
936 newName.Printf( wxT(
"%s_%d" ), aSymbol->
GetName(), i++ );
951 symbolName.IsEmpty() ? libName : symbolName );
956 bool reload_currentSymbol =
false;
957 wxString curr_symbolName = symbolName;
963 if( symbolName.IsEmpty() )
968 if( reload_currentSymbol )
979 if( reload_currentSymbol )
982 if( symbolName.IsEmpty() )
1003 wxCHECK_RET(
m_libMgr, wxT(
"Library manager object not created." ) );
1049 SCH_IO_MGR::SCH_FILE_T
fileType = SCH_IO_MGR::SCH_FILE_T::SCH_KICAD;
1054 if( !aNewFile && ( aLibrary.empty() || !prj.SchSymbolLibTable()->HasLibrary( aLibrary ) ) )
1070 fn.SetName( aLibrary );
1075 wxFileDialog dlg(
this,
wxString::Format(
_(
"Save Library '%s' As..." ), aLibrary ),
1076 default_path, fn.GetFullName(), wildcards,
1077 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
1081 if( dlg.ShowModal() == wxID_CANCEL )
1088 if( fn.GetExt().IsEmpty() )
1091 const SAVE_AS_HELPER* sah = dynamic_cast<const SAVE_AS_HELPER*>( dlg.GetExtraControl() );
1092 wxCHECK( sah,
false );
1098 fn = prj.SchSymbolLibTable()->GetFullURI( aLibrary );
1114 msg.Printf(
_(
"Failed to save changes to symbol library file '%s'." ),
1126 bool resyncLibTree =
false;
1128 wxString forceRefresh;
1132 case SAVE_AS_HELPER::SAH_TYPE::REPLACE_TABLE_ENTRY:
1134 forceRefresh = originalLibNickname;
1137 case SAVE_AS_HELPER::SAH_TYPE::ADD_GLOBAL_TABLE_ENTRY:
1141 case SAVE_AS_HELPER::SAH_TYPE::ADD_PROJECT_TABLE_ENTRY:
1145 case SAVE_AS_HELPER::SAH_TYPE::NORMAL_SAVE_AS:
1159 msg.Printf(
_(
"Symbol library file '%s' saved." ), fn.GetFullPath() );
1171 bool applyToAll =
false;
1184 if( aRequireConfirmation && !applyToAll )
1186 msg.Printf(
_(
"Save changes to '%s' before closing?" ), libNickname );
1190 case wxID_YES: doSave =
true;
break;
1191 case wxID_NO: doSave =
false;
break;
1193 case wxID_CANCEL:
return false;
1208 msg.Printf(
_(
"Symbol library '%s' is not writable." ), libNickname );
1209 msg2 =
_(
"You must save to a different location." );
1211 if( dirtyCount == 1 )
1223 2000, wxICON_EXCLAMATION );
1259 msg = parent ? parent->GetName() :
_(
"Undefined!" );
1263 static wxChar UnitLetter[] = wxT(
"?ABCDEFGHIJKLMNOPQRSTUVWXYZ" );
1264 msg = UnitLetter[
m_unit];
1269 msg =
_(
"Convert" );
1271 msg =
_(
"Normal" );
1276 msg =
_(
"Power Symbol" );
1278 msg =
_(
"Symbol" );
Field Reference of part, i.e. "IC21".
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
static SCH_FILE_T GuessPluginTypeFromLibPath(const wxString &aLibPath)
Return a plugin type given a symbol library using the file extension of aLibPath.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
void SetPinNameOffset(int aOffset)
Set the offset in mils of the pin name text from the pin symbol.
LIB_SYMBOL_REF & GetParent()
int GetPinNameOffset() const
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.
int m_convert
Flag if the symbol being edited was loaded directly from a schematic.
void Revert(bool aConfirm=true)
Revert unsaved changes in a symbol, restoring to the last saved state.
const UTF8 & GetLibItemName() const
void DoNotShowCheckbox(wxString file, int line)
Checks the 'do not show again' setting for the dialog.
bool ConfirmRevertDialog(wxWindow *parent, const wxString &aMessage)
Display a confirmation dialog for a revert action.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
wxString GetTextSelection(int aColumn=0)
Return the selected text from aColumn in the wxListCtrl in the dialog.
Container for project specific data.
void SelectActiveLibrary(const wxString &aLibrary=wxEmptyString)
Set the current active library to aLibrary.
SCH_SCREEN * m_dummyScreen
< Helper screen used when no symbol is loaded
void GetRootSymbolNames(const wxString &aLibName, wxArrayString &aRootSymbolNames)
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
void SetIncludeOnBoard(bool aIncludeOnBoard)
Set or clear include in board netlist flag.
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
This file is part of the common library.
wxString GetName() const override
bool ClearLibraryModified(const wxString &aLibrary) const
Clear the modified flag for all symbols in a library.
bool backupFile(const wxFileName &aOriginalFile, const wxString &aBackupExt)
Return currently edited symbol.
void SetOKLabel(const wxString &aLabel)
void SetScreen(BASE_SCREEN *aScreen) override
void SetShowDeMorgan(bool show)
LIB_SYMBOL * GetBufferedSymbol(const wxString &aAlias, const wxString &aLibrary)
Return the symbol copy from the buffer.
void SetConversion(bool aSetConvert, bool aDuplicatePins=true)
Set or clear the alternate body style (DeMorgan) for the symbol.
Field object used in symbol libraries.
bool SaveLibrary(const wxString &aLibrary, const wxString &aFileName, SCH_IO_MGR::SCH_FILE_T aFileType=SCH_IO_MGR::SCH_FILE_T::SCH_LEGACY)
Save library to a file, including unsaved changes.
void ensureUniqueName(LIB_SYMBOL *aSymbol, const wxString &aLibrary)
static TOOL_ACTION cancelInteractive
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
bool m_SyncPinEdit
Set to true to synchronize pins at the same position when editing symbols with multiple units or mult...
void SetUnitCount(int aCount, bool aDuplicateDrawItems=true)
Set the units per symbol count.
std::shared_ptr< LIB_SYMBOL > LIB_SYMBOL_SPTR
shared pointer to LIB_SYMBOL
SYMBOL_TREE_PANE * m_treePane
static TOOL_ACTION zoomFitScreen
void Save()
Save the selected symbol or library.
bool RemoveSymbol(const wxString &aName, const wxString &aLibrary)
Remove the symbol from the symbol buffer.
static wxWindow * Create(wxWindow *aParent)
Create a new panel to add to a wxFileDialog object.
wxRadioButton * m_addGlobalTableEntry
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
void SaveAll()
Save all modified symbols and libraries.
Schematic editor (Eeschema) main window.
Look for files in a number of paths.
bool GetAlternateBodyStyle(void)
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION, MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the infobar with the provided message and icon for a specific period of time.
bool LoadOneLibrarySymbolAux(LIB_SYMBOL *aLibEntry, const wxString &aLibrary, int aUnit, int aConvert)
Create a copy of aLibEntry into memory.
A logical library item identifier and consists of various portions much like a URI.
Define a library symbol object.
LIB_ID RevertSymbol(const wxString &aAlias, const wxString &aLibrary)
Revert unsaved changes for a symbolicular symbol.
wxString GetCurLib() const
The nickname of the current library being edited and empty string if none.
bool RevertLibrary(const wxString &aLibrary)
Revert unsaved changes for a symbolicular library.
virtual const wxString Problem() const
what was the problem?
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
LIB_FIELD & GetReferenceField()
Return reference to the reference designator field.
bool IsSymbolFromSchematic() const
virtual void SetParent(EDA_ITEM *aParent)
LIB_ID m_centerItemOnIdle
LIB_SYMBOL * getTargetSymbol() const
Return either the library selected in the symbol tree, if context menu is active or the library that ...
bool m_isSymbolFromSchematic
bool FlushSymbol(const wxString &aAlias, const wxString &aLibrary)
Save symbol changes to the library copy used by the schematic editor.
void UpdateAfterSymbolProperties(wxString *aOldName=nullptr)
wxString GetName(void) const override
bool SymbolExists(const wxString &aAlias, const wxString &aLibrary) const
Return true if symbol with a specific alias exists in library (either original one or buffered).
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, WX_INFOBAR::MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
int GetPinTextPosition(void)
void SetShowPinNames(bool aShow)
Set or clear the pin name visibility flag.
LIB_SYMBOL * GetCurSymbol() const
Return the current symbol being edited or NULL if none selected.
void LoadSymbol(const wxString &aLibrary, const wxString &aSymbol, int Unit)
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
static LIB_SYMBOL * ParseLibSymbol(LINE_READER &aReader, int aVersion=SEXPR_SCHEMATIC_FILE_VERSION)
void RebuildSymbolUnitsList()
void updateTitle()
Update the main window title bar with the current library name and read only status of the library.
wxString GetKeyWords() const
bool RevertAll()
Revert all pending changes.
void SaveSymbolAs()
Save the currently selected symbol to a new name and/or location.
Field Value of part, i.e. "3.3K".
virtual void SetText(const wxString &aText)
static void FormatLibSymbol(LIB_SYMBOL *aPart, OUTPUTFORMATTER &aFormatter)
virtual const wxString What() const
A composite of Problem() and Where()
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
void SetCurSymbol(LIB_SYMBOL *aSymbol, bool aUpdateZoom)
Take ownership of aSymbol and notes that it is the one currently being edited.
LIB_ID GetLibId() const override
void SyncLibraries(bool aShowProgress, bool aPreloadCancelled=false, const wxString &aForceRefresh=wxEmptyString)
Synchronize the library manager to the symbol library table, and then the symbol tree to the library ...
const wxString GetDescription(const wxString &aNickname)
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
virtual void SetName(const wxString &aName)
bool IsLibraryReadOnly(const wxString &aLibrary) const
Return true if the library is stored in a read-only file.
bool IsSymbolModified(const wxString &aAlias, const wxString &aLibrary) const
Return true if symbol has unsaved modifications.
wxString getTargetLib() const
bool GetIncludeOnBoard() const
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
For multi-unit symbols, if the user selects the symbol itself rather than picking an individual unit,...
int UnsavedChangesDialog(wxWindow *parent, const wxString &aMessage, bool *aApplyToAll)
A specialized version of HandleUnsavedChanges which handles an apply-to-all checkbox.
Definition of file extensions used in Kicad.
void ReCreateHToolbar() override
bool GetShowPinNumber(void)
Definition for symbol library class.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
wxString SelectLibraryFromList()
Display a list of loaded libraries in the symbol library and allows the user to select a library.
bool replaceLibTableEntry(const wxString &aLibNickname, const wxString &aLibFile)
Replace the file path of the symbol library table entry aLibNickname with aLibFile.
wxString KiCadSymbolLibFileWildcard()
void SetParent(LIB_SYMBOL *aParent=nullptr)
void DeleteSymbolFromLibrary()
void ClearMsgPanel() override
Clear all messages from the message panel.
bool saveCurrentSymbol()
Store the currently modified symbol in the library manager buffer.
bool GetPinNameInside(void)
bool HasDerivedSymbols(const wxString &aSymbolName, const wxString &aLibraryName)
Check if symbol aSymbolName in library aLibraryName is a root symbol that has derived symbols.
FormatType fileType(const char *aFileName)
bool isCurrentSymbol(const LIB_ID &aLibId) const
Rename LIB_SYMBOL aliases to avoid conflicts before adding a symbol to a library.
int OKOrCancelDialog(wxWindow *aParent, const wxString &aWarning, const wxString &aMessage, const wxString &aDetailedMessage, const wxString &aOKLabel, const wxString &aCancelLabel, bool *aApplyToAll)
Display a warning dialog with aMessage and returns the user response.
void RefreshLibTree()
Refreshes the tree (mainly to update highlighting and asterisking)
virtual void ClearMsgPanel()
Clear all messages from the message panel.
void ReCreateMenuBar() override
Recreates the menu bar.
bool addLibTableEntry(const wxString &aLibFile, TABLE_SCOPE aScope=GLOBAL_LIB_TABLE)
Add aLibFile to the symbol library table defined by aScope.
void SaveSymbolToSchematic(const LIB_SYMBOL &aSymbol, const KIID &aSchematicSymbolUUID)
Update a schematic symbol from a LIB_SYMBOL.
void centerItemIdleHandler(wxIdleEvent &aEvent)
void UpdateSymbolMsgPanelInfo()
Display the documentation of the selected symbol.
wxString UnescapeString(const wxString &aSource)
wxString GetReference(void)
bool UnitsLocked() const
Check whether symbol units are interchangeable.
bool saveLibrary(const wxString &aLibrary, bool aNewFile)
Save the changes to the current library.
Helper control to inquire user what to do on library save as operation.
virtual void SetRString(RSTRING_T aStringId, const wxString &aString)
Store a "retained string", which is any session and project specific string identified in enum RSTRIN...
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
void SetContentModified(bool aModified=true)
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
wxArrayString GetLibraryNames() const
Return the array of library names.
void ExpandLibId(const LIB_ID &aLibId)
Expand and item i the tree widget.
bool GetPowerSymbol(void)
bool LoadSymbolFromCurrentLib(const wxString &aAliasName, int aUnit=0, int aConvert=0)
Load a symbol from the current active library, optionally setting the selected unit and convert.
LIB_ID GetTargetLibId() const
bool ClearSymbolModified(const wxString &aAlias, const wxString &aLibrary) const
Clear the modified flag for a symbol.
virtual const wxString & GetRString(RSTRING_T aStringId)
Return a "retained string", which is any session and project specific string identified in enum RSTRI...
bool IsLibraryModified(const wxString &aLibrary) const
Return true if library has unsaved modifications.
LIB_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
bool LibraryExists(const wxString &aLibrary, bool aCheckEnabled=false) const
Return true if library exists.
bool IsContentModified() const override
Get if any symbols or libraries have been modified but not saved.
bool GetIncludeInBom() const
void SetIncludeInBom(bool aIncludeInBom)
Set or clear the include in schematic bill of materials flag.
bool saveAllLibraries(bool aRequireConfirmation)
Save the current symbol.
wxRadioButton * m_simpleSaveAs
const wxString LastVisitedPath(const wxString &aSubPathToSearch=wxEmptyString)
A quirky function inherited from old code that seems to serve particular needs in the UI.
void DuplicateSymbol(bool aFromClipboard)
Insert a duplicate symbol.
bool GetShowPinName(void)
LIB_FIELD & GetDatasheetField()
Return reference to the datasheet field.
static bool empty(const wxTextEntryBase *aCtrl)
void SetShowPinNumbers(bool aShow)
Set or clear the pin number visibility flag.
wxRadioButton * m_addProjectTableEntry
LIB_SYMBOL * GetAlias(const wxString &aAlias, const wxString &aLibrary) const
Return either an alias of a working LIB_SYMBOL copy, or alias of the original symbol if there is no w...
wxRadioButton * m_replaceTableEntry
bool UpdateSymbol(LIB_SYMBOL *aSymbol, const wxString &aLibrary)
Update the symbol buffer with a new version of the symbol.
WX_INFOBAR * GetInfoBar()
SYMBOL_LIBRARY_MANAGER * m_libMgr
SCH_SCREEN * GetScreen(const wxString &aAlias, const wxString &aLibrary)
Return the screen used to edit a specific symbol.
void CopySymbolToClipboard()
void SaveLibraryAs()
Save the currently selected library to a new file.
void emptyScreen()
Return either the symbol selected in the symbol tree, if context menu is active or the currently modi...
LIB_TREE * GetLibTree() const
wxString GetDescription() override
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
wxString SetCurLib(const wxString &aLibNickname)
Set the current library nickname and returns the old library nickname.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
virtual void ClearUndoRedoList()
Clear the undo and redo list using ClearUndoORRedoList()
SAH_TYPE GetOption() const
virtual const wxString & GetText() const
Return the string associated with the text object.
const wxString GetUniStringLibItemName() const
Get strings for display messages in dialogs.
void LockUnits(bool aLockUnits)
Set interchangeable the property for symbol units.
bool UpdateSymbolAfterRename(LIB_SYMBOL *aSymbol, const wxString &oldAlias, const wxString &aLibrary)
Update the symbol buffer with a new version of the symbol when the name has changed.
std::vector< wxString > GetLogicalLibs()
Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE.
void CenterLibId(const LIB_ID &aLibId)
Ensure that an item is visible (preferably centered).
SAVE_AS_HELPER(wxWindow *aParent)
KIID m_schematicSymbolUUID
RefDes of the symbol (only valid if symbol was loaded from schematic)
void CreateNewSymbol()
Create a new symbol in the selected library.
wxString GetParentSymbolName() const
void SelectLibId(const LIB_ID &aLibId)
Select an item in the tree widget.
virtual void UpdateMsgPanel()
Redraw the message panel.
const std::string KiCadSymbolLibFileExtension
void AppendMsgPanel(const wxString &aTextUpper, const wxString &aTextLower, int aPadding=6)
Append a message to the message panel.
Field Name Module PCB, i.e. "16DIP300".
void SetListLabel(const wxString &aLabel)