Browse Source

Added default properties panel for footprint and symbol

When nothing is selected in the footprint and symbol editors, we show
the properties of the footprint and symbol, allowing easy access to
their properties
master
Seth Hillbrand 5 days ago
parent
commit
18a62544e9
  1. 101
      eeschema/lib_symbol.cpp
  2. 147
      eeschema/lib_symbol.h
  3. 1
      eeschema/symbol_editor/symbol_edit_frame.cpp
  4. 55
      eeschema/widgets/sch_properties_panel.cpp
  5. 17
      eeschema/widgets/sch_properties_panel.h
  6. 23
      pcbnew/board_item.cpp
  7. 15
      pcbnew/footprint.cpp
  8. 1
      pcbnew/footprint_edit_frame.cpp
  9. 53
      pcbnew/widgets/pcb_properties_panel.cpp
  10. 18
      pcbnew/widgets/pcb_properties_panel.h

101
eeschema/lib_symbol.cpp

@ -2076,3 +2076,104 @@ std::optional<const std::set<wxString>> LIB_SYMBOL::GetJumperPinGroup( const wxS
return std::nullopt;
}
static struct LIB_SYMBOL_DESC
{
LIB_SYMBOL_DESC()
{
PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance();
REGISTER_TYPE( LIB_SYMBOL );
propMgr.InheritsAfter( TYPE_HASH( LIB_SYMBOL ), TYPE_HASH( SYMBOL ) );
const wxString groupFields = _HKI( "Fields" );
propMgr.AddProperty( new PROPERTY<LIB_SYMBOL, wxString>( _HKI( "Reference" ),
&LIB_SYMBOL::SetRefProp, &LIB_SYMBOL::GetRefProp ),
groupFields );
propMgr.AddProperty( new PROPERTY<LIB_SYMBOL, wxString>( _HKI( "Value" ),
&LIB_SYMBOL::SetValueProp, &LIB_SYMBOL::GetValueProp ),
groupFields );
propMgr.AddProperty( new PROPERTY<LIB_SYMBOL, wxString>( _HKI( "Footprint" ),
&LIB_SYMBOL::SetFootprintProp, &LIB_SYMBOL::GetFootprintProp ),
groupFields );
propMgr.AddProperty( new PROPERTY<LIB_SYMBOL, wxString>( _HKI( "Datasheet" ),
&LIB_SYMBOL::SetDatasheetProp, &LIB_SYMBOL::GetDatasheetProp ),
groupFields );
propMgr.AddProperty( new PROPERTY<LIB_SYMBOL, wxString>( _HKI( "Keywords" ),
&LIB_SYMBOL::SetKeywordsProp, &LIB_SYMBOL::GetKeywordsProp ),
groupFields );
const wxString groupSymbolDef = _HKI( "Symbol Definition" );
propMgr.AddProperty( new PROPERTY<LIB_SYMBOL, bool>( _HKI( "Define as Power Symbol" ),
&LIB_SYMBOL::SetPowerSymbolProp, &LIB_SYMBOL::GetPowerSymbolProp ),
groupSymbolDef );
propMgr.AddProperty( new PROPERTY<LIB_SYMBOL, bool>( _HKI( "Define as Local Power Symbol" ),
&LIB_SYMBOL::SetLocalPowerSymbolProp, &LIB_SYMBOL::GetLocalPowerSymbolProp ),
groupSymbolDef );
const wxString groupPinDisplay = _HKI( "Pin Display" );
propMgr.AddProperty( new PROPERTY<SYMBOL, bool>( _HKI( "Show Pin Number" ),
&SYMBOL::SetShowPinNumbers, &SYMBOL::GetShowPinNumbers ),
groupPinDisplay );
propMgr.AddProperty( new PROPERTY<SYMBOL, bool>( _HKI( "Show Pin Name" ),
&SYMBOL::SetShowPinNames, &SYMBOL::GetShowPinNames ),
groupPinDisplay );
propMgr.AddProperty( new PROPERTY<LIB_SYMBOL, bool>( _HKI( "Place Pin Names Inside" ),
&LIB_SYMBOL::SetPinNamesInsideProp, &LIB_SYMBOL::GetPinNamesInsideProp ),
groupPinDisplay );
propMgr.AddProperty( new PROPERTY<SYMBOL, int>( _HKI( "Pin Name Position Offset" ),
&SYMBOL::SetPinNameOffset, &SYMBOL::GetPinNameOffset,
PROPERTY_DISPLAY::PT_SIZE ),
groupPinDisplay );
const wxString groupAttributes = _HKI( "Attributes" );
propMgr.AddProperty( new PROPERTY<LIB_SYMBOL, bool>( _HKI( "Exclude from Simulation" ),
&LIB_SYMBOL::SetExcludedFromSimProp, &LIB_SYMBOL::GetExcludedFromSimProp ),
groupAttributes );
propMgr.AddProperty( new PROPERTY<SYMBOL, bool>( _HKI( "Exclude from Board" ),
&SYMBOL::SetExcludedFromBoard, &SYMBOL::GetExcludedFromBoard ),
groupAttributes );
propMgr.AddProperty( new PROPERTY<LIB_SYMBOL, bool>( _HKI( "Exclude from Bill of Materials" ),
&LIB_SYMBOL::SetExcludedFromBOMProp, &LIB_SYMBOL::GetExcludedFromBOMProp ),
groupAttributes );
const wxString groupUnits = _HKI( "Units and Body Styles" );
propMgr.AddProperty( new PROPERTY<LIB_SYMBOL, int>( _HKI( "Number of Symbol Units" ),
&LIB_SYMBOL::SetUnitProp, &LIB_SYMBOL::GetUnitProp ),
groupUnits );
propMgr.AddProperty( new PROPERTY<LIB_SYMBOL, bool>( _HKI( "Units are Interchangeable" ),
&LIB_SYMBOL::SetUnitsInterchangeableProp, &LIB_SYMBOL::GetUnitsInterchangeableProp ),
groupUnits );
auto multiBodyStyle =
[=]( INSPECTABLE* aItem ) -> bool
{
if( LIB_SYMBOL* symbol = dynamic_cast<LIB_SYMBOL*>( aItem ) )
return symbol->IsMultiBodyStyle();
return false;
};
propMgr.AddProperty( new PROPERTY<LIB_SYMBOL, wxString>( _HKI( "Body Styles" ),
&LIB_SYMBOL::SetBodyStyleProp, &LIB_SYMBOL::GetBodyStyleProp ),
groupUnits )
.SetAvailableFunc( multiBodyStyle )
.SetChoicesFunc( []( INSPECTABLE* aItem )
{
wxPGChoices choices;
if( LIB_SYMBOL* symbol = dynamic_cast<LIB_SYMBOL*>( aItem ) )
{
for( int ii = 1; ii <= symbol->GetBodyStyleCount(); ii++ )
choices.Add( symbol->GetBodyStyleDescription( ii, false ) );
}
return choices;
} );
}
} _LIB_SYMBOL_DESC;

