46 m_posX( aParent, m_xPosLabel, m_xPosCtrl, m_xPosUnits, true ),
47 m_posY( aParent, m_yPosLabel, m_yPosCtrl, m_yPosUnits, true ),
48 m_textSize( aParent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, true ),
50 m_scintillaTricks( nullptr )
52 wxASSERT( aTextItem );
127 GetSizer()->SetSizeHints(
this );
228 DisplayError(
this,
_(
"Illegal reference designator value!" ) );
268 const wxString& aTitle,
281 const wxString& aTitle,
292 switch( aField->
GetId() )
329 wxArrayString autocompleteTokens;
347 if( textVarRef( refStart ) )
358 for(
size_t jj = 0; jj < refs.
GetCount(); jj++ )
360 if( refs[ jj ].GetSymbol()->GetRef( &refs[ jj ].GetSheetPath(),
true ) == ref )
362 refSymbol = refs[ jj ].GetSymbol();
371 else if( textVarRef( start ) )
389 sheet->GetContextualTextVars( &autocompleteTokens );
391 for( std::pair<wxString, wxString> entry :
Prj().GetTextVars() )
392 autocompleteTokens.push_back( entry.first );
404 int fieldType = aField->
GetId();
408 SCH_COMPONENT* symbol = static_cast<SCH_COMPONENT*>( parent );
418 bool positioningModified =
false;
421 positioningModified =
true;
424 positioningModified =
true;
427 positioningModified =
true;
430 positioningModified =
true;
442 SCH_COMPONENT* symbol = static_cast<SCH_COMPONENT*>( parent );
448 wxString ref = symbol->
GetRef( aSheetPath );
454 std::vector<SCH_COMPONENT*> otherUnits;
455 constexpr
bool appendUndo =
true;
465 otherUnit->SetValue(
m_text );
467 otherUnit->SetFootprint(
m_text );
477 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...
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
void SelectReferenceNumber(wxTextEntry *aTextEntry)
Select the number (or "?") in a reference for ease of editing.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanComponents=false) const
Add a SCH_REFERENCE object to aReferences for each component in the list of sheets.
Holds all the data relating to one schematic A schematic may consist of one or more sheets (and one r...
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
SCINTILLA_TRICKS * m_scintillaTricks
This file is part of the common library.
void onScintillaCharAdded(wxStyledTextEvent &aEvent)
Add cut/copy/paste, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
void CollectOtherUnits(const wxString &aRef, int aUnit, SCH_SHEET_PATH &aSheet, std::vector< SCH_COMPONENT * > *otherUnits)
void DoAutocomplete(const wxString &aPartial, const wxArrayString &aTokens)
void SetItalic(bool isItalic)
int m_verticalJustification
wxStaticText * m_PowerComponentValues
Field object used in symbol libraries.
void SetTextPos(const wxPoint &aPoint)
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
void SetVisible(bool aVisible)
double GetTextAngle() const
void UpdateField(SCH_FIELD *aField, SCH_SHEET_PATH *aSheetPath)
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.
LIB_PART * GetLibPart(const LIB_ID &aLibId, bool aUseCacheLib=false, bool aShowErrorMsg=false)
Load symbol from symbol library table.
void SetTextSize(const wxSize &aNewSize)
wxStaticText * m_textLabel
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
DIALOG_EDIT_ONE_FIELD(SCH_BASE_FRAME *aParent, const wxString &aTitle, const EDA_TEXT *aTextItem)
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
DIALOG_SCH_EDIT_ONE_FIELD(SCH_BASE_FRAME *aParent, const wxString &aTitle, const SCH_FIELD *aField)
wxChoice * m_vAlignChoice
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
DIALOG_LIB_EDIT_ONE_FIELD(SCH_BASE_FRAME *aParent, const wxString &aTitle, const LIB_FIELD *aField)
DIALOG_EDIT_ONE_FIELD is a base class to edit schematic and component library fields.
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
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
void SetVertJustify(EDA_TEXT_VJUSTIFY_T aType)
Definitions of control validators for schematic dialogs.
const SCH_FIELD * m_field
~DIALOG_EDIT_ONE_FIELD() override
SCHEMATIC & Schematic() const
Define a library symbol object.
void ClearFieldsAutoplaced()
Set fields automatically placed flag false.
EDA_ITEM * GetParent() const
bool IsAnnotated(const SCH_SHEET_PATH *aSheet)
Checks if the component has a valid annotation (reference) for the given sheet path.
wxBitmapButton * m_TextValueSelectButton
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
const BITMAP_OPAQUE small_library_xpm[1]
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this symbol.
static EDA_TEXT_VJUSTIFY_T MapVertJustify(int aVertJustify)
bool TransferDataToWindow() override
void updateText(EDA_TEXT *aText)
Class DIALOG_LIB_EDIT_TEXT_BASE.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
unsigned GetCount() const
wxString ConvertKIIDsToRefs(const wxString &aSource) const
SCH_BASE_FRAME * GetParent()
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
void SetRef(const SCH_SHEET_PATH *aSheet, const wxString &aReference)
Set the reference for the given sheet path for this symbol.
SCH_SHEET_LIST GetSheets() const override
Builds and returns an updated schematic hierarchy TODO: can this be cached?
wxChoice * m_hAlignChoice
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.
void OnTextValueSelectButtonClick(wxCommandEvent &aEvent) override
Function OnTextValueSelectButtonClick Handles the select button next to the text value field.
virtual void SetValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
wxString GetName(bool aUseDefaultName=true) const
Function GetName returns the field name.
wxCheckBox * m_CommonUnit
wxChoice * m_orientChoice
wxStyledTextCtrl * m_StyledTextCtrl
virtual long long int GetValue()
Return the current value in Internal Units.
bool TransferDataFromWindow() override
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
const wxPoint & GetTextPos() const
virtual void SetTextAngle(double aAngle)
A text control validator used for validating the text allowed in library and schematic component fiel...
int m_horizontalJustification
Definition for part library class.
SCH_SHEET_PATH & CurrentSheet() const override
void SetValue(const SCH_SHEET_PATH *sheet, const wxString &aValue)
static bool IsReferenceStringValid(const wxString &aReferenceString)
Tests for an acceptable reference string.
wxCheckBox * m_CommonConvert
const LIB_ID & GetLibId() const
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
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.
void SetFootprint(const SCH_SHEET_PATH *sheet, const wxString &aFootprint)
wxButton * m_sdbSizerButtonsOK
KICAD_T Type() const
Returns the type of object.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
Return the reference for the given sheet path.
Field Name Module PCB, i.e. "16DIP300".
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...