128 colorProp->SetBackgroundColor( bg );
141 wxCHECK_MSG( firstItem,
nullptr,
142 wxT(
"getPropertyFromEvent for a property with nothing selected!") );
145 aEvent.GetPropertyName() );
146 wxCHECK_MSG( property,
nullptr,
147 wxT(
"getPropertyFromEvent for a property not found on the selected item!" ) );
160 wxCHECK( property, );
163 wxVariant newValue = aEvent.GetPropertyValue();
165 if(
VALIDATOR_RESULT validationFailure = property->Validate( newValue.GetAny(), item ) )
167 wxString errorMsg = wxString::Format( wxS(
"%s: %s" ), wxGetTranslation( property->Name() ),
168 validationFailure->get()->Format(
m_frame ) );
184 wxCHECK( property, );
186 wxVariant newValue = aEvent.GetPropertyValue();
192 for(
EDA_ITEM* edaItem : selection )
195 changes.
Modify( item, screen );
196 item->
Set( property, newValue );
199 changes.
Push(
_(
"Edit Properties" ) );
223 std::vector<std::string> fontNames;
224 Fontconfig()->ListFonts( fontNames, std::string(
Pgm().GetLanguageTag().utf8_str() ) );
226 fonts.Add(
_(
"Default Font" ), -1 );
229 for(
int ii = 0; ii < (int) fontNames.size(); ++ii )
230 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.
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,...
bool Set(PROPERTY_BASE *aProperty, wxAny &aValue, bool aNotify=true)
A color representation with 4 components: red, green, blue, alpha.
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.
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()
FONTCONFIG * Fontconfig()
@ 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.