127 colorProp->SetBackgroundColor( bg );
140 wxCHECK_MSG( firstItem,
nullptr,
141 wxT(
"getPropertyFromEvent for a property with nothing selected!") );
144 aEvent.GetPropertyName() );
145 wxCHECK_MSG( property,
nullptr,
146 wxT(
"getPropertyFromEvent for a property not found on the selected item!" ) );
159 EDA_ITEM* frontItem = selection.Front();
166 wxVariant newValue = aEvent.GetPropertyValue();
168 if(
VALIDATOR_RESULT validationFailure = property->Validate( newValue.GetAny(), frontItem ) )
170 wxString errorMsg = wxString::Format( wxS(
"%s: %s" ), wxGetTranslation( property->Name() ),
171 validationFailure->get()->Format(
m_frame ) );
190 wxCHECK( property, );
192 wxVariant newValue = aEvent.GetPropertyValue();
198 for(
EDA_ITEM* edaItem : selection )
200 if( !edaItem->IsSCH_ITEM() )
208 changes.
Modify( item, screen, RECURSE_MODE::NO_RECURSE );
210 item->
Set( property, newValue );
213 symbol->SyncOtherUnits( symbol->Schematic()->CurrentSheet(), changes, property );
216 changes.
Push(
_(
"Edit Properties" ) );
COLOR4D GetColor(int aLayer) const
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
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.
KICAD_T Type() const
Returns the type of object.
EDA_ITEM * GetParent() const
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)
int m_SuppressGridChangeEvents
virtual void OnLanguageChanged(wxCommandEvent &aEvent)
virtual void rebuildProperties(const SELECTION &aSelection)
Generates the property grid for a given selection of items.
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
Execute the changes.
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
virtual ~SCH_PROPERTIES_PANEL()
@ LAYER_SCHEMATIC_BACKGROUND
wxPGProperty * PGPropertyFactory(const PROPERTY_BASE *aProperty, EDA_DRAW_FRAME *aFrame)
Customized abstract wxPGProperty class to handle coordinate/size units.
APIIMPORT wxPGGlobalVarsClass * wxPGGlobalVars
std::optional< std::unique_ptr< VALIDATION_ERROR > > VALIDATOR_RESULT
Null optional means validation succeeded.