|
KiCad PCB EDA Suite
|
#include <pl_properties_panel.h>
Public Member Functions | |
| PL_PROPERTIES_PANEL (PL_EDITOR_FRAME *aFrame) | |
| ~PL_PROPERTIES_PANEL () override | |
| void | UpdateData () override |
| virtual void | AfterCommit () |
| wxPropertyGrid * | GetPropertyGrid () |
| int | PropertiesCount () const |
| const std::vector< PROPERTY_BASE * > & | Properties () const |
| void | RecalculateSplitterPos () |
| void | SetSplitterProportion (float aProportion) |
| float | SplitterProportion () const |
Public Attributes | |
| int | m_SuppressGridChangeEvents |
| bool | m_ValueChangeVetoed |
Protected Member Functions | |
| void | rebuildProperties (const SELECTION &aSelection) override |
| Generates the property grid for a given selection of items. | |
| wxPGProperty * | createPGProperty (const PROPERTY_BASE *aProperty) const override |
| void | valueChanging (wxPropertyGridEvent &aEvent) override |
| void | valueChanged (wxPropertyGridEvent &aEvent) override |
| void | onCharHook (wxKeyEvent &aEvent) |
| void | onShow (wxShowEvent &aEvent) |
| virtual void | OnLanguageChanged (wxCommandEvent &aEvent) |
| virtual bool | isKeyEditable (const wxPGProperty *aPGProp) const |
| virtual bool | isKeyNameInUse (const wxString &aName) const |
| virtual void | onKeyRenamed (const wxString &aOldName, const wxString &aNewName) |
| virtual void | onLabelEditBegin (wxPropertyGridEvent &aEvent) |
| virtual void | onLabelEditEnding (wxPropertyGridEvent &aEvent) |
| virtual bool | buildContextMenu (wxMenu &aMenu, wxPGProperty *aPGProp) |
| virtual void | onNewItemLeftBlank (const wxString &aKey) |
| void | onRightClick (wxPropertyGridEvent &aEvent) |
| void | beginLabelEdit (const wxString &aKey, bool aStartBlank=false) |
| void | settlePendingLabelEdit () |
| Synchronously ends any in-progress label edit; potentially canceling a newly added row. | |
| 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 property aProperty. | |
| 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 the common value should be for the items in the selection. | |
| 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 | updateCategoryButtons () |
| Updates overlay button visibility/positions; called after rebuilds and on scroll. | |
| void | hideCategoryButtons () |
| Hides all overlay buttons (used when no selection or a rebuild is deferred). | |
| void | positionCategoryButtons () |
| wxPGProperty * | categoryForGroup (const wxString &aGroupKey) const |
| Find the caption row for the given untranslated group name, if present. | |
Protected Attributes | |
| wxStaticText * | m_caption |
| std::vector< PROPERTY_BASE * > | m_displayed |
| wxPropertyGrid * | m_grid |
| EDA_BASE_FRAME * | m_frame |
| float | m_splitter_key_proportion |
| Proportion of the grid column splitter that is used for the key column (0.0 - 1.0) | |
| wxTimer | m_deferredRebuildTimer |
| Not CallAfter(): on macOS the pending-event queue is drained from inside tool events, where a deferred rebuild would only re-defer itself forever. | |
| SELECTION | m_deferredSelection |
| wxString | m_editingOriginalLabel |
| wxString | m_contextMenuPropertyName |
| std::vector< CATEGORY_BUTTON > | m_categoryButtons |
| bool | m_resolvingPendingKey = false |
| True while settling a pending label edit synchronously (see settlePendingLabelEdit). | |
| wxString | m_pendingNewKey |
| Key of a freshly-added blank field/custom property awaiting a name from the user. | |
Private Member Functions | |
| void | resetDefaults () |
| void | refreshDrawing () |
Private Attributes | |
| PL_EDITOR_FRAME * | m_editor |
| PG_UNIT_EDITOR * | m_unitEditor |
| std::unique_ptr< PL_PAGE_PROPERTIES > | m_pageProperties |
| std::vector< std::unique_ptr< PL_ITEM_PROPERTIES > > | m_itemProperties |
| SELECTION | m_selection |
Definition at line 29 of file pl_properties_panel.h.
|
explicit |
Definition at line 134 of file pl_properties_panel.cpp.
References _, _HKI, PROPERTIES_PANEL::addCategoryButton(), PG_UNIT_EDITOR::BuildEditorName(), PG_CHECKBOX_EDITOR::EDITOR_NAME, PG_COLOR_EDITOR::EDITOR_NAME, PROPERTY_MANAGER::Instance(), m_editor, m_itemProperties, m_pageProperties, m_unitEditor, PROPERTIES_PANEL::PROPERTIES_PANEL(), PROPERTY_MANAGER::Rebuild(), resetDefaults(), small_refresh, and wxPGGlobalVars.
|
override |
Definition at line 176 of file pl_properties_panel.cpp.
References PROPERTIES_PANEL::m_deferredRebuildTimer, PROPERTIES_PANEL::m_deferredSelection, and m_unitEditor.
|
protectedinherited |
Registers an overlay button on a category caption row.
The button is shown when its category row is on-screen and selection-appropriate (the optional enable predicate is consulted; it is re-evaluated on every rebuild).
TODO it would be nice to remove this hack by getting upstream wxWidgets to support customizing/subclassing the property group widgets
| aGroupKey | is the untranslated group name (e.g. _HKI( "Fields" )). |
| aTooltip | is the tooltip text (translated by the caller). |
| aBitmap | is the icon shown on the button. |
| aAction | is invoked when the button is clicked. |
| aEnableFunc | optionally controls visibility (evaluated on each rebuild). |
| aForceCategory | optionally forces the category caption row to be emitted during rebuilds (only when aEnableFunc, if set, returns true). |
Definition at line 952 of file properties_panel.cpp.
References KiBitmapBundle(), m_categoryButtons, m_grid, and BITMAP_BUTTON::SetBitmap().
Referenced by PCB_PROPERTIES_PANEL::PCB_PROPERTIES_PANEL(), PL_PROPERTIES_PANEL::PL_PROPERTIES_PANEL(), and SCH_PROPERTIES_PANEL::SCH_PROPERTIES_PANEL().
|
inlinevirtualinherited |
Reimplemented in PCB_PROPERTIES_PANEL, and SCH_PROPERTIES_PANEL.
Definition at line 63 of file properties_panel.h.
|
protectedinherited |
Definition at line 787 of file properties_panel.cpp.
References m_grid.
Referenced by PCB_PROPERTIES_PANEL::addBlankCustomProperty(), SCH_PROPERTIES_PANEL::addBlankCustomProperty(), PCB_PROPERTIES_PANEL::addBlankField(), and SCH_PROPERTIES_PANEL::addBlankField().
|
inlineprotectedvirtualinherited |
Reimplemented in PCB_PROPERTIES_PANEL, and SCH_PROPERTIES_PANEL.
Definition at line 110 of file properties_panel.h.
Referenced by onRightClick().
|
protectedinherited |
Find the caption row for the given untranslated group name, if present.
Definition at line 982 of file properties_panel.cpp.
References m_grid.
Referenced by positionCategoryButtons().
|
overrideprotectedvirtual |
Implements PROPERTIES_PANEL.
Definition at line 223 of file pl_properties_panel.cpp.
References PROPERTY_BASE::HelpString(), m_editor, PROPERTY_BASE::Name(), and PGPropertyFactory().
|
protectedinherited |
Processes a selection and determines whether the given property should be available or not and what the common value should be for the items in the selection.
| aSelection | is a set of EDA_ITEMs to process |
| aPropName | is the property to look up |
| aValue | will be filled with the value common to the selection, or null if different |
| aWritable | will be set to whether or not the property can be written for the selection |
| aChoices |
Definition at line 558 of file properties_panel.cpp.
References PROPERTY_BASE::GetChoices(), getItemValue(), PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_MANAGER::IsAvailableFor(), PROPERTY_MANAGER::IsWriteableFor(), and TYPE_HASH.
Referenced by rebuildProperties().
|
protectedvirtualinherited |
Utility to fetch a property value and convert to wxVariant Precondition: aItem is known to have property aProperty.
Reimplemented in PCB_PROPERTIES_PANEL, and SCH_PROPERTIES_PANEL.
Definition at line 527 of file properties_panel.cpp.
References INSPECTABLE::Get(), KIGFX::VIEW_ITEM::GetClass(), PROPERTY_BASE::HasChoices(), and PROPERTY_BASE::Name().
Referenced by extractValueAndWritability(), PCB_PROPERTIES_PANEL::getItemValue(), and SCH_PROPERTIES_PANEL::getItemValue().
|
inlineinherited |
Definition at line 65 of file properties_panel.h.
References m_grid.
|
protectedinherited |
Hides all overlay buttons (used when no selection or a rebuild is deferred).
Definition at line 1002 of file properties_panel.cpp.
References m_categoryButtons.
Referenced by rebuildProperties().
|
inlineprotectedvirtualinherited |
Reimplemented in PCB_PROPERTIES_PANEL, and SCH_PROPERTIES_PANEL.
Definition at line 103 of file properties_panel.h.
Referenced by onLabelEditBegin(), and onLabelEditEnding().
|
inlineprotectedvirtualinherited |
Reimplemented in PCB_PROPERTIES_PANEL, and SCH_PROPERTIES_PANEL.
Definition at line 104 of file properties_panel.h.
Referenced by onLabelEditEnding(), and settlePendingLabelEdit().
|
protectedinherited |
Definition at line 809 of file properties_panel.cpp.
References m_grid, and m_ValueChangeVetoed.
Referenced by PROPERTIES_PANEL().
|
inlineprotectedvirtualinherited |
Reimplemented in PCB_PROPERTIES_PANEL, and SCH_PROPERTIES_PANEL.
Definition at line 105 of file properties_panel.h.
Referenced by onLabelEditEnding(), and settlePendingLabelEdit().
|
protectedvirtualinherited |
Definition at line 638 of file properties_panel.cpp.
References isKeyEditable(), and m_editingOriginalLabel.
Referenced by PROPERTIES_PANEL().
|
protectedvirtualinherited |
Definition at line 653 of file properties_panel.cpp.
References isKeyEditable(), isKeyNameInUse(), m_editingOriginalLabel, m_grid, m_pendingNewKey, m_resolvingPendingKey, onKeyRenamed(), and onNewItemLeftBlank().
Referenced by PROPERTIES_PANEL().
|
protectedvirtualinherited |
Reimplemented in SCH_PROPERTIES_PANEL.
Definition at line 222 of file properties_panel.cpp.
References m_displayed, m_grid, and UpdateData().
Referenced by SCH_PROPERTIES_PANEL::OnLanguageChanged(), PROPERTIES_PANEL(), and ~PROPERTIES_PANEL().
|
inlineprotectedvirtualinherited |
Reimplemented in PCB_PROPERTIES_PANEL, and SCH_PROPERTIES_PANEL.
Definition at line 111 of file properties_panel.h.
Referenced by onLabelEditEnding(), and settlePendingLabelEdit().
|
protectedinherited |
Definition at line 735 of file properties_panel.cpp.
References buildContextMenu(), and m_contextMenuPropertyName.
Referenced by PROPERTIES_PANEL().
|
protectedinherited |
Definition at line 629 of file properties_panel.cpp.
References UpdateData().
Referenced by PROPERTIES_PANEL().
|
protectedinherited |
Definition at line 1009 of file properties_panel.cpp.
References categoryForGroup(), m_categoryButtons, and m_grid.
Referenced by PROPERTIES_PANEL(), and updateCategoryButtons().
|
inlineinherited |
Definition at line 75 of file properties_panel.h.
References m_displayed.
|
inlineinherited |
Definition at line 70 of file properties_panel.h.
References m_displayed.
|
overrideprotectedvirtual |
Generates the property grid for a given selection of items.
| aSelection | is a set of items to show properties for. |
Reimplemented from PROPERTIES_PANEL.
Definition at line 215 of file pl_properties_panel.cpp.
References UpdateData().
|
inherited |
Definition at line 936 of file properties_panel.cpp.
References m_grid, and m_splitter_key_proportion.
Referenced by PROPERTIES_PANEL(), FOOTPRINT_WIZARD_PROPERTIES_PANEL::RebuildParameters(), rebuildProperties(), and SetSplitterProportion().
|
private |
Definition at line 310 of file pl_properties_panel.cpp.
References SELECTION_TOOL::AddItemToSel(), m_editor, m_itemProperties, EVENTS::SelectedEvent, EVENTS::UnselectedEvent, and UpdateData().
Referenced by resetDefaults(), and valueChanged().
|
private |
Definition at line 299 of file pl_properties_panel.cpp.
References DS_DATA_MODEL::GetTheInstance(), m_editor, model, refreshDrawing(), and TB_DEFAULT_TEXTSIZE.
Referenced by PL_PROPERTIES_PANEL().
|
inherited |
Definition at line 945 of file properties_panel.cpp.
References m_splitter_key_proportion, and RecalculateSplitterPos().
|
protectedinherited |
Synchronously ends any in-progress label edit; potentially canceling a newly added row.
Definition at line 762 of file properties_panel.cpp.
References isKeyNameInUse(), m_grid, m_pendingNewKey, m_resolvingPendingKey, onKeyRenamed(), and onNewItemLeftBlank().
Referenced by PCB_PROPERTIES_PANEL::addBlankCustomProperty(), SCH_PROPERTIES_PANEL::addBlankCustomProperty(), PCB_PROPERTIES_PANEL::addBlankField(), and SCH_PROPERTIES_PANEL::addBlankField().
|
inlineinherited |
Definition at line 83 of file properties_panel.h.
References m_splitter_key_proportion.
|
protectedinherited |
Updates overlay button visibility/positions; called after rebuilds and on scroll.
Definition at line 996 of file properties_panel.cpp.
References positionCategoryButtons().
Referenced by rebuildProperties().
|
overridevirtual |
Implements PROPERTIES_PANEL.
Definition at line 184 of file pl_properties_panel.cpp.
References PROPERTIES_PANEL::m_deferredRebuildTimer, PROPERTIES_PANEL::m_deferredSelection, m_editor, m_itemProperties, m_pageProperties, m_selection, and PROPERTIES_PANEL::rebuildProperties().
Referenced by rebuildProperties(), and refreshDrawing().
|
overrideprotectedvirtual |
Reimplemented from PROPERTIES_PANEL.
Definition at line 281 of file pl_properties_panel.cpp.
References PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), m_editor, m_selection, PROPERTIES_PANEL::m_SuppressGridChangeEvents, and refreshDrawing().
|
overrideprotectedvirtual |
Reimplemented from PROPERTIES_PANEL.
Definition at line 251 of file pl_properties_panel.cpp.
References PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), m_editor, m_selection, and PROPERTIES_PANEL::m_SuppressGridChangeEvents.
|
protectedinherited |
Definition at line 172 of file properties_panel.h.
Referenced by FOOTPRINT_WIZARD_PROPERTIES_PANEL::FOOTPRINT_WIZARD_PROPERTIES_PANEL(), PROPERTIES_PANEL(), and rebuildProperties().
|
protectedinherited |
Definition at line 207 of file properties_panel.h.
Referenced by addCategoryButton(), hideCategoryButtons(), positionCategoryButtons(), and rebuildProperties().
|
protectedinherited |
Definition at line 193 of file properties_panel.h.
Referenced by PCB_PROPERTIES_PANEL::onContextMenu(), SCH_PROPERTIES_PANEL::onContextMenu(), and onRightClick().
|
protectedinherited |
Not CallAfter(): on macOS the pending-event queue is drained from inside tool events, where a deferred rebuild would only re-defer itself forever.
Definition at line 188 of file properties_panel.h.
Referenced by PROPERTIES_PANEL(), rebuildProperties(), PL_PROPERTIES_PANEL::UpdateData(), and PL_PROPERTIES_PANEL::~PL_PROPERTIES_PANEL().
|
protectedinherited |
Definition at line 189 of file properties_panel.h.
Referenced by PROPERTIES_PANEL(), rebuildProperties(), PL_PROPERTIES_PANEL::UpdateData(), and PL_PROPERTIES_PANEL::~PL_PROPERTIES_PANEL().
|
protectedinherited |
Definition at line 179 of file properties_panel.h.
Referenced by OnLanguageChanged(), Properties(), PropertiesCount(), and rebuildProperties().
|
protectedinherited |
Definition at line 191 of file properties_panel.h.
Referenced by onLabelEditBegin(), and onLabelEditEnding().
|
private |
Definition at line 47 of file pl_properties_panel.h.
Referenced by createPGProperty(), PL_PROPERTIES_PANEL(), refreshDrawing(), resetDefaults(), UpdateData(), valueChanged(), and valueChanging().
|
protectedinherited |
Definition at line 181 of file properties_panel.h.
Referenced by PROPERTIES_PANEL(), rebuildProperties(), and ~PROPERTIES_PANEL().
|
protectedinherited |
Definition at line 180 of file properties_panel.h.
Referenced by addCategoryButton(), PCB_PROPERTIES_PANEL::applyConfirmedScale(), beginLabelEdit(), categoryForGroup(), GetPropertyGrid(), onCharHook(), onLabelEditEnding(), OnLanguageChanged(), positionCategoryButtons(), PROPERTIES_PANEL(), FOOTPRINT_WIZARD_PROPERTIES_PANEL::RebuildParameters(), rebuildProperties(), RecalculateSplitterPos(), and settlePendingLabelEdit().
|
private |
Definition at line 50 of file pl_properties_panel.h.
Referenced by PL_PROPERTIES_PANEL(), refreshDrawing(), and UpdateData().
|
private |
Definition at line 49 of file pl_properties_panel.h.
Referenced by PL_PROPERTIES_PANEL(), and UpdateData().
|
protectedinherited |
Key of a freshly-added blank field/custom property awaiting a name from the user.
Definition at line 213 of file properties_panel.h.
Referenced by PCB_PROPERTIES_PANEL::addBlankCustomProperty(), SCH_PROPERTIES_PANEL::addBlankCustomProperty(), PCB_PROPERTIES_PANEL::addBlankField(), SCH_PROPERTIES_PANEL::addBlankField(), onLabelEditEnding(), and settlePendingLabelEdit().
|
protectedinherited |
True while settling a pending label edit synchronously (see settlePendingLabelEdit).
Definition at line 210 of file properties_panel.h.
Referenced by onLabelEditEnding(), and settlePendingLabelEdit().
|
private |
Definition at line 51 of file pl_properties_panel.h.
Referenced by UpdateData(), valueChanged(), and valueChanging().
|
protectedinherited |
Proportion of the grid column splitter that is used for the key column (0.0 - 1.0)
Definition at line 184 of file properties_panel.h.
Referenced by PROPERTIES_PANEL(), RecalculateSplitterPos(), SetSplitterProportion(), and SplitterProportion().
|
inherited |
Definition at line 175 of file properties_panel.h.
Referenced by PROPERTIES_PANEL(), PCB_PROPERTIES_PANEL::valueChanged(), PL_PROPERTIES_PANEL::valueChanged(), SCH_PROPERTIES_PANEL::valueChanged(), FOOTPRINT_WIZARD_PROPERTIES_PANEL::valueChanging(), PCB_PROPERTIES_PANEL::valueChanging(), PL_PROPERTIES_PANEL::valueChanging(), and SCH_PROPERTIES_PANEL::valueChanging().
|
private |
Definition at line 48 of file pl_properties_panel.h.
Referenced by PL_PROPERTIES_PANEL(), and ~PL_PROPERTIES_PANEL().
|
inherited |
Definition at line 176 of file properties_panel.h.
Referenced by onCharHook(), PCB_PROPERTIES_PANEL::valueChanging(), and SCH_PROPERTIES_PANEL::valueChanging().