147
eeschema/lib_symbol.h

@ -27,6 +27,7 @@
#ifndef LIB_SYMBOL_H
#define LIB_SYMBOL_H
#include <base_units.h>
#include <embedded_files.h>
#include <symbol.h>
#include <sch_field.h>
@ -34,6 +35,7 @@
#include <lib_tree_item.h>
#include <vector>
#include <core/multivector.h>
#include <default_values.h>
class LINE_READER;
class OUTPUTFORMATTER;
@ -365,6 +367,151 @@ public:
return GetValueField().GetText();
}
/*
* Field access for property manager
*/
wxString GetRefProp() const
{
return GetReferenceField().GetText();
}
void SetRefProp( const wxString& aRef )
{
GetReferenceField().SetText( aRef );
}
wxString GetValueProp() const
{
return GetValueField().GetText();
}
void SetValueProp( const wxString& aValue )
{
GetValueField().SetText( aValue );
}
wxString GetFootprintProp() const
{
return GetFootprintField().GetText();
}
void SetFootprintProp( const wxString& aFootprint )
{
GetFootprintField().SetText( aFootprint );
}
wxString GetDatasheetProp() const
{
return GetDatasheetField().GetText();
}
void SetDatasheetProp( const wxString& aDatasheet )
{
GetDatasheetField().SetText( aDatasheet );
}
wxString GetKeywordsProp() const
{
return GetKeyWords();
}
void SetKeywordsProp( const wxString& aKeywords )
{
SetKeyWords( aKeywords );
}
bool GetPowerSymbolProp() const
{
return IsPower();
}
void SetPowerSymbolProp( bool aIsPower )
{
if( aIsPower )
SetGlobalPower();
else
SetNormal();
}
bool GetLocalPowerSymbolProp() const
{
return IsLocalPower();
}
void SetLocalPowerSymbolProp( bool aIsLocalPower )
{
if( aIsLocalPower )
SetLocalPower();
else if( IsPower() )
SetGlobalPower();
else
SetNormal();
}
bool GetPinNamesInsideProp() const
{
return GetPinNameOffset() != 0;
}
void SetPinNamesInsideProp( bool aInside )
{
if( aInside && GetPinNameOffset() == 0 )
SetPinNameOffset( schIUScale.MilsToIU( DEFAULT_PIN_NAME_OFFSET ) );
else if( !aInside )
SetPinNameOffset( 0 );
}
int GetUnitProp() const
{
return GetUnitCount();
}
void SetUnitProp( int aUnits )
{
SetUnitCount( aUnits, true );
}
bool GetUnitsInterchangeableProp() const
{
return !UnitsLocked();
}
void SetUnitsInterchangeableProp( bool aInterchangeable )
{
LockUnits( !aInterchangeable );
}
wxString GetBodyStyleProp() const override
{
return GetBodyStyleDescription( 1, false );
}
void SetBodyStyleProp( const wxString& aBodyStyle ) override
{
// Body style setting is more complex for LIB_SYMBOL
// For now, this is primarily for display purposes
}
bool GetExcludedFromSimProp() const
{
return GetExcludedFromSim();
}
void SetExcludedFromSimProp( bool aExclude )
{
SetExcludedFromSim( aExclude );
}
bool GetExcludedFromBOMProp() const
{
return GetExcludedFromBOM();
}
void SetExcludedFromBOMProp( bool aExclude )
{
SetExcludedFromBOM( aExclude );
}
std::set<KIFONT::OUTLINE_FONT*> GetFonts() const override;
EMBEDDED_FILES* GetEmbeddedFiles() override;

