20#ifndef SYMBOL_EDITOR_TAB_CONTEXT_H
21#define SYMBOL_EDITOR_TAB_CONTEXT_H
54 const KIID& aSchematicSymbolUUID,
const wxString& aReference );
61 static wxString
MakeTabKey(
const wxString& aLib,
const wxString& aName )
63 return aLib + wxT(
":" ) + aName;
74 return wxString( wxT(
"\x01@sym:" ) ) + aSchematicSymbolUUID.
AsString();
wxString AsString() const
Define a library symbol object.
void RefreshFrameOwnedObjects(LIB_SYMBOL *aSymbol, SCH_SCREEN *aScreen)
Track the frame's new working symbol after undo/redo replaces it, while staying frame-owned.
int m_bodyStyle
True for an instance tab edited in place from a placed schematic symbol.
bool m_fromSchematic
Source instance UUID, used as both the de-dup key and the save-back target.
void ReleaseToFrame()
Hand the working symbol/screen to the frame as the tab becomes active.
wxString GetDisplayName() const override
Short label shown on the tab.
LIB_SYMBOL * GetSymbol() const
Observe the working symbol/screen.
LIB_SYMBOL * m_symbol
Working copy; owned by the context while detached.
const wxString & GetReference() const
const wxString & GetName() const
static wxString MakeTabKey(const wxString &aLib, const wxString &aName)
De-duplication key for a library:symbol pair.
static wxString MakeInstanceTabKey(const KIID &aSchematicSymbolUUID)
De-duplication key for a placed schematic instance, in a namespace disjoint from library keys.
SYMBOL_EDITOR_TAB_CONTEXT(const wxString &aLib, const wxString &aName, SYMBOL_BUFFER *aBuffer)
SCH_SCREEN * GetScreen() const
~SYMBOL_EDITOR_TAB_CONTEXT() override
wxString GetTabKey() const override
Stable identity for persistence and de-duplication.
const KIID & GetSchematicSymbolUUID() const
bool m_frameOwns
True while the tab is active and the frame owns the symbol/screen.
void SetBodyStyle(int aBodyStyle)
bool IsModified() const override
True when the working screen carries unsaved edits.
SCH_SCREEN * m_screen
Working screen; owned by the context while detached.
void AdoptWorkingObjects(LIB_SYMBOL *aSymbol, SCH_SCREEN *aScreen)
Take ownership back on detach, capturing whatever the frame's symbol now points at.
bool IsFromSchematic() const
const wxString & GetLibrary() const
bool IsTransient() const
True for an instance (schematic) tab, which is session-only and never persisted.
KIID m_schematicSymbolUUID
Reference designator of the source instance, shown as the tab label.