KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SCH_PROPERTIES_PANEL Class Reference

#include <sch_properties_panel.h>

Inheritance diagram for SCH_PROPERTIES_PANEL:
PROPERTIES_PANEL

Public Member Functions

 SCH_PROPERTIES_PANEL (wxWindow *aParent, SCH_BASE_FRAME *aFrame)
 
virtual ~SCH_PROPERTIES_PANEL ()
 
void UpdateData () override
 
void AfterCommit () override
 
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
 

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
 
bool getItemValue (EDA_ITEM *aItem, PROPERTY_BASE *aProperty, wxVariant &aValue) override
 Utility to fetch a property value and convert to wxVariant Precondition: aItem is known to have property aProperty.
 
PROPERTY_BASEgetPropertyFromEvent (const wxPropertyGridEvent &aEvent) const
 
void valueChanging (wxPropertyGridEvent &aEvent) override
 
void valueChanged (wxPropertyGridEvent &aEvent) override
 
bool handleSheetFilenameChange (SCH_EDIT_FRAME *aFrame, SCH_SHEET *aSheet, SCH_COMMIT &aChanges, const wxString &aNewFilename)
 
void OnLanguageChanged (wxCommandEvent &aEvent) override
 
const SELECTIONgetSelection (SELECTION &aFallbackSelection)
 Get the current selection from the selection tool.
 
EDA_ITEMgetFrontItem ()
 Get the front item of the current selection.
 
void onEditPinMap (wxCommandEvent &aEvent)
 Open the symbol properties dialog on its Pin Map page for the single selected symbol (issue #2282).
 
SCH_SYMBOLgetSinglePinMappedSymbol ()
 
void onCharHook (wxKeyEvent &aEvent)
 
void onShow (wxShowEvent &aEvent)
 
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.
 

Protected Attributes

SCH_BASE_FRAMEm_frame
 
PROPERTY_MANAGERm_propMgr
 
PG_UNIT_EDITORm_unitEditorInstance
 
PG_CHECKBOX_EDITORm_checkboxEditorInstance
 
PG_COLOR_EDITORm_colorEditorInstance
 
PG_FPID_EDITORm_fpEditorInstance
 
PG_URL_EDITORm_urlEditorInstance
 
wxPGChoices m_nets
 
wxButton * m_editPinMapButton
 
std::vector< PROPERTY_BASE * > m_displayed
 
wxPropertyGrid * m_grid
 
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)
 

Static Protected Attributes

static std::set< wxString > m_currentSymbolFieldNames
 
static std::set< wxString > m_currentSheetFieldNames
 
static std::set< wxString > m_currentPinMapPinNumbers
 Distinct pin numbers of the selected pin-mapped symbol, gating the per-pin table rows.
 

Detailed Description

Definition at line 43 of file sch_properties_panel.h.

Constructor & Destructor Documentation

◆ SCH_PROPERTIES_PANEL()

◆ ~SCH_PROPERTIES_PANEL()

SCH_PROPERTIES_PANEL::~SCH_PROPERTIES_PANEL ( )
virtual

Member Function Documentation

◆ AfterCommit()

void SCH_PROPERTIES_PANEL::AfterCommit ( )
overridevirtual

Reimplemented from PROPERTIES_PANEL.

Definition at line 754 of file sch_properties_panel.cpp.

References getSelection(), and rebuildProperties().

Referenced by onEditPinMap(), and valueChanged().

◆ createPGProperty()

wxPGProperty * SCH_PROPERTIES_PANEL::createPGProperty ( const PROPERTY_BASE * aProperty) const
overrideprotectedvirtual

◆ extractValueAndWritability()

bool PROPERTIES_PANEL::extractValueAndWritability ( const SELECTION & aSelection,
const wxString & aPropName,
wxVariant & aValue,
bool & aWritable,
wxPGChoices & aChoices )
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.

Parameters
aSelectionis a set of EDA_ITEMs to process
aPropertyis the property to look up
aValuewill be filled with the value common to the selection, or null if different
aWritablewill be set to whether or not the property can be written for the selection
Returns
true if the property is available for all the items in the selection

Definition at line 412 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().

◆ getFrontItem()

EDA_ITEM * SCH_PROPERTIES_PANEL::getFrontItem ( )
protected

Get the front item of the current selection.

If the selection is empty and we're in the symbol editor, returns the current symbol instead.

Returns
EDA_ITEM* pointer to the front item, or nullptr if no selection

Definition at line 735 of file sch_properties_panel.cpp.

References SELECTION::Empty(), SELECTION::Front(), and getSelection().

Referenced by getPropertyFromEvent(), and valueChanging().

◆ getItemValue()