1
eeschema/symbol_editor/symbol_edit_frame.cpp

@ -924,6 +924,7 @@ void SYMBOL_EDIT_FRAME::SetCurSymbol( LIB_SYMBOL* aSymbol, bool aUpdateZoom )
m_toolManager->RunAction( ACTIONS::zoomFitScreen );
GetCanvas()->Refresh();
m_propertiesPanel->UpdateData();
WX_INFOBAR& infobar = *GetInfoBar();
infobar.RemoveAllButtons();

55
eeschema/widgets/sch_properties_panel.cpp

@ -188,10 +188,40 @@ SCH_PROPERTIES_PANEL::~SCH_PROPERTIES_PANEL()
}
void SCH_PROPERTIES_PANEL::UpdateData()
const SELECTION& SCH_PROPERTIES_PANEL::getSelection( SELECTION& aFallbackSelection )
{
SCH_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool<SCH_SELECTION_TOOL>();
const SELECTION& selection = selectionTool->GetSelection();
const SELECTION& selection = selectionTool->GetSelection();
if( selection.Empty() && m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) )
{
SYMBOL_EDIT_FRAME* symbolFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
if( symbolFrame->GetCurSymbol() )
{
aFallbackSelection.Clear();
aFallbackSelection.Add( symbolFrame->GetCurSymbol() );
return aFallbackSelection;
}
}
return selection;
}
EDA_ITEM* SCH_PROPERTIES_PANEL::getFrontItem()
{
SELECTION fallbackSelection;
const SELECTION& selection = getSelection( fallbackSelection );
return selection.Empty() ? nullptr : selection.Front();
}
void SCH_PROPERTIES_PANEL::UpdateData()
{
SELECTION fallbackSelection;
const SELECTION& selection = getSelection( fallbackSelection );
// Will actually just be updatePropertyValues() if selection hasn't changed
rebuildProperties( selection );
@ -200,8 +230,8 @@ void SCH_PROPERTIES_PANEL::UpdateData()
void SCH_PROPERTIES_PANEL::AfterCommit()
{
SCH_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool<SCH_SELECTION_TOOL>();
const SELECTION& selection = selectionTool->GetSelection();
SELECTION fallbackSelection;
const SELECTION& selection = getSelection( fallbackSelection );
rebuildProperties( selection );
}
@ -266,9 +296,12 @@ wxPGProperty* SCH_PROPERTIES_PANEL::createPGProperty( const PROPERTY_BASE* aProp
PROPERTY_BASE* SCH_PROPERTIES_PANEL::getPropertyFromEvent( const wxPropertyGridEvent& aEvent ) const
{
SCH_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool<SCH_SELECTION_TOOL>();
const SELECTION& selection = selectionTool->GetSelection();
SCH_ITEM* firstItem = static_cast<SCH_ITEM*>( selection.Front() );
EDA_ITEM* item = const_cast<SCH_PROPERTIES_PANEL*>( this )->getFrontItem();
if( !item || !item->IsSCH_ITEM() )
return nullptr;
SCH_ITEM* firstItem = static_cast<SCH_ITEM*>( item );
wxCHECK_MSG( firstItem, nullptr,
wxT( "getPropertyFromEvent for a property with nothing selected!") );
@ -287,9 +320,7 @@ void SCH_PROPERTIES_PANEL::valueChanging( wxPropertyGridEvent& aEvent )
if( m_SuppressGridChangeEvents )
return;
SCH_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool<SCH_SELECTION_TOOL>();
const SELECTION& selection = selectionTool->GetSelection();
EDA_ITEM* frontItem = selection.Front();
EDA_ITEM* frontItem = getFrontItem();
if( !frontItem )
return;
@ -317,8 +348,8 @@ void SCH_PROPERTIES_PANEL::valueChanged( wxPropertyGridEvent& aEvent )
if( m_SuppressGridChangeEvents )
return;
SCH_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool<SCH_SELECTION_TOOL>();
const SELECTION& selection = selectionTool->GetSelection();
SELECTION fallbackSelection;
const SELECTION& selection = getSelection( fallbackSelection );
wxCHECK( getPropertyFromEvent( aEvent ), /* void */ );

17
eeschema/widgets/sch_properties_panel.h

@ -57,6 +57,23 @@ protected:
void OnLanguageChanged( wxCommandEvent& aEvent ) override;
/**
* 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.
*
* @param aFallbackSelection [out] local SELECTION object for fallback symbol selection
* @return const SELECTION& reference to the selection (either real selection or fallback)
*/
const SELECTION& getSelection( SELECTION& aFallbackSelection );
/**
* 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.
*
* @return EDA_ITEM* pointer to the front item, or nullptr if no selection
*/
EDA_ITEM* getFrontItem();
SCH_BASE_FRAME* m_frame;
PROPERTY_MANAGER& m_propMgr;
PG_UNIT_EDITOR* m_unitEditorInstance;

23
pcbnew/board_item.cpp

@ -431,22 +431,27 @@ static struct BOARD_ITEM_DESC
.SetIsHiddenFromLibraryEditors()
.SetIsHiddenFromPropertiesManager();
auto isNotFootprintHolder =
[]( INSPECTABLE* aItem ) -> bool
{
BOARD_ITEM* item = dynamic_cast<BOARD_ITEM*>( aItem );
return item && item->GetBoard() && !item->GetBoard()->IsFootprintHolder();
};
propMgr.AddProperty( new PROPERTY<BOARD_ITEM, int>( _HKI( "Position X" ),
&BOARD_ITEM::SetX, &BOARD_ITEM::GetX, PROPERTY_DISPLAY::PT_COORD,
ORIGIN_TRANSFORMS::ABS_X_COORD ) );
ORIGIN_TRANSFORMS::ABS_X_COORD ) )
.SetAvailableFunc( isNotFootprintHolder );
propMgr.AddProperty( new PROPERTY<BOARD_ITEM, int>( _HKI( "Position Y" ),
&BOARD_ITEM::SetY, &BOARD_ITEM::GetY, PROPERTY_DISPLAY::PT_COORD,
ORIGIN_TRANSFORMS::ABS_Y_COORD ) );
ORIGIN_TRANSFORMS::ABS_Y_COORD ) )
.SetAvailableFunc( isNotFootprintHolder );
propMgr.AddProperty( new PROPERTY_ENUM<BOARD_ITEM, PCB_LAYER_ID>( _HKI( "Layer" ),
&BOARD_ITEM::SetLayer, &BOARD_ITEM::GetLayer ) );
&BOARD_ITEM::SetLayer, &BOARD_ITEM::GetLayer ) )
.SetAvailableFunc( isNotFootprintHolder );
propMgr.AddProperty( new PROPERTY<BOARD_ITEM, bool>( _HKI( "Locked" ),
&BOARD_ITEM::SetLocked, &BOARD_ITEM::IsLocked ) )
.SetAvailableFunc(
[=]( INSPECTABLE* aItem ) -> bool
{
BOARD_ITEM* item = dynamic_cast<BOARD_ITEM*>( aItem );
return item && item->GetBoard() && !item->GetBoard()->IsFootprintHolder();
} );
.SetAvailableFunc( isNotFootprintHolder );
}
} _BOARD_ITEM_DESC;

