56 m_posX( aParent, m_xPosLabel, m_xPosCtrl, m_xPosUnits, true ),
57 m_posY( aParent, m_yPosLabel, m_yPosCtrl, m_yPosUnits, true ),
58 m_textSize( aParent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, true ),
61 m_scintillaTricks( nullptr )
66 wxASSERT( aTextItem );
77 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
189 GetSizer()->SetSizeHints(
this );
223 if( frame->ShowModal( &fpid,
this ) )
267 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
277 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
287 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
353 DisplayError(
this,
_(
"Illegal reference designator value!" ) );
410 const wxString& aTitle,
444 const wxString& aTitle,
457 switch( aField->
GetId() )
467 _(
"Sheet filename can only be modified in Sheet Properties dialog." ) ) );
516 int key = aEvent.GetKey();
519 wxArrayString autocompleteTokens;
532 text.Replace( wxS(
"\n" ), wxS(
"" ) );
551 if( textVarRef( refStart ) )
557 if( ref == wxS(
"OP" ) )
570 if(
pin.StartsWith(
'<' ) &&
pin.EndsWith(
'>' ) )
571 autocompleteTokens.push_back(
pin.Mid( 1,
pin.Length() - 2 ) );
573 autocompleteTokens.push_back(
pin );
585 for(
size_t jj = 0; jj < refs.
GetCount(); jj++ )
587 if( refs[ jj ].GetSymbol()->GetRef( &refs[ jj ].GetSheetPath(),
true ) == ref )
589 refSymbol = refs[ jj ].GetSymbol();
599 else if( textVarRef( start ) )
624 autocompleteTokens.push_back( entry.first );
636 int fieldType = aField->
GetId();
656 "controlled globally from "
657 "Schematic Setup > General > Formatting" ) );
662 bool positioningModified =
false;
665 positioningModified =
true;
668 positioningModified =
true;
671 positioningModified =
true;
674 positioningModified =
true;
710 wxString ref = symbol->
GetRef( aSheetPath );
717 std::vector<SCH_SYMBOL*> otherUnits;
718 constexpr bool appendUndo =
true;
728 otherUnit->SetValueFieldText(
m_text );
730 otherUnit->SetFootprintFieldText(
m_text );
734 editFrame->
UpdateItem( otherUnit,
false,
true );
740 if( positioningModified && parent )
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetColor(int aLayer) const
void SetSwatchColor(const KIGFX::COLOR4D &aColor, bool aSendEvent)
Set the current swatch color directly.
KIGFX::COLOR4D GetSwatchColor() const
void SetDefaultColor(const KIGFX::COLOR4D &aColor)
Sets the color that will be chosen with the "Reset to Default" button in the chooser.
void SetSwatchBackground(const KIGFX::COLOR4D &aBackground)
Set the swatch background color.
Class DIALOG_FIELD_PROPERTIES_BASE.
wxCheckBox * m_nameVisible
BITMAP_BUTTON * m_separator5
BITMAP_BUTTON * m_separator2
BITMAP_BUTTON * m_hAlignLeft
wxBitmapButton * m_TextValueSelectButton
BITMAP_BUTTON * m_hAlignCenter
BITMAP_BUTTON * m_vAlignCenter
BITMAP_BUTTON * m_vertical
BITMAP_BUTTON * m_vAlignBottom
wxCheckBox * m_CommonConvert
BITMAP_BUTTON * m_horizontal
BITMAP_BUTTON * m_separator1
wxStyledTextCtrl * m_StyledTextCtrl
BITMAP_BUTTON * m_hAlignRight
wxCheckBox * m_CommonUnit
wxCheckBox * m_cbAllowAutoPlace
COLOR_SWATCH * m_textColorSwatch
BITMAP_BUTTON * m_separator3
wxStaticText * m_textLabel
BITMAP_BUTTON * m_vAlignTop
BITMAP_BUTTON * m_separator4
A base class to edit schematic and symbol library fields.
void onOrientButton(wxCommandEvent &aEvent)
void OnTextValueSelectButtonClick(wxCommandEvent &aEvent) override
Handle the select button next to the text value field.
GR_TEXT_H_ALIGN_T m_horizontalJustification
bool TransferDataFromWindow() override
bool TransferDataToWindow() override
SCH_BASE_FRAME * GetParent()
void onVAlignButton(wxCommandEvent &aEvent)
~DIALOG_FIELD_PROPERTIES() override
SCINTILLA_TRICKS * m_scintillaTricks
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...
void updateText(EDA_TEXT *aText)
void onHAlignButton(wxCommandEvent &aEvent)
GR_TEXT_V_ALIGN_T m_verticalJustification
DIALOG_FIELD_PROPERTIES(SCH_BASE_FRAME *aParent, const wxString &aTitle, const EDA_TEXT *aTextItem)
void UpdateField(LIB_FIELD *aField)
DIALOG_LIB_FIELD_PROPERTIES(SCH_BASE_FRAME *aParent, const wxString &aTitle, const LIB_FIELD *aField)
DIALOG_SCH_FIELD_PROPERTIES(SCH_BASE_FRAME *aParent, const wxString &aTitle, const SCH_FIELD *aField)
void onScintillaCharAdded(wxStyledTextEvent &aEvent)
void UpdateField(SCH_FIELD *aField, SCH_SHEET_PATH *aSheetPath)
const SCH_FIELD * m_field
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...
bool IsType(FRAME_T aType) const
KICAD_T Type() const
Returns the type of object.
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
EDA_ITEM * GetParent() const
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
void SetTextColor(const COLOR4D &aColor)
const VECTOR2I & GetTextPos() const
COLOR4D GetTextColor() const
const EDA_ANGLE & GetTextAngle() const
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual bool IsVisible() const
void SetTextPos(const VECTOR2I &aPoint)
KIFONT::FONT * GetFont() const
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
GR_TEXT_H_ALIGN_T GetHorizJustify() const
virtual void SetVisible(bool aVisible)
static GR_TEXT_H_ALIGN_T MapHorizJustify(int aHorizJustify)
static GR_TEXT_V_ALIGN_T MapVertJustify(int aVertJustify)
GR_TEXT_V_ALIGN_T GetVertJustify() const
void SetTextSize(const VECTOR2I &aNewSize)
virtual void SetText(const wxString &aText)
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
void SetItalic(bool aItalic)
void SetFont(KIFONT::FONT *aFont)
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
bool HaveFontSelection() const
void SetFontSelection(KIFONT::FONT *aFont)
KIFONT::FONT * GetFontSelection(bool aBold, bool aItalic) const
A color representation with 4 components: red, green, blue, alpha.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
Field object used in symbol libraries.
bool CanAutoplace() const
void SetNameShown(bool aShown=true)
void SetCanAutoplace(bool aCanPlace)
A logical library item identifier and consists of various portions much like a URI.
virtual std::map< wxString, wxString > & GetTextVars() const
bool m_IntersheetRefsShow
Holds all the data relating to one schematic.
SCH_SHEET_PATH & CurrentSheet() const override
SCHEMATIC_SETTINGS & Settings() const
wxString ConvertKIIDsToRefs(const wxString &aSource) const
SCH_SHEET_LIST GetSheets() const override
Builds and returns an updated schematic hierarchy TODO: can this be cached?
wxString ConvertRefsToKIIDs(const wxString &aSource) const
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Returns a pointer to the active color theme settings.
Schematic editor (Eeschema) main window.
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend, bool aDirtyConnectivity=true)
Create a copy of the current schematic item, and put it in the undo list.
SCHEMATIC & Schematic() const
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false, bool aUpdateRtree=false) override
Mark an item for refresh.
A text control validator used for validating the text allowed in library and schematic symbol fields.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
GR_TEXT_V_ALIGN_T GetEffectiveVertJustify() const
VECTOR2I GetPosition() const override
bool IsHorizJustifyFlipped() const
Return whether the field will be rendered with the horizontal justification inverted due to rotation ...
bool IsVertJustifyFlipped() const
void SetCanAutoplace(bool aCanPlace)
GR_TEXT_H_ALIGN_T GetEffectiveHorizJustify() const
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
void SetPosition(const VECTOR2I &aPosition) override
bool CanAutoplace() const
void SetNameShown(bool aShown=true)
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
void ClearFieldsAutoplaced()
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this label.
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
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.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
static bool IsReferenceStringValid(const wxString &aReferenceString)
Test for an acceptable reference string.
void SetValueFieldText(const wxString &aValue)
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
Return the reference for the given sheet path.
void SetRef(const SCH_SHEET_PATH *aSheet, const wxString &aReference)
Set the reference for the given sheet path for this symbol.
void SetFootprintFieldText(const wxString &aFootprint)
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this symbol.
bool IsAnnotated(const SCH_SHEET_PATH *aSheet)
Check if the symbol has a valid annotation (reference) for the given sheet path.
const LIB_ID & GetLibId() const
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
void DoAutocomplete(const wxString &aPartial, const wxArrayString &aTokens)
SIM_MODEL & CreateModel(SIM_MODEL::TYPE aType, const std::vector< LIB_PIN * > &aPins)
virtual std::vector< std::string > GetPinNames() const
virtual long long int GetValue()
Return the current value in Internal Units.
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
wxString EnsureFileExtension(const wxString &aFilename, const wxString &aExtension)
It's annoying to throw up nag dialogs when the extension isn't right.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
This file is part of the common library.
static constexpr EDA_ANGLE & ANGLE_HORIZONTAL
static constexpr EDA_ANGLE & ANGLE_VERTICAL
void CollectOtherUnits(const wxString &aRef, int aUnit, const LIB_ID &aLibId, SCH_SHEET_PATH &aSheet, std::vector< SCH_SYMBOL * > *otherUnits)
@ FRAME_FOOTPRINT_VIEWER_MODAL
@ FRAME_SCH_SYMBOL_EDITOR
const std::string KiCadSchematicFileExtension
@ LAYER_SCHEMATIC_BACKGROUND
wxFont GetInfoFont(wxWindow *aWindow)
void SelectReferenceNumber(wxTextEntry *aTextEntry)
Select the number (or "?") in a reference for ease of editing.
Definitions of control validators for schematic dialogs.
wxString UnescapeString(const wxString &aSource)
Definition for symbol library class.
@ DATASHEET_FIELD
name of datasheet
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
Definition of file extensions used in Kicad.