KiCad PCB EDA Suite
|
#include <properties_panel.h>
Public Member Functions | |
PROPERTIES_PANEL (wxWindow *aParent, EDA_BASE_FRAME *aFrame) | |
virtual | ~PROPERTIES_PANEL () |
virtual void | UpdateData ()=0 |
virtual void | AfterCommit () |
wxPropertyGrid * | GetPropertyGrid () |
int | PropertiesCount () const |
const std::vector< PROPERTY_BASE * > & | Properties () const |
void | RecalculateSplitterPos () |
void | SetSplitterProportion (float aProportion) |
float | SplitterProportion () const |
void | OnLanguageChanged () |
Protected Member Functions | |
virtual void | rebuildProperties (const SELECTION &aSelection) |
Generates the property grid for a given selection of items. More... | |
virtual void | updatePropertyValues (const SELECTION &aSelection) |
Updates the values shown in the property grid for the current selection. More... | |
virtual wxPGProperty * | createPGProperty (const PROPERTY_BASE *aProperty) const =0 |
virtual void | valueChanging (wxPropertyGridEvent &aEvent) |
virtual void | valueChanged (wxPropertyGridEvent &aEvent) |
void | onCharHook (wxKeyEvent &aEvent) |
void | onShow (wxShowEvent &aEvent) |
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. More... | |
bool | extractValueAndWritability (const SELECTION &aSelection, PROPERTY_BASE *aProperty, wxVariant &aValue, bool &aWritable) |
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. More... | |
Protected Attributes | |
std::vector< PROPERTY_BASE * > | m_displayed |
wxPropertyGrid * | m_grid |
EDA_BASE_FRAME * | m_frame |
wxStaticText * | m_caption |
float | m_splitter_key_proportion |
Proportion of the grid column splitter that is used for the key column (0.0 - 1.0) More... | |
std::unique_ptr< SELECTION > | m_cachedSelection |
A copy of the most recent selection passed to rebuildProperties. More... | |
Definition at line 39 of file properties_panel.h.
PROPERTIES_PANEL::PROPERTIES_PANEL | ( | wxWindow * | aParent, |
EDA_BASE_FRAME * | aFrame | ||
) |
Definition at line 39 of file properties_panel.cpp.
References _, KIUI::GetDockedPaneFont(), m_cachedSelection, m_caption, m_grid, m_splitter_key_proportion, onCharHook(), onShow(), RecalculateSplitterPos(), valueChanged(), valueChanging(), and wxPGGlobalVars.
|
inlinevirtual |
Definition at line 44 of file properties_panel.h.
|
inlinevirtual |
|
protectedpure virtual |
Implemented in PCB_PROPERTIES_PANEL.
Referenced by rebuildProperties().
|
protected |
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 |
aProperty | 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 |
Definition at line 305 of file properties_panel.cpp.
References getItemValue(), EDA_BASE_FRAME::GetOriginTransforms(), UNITS_PROVIDER::GetUserUnits(), PROPERTY_MANAGER::Instance(), PROPERTY_MANAGER::IsAvailableFor(), m_frame, PROPERTY_MANAGER::SetTransforms(), PROPERTY_MANAGER::SetUnits(), TYPE_HASH, and PROPERTY_BASE::Writeable().
Referenced by rebuildProperties(), and PCB_PROPERTIES_PANEL::updatePropertyValues().
|
protected |
Utility to fetch a property value and convert to wxVariant Precondition: aItem is known to have property aProperty.
Definition at line 280 of file properties_panel.cpp.
References INSPECTABLE::Get(), and PROPERTY_BASE::HasChoices().
Referenced by extractValueAndWritability().
|
inline |
|
protected |
Definition at line 360 of file properties_panel.cpp.
References m_grid.
Referenced by PROPERTIES_PANEL().
void PROPERTIES_PANEL::OnLanguageChanged | ( | ) |
Definition at line 126 of file properties_panel.cpp.
References UpdateData().
Referenced by PCB_EDIT_FRAME::ShowChangedLanguage().
|
protected |
Definition at line 353 of file properties_panel.cpp.
References UpdateData().
Referenced by PROPERTIES_PANEL().
|
inline |
Definition at line 62 of file properties_panel.h.
References m_displayed.
|
inline |
Definition at line 57 of file properties_panel.h.
References m_displayed.
|
protectedvirtual |
Generates the property grid for a given selection of items.
Calling this will remove any existing properties shown, causing visible flicker on some platforms and canceling any pending edits. Make sure to only call this when the group of selected items has actually changed.
aSelection | is a set of items to show properties for. |
Definition at line 132 of file properties_panel.cpp.
References _, copy, createPGProperty(), SELECTION::Empty(), extractValueAndWritability(), Format(), SELECTION::Front(), PROPERTY_MANAGER::GetDisplayOrder(), EDA_ITEM::GetFriendlyName(), PROPERTY_MANAGER::GetGroupDisplayOrder(), EDA_BASE_FRAME::GetOriginTransforms(), PROPERTY_MANAGER::GetProperties(), UNITS_PROVIDER::GetUserUnits(), group, PROPERTY_MANAGER::Instance(), PROPERTY_MANAGER::IsAvailableFor(), m_cachedSelection, m_caption, m_displayed, m_frame, m_grid, RecalculateSplitterPos(), PROPERTY_MANAGER::SetTransforms(), PROPERTY_MANAGER::SetUnits(), SELECTION::Size(), TYPE_HASH, and updatePropertyValues().
Referenced by PCB_PROPERTIES_PANEL::UpdateData().
void PROPERTIES_PANEL::RecalculateSplitterPos | ( | ) |
Definition at line 390 of file properties_panel.cpp.
References m_grid, and m_splitter_key_proportion.
Referenced by PROPERTIES_PANEL(), rebuildProperties(), and SetSplitterProportion().
void PROPERTIES_PANEL::SetSplitterProportion | ( | float | aProportion | ) |
Definition at line 399 of file properties_panel.cpp.
References m_splitter_key_proportion, and RecalculateSplitterPos().
|
inline |
Definition at line 70 of file properties_panel.h.
References m_splitter_key_proportion.
Referenced by PCB_EDIT_FRAME::SaveSettings().
|
pure virtual |
Implemented in PCB_PROPERTIES_PANEL.
Referenced by OnLanguageChanged(), onShow(), and PCB_BASE_EDIT_FRAME::UpdateProperties().
|
inlineprotectedvirtual |
Updates the values shown in the property grid for the current selection.
Does not add or remove properties from the display (
aSelection | is the set of selected items. |
Reimplemented in PCB_PROPERTIES_PANEL.
Definition at line 94 of file properties_panel.h.
Referenced by rebuildProperties().
|
inlineprotectedvirtual |
Reimplemented in PCB_PROPERTIES_PANEL.
Definition at line 100 of file properties_panel.h.
Referenced by PROPERTIES_PANEL().
|
inlineprotectedvirtual |
|
protected |
A copy of the most recent selection passed to rebuildProperties.
Definition at line 133 of file properties_panel.h.
Referenced by PROPERTIES_PANEL(), and rebuildProperties().
|
protected |
Definition at line 127 of file properties_panel.h.
Referenced by PROPERTIES_PANEL(), and rebuildProperties().
|
protected |
Definition at line 124 of file properties_panel.h.
Referenced by Properties(), PropertiesCount(), and rebuildProperties().
|
protected |
Definition at line 126 of file properties_panel.h.
Referenced by extractValueAndWritability(), and rebuildProperties().
|
protected |
Definition at line 125 of file properties_panel.h.
Referenced by GetPropertyGrid(), onCharHook(), PROPERTIES_PANEL(), rebuildProperties(), RecalculateSplitterPos(), and PCB_PROPERTIES_PANEL::updatePropertyValues().
|
protected |
Proportion of the grid column splitter that is used for the key column (0.0 - 1.0)
Definition at line 130 of file properties_panel.h.
Referenced by PROPERTIES_PANEL(), RecalculateSplitterPos(), SetSplitterProportion(), and SplitterProportion().