48 m_posX( aParent, m_xPosLabel, m_xPosCtrl, m_xPosUnits, true ),
49 m_posY( aParent, m_yPosLabel, m_yPosCtrl, m_yPosUnits, true ),
50 m_textSize( aParent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, true ),
52 m_scintillaTricks( nullptr )
54 wxASSERT( aTextItem );
68 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
131 _(
"Power symbol value field text cannot be changed." ) ) );
142 GetSizer()->SetSizeHints(
this );
246 DisplayError(
this,
_(
"Illegal reference designator value!" ) );
267 m_text = fn.GetFullPath();
297 const wxString& aTitle,
313 const wxString& aTitle,
326 switch( aField->
GetId() )
336 _(
"Sheet filename can only be modified in Sheet Properties dialog." ) ) );
367 if( libSymbol && libSymbol->IsPower() )
386 int key = aEvent.GetKey();
389 wxArrayString autocompleteTokens;
402 text.Replace( wxT(
"\n" ), wxEmptyString );
421 if( textVarRef( refStart ) )
432 for(
size_t jj = 0; jj < refs.
GetCount(); jj++ )
434 if( refs[ jj ].GetSymbol()->GetRef( &refs[ jj ].GetSheetPath(),
true ) == ref )
436 refSymbol = refs[ jj ].GetSymbol();
445 else if( textVarRef( start ) )
463 sheet->GetContextualTextVars( &autocompleteTokens );
465 for( std::pair<wxString, wxString> entry :
Prj().GetTextVars() )
466 autocompleteTokens.push_back( entry.first );
478 int fieldType = aField->
GetId();
482 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( parent );
494 bool positioningModified =
false;
497 positioningModified =
true;
500 positioningModified =
true;
503 positioningModified =
true;
506 positioningModified =
true;
531 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( parent );
537 wxString ref = symbol->
GetRef( aSheetPath );
544 std::vector<SCH_SYMBOL*> otherUnits;
545 constexpr
bool appendUndo =
true;
555 otherUnit->SetValue(
m_text );
557 otherUnit->SetFootprint(
m_text );
561 editFrame->
UpdateItem( otherUnit,
false,
true );
567 if( positioningModified && parent )
Field Reference of part, i.e. "IC21".
virtual bool ShowModal(wxString *aResult=nullptr, wxWindow *aResultantFocusWindow=nullptr)
Show this wxFrame as if it were a modal dialog, with all other instantiated wxFrames disabled until t...
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
#define TEXT_ANGLE_HORIZ
Frequent text rotations, used with {Set,Get}TextAngle(), in 0.1 degrees for now, hoping to migrate to...
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
void SelectReferenceNumber(wxTextEntry *aTextEntry)
Select the number (or "?") in a reference for ease of editing.
Class DIALOG_LIB_TEXT_PROPERTIES_BASE.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Holds all the data relating to one schematic.
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanSymbols=false) const
Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets.
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
This file is part of the common library.
wxCheckBox * m_CommonUnit
wxCheckBox * m_CommonConvert
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
bool TransferDataFromWindow() override
A base class to edit schematic and symbol library fields.
wxPoint GetPosition() const override
void DoAutocomplete(const wxString &aPartial, const wxArrayString &aTokens)
void updateText(EDA_TEXT *aText)
void SetItalic(bool isItalic)
Field object used in symbol libraries.
DIALOG_SCH_FIELD_PROPERTIES(SCH_BASE_FRAME *aParent, const wxString &aTitle, const SCH_FIELD *aField)
void SetValue(const SCH_SHEET_PATH *sheet, const wxString &aValue)
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
wxFont GetInfoFont(wxWindow *aWindow)
bool IsVertJustifyFlipped() const
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
double GetTextAngle() const
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Schematic editor (Eeschema) main window.
void CollectOtherUnits(const wxString &aRef, int aUnit, const LIB_ID &aLibId, SCH_SHEET_PATH &aSheet, std::vector< SCH_SYMBOL * > *otherUnits)
void SetTextSize(const wxSize &aNewSize)
wxChoice * m_hAlignChoice
wxStaticText * m_textLabel
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
Return the reference for the given sheet path.
A logical library item identifier and consists of various portions much like a URI.
Define a library symbol object.
void SetFootprint(const SCH_SHEET_PATH *sheet, const wxString &aFootprint)
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
void onScintillaCharAdded(wxStyledTextEvent &aEvent)
const SCH_FIELD * m_field
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this symbol.
virtual void SetVisible(bool aVisible)
wxButton * m_sdbSizerButtonsOK
EDA_TEXT_VJUSTIFY_T GetEffectiveVertJustify() const
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
static EDA_TEXT_HJUSTIFY_T MapHorizJustify(int aHorizJustify)
Field Value of part, i.e. "3.3K".
virtual void SetText(const wxString &aText)
wxString ConvertRefsToKIIDs(const wxString &aSource) const
virtual bool IsVisible() const
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
void SetVertJustify(EDA_TEXT_VJUSTIFY_T aType)
~DIALOG_FIELD_PROPERTIES() override
Definitions of control validators for schematic dialogs.
DIALOG_FIELD_PROPERTIES(SCH_BASE_FRAME *aParent, const wxString &aTitle, const EDA_TEXT *aTextItem)
SCHEMATIC & Schematic() const
Definition of file extensions used in Kicad.
wxStyledTextCtrl * m_StyledTextCtrl
wxChoice * m_vAlignChoice
void ClearFieldsAutoplaced()
Definition for symbol library class.
EDA_ITEM * GetParent() const
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false, bool aUpdateRtree=false)
Mark an item for refresh.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void OnTextValueSelectButtonClick(wxCommandEvent &aEvent) override
Handle the select button next to the text value field.
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
static EDA_TEXT_VJUSTIFY_T MapVertJustify(int aVertJustify)
wxString UnescapeString(const wxString &aSource)
EDA_TEXT_HJUSTIFY_T GetEffectiveHorizJustify() const
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
bool IsAnnotated(const SCH_SHEET_PATH *aSheet)
Check if the symbol has a valid annotation (reference) for the given sheet path.
SCINTILLA_TRICKS * m_scintillaTricks
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
wxString ConvertKIIDsToRefs(const wxString &aSource) const
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
SCH_SHEET_LIST GetSheets() const override
Builds and returns an updated schematic hierarchy TODO: can this be cached?
DIALOG_LIB_FIELD_PROPERTIES(SCH_BASE_FRAME *aParent, const wxString &aTitle, const LIB_FIELD *aField)
bool IsType(FRAME_T aType) const
void SetHorizJustify(EDA_TEXT_HJUSTIFY_T aType)
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend)
Create a copy of the current schematic item, and put it in the undo list.
virtual void SetValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void SetRef(const SCH_SHEET_PATH *aSheet, const wxString &aReference)
Set the reference for the given sheet path for this symbol.
wxString GetName(bool aUseDefaultName=true) const
Return the field name.
const std::string KiCadSchematicFileExtension
int m_verticalJustification
bool IsHorizJustifyFlipped() const
Return whether the field will be rendered with the horizontal justification inverted due to rotation ...
virtual long long int GetValue()
Return the current value in Internal Units.
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
const wxPoint & GetTextPos() const
LIB_SYMBOL * GetLibSymbol(const LIB_ID &aLibId, bool aUseCacheLib=false, bool aShowErrorMsg=false)
Load symbol from symbol library table.
virtual void SetTextAngle(double aAngle)
void UpdateField(SCH_FIELD *aField, SCH_SHEET_PATH *aSheetPath)
A text control validator used for validating the text allowed in library and schematic symbol fields.
SCH_BASE_FRAME * GetParent()
SCH_SHEET_PATH & CurrentSheet() const override
bool TransferDataToWindow() override
static bool IsReferenceStringValid(const wxString &aReferenceString)
Test for an acceptable reference string.
wxChoice * m_orientChoice
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
void SetPosition(const wxPoint &aPosition) override
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual const wxString & GetText() const
Return the string associated with the text object.
int m_horizontalJustification
virtual void OnSetFocusText(wxFocusEvent &event) override
Used to select the variant part of some text fields (for instance, the question mark or number in a r...
wxBitmapButton * m_TextValueSelectButton
KICAD_T Type() const
Returns the type of object.
const LIB_ID & GetLibId() const
Field Name Module PCB, i.e. "16DIP300".