15
pcbnew/footprint.cpp

@ -4433,14 +4433,27 @@ static struct FOOTPRINT_DESC
propMgr.InheritsAfter( TYPE_HASH( FOOTPRINT ), TYPE_HASH( BOARD_ITEM ) );
propMgr.InheritsAfter( TYPE_HASH( FOOTPRINT ), TYPE_HASH( BOARD_ITEM_CONTAINER ) );
auto isNotFootprintHolder =
[]( INSPECTABLE* aItem ) -> bool
{
if( FOOTPRINT* footprint = dynamic_cast<FOOTPRINT*>( aItem ) )
{
if( BOARD* board = footprint->GetBoard() )
return !board->IsFootprintHolder();
}
return true;
};
auto layer = new PROPERTY_ENUM<FOOTPRINT, PCB_LAYER_ID>( _HKI( "Layer" ),
&FOOTPRINT::SetLayerAndFlip, &FOOTPRINT::GetLayer );
layer->SetChoices( fpLayers );
layer->SetAvailableFunc( isNotFootprintHolder );
propMgr.ReplaceProperty( TYPE_HASH( BOARD_ITEM ), _HKI( "Layer" ), layer );
propMgr.AddProperty( new PROPERTY<FOOTPRINT, double>( _HKI( "Orientation" ),
&FOOTPRINT::SetOrientationDegrees, &FOOTPRINT::GetOrientationDegrees,
PROPERTY_DISPLAY::PT_DEGREE ) );
PROPERTY_DISPLAY::PT_DEGREE ) )
.SetAvailableFunc( isNotFootprintHolder );
const wxString groupFields = _HKI( "Fields" );