bool SCH_PROPERTIES_PANEL::getItemValue ( EDA_ITEM * aItem,
PROPERTY_BASE * aProperty,
wxVariant & aValue )
overrideprotectedvirtual

Utility to fetch a property value and convert to wxVariant Precondition: aItem is known to have property aProperty.

Returns
true if conversion succeeded

Reimplemented from PROPERTIES_PANEL.

Definition at line 1176 of file sch_properties_panel.cpp.

References SCHEMATIC::CurrentSheet(), FRAME_SCH, SCHEMATIC::GetCurrentVariant(), PROPERTIES_PANEL::getItemValue(), SCH_ITEM::GetParentSymbol(), SCH_FIELD::GetText(), m_frame, PROPERTY_BASE::Name(), SCH_FIELD_T, SCH_ITEM::Schematic(), text, and EDA_ITEM::Type().

◆ getPropertyFromEvent()

PROPERTY_BASE * SCH_PROPERTIES_PANEL::getPropertyFromEvent ( const wxPropertyGridEvent & aEvent) const
protected

◆ GetPropertyGrid()

wxPropertyGrid * PROPERTIES_PANEL::GetPropertyGrid ( )
inlineinherited

Definition at line 46 of file properties_panel.h.

References m_grid.

◆ getSelection()

const SELECTION & SCH_PROPERTIES_PANEL::getSelection ( SELECTION & aFallbackSelection)
protected

Get the current selection from the selection tool.

If the selection is empty and we're in the symbol editor, returns the current symbol instead.

Parameters
aFallbackSelection[out] local SELECTION object for fallback symbol selection
Returns
const SELECTION& reference to the selection (either real selection or fallback)

Definition at line 714 of file sch_properties_panel.cpp.

References SELECTION::Add(), SELECTION::Clear(), FRAME_SCH_SYMBOL_EDITOR, SYMBOL_EDIT_FRAME::GetCurSymbol(), SCH_SELECTION_TOOL::GetSelection(), and m_frame.

Referenced by AfterCommit(), getFrontItem(), getSinglePinMappedSymbol(), UpdateData(), and valueChanged().

◆ getSinglePinMappedSymbol()

SCH_SYMBOL * SCH_PROPERTIES_PANEL::getSinglePinMappedSymbol ( )
protected
Returns
the single selected SCH_SYMBOL with an effective associated footprint, else nullptr.

Definition at line 921 of file sch_properties_panel.cpp.

References SELECTION::Front(), getSelection(), SCH_SYMBOL_T, SELECTION::Size(), symbolHasAssociatedFootprint(), and EDA_ITEM::Type().

Referenced by onEditPinMap(), and rebuildProperties().

◆ handleSheetFilenameChange()

◆ onCharHook()

void PROPERTIES_PANEL::onCharHook ( wxKeyEvent & aEvent)
protectedinherited

Definition at line 489 of file properties_panel.cpp.

References m_grid.

Referenced by PROPERTIES_PANEL().

◆ onEditPinMap()

void SCH_PROPERTIES_PANEL::onEditPinMap ( wxCommandEvent & aEvent)
protected

