Commit e7817f3e authored by Marco Mattila's avatar Marco Mattila

Add zone duplication to pcbnew.

parent e936d3c1
......@@ -467,6 +467,24 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
SetCurItem( NULL ); // Outlines can have changed
break;
case ID_POPUP_PCB_ZONE_DUPLICATE:
{
ZONE_CONTAINER* zone = (ZONE_CONTAINER*) GetCurItem();
ZONE_CONTAINER* newZone = new ZONE_CONTAINER( m_Pcb );
newZone->Copy( zone );
ZONE_SETTINGS zoneSettings;
zoneSettings << *zone;
if( InvokeCopperZonesEditor( this, &zoneSettings ) )
{
zoneSettings.ExportSetting( *newZone );
m_Pcb->Add( newZone );
newZone->Draw( m_canvas, &dc, GR_OR );
}
else
delete newZone;
}
break;
case ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE:
m_canvas->MoveCursorToCrossHair();
m_canvas->SetAutoPanRequest( true );
......
......@@ -621,6 +621,9 @@ void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu*
}
zones_menu->AppendSeparator();
AddMenuItem( zones_menu, ID_POPUP_PCB_ZONE_DUPLICATE,
_( "Duplicate Zone" ), KiBitmap( add_zone_xpm ) );
AddMenuItem( zones_menu, ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE,
_( "Add Similar Zone" ), KiBitmap( add_zone_xpm ) );
......
......@@ -92,6 +92,7 @@ enum pcbnew_ids
ID_POPUP_PCB_FILL_ALL_ZONES,
ID_POPUP_PCB_FILL_ZONE,
ID_POPUP_PCB_DELETE_ZONE_CONTAINER,
ID_POPUP_PCB_ZONE_DUPLICATE,
ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE,
ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE,
ID_POPUP_PCB_DELETE_ZONE_CUTOUT,
......
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