Browse Source

Properties Panel: Plain-language descriptive noun function of EDA_ITEM

7.0
Roberto Fernandez Bautista 3 years ago
committed by Jon Evans
parent
commit
bfdb39f418
  1. 9
      common/eda_item.cpp
  2. 4
      common/widgets/properties_panel.cpp
  3. 6
      include/eda_item.h

9
common/eda_item.cpp

@ -303,6 +303,15 @@ std::ostream& EDA_ITEM::NestedSpace( int nestLevel, std::ostream& os )
#endif
wxString EDA_ITEM::GetTypeDesc()
{
//@see EDA_ITEM_DESC for definition of ENUM_MAP<KICAD_T>
wxString typeDescr = ENUM_MAP<KICAD_T>::Instance().ToString( Type() );
return wxGetTranslation( typeDescr );
}
static struct EDA_ITEM_DESC
{
EDA_ITEM_DESC()

4
common/widgets/properties_panel.cpp

@ -90,9 +90,7 @@ void PROPERTIES_PANEL::update( const SELECTION& aSelection )
}
else
{
// TODO: Plain-language descriptive noun function in EDA_ITEM classes
// TODO: Need to override this in PCB editor vs. schematic
m_caption->SetLabel( aSelection.Front()->GetClass() );
m_caption->SetLabel( aSelection.Front()->GetTypeDesc() );
}
PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance();

6
include/eda_item.h

@ -350,6 +350,12 @@ public:
*/
virtual wxString GetClass() const = 0;
/**
* Return a translated description of the type for this EDA_ITEM for display in user facing
* messages.
*/
wxString GetTypeDesc();
/**
* Return the text to display to be used in the selection clarification context menu
* when multiple items are found at the current cursor position.

Loading…
Cancel
Save