Reduce line-breaking.
Also simplifies handling of generator properties dialogs.
This commit is contained in:
parent
67f0f6e3b9
commit
16ec0faa7a
|
@ -168,13 +168,11 @@ void PCB_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
|
|||
break;
|
||||
|
||||
case PCB_GROUP_T:
|
||||
m_toolManager->RunAction<PCB_GROUP*>( PCB_ACTIONS::groupProperties,
|
||||
static_cast<PCB_GROUP*>( aItem ) );
|
||||
m_toolManager->RunAction( PCB_ACTIONS::groupProperties, static_cast<PCB_GROUP*>( aItem ) );
|
||||
break;
|
||||
|
||||
case PCB_GENERATOR_T:
|
||||
m_toolManager->RunAction<PCB_GENERATOR*>( PCB_ACTIONS::generatorProperties,
|
||||
static_cast<PCB_GENERATOR*>( aItem ) );
|
||||
static_cast<PCB_GENERATOR*>( aItem )->ShowPropertiesDialog( this );
|
||||
break;
|
||||
|
||||
case PCB_MARKER_T:
|
||||
|
|
|
@ -252,8 +252,7 @@ void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
|
|||
}
|
||||
|
||||
case PCB_GROUP_T:
|
||||
m_toolManager->RunAction<PCB_GROUP*>( PCB_ACTIONS::groupProperties,
|
||||
static_cast<PCB_GROUP*>( aItem ) );
|
||||
m_toolManager->RunAction( PCB_ACTIONS::groupProperties, static_cast<PCB_GROUP*>( aItem ) );
|
||||
break;
|
||||
|
||||
case PCB_MARKER_T:
|
||||
|
|
|
@ -548,10 +548,8 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit
|
|||
|
||||
if( item->Type() == PCB_GENERATOR_T )
|
||||
{
|
||||
PCB_GENERATOR* generator = static_cast<PCB_GENERATOR*>( item );
|
||||
|
||||
m_toolMgr->RunSynchronousAction<PCB_GENERATOR*>( PCB_ACTIONS::genUpdateEdit,
|
||||
aCommit, generator );
|
||||
m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genUpdateEdit, aCommit,
|
||||
static_cast<PCB_GENERATOR*>( item ) );
|
||||
}
|
||||
else if( item->Type() == PCB_FOOTPRINT_T )
|
||||
{
|
||||
|
@ -586,10 +584,8 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit
|
|||
{
|
||||
if( item->Type() == PCB_GENERATOR_T )
|
||||
{
|
||||
PCB_GENERATOR* generator = static_cast<PCB_GENERATOR*>( item );
|
||||
|
||||
m_toolMgr->RunSynchronousAction<PCB_GENERATOR*>(
|
||||
PCB_ACTIONS::genStartEdit, aCommit, generator );
|
||||
m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genStartEdit, aCommit,
|
||||
static_cast<PCB_GENERATOR*>( item ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -807,10 +803,8 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit
|
|||
{
|
||||
if( item->Type() == PCB_GENERATOR_T )
|
||||
{
|
||||
PCB_GENERATOR* generator = static_cast<PCB_GENERATOR*>( item );
|
||||
|
||||
m_toolMgr->RunSynchronousAction<PCB_GENERATOR*>( PCB_ACTIONS::genPushEdit, aCommit,
|
||||
generator );
|
||||
m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genPushEdit, aCommit,
|
||||
static_cast<PCB_GENERATOR*>( item ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -820,10 +814,8 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit
|
|||
{
|
||||
if( item->Type() == PCB_GENERATOR_T )
|
||||
{
|
||||
PCB_GENERATOR* generator = static_cast<PCB_GENERATOR*>( item );
|
||||
|
||||
m_toolMgr->RunSynchronousAction<PCB_GENERATOR*>( PCB_ACTIONS::genRevertEdit,
|
||||
aCommit, generator );
|
||||
m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genRevertEdit, aCommit,
|
||||
static_cast<PCB_GENERATOR*>( item ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,17 +82,6 @@ int GENERATOR_TOOL::ShowGeneratorsManager( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
|
||||
int GENERATOR_TOOL::ShowGeneratorProperties( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
PCB_BASE_EDIT_FRAME* editFrame = getEditFrame<PCB_BASE_EDIT_FRAME>();
|
||||
PCB_GENERATOR* gen = aEvent.Parameter<PCB_GENERATOR*>();
|
||||
|
||||
gen->ShowPropertiesDialog( editFrame );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int GENERATOR_TOOL::RegenerateAll( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
BOARD_COMMIT localCommit( this );
|
||||
|
@ -292,7 +281,6 @@ void GENERATOR_TOOL::setTransitions()
|
|||
{
|
||||
// Generator actions
|
||||
Go( &GENERATOR_TOOL::ShowGeneratorsManager, PCB_ACTIONS::generatorsShowManager.MakeEvent() );
|
||||
Go( &GENERATOR_TOOL::ShowGeneratorProperties, PCB_ACTIONS::generatorProperties.MakeEvent() );
|
||||
|
||||
Go( &GENERATOR_TOOL::RegenerateAll, PCB_ACTIONS::regenerateAll.MakeEvent() );
|
||||
Go( &GENERATOR_TOOL::RegenerateOutdated, PCB_ACTIONS::regenerateOutdated.MakeEvent() );
|
||||
|
|
|
@ -50,7 +50,6 @@ public:
|
|||
void DestroyManagerDialog();
|
||||
|
||||
int ShowGeneratorsManager( const TOOL_EVENT& aEvent );
|
||||
int ShowGeneratorProperties( const TOOL_EVENT& aEvent );
|
||||
|
||||
int RegenerateSelected( const TOOL_EVENT& aEvent );
|
||||
int RegenerateAll( const TOOL_EVENT& aEvent );
|
||||
|
|
|
@ -2391,11 +2391,6 @@ TOOL_ACTION PCB_ACTIONS::dragFreeAngle( TOOL_ACTION_ARGS()
|
|||
// GENERATOR_TOOL
|
||||
//
|
||||
|
||||
TOOL_ACTION PCB_ACTIONS::generatorProperties( TOOL_ACTION_ARGS()
|
||||
.Name( "pcbnew.Generator.generatorProperties" )
|
||||
.Scope( AS_GLOBAL ) );
|
||||
|
||||
|
||||
TOOL_ACTION PCB_ACTIONS::regenerateOutdated( TOOL_ACTION_ARGS()
|
||||
.Name( "pcbnew.Generator.regenerateOutdated" )
|
||||
.Scope( AS_GLOBAL )
|
||||
|
|
|
@ -269,7 +269,6 @@ public:
|
|||
static TOOL_ACTION routerInlineDrag;
|
||||
|
||||
/// Generator tool
|
||||
static TOOL_ACTION generatorProperties;
|
||||
static TOOL_ACTION regenerateOutdated;
|
||||
static TOOL_ACTION regenerateAll;
|
||||
static TOOL_ACTION regenerateSelected;
|
||||
|
|
|
@ -539,9 +539,8 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
|
|||
|
||||
if( item->Type() == PCB_GENERATOR_T )
|
||||
{
|
||||
m_toolMgr->RunSynchronousAction<PCB_GENERATOR*>(
|
||||
PCB_ACTIONS::genStartEdit, &commit,
|
||||
static_cast<PCB_GENERATOR*>( item ) );
|
||||
m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genStartEdit, &commit,
|
||||
static_cast<PCB_GENERATOR*>( item ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -652,8 +651,8 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
m_statusPopup->Hide();
|
||||
|
||||
m_toolMgr->RunSynchronousAction<PCB_GENERATOR*>(
|
||||
PCB_ACTIONS::genPushEdit, &commit, static_cast<PCB_GENERATOR*>( item ) );
|
||||
m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genPushEdit, &commit,
|
||||
static_cast<PCB_GENERATOR*>( item ) );
|
||||
}
|
||||
|
||||
commit.Push( _( "Drag Corner" ) );
|
||||
|
@ -670,9 +669,8 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
if( item->Type() == PCB_GENERATOR_T )
|
||||
{
|
||||
m_toolMgr->RunSynchronousAction<PCB_GENERATOR*>(
|
||||
PCB_ACTIONS::genRevertEdit, &commit,
|
||||
static_cast<PCB_GENERATOR*>( item ) );
|
||||
m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genRevertEdit, &commit,
|
||||
static_cast<PCB_GENERATOR*>( item ) );
|
||||
}
|
||||
commit.Revert();
|
||||
|
||||
|
@ -1495,10 +1493,9 @@ void PCB_POINT_EDITOR::updateItem( BOARD_COMMIT* aCommit )
|
|||
{
|
||||
GENERATOR_TOOL* generatorTool = m_toolMgr->GetTool<GENERATOR_TOOL>();
|
||||
PCB_GENERATOR* generatorItem = static_cast<PCB_GENERATOR*>( item );
|
||||
generatorItem->UpdateFromEditPoints( m_editPoints, aCommit );
|
||||
|
||||
m_toolMgr->RunSynchronousAction<PCB_GENERATOR*>( PCB_ACTIONS::genUpdateEdit, aCommit,
|
||||
generatorItem );
|
||||
generatorItem->UpdateFromEditPoints( m_editPoints, aCommit );
|
||||
m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genUpdateEdit, aCommit, generatorItem );
|
||||
|
||||
m_statusPopup->Popup();
|
||||
generatorItem->UpdateStatus( generatorTool, frame(), m_statusPopup.get() );
|
||||
|
|
Loading…
Reference in New Issue