Allow "Update Symbol" command on power symbols
Power symbols can be modified in the library so it is useful to allow them to be updated with the right-click menu
This commit is contained in:
parent
a1730d51ff
commit
a25dfcd1b4
|
@ -66,6 +66,20 @@ SELECTION_CONDITION EE_CONDITIONS::SingleSymbol = [] (const SELECTION& aSel )
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
SELECTION_CONDITION EE_CONDITIONS::SingleSymbolOrPower = [] (const SELECTION& aSel )
|
||||||
|
{
|
||||||
|
if( aSel.GetSize() == 1 )
|
||||||
|
{
|
||||||
|
SCH_COMPONENT* symbol = dynamic_cast<SCH_COMPONENT*>( aSel.Front() );
|
||||||
|
|
||||||
|
if( symbol )
|
||||||
|
return !symbol->GetPartRef();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
SELECTION_CONDITION EE_CONDITIONS::SingleDeMorganSymbol = [] ( const SELECTION& aSel )
|
SELECTION_CONDITION EE_CONDITIONS::SingleDeMorganSymbol = [] ( const SELECTION& aSel )
|
||||||
{
|
{
|
||||||
if( aSel.GetSize() == 1 )
|
if( aSel.GetSize() == 1 )
|
||||||
|
|
|
@ -46,6 +46,7 @@ class EE_CONDITIONS : public SELECTION_CONDITIONS
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static SELECTION_CONDITION SingleSymbol;
|
static SELECTION_CONDITION SingleSymbol;
|
||||||
|
static SELECTION_CONDITION SingleSymbolOrPower;
|
||||||
static SELECTION_CONDITION SingleDeMorganSymbol;
|
static SELECTION_CONDITION SingleDeMorganSymbol;
|
||||||
static SELECTION_CONDITION SingleMultiUnitSymbol;
|
static SELECTION_CONDITION SingleMultiUnitSymbol;
|
||||||
};
|
};
|
||||||
|
|
|
@ -348,8 +348,8 @@ bool SCH_EDIT_TOOL::Init()
|
||||||
selToolMenu.AddMenu( symUnitMenu3.get(), E_C::SingleMultiUnitSymbol, 1 );
|
selToolMenu.AddMenu( symUnitMenu3.get(), E_C::SingleMultiUnitSymbol, 1 );
|
||||||
|
|
||||||
selToolMenu.AddItem( EE_ACTIONS::editWithLibEdit, singleSymbolCondition && E_C::Idle, 200 );
|
selToolMenu.AddItem( EE_ACTIONS::editWithLibEdit, singleSymbolCondition && E_C::Idle, 200 );
|
||||||
selToolMenu.AddItem( EE_ACTIONS::changeSymbol, E_C::SingleSymbol, 200 );
|
selToolMenu.AddItem( EE_ACTIONS::changeSymbol, E_C::SingleSymbolOrPower, 200 );
|
||||||
selToolMenu.AddItem( EE_ACTIONS::updateSymbol, E_C::SingleSymbol, 200 );
|
selToolMenu.AddItem( EE_ACTIONS::updateSymbol, E_C::SingleSymbolOrPower, 200 );
|
||||||
|
|
||||||
selToolMenu.AddItem( EE_ACTIONS::toLabel, toLabelCondition, 200 );
|
selToolMenu.AddItem( EE_ACTIONS::toLabel, toLabelCondition, 200 );
|
||||||
selToolMenu.AddItem( EE_ACTIONS::toHLabel, toHLabelCondition, 200 );
|
selToolMenu.AddItem( EE_ACTIONS::toHLabel, toHLabelCondition, 200 );
|
||||||
|
|
Loading…
Reference in New Issue