1
pcbnew/footprint_edit_frame.cpp

@ -1113,6 +1113,7 @@ void FOOTPRINT_EDIT_FRAME::UpdateView()
GetCanvas()->UpdateColors();
GetCanvas()->DisplayBoard( GetBoard() );
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
m_propertiesPanel->UpdateData();
UpdateTitle();
}

53
pcbnew/widgets/pcb_properties_panel.cpp

@ -23,6 +23,7 @@
#include <font/fontconfig.h>
#include <font/kicad_font_name.h>
#include <frame_type.h>
#include <pgm_base.h>
#include <pcb_base_edit_frame.h>
#include <tool/tool_manager.h>
@ -282,11 +283,42 @@ PCB_PROPERTIES_PANEL::~PCB_PROPERTIES_PANEL()
}
void PCB_PROPERTIES_PANEL::UpdateData()
const SELECTION& PCB_PROPERTIES_PANEL::getSelection( SELECTION& aFallbackSelection )
{
PCB_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool<PCB_SELECTION_TOOL>();
const SELECTION& selection = selectionTool->GetSelection();
if( selection.Empty() && m_frame->IsType( FRAME_FOOTPRINT_EDITOR ) )
{
if( BOARD* board = m_frame->GetBoard() )
{
if( FOOTPRINT* footprint = board->GetFirstFootprint() )
{
aFallbackSelection.Clear();
aFallbackSelection.Add( footprint );
return aFallbackSelection;
}
}
}
return selection;
}
EDA_ITEM* PCB_PROPERTIES_PANEL::getFrontItem()
{
SELECTION fallbackSelection;
const SELECTION& selection = getSelection( fallbackSelection );
return selection.Empty() ? nullptr : selection.Front();
}
void PCB_PROPERTIES_PANEL::UpdateData()
{
SELECTION fallbackSelection;
const SELECTION& selection = getSelection( fallbackSelection );
// TODO perhaps it could be called less often? use PROPERTIES_TOOL and catch MODEL_RELOAD?
updateLists( static_cast<PCB_EDIT_FRAME*>( m_frame )->GetBoard() );
@ -297,8 +329,8 @@ void PCB_PROPERTIES_PANEL::UpdateData()
void PCB_PROPERTIES_PANEL::AfterCommit()
{
PCB_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool<PCB_SELECTION_TOOL>();
const SELECTION& selection = selectionTool->GetSelection();
SELECTION fallbackSelection;
const SELECTION& selection = getSelection( fallbackSelection );
rebuildProperties( selection );
}
@ -384,13 +416,12 @@ wxPGProperty* PCB_PROPERTIES_PANEL::createPGProperty( const PROPERTY_BASE* aProp
PROPERTY_BASE* PCB_PROPERTIES_PANEL::getPropertyFromEvent( const wxPropertyGridEvent& aEvent ) const
{
PCB_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool<PCB_SELECTION_TOOL>();
const SELECTION& selection = selectionTool->GetSelection();
EDA_ITEM* item = const_cast<PCB_PROPERTIES_PANEL*>( this )->getFrontItem();
if( !selection.Front()->IsBOARD_ITEM() )
if( !item || !item->IsBOARD_ITEM() )
return nullptr;
BOARD_ITEM* firstItem = static_cast<BOARD_ITEM*>( selection.Front() );
BOARD_ITEM* firstItem = static_cast<BOARD_ITEM*>( item );
wxCHECK_MSG( firstItem, nullptr,
wxT( "getPropertyFromEvent for a property with nothing selected!") );
@ -408,9 +439,7 @@ void PCB_PROPERTIES_PANEL::valueChanging( wxPropertyGridEvent& aEvent )
if( m_SuppressGridChangeEvents > 0 )
return;
PCB_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool<PCB_SELECTION_TOOL>();
const SELECTION& selection = selectionTool->GetSelection();
EDA_ITEM* item = selection.Front();
EDA_ITEM* item = getFrontItem();
PROPERTY_BASE* property = getPropertyFromEvent( aEvent );
wxCHECK( property, /* void */ );
@ -436,8 +465,8 @@ void PCB_PROPERTIES_PANEL::valueChanged( wxPropertyGridEvent& aEvent )
if( m_SuppressGridChangeEvents > 0 )
return;
PCB_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool<PCB_SELECTION_TOOL>();
const SELECTION& selection = selectionTool->GetSelection();
SELECTION fallbackSelection;
const SELECTION& selection = getSelection( fallbackSelection );
wxCHECK( getPropertyFromEvent( aEvent ), /* void */ );

18
pcbnew/widgets/pcb_properties_panel.h

@ -60,6 +60,24 @@ protected:
///< Regenerates caches storing layer and net names
void updateLists( const BOARD* aBoard );
/**
* Get the current selection from the selection tool.
* If the selection is empty and we're in the footprint editor, returns the footprint instead.
*
* @param aSelection [out] reference to a SELECTION pointer that will be set to the selection
* @param aFallbackSelection [out] local SELECTION object for fallback footprint selection
* @return const SELECTION& reference to the selection (either real selection or fallback)
*/
const SELECTION& getSelection( SELECTION& aFallbackSelection );
/**
* Get the front item of the current selection.
* If the selection is empty and we're in the footprint editor, returns the footprint instead.
*
* @return EDA_ITEM* pointer to the front item, or nullptr if no selection
*/
EDA_ITEM* getFrontItem();
protected:
PCB_BASE_EDIT_FRAME* m_frame;
PROPERTY_MANAGER& m_propMgr;

Loading…
Cancel
Save