55 m_posX( aParent, m_xPosLabel, m_xPosCtrl, m_xPosUnits, true ),
56 m_posY( aParent, m_yPosLabel, m_yPosCtrl, m_yPosUnits, true ),
57 m_textSize( aParent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, true ),
60 m_scintillaTricks( nullptr )
65 wxASSERT( aTextItem );
75 [
this]( wxKeyEvent& aEvent )
77 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
196 GetSizer()->SetSizeHints(
this );
230 frame->KiwayMailIn( event );
232 if( frame->ShowModal( &fpid,
this ) )
276 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
286 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
296 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
364 DisplayError(
this,
_(
"Illegal reference designator value!" ) );
422 const wxString& aTitle,
442 std::vector<LIB_PIN*> pinList;
449 pins.push_back(
pin->GetNumber() +
' ' +
pin->GetShownName() );
451 if( !pins.IsEmpty() )
458 if( !fpFilters.IsEmpty() )
491 const wxString& aTitle,
515 pins.push_back(
pin->GetNumber() +
' ' +
pin->GetShownName() );
517 if( !pins.IsEmpty() )
524 if( !fpFilters.IsEmpty() )
533 switch( aField->
GetId() )
543 _(
"Sheet filename can only be modified in Sheet Properties dialog." ) ) );
601 int fieldType = aField->
GetId();
621 "controlled globally from "
622 "Schematic Setup > General > Formatting" ) );
627 bool positioningModified =
false;
630 positioningModified =
true;
633 positioningModified =
true;
636 positioningModified =
true;
639 positioningModified =
true;
645 bool needUpdateHierNav =
false;
679 wxString ref = symbol->
GetRef( aSheetPath );
686 std::vector<SCH_SYMBOL*> otherUnits;
692 aCommit->
Modify( otherUnit, screen );
695 otherUnit->SetValueFieldText(
m_text );
697 otherUnit->SetFootprintFieldText(
m_text );
701 editFrame->
UpdateItem( otherUnit,
false,
true );
707 if( positioningModified && parent )
711 if( needUpdateHierNav )
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
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.
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
Class DIALOG_FIELD_PROPERTIES_BASE.
wxCheckBox * m_nameVisible
STD_BITMAP_BUTTON * m_TextValueSelectButton
BITMAP_BUTTON * m_separator5
BITMAP_BUTTON * m_separator2
BITMAP_BUTTON * m_hAlignLeft
BITMAP_BUTTON * m_hAlignCenter
BITMAP_BUTTON * m_vAlignCenter
BITMAP_BUTTON * m_vertical
BITMAP_BUTTON * m_vAlignBottom
BITMAP_BUTTON * m_horizontal
BITMAP_BUTTON * m_separator1
wxStyledTextCtrl * m_StyledTextCtrl
BITMAP_BUTTON * m_hAlignRight
wxCheckBox * m_cbAllowAutoPlace
COLOR_SWATCH * m_textColorSwatch
BITMAP_BUTTON * m_separator3
wxStaticText * m_textLabel
BITMAP_BUTTON * m_vAlignTop
wxCheckBox * m_commonToAllUnits
wxCheckBox * m_commonToAllBodyStyles
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)
void onScintillaCharAdded(wxStyledTextEvent &aEvent)
const SCH_FIELD * m_field
void UpdateField(SCH_COMMIT *aCommit, SCH_FIELD *aField, SCH_SHEET_PATH *aSheetPath)
DIALOG_SCH_FIELD_PROPERTIES(SCH_EDIT_FRAME *aParent, const wxString &aTitle, const SCH_FIELD *aField)
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...
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
void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
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
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)
A text control validator used for validating the text allowed in fields.
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.
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
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.
LIB_SYMBOL * GetParent() const
void GetPins(LIB_PINS &aList, int aUnit=0, int aBodyStyle=0) const
Return a list of pin object pointers from the draw item list.
wxArrayString GetFPFilters() const
bool m_IntersheetRefsShow
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.
SCH_SHEET_PATH & GetCurrentSheet() const
SCHEMATIC & Schematic() const
void UpdateLabelsHierarchyNavigator()
Update the hierarchy navigation tree labels.
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false, bool aUpdateRtree=false) override
Mark an item for refresh.
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)
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
bool IsNamedVariable() const
Named variables are fields whose names are variables like ${VAR}.
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 SetText(const wxString &aText) override
void OnScintillaCharAdded(SCINTILLA_TRICKS *aScintillaTricks, wxStyledTextEvent &aEvent) 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()
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
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.
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve a list of the SCH_PINs for the given sheet path.
void SetFootprintFieldText(const wxString &aFootprint)
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
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
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_VERTICAL
static constexpr EDA_ANGLE ANGLE_HORIZONTAL
void CollectOtherUnits(const wxString &aRef, int aUnit, const LIB_ID &aLibId, SCH_SHEET_PATH &aSheet, std::vector< SCH_SYMBOL * > *otherUnits)
@ FRAME_FOOTPRINT_CHOOSER
static 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)
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
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".
@ GR_TEXT_H_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_INDETERMINATE
Definition of file extensions used in Kicad.