54 m_posX( aParent, m_xPosLabel, m_xPosCtrl, m_xPosUnits, true ),
55 m_posY( aParent, m_yPosLabel, m_yPosCtrl, m_yPosUnits, true ),
56 m_textSize( aParent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, true ),
59 m_scintillaTricks( nullptr ),
72 [
this]( wxKeyEvent& aEvent )
74 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
168 pins.push_back(
pin->GetNumber() +
' ' +
pin->GetShownName() );
170 if( !pins.IsEmpty() )
177 if( !fpFilters.IsEmpty() )
203 const std::unique_ptr< LIB_SYMBOL >& lib_symbol = symbol->
GetLibSymbolRef();
207 for(
SCH_PIN*
pin : lib_symbol->GetPins( 0 , 1 ) )
208 pins.push_back(
pin->GetNumber() +
' ' +
pin->GetShownName() );
211 if( !pins.IsEmpty() )
216 wxArrayString fpFilters;
221 if( !fpFilters.IsEmpty() )
230 switch( aField->
GetId() )
240 _(
"Sheet filename can only be modified in Sheet Properties dialog." ) ) );
329 GetSizer()->SetSizeHints(
this );
363 frame->KiwayMailIn( event );
365 if( frame->ShowModal( &fpid,
this ) )
409 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
419 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
429 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
585 int fieldType = aField->
GetId();
603 symbol->
SetUnit( unit_selection );
613 "controlled globally from "
614 "Schematic Setup > General > Formatting" ) );
619 bool positioningModified =
false;
622 positioningModified =
true;
625 positioningModified =
true;
628 positioningModified =
true;
631 positioningModified =
true;
637 bool needUpdateHierNav =
false;
671 wxString ref = symbol->
GetRef( aSheetPath );
678 std::vector<SCH_SYMBOL*> otherUnits;
684 aCommit->
Modify( otherUnit, screen );
687 otherUnit->SetValueFieldText(
m_text );
689 otherUnit->SetFootprintFieldText(
m_text );
693 editFrame->
UpdateItem( otherUnit,
false,
true );
699 if( positioningModified && parent )
703 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
wxStaticText * m_unitLabel
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
const SCH_FIELD * m_field
void onOrientButton(wxCommandEvent &aEvent)
void OnTextValueSelectButtonClick(wxCommandEvent &aEvent) override
Handle the select button next to the text value field.
DIALOG_FIELD_PROPERTIES(SCH_BASE_FRAME *aParent, const wxString &aTitle, const SCH_FIELD *aField)
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
void UpdateField(SCH_FIELD *aField)
void onScintillaCharAdded(wxStyledTextEvent &aEvent)
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
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)
void SetBold(bool aBold)
Set the text to be bold - this will also update the font if needed.
static GR_TEXT_V_ALIGN_T MapVertJustify(int aVertJustify)
GR_TEXT_V_ALIGN_T GetVertJustify() const
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
void SetItalic(bool aItalic)
Set the text to be italic - this will also update the font if needed.
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.
KIFONT::FONT * GetFontSelection(bool aBold, bool aItalic, bool aForDrawingSheet=false) const
bool HaveFontSelection() const
void SetFontSelection(KIFONT::FONT *aFont)
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.
A logical library item identifier and consists of various portions much like a URI.
Define a library symbol object.
std::vector< SCH_PIN * > GetPins(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 Hierarchy() const override
Return the full schematic flattened hierarchical sheet list.
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.
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,...
const SYMBOL * GetParentSymbol() const
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
void ClearFieldsAutoplaced()
virtual void SetUnit(int aUnit)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
wxString GetUnitDisplayName(int aUnit) const
Return the display name for a given unit aUnit.
wxString SubReference(int aUnit, bool aAddSeparator=true) const
bool IsAnnotated(const SCH_SHEET_PATH *aSheet) const
Check if the symbol has a valid annotation (reference) for the given sheet path.
void SetValueFieldText(const wxString &aValue)
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)
const LIB_ID & GetLibId() const override
int GetUnitCount() const override
Return the number of units per package of the symbol.
void SetUnitSelection(const SCH_SHEET_PATH *aSheet, int aUnitSelection)
Set the selected unit of this symbol on one sheet.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
bool HasUnitDisplayName(int aUnit) const
Return true if the given unit aUnit has a display name set.
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
virtual bool IsMulti() const =0
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 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
KICOMMON_API wxFont GetInfoFont(wxWindow *aWindow)
KICOMMON_API 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
VECTOR2< int32_t > VECTOR2I
Definition of file extensions used in Kicad.