Open the symbol properties dialog on its Pin Map page for the single selected symbol (issue #2282).

Only enabled in the schematic editor.

Definition at line 935 of file sch_properties_panel.cpp.

References AfterCommit(), FRAME_SCH, getSinglePinMappedSymbol(), m_frame, SCH_EDIT_FRAME::OnModify(), DIALOG_SYMBOL_PROPERTIES::SelectPinMapPage(), DIALOG_SHIM::ShowQuasiModal(), and SYMBOL_PROPS_EDIT_OK.

Referenced by SCH_PROPERTIES_PANEL().

◆ OnLanguageChanged()

void SCH_PROPERTIES_PANEL::OnLanguageChanged ( wxCommandEvent & aEvent)
overrideprotectedvirtual

Reimplemented from PROPERTIES_PANEL.

Definition at line 1168 of file sch_properties_panel.cpp.

References PROPERTIES_PANEL::OnLanguageChanged().

◆ onShow()

void PROPERTIES_PANEL::onShow ( wxShowEvent & aEvent)
protectedinherited

Definition at line 480 of file properties_panel.cpp.

References UpdateData().

Referenced by PROPERTIES_PANEL().

◆ Properties()

const std::vector< PROPERTY_BASE * > & PROPERTIES_PANEL::Properties ( ) const
inlineinherited

Definition at line 56 of file properties_panel.h.

References m_displayed.

◆ PropertiesCount()

int PROPERTIES_PANEL::PropertiesCount ( ) const
inlineinherited

Definition at line 51 of file properties_panel.h.

References m_displayed.

◆ rebuildProperties()

◆ RecalculateSplitterPos()

void PROPERTIES_PANEL::RecalculateSplitterPos ( )
inherited

◆ SetSplitterProportion()

void PROPERTIES_PANEL::SetSplitterProportion ( float aProportion)
inherited

Definition at line 606 of file properties_panel.cpp.

References m_splitter_key_proportion, and RecalculateSplitterPos().

◆ SplitterProportion()

float PROPERTIES_PANEL::SplitterProportion ( ) const
inlineinherited

Definition at line 64 of file properties_panel.h.

References m_splitter_key_proportion.

◆ UpdateData()

void SCH_PROPERTIES_PANEL::UpdateData ( )
overridevirtual

Implements PROPERTIES_PANEL.

Definition at line 744 of file sch_properties_panel.cpp.

References getSelection(), and rebuildProperties().

Referenced by valueChanged().

◆ valueChanged()

◆ valueChanging()

void SCH_PROPERTIES_PANEL::valueChanging ( wxPropertyGridEvent & aEvent)
overrideprotectedvirtual

Member Data Documentation

◆ m_caption

wxStaticText* PROPERTIES_PANEL::m_caption
protectedinherited

◆ m_checkboxEditorInstance

PG_CHECKBOX_EDITOR* SCH_PROPERTIES_PANEL::m_checkboxEditorInstance
protected

Definition at line 99 of file sch_properties_panel.h.

Referenced by SCH_PROPERTIES_PANEL().

◆ m_colorEditorInstance

PG_COLOR_EDITOR* SCH_PROPERTIES_PANEL::m_colorEditorInstance
protected

Definition at line 100 of file sch_properties_panel.h.

Referenced by SCH_PROPERTIES_PANEL().

◆ m_currentPinMapPinNumbers

std::set< wxString > SCH_PROPERTIES_PANEL::m_currentPinMapPinNumbers
staticprotected

Distinct pin numbers of the selected pin-mapped symbol, gating the per-pin table rows.

Definition at line 108 of file sch_properties_panel.h.

Referenced by rebuildProperties().

◆ m_currentSheetFieldNames

std::set< wxString > SCH_PROPERTIES_PANEL::m_currentSheetFieldNames
staticprotected

Definition at line 105 of file sch_properties_panel.h.

Referenced by rebuildProperties().

◆ m_currentSymbolFieldNames

std::set< wxString > SCH_PROPERTIES_PANEL::m_currentSymbolFieldNames
staticprotected

Definition at line 104 of file sch_properties_panel.h.

Referenced by rebuildProperties().

◆ m_displayed

std::vector<PROPERTY_BASE*> PROPERTIES_PANEL::m_displayed
protectedinherited

◆ m_editPinMapButton

wxButton* SCH_PROPERTIES_PANEL::m_editPinMapButton
protected

Definition at line 111 of file sch_properties_panel.h.

Referenced by rebuildProperties(), and SCH_PROPERTIES_PANEL().

◆ m_fpEditorInstance

PG_FPID_EDITOR* SCH_PROPERTIES_PANEL::m_fpEditorInstance
protected

Definition at line 101 of file sch_properties_panel.h.

Referenced by SCH_PROPERTIES_PANEL(), and ~SCH_PROPERTIES_PANEL().

◆ m_frame

◆ m_grid

◆ m_nets

wxPGChoices SCH_PROPERTIES_PANEL::m_nets
protected

Definition at line 109 of file sch_properties_panel.h.

◆ m_propMgr

PROPERTY_MANAGER& SCH_PROPERTIES_PANEL::m_propMgr
protected

◆ m_splitter_key_proportion

float PROPERTIES_PANEL::m_splitter_key_proportion
protectedinherited

Proportion of the grid column splitter that is used for the key column (0.0 - 1.0)

Definition at line 113 of file properties_panel.h.

Referenced by PROPERTIES_PANEL(), RecalculateSplitterPos(), SetSplitterProportion(), and SplitterProportion().

◆ m_SuppressGridChangeEvents

◆ m_unitEditorInstance

PG_UNIT_EDITOR* SCH_PROPERTIES_PANEL::m_unitEditorInstance
protected

Definition at line 98 of file sch_properties_panel.h.

Referenced by SCH_PROPERTIES_PANEL(), and ~SCH_PROPERTIES_PANEL().

◆ m_urlEditorInstance

PG_URL_EDITOR* SCH_PROPERTIES_PANEL::m_urlEditorInstance
protected

Definition at line 102 of file sch_properties_panel.h.

Referenced by SCH_PROPERTIES_PANEL(), and ~SCH_PROPERTIES_PANEL().


The documentation for this class was generated from the following files: