20#ifndef PROPERTIES_PANEL_H
21#define PROPERTIES_PANEL_H
24#include <wx/propgrid/propgrid.h>
36class wxPropertyGridEvent;
90 virtual void valueChanging( wxPropertyGridEvent& aEvent ) { aEvent.Skip(); }
91 virtual void valueChanged( wxPropertyGridEvent& aEvent ) { aEvent.Skip(); }
93 void onShow( wxShowEvent& aEvent );
97 virtual bool isKeyEditable(
const wxPGProperty* aPGProp )
const {
return false; }
99 virtual void onKeyRenamed(
const wxString& aOldName,
const wxString& aNewName ) {}
108 void beginLabelEdit(
const wxString& aKey,
bool aStartBlank =
false );
130 wxVariant& aValue,
bool& aWritable, wxPGChoices& aChoices );
149 BITMAPS aBitmap, std::function<
void()> aAction,
150 std::function<
bool()> aEnableFunc =
nullptr,
151 bool aForceCategory =
false );
BITMAPS
A list of all bitmap identifiers.
The base frame for deriving all KiCad main window classes.
A base class for most all the KiCad significant classes used in schematics and boards.
wxString m_contextMenuPropertyName
virtual ~PROPERTIES_PANEL()
float m_splitter_key_proportion
Proportion of the grid column splitter that is used for the key column (0.0 - 1.0)
virtual bool isKeyEditable(const wxPGProperty *aPGProp) const
virtual void onKeyRenamed(const wxString &aOldName, const wxString &aNewName)
PROPERTIES_PANEL(wxWindow *aParent, EDA_BASE_FRAME *aFrame)
virtual void valueChanging(wxPropertyGridEvent &aEvent)
float SplitterProportion() const
wxString m_editingOriginalLabel
const std::vector< PROPERTY_BASE * > & Properties() const
virtual void onLabelEditEnding(wxPropertyGridEvent &aEvent)
void RecalculateSplitterPos()
virtual bool buildContextMenu(wxMenu &aMenu, wxPGProperty *aPGProp)
void beginLabelEdit(const wxString &aKey, bool aStartBlank=false)
wxPropertyGrid * GetPropertyGrid()
virtual bool isKeyNameInUse(const wxString &aName) const
bool m_resolvingPendingKey
True while settling a pending label edit synchronously (see settlePendingLabelEdit).
void SetSplitterProportion(float aProportion)
void onRightClick(wxPropertyGridEvent &aEvent)
int PropertiesCount() const
void settlePendingLabelEdit()
Synchronously ends any in-progress label edit; potentially canceling a newly added row.
std::vector< PROPERTY_BASE * > m_displayed
int m_SuppressGridChangeEvents
virtual void AfterCommit()
virtual void OnLanguageChanged(wxCommandEvent &aEvent)
virtual void UpdateData()=0
friend class PROPERTIES_PANEL_GRID
virtual void onLabelEditBegin(wxPropertyGridEvent &aEvent)
virtual void valueChanged(wxPropertyGridEvent &aEvent)
virtual void onNewItemLeftBlank(const wxString &aKey)
bool extractValueAndWritability(const SELECTION &aSelection, const wxString &aPropName, wxVariant &aValue, bool &aWritable, wxPGChoices &aChoices)
Processes a selection and determines whether the given property should be available or not and what t...
virtual bool getItemValue(EDA_ITEM *aItem, PROPERTY_BASE *aProperty, wxVariant &aValue)
Utility to fetch a property value and convert to wxVariant Precondition: aItem is known to have prope...
wxPGProperty * categoryForGroup(const wxString &aGroupKey) const
virtual void rebuildProperties(const SELECTION &aSelection)
Generates the property grid for a given selection of items.
void onCharHook(wxKeyEvent &aEvent)
virtual wxPGProperty * createPGProperty(const PROPERTY_BASE *aProperty) const =0
void addCategoryButton(const wxString &aGroupKey, const wxString &aTooltip, BITMAPS aBitmap, std::function< void()> aAction, std::function< bool()> aEnableFunc=nullptr, bool aForceCategory=false)
Registers an overlay button on a category caption row.
void onShow(wxShowEvent &aEvent)
void hideCategoryButtons()
Hides all overlay buttons (used when no selection or a rebuild is deferred).
std::vector< CATEGORY_BUTTON > m_categoryButtons
void positionCategoryButtons()
Find the caption row for the given untranslated group name, if present.
void updateCategoryButtons()
Updates overlay button visibility/positions; called after rebuilds and on scroll.
wxString m_pendingNewKey
Key of a freshly-added blank field/custom property awaiting a name from the user.
SUPPRESS_GRID_CHANGED_EVENTS(PROPERTIES_PANEL *aPanel)
~SUPPRESS_GRID_CHANGED_EVENTS()
PROPERTIES_PANEL * m_panel
PROPERTIES_PANEL_CONTEXT_MENU_IDS
@ ID_CTX_REMOVE_CUSTOM_PROPERTY
@ ID_CTX_ADD_CUSTOM_PROPERTY