Commit d613da8b authored by Maciej Suminski's avatar Maciej Suminski

Module texts are undo/redoable.

parent 7ce91d4e
...@@ -295,6 +295,17 @@ void PCB_EDIT_FRAME::SaveCopyInUndoList( BOARD_ITEM* aItem, ...@@ -295,6 +295,17 @@ void PCB_EDIT_FRAME::SaveCopyInUndoList( BOARD_ITEM* aItem,
if( aItem == NULL ) // Nothing to save if( aItem == NULL ) // Nothing to save
return; return;
// For texts belonging to modules, we need to save state of the parent module
if( aItem->Type() == PCB_MODULE_TEXT_T )
{
aItem = aItem->GetParent();
wxASSERT( aItem->Type() == PCB_MODULE_T );
aCommandType = UR_CHANGED;
if( aItem == NULL )
return;
}
PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST(); PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST();
commandToUndo->m_TransformPoint = aTransformPoint; commandToUndo->m_TransformPoint = aTransformPoint;
...@@ -364,6 +375,20 @@ void PCB_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, ...@@ -364,6 +375,20 @@ void PCB_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
for( unsigned ii = 0; ii < commandToUndo->GetCount(); ii++ ) for( unsigned ii = 0; ii < commandToUndo->GetCount(); ii++ )
{ {
BOARD_ITEM* item = (BOARD_ITEM*) commandToUndo->GetPickedItem( ii ); BOARD_ITEM* item = (BOARD_ITEM*) commandToUndo->GetPickedItem( ii );
// For texts belonging to modules, we need to save state of the parent module
if( item->Type() == PCB_MODULE_TEXT_T )
{
item = item->GetParent();
wxASSERT( item->Type() == PCB_MODULE_T );
if( item == NULL )
continue;
commandToUndo->SetPickedItem( item, ii );
commandToUndo->SetPickedItemStatus( UR_CHANGED, ii );
}
UNDO_REDO_T command = commandToUndo->GetPickedItemStatus( ii ); UNDO_REDO_T command = commandToUndo->GetPickedItemStatus( ii );
if( command == UR_UNSPECIFIED ) if( command == UR_UNSPECIFIED )
......
...@@ -463,9 +463,13 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const ...@@ -463,9 +463,13 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const
break; break;
case PCB_MODULE_TEXT_T:
if( m_multiple )
return false;
break;
// These are not selectable // These are not selectable
case PCB_MODULE_EDGE_T: case PCB_MODULE_EDGE_T:
case PCB_MODULE_TEXT_T:
case PCB_PAD_T: case PCB_PAD_T:
case NOT_USED: case NOT_USED:
case TYPE_NOT_INIT: case TYPE_NOT_INIT:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment