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 ) );
82#elif defined ( __WXMSW__ )
179 pins.push_back(
pin->GetNumber() +
' ' +
pin->GetShownName() );
181 if( !pins.IsEmpty() )
188 if( !fpFilters.IsEmpty() )
212 const std::unique_ptr< LIB_SYMBOL >& lib_symbol = symbol->
GetLibSymbolRef();
216 for(
SCH_PIN*
pin : lib_symbol->GetPins( 0 , 1 ) )
217 pins.push_back(
pin->GetNumber() +
' ' +
pin->GetShownName() );
220 if( !pins.IsEmpty() )
225 wxArrayString fpFilters;
230 if( !fpFilters.IsEmpty() )
238 if( aField->
GetId() == FIELD_T::SHEET_FILENAME )
290 ||
m_fieldId == FIELD_T::SHEET_FILENAME )
305 bool showUnitSelector =
m_fieldId == FIELD_T::REFERENCE
319 GetSizer()->SetSizeHints(
this );
353 frame->KiwayMailIn( event );
355 if( frame->ShowModal( &fpid,
this ) )
399 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
409 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
419 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
503 if(
m_fieldId == FIELD_T::SHEET_FILENAME )
593 symbol->
SetUnit( unit_selection );
598 if(
m_fieldId == FIELD_T::INTERSHEET_REFS )
603 "controlled globally from "
604 "Schematic Setup > General > Formatting" ) );
609 bool positioningModified =
false;
612 positioningModified =
true;
615 positioningModified =
true;
618 positioningModified =
true;
621 positioningModified =
true;
627 bool needUpdateHierNav =
false;
661 wxString ref = symbol->
GetRef( aSheetPath );
668 std::vector<SCH_SYMBOL*> otherUnits;
674 aCommit->
Modify( otherUnit, screen );
676 editFrame->
UpdateItem( otherUnit,
false,
true );
682 if( positioningModified && parent )
686 if( needUpdateHierNav )
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
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)
Modify a given item in the model.
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
void updateText(SCH_FIELD *aField)
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 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.
EDA_ITEM * GetParent() const
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.
void SetFontSelection(KIFONT::FONT *aFont, bool aSilentMode=false)
Set the selection in wxChoice widget.
KIFONT::FONT * GetFontSelection(bool aBold, bool aItalic, bool aForDrawingSheet=false) const
bool HaveFontSelection() 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.
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, int aBodyStyle) 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
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.
GR_TEXT_V_ALIGN_T GetEffectiveVertJustify() const
VECTOR2I GetPosition() const override
bool IsGeneratedField() const
Generated fields are fields whose names are variables like ${VAR}.
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 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
Search the item hierarchy to find a SCHEMATIC.
void SetFieldsAutoplaced(AUTOPLACE_ALGO aAlgo)
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 SetRef(const SCH_SHEET_PATH *aSheet, const wxString &aReference)
Set the reference for the given sheet path for this symbol.
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.
A base class for LIB_SYMBOL and SCH_SYMBOL.
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
@ 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.
void CollectOtherUnits(const wxString &aRef, int aUnit, const LIB_ID &aLibId, SCH_SHEET_PATH &aSheet, std::vector< SCH_SYMBOL * > *otherUnits)
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.
@ GR_TEXT_H_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_INDETERMINATE
VECTOR2< int32_t > VECTOR2I
Definition of file extensions used in Kicad.