130 colorProp->SetBackgroundColor( bg );
143 wxCHECK_MSG( firstItem,
nullptr,
144 wxT(
"getPropertyFromEvent for a property with nothing selected!") );
147 aEvent.GetPropertyName() );
148 wxCHECK_MSG( property,
nullptr,
149 wxT(
"getPropertyFromEvent for a property not found on the selected item!" ) );
162 wxCHECK( property, );
165 wxVariant newValue = aEvent.GetPropertyValue();
167 if(
VALIDATOR_RESULT validationFailure = property->Validate( newValue.GetAny(), item ) )
169 wxString errorMsg = wxString::Format( wxS(
"%s: %s" ), wxGetTranslation( property->Name() ),
170 validationFailure->get()->Format(
m_frame ) );
186 wxCHECK( property, );
188 wxVariant newValue = aEvent.GetPropertyValue();
194 for(
EDA_ITEM* edaItem : selection )
197 changes.
Modify( item, screen );
198 item->
Set( property, newValue );
201 symbol->SyncOtherUnits( symbol->Schematic()->CurrentSheet(), changes, property );
204 changes.
Push(
_(
"Edit Properties" ) );
226 const std::vector<wxString>* fontFiles =
nullptr;
248 std::vector<std::string> fontNames;
249 Fontconfig()->ListFonts( fontNames, std::string(
Pgm().GetLanguageTag().utf8_str() ),
252 fonts.Add(
_(
"Default Font" ), -1 );
255 for(
int ii = 0; ii < (int) fontNames.size(); ++ii )
256 fonts.Add( wxString( fontNames[ii] ), ii );
COLOR4D GetColor(int aLayer) const
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
FRAME_T GetFrameType() const
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, WX_INFOBAR::MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
A base class for most all the KiCad significant classes used in schematics and boards.
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
const std::vector< wxString > * UpdateFontFiles()
Helper function to get a list of fonts for fontconfig to add to the library.
const std::vector< wxString > * GetFontFiles() const
If we just need the cached version of the font files, we can use this function which is const and wil...
bool Set(PROPERTY_BASE *aProperty, wxAny &aValue, bool aNotify=true)
A color representation with 4 components: red, green, blue, alpha.
EMBEDDED_FILES * GetEmbeddedFiles() override
static const wxString EDITOR_NAME
static const wxString EDITOR_NAME
void UpdateFrame(EDA_DRAW_FRAME *aFrame)
When restarting an editor, the instance of PG_UNIT_EDITOR may be the same but the referenced frame is...
static wxString BuildEditorName(EDA_DRAW_FRAME *aFrame)
virtual void OnLanguageChanged(wxCommandEvent &aEvent)
virtual void rebuildProperties(const SELECTION &aSelection)
Generates the property grid for a given selection of items.
virtual void SetChoices(const wxPGChoices &aChoices)
Set the possible values for for the property.
Provide class metadata.Helper macro to map type hashes to names.
void Rebuild()
Rebuild the list of all registered properties.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
EMBEDDED_FILES * GetEmbeddedFiles() override
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Returns a pointer to the active color theme settings.
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
Base class for any item which can be embedded within the SCHEMATIC container class,...
wxPGProperty * createPGProperty(const PROPERTY_BASE *aProperty) const override
PROPERTY_MANAGER & m_propMgr
PG_CHECKBOX_EDITOR * m_checkboxEditorInstance
void UpdateData() override
void valueChanging(wxPropertyGridEvent &aEvent) override
PG_UNIT_EDITOR * m_unitEditorInstance
void AfterCommit() override
void valueChanged(wxPropertyGridEvent &aEvent) override
SCH_PROPERTIES_PANEL(wxWindow *aParent, SCH_BASE_FRAME *aFrame)
PG_COLOR_EDITOR * m_colorEditorInstance
PROPERTY_BASE * getPropertyFromEvent(const wxPropertyGridEvent &aEvent) const
void OnLanguageChanged(wxCommandEvent &aEvent) override
Regenerates caches of font list property.
virtual ~SCH_PROPERTIES_PANEL()
SCHEMATIC * Schematic() const
The symbol library editor main window.
LIB_SYMBOL * GetCurSymbol() const
Return the current symbol being edited or NULL if none selected.
Symbol library viewer main window.
LIB_SYMBOL * GetSelectedSymbol() const
FONTCONFIG * Fontconfig()
@ FRAME_SCH_SYMBOL_EDITOR
@ LAYER_SCHEMATIC_BACKGROUND
wxPGProperty * PGPropertyFactory(const PROPERTY_BASE *aProperty, EDA_DRAW_FRAME *aFrame)
Customized abstract wxPGProperty class to handle coordinate/size units.
PGM_BASE & Pgm()
The global Program "get" accessor.
APIIMPORT wxPGGlobalVarsClass * wxPGGlobalVars
std::optional< std::unique_ptr< VALIDATION_ERROR > > VALIDATOR_RESULT
Null optional means validation succeeded.