2008-04-18 13:28:56 +00:00
|
|
|
/**************************************************/
|
|
|
|
/* onrightclick.cpp: Right mouse button functions */
|
|
|
|
/**************************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
#include "gr_basic.h"
|
|
|
|
#include "macros.h"
|
|
|
|
#include "common.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "class_drawpanel.h"
|
|
|
|
#include "confirm.h"
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
#include "pcbnew.h"
|
2009-07-30 11:04:07 +00:00
|
|
|
#include "wxPcbStruct.h"
|
2009-10-28 11:48:47 +00:00
|
|
|
#include "class_board_design_settings.h"
|
2009-08-03 18:54:48 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
#include "pcbnew_id.h"
|
2007-09-21 10:38:50 +00:00
|
|
|
#include "hotkeys.h"
|
2007-10-10 04:45:26 +00:00
|
|
|
#include "collectors.h"
|
2009-08-03 18:54:48 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
/* Bitmaps */
|
|
|
|
#include "bitmaps.h"
|
2009-10-28 11:48:47 +00:00
|
|
|
|
2009-10-30 17:58:15 +00:00
|
|
|
static wxMenu* Append_Track_Width_List( BOARD* aBoard );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
2007-09-06 04:34:03 +00:00
|
|
|
/******************************************************************************/
|
2007-10-07 18:24:15 +00:00
|
|
|
bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
|
2007-09-06 04:34:03 +00:00
|
|
|
/******************************************************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2007-10-07 18:24:15 +00:00
|
|
|
wxString msg;
|
|
|
|
int flags = 0;
|
|
|
|
bool locate_track = FALSE;
|
2009-07-25 04:53:39 +00:00
|
|
|
bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE);
|
2007-09-21 10:38:50 +00:00
|
|
|
|
|
|
|
wxClientDC dc( DrawPanel );
|
|
|
|
|
|
|
|
BOARD_ITEM* item = GetCurItem();
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2007-09-19 15:29:50 +00:00
|
|
|
DrawPanel->m_CanStartBlock = -1; // Avoid to start a block coomand when clicking on menu
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2007-09-29 13:31:10 +00:00
|
|
|
|
2007-10-07 18:24:15 +00:00
|
|
|
// If a command or a block is in progress:
|
2008-01-01 11:46:47 +00:00
|
|
|
// Put the Cancel command (if needed) and the End command
|
2007-10-07 18:24:15 +00:00
|
|
|
|
|
|
|
if( BlockActive )
|
|
|
|
{
|
|
|
|
createPopUpBlockMenu( aPopMenu );
|
2007-09-29 13:31:10 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-10-07 18:24:15 +00:00
|
|
|
return true;
|
|
|
|
}
|
2007-09-29 13:31:10 +00:00
|
|
|
|
|
|
|
DrawPanel->CursorOff( &dc );
|
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
if( m_ID_current_state )
|
|
|
|
{
|
2007-09-06 04:34:03 +00:00
|
|
|
if( item && item->m_Flags )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2007-09-06 04:34:03 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Cancel" ), cancel_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-09-06 04:34:03 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_CLOSE_CURRENT_TOOL,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "End Tool" ), cancel_tool_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-09-29 13:31:10 +00:00
|
|
|
if( item && item->m_Flags )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2007-10-07 18:24:15 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Cancel" ), cancel_xpm );
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-01 11:46:47 +00:00
|
|
|
|
2007-09-20 21:06:49 +00:00
|
|
|
/* Select a proper item */
|
2007-10-10 04:45:26 +00:00
|
|
|
|
|
|
|
wxPoint cursorPos = GetScreen()->m_Curseur;
|
|
|
|
wxPoint selectPos = m_Collector->GetRefPos();
|
2008-01-01 11:46:47 +00:00
|
|
|
|
|
|
|
PutOnGrid( &selectPos );
|
|
|
|
|
|
|
|
/* We can reselect another item only if there are no item being edited
|
2008-01-28 18:44:14 +00:00
|
|
|
* because ALL moving functions use GetCurItem(), therefore GetCurItem()
|
|
|
|
* must return the same item during moving. We know an item is moving
|
|
|
|
* if( item && (item->m_Flags != 0)) is true and after calling
|
|
|
|
* PcbGeneralLocateAndDisplay(), GetCurItem() is any arbitrary BOARD_ITEM,
|
|
|
|
* not the current item being edited. In such case we cannot call
|
|
|
|
* PcbGeneralLocateAndDisplay().
|
2008-01-01 11:46:47 +00:00
|
|
|
*/
|
|
|
|
if( !item || (item->m_Flags == 0) )
|
|
|
|
{
|
|
|
|
// show "item selector" menu only if no item now or selected item was not
|
2007-10-31 14:14:21 +00:00
|
|
|
// previously picked at this position
|
2008-01-01 11:46:47 +00:00
|
|
|
if( !item || cursorPos != selectPos )
|
|
|
|
{
|
|
|
|
DrawPanel->m_AbortRequest = false;
|
|
|
|
item = PcbGeneralLocateAndDisplay();
|
|
|
|
if( DrawPanel->m_AbortRequest )
|
|
|
|
{
|
|
|
|
DrawPanel->CursorOn( &dc );
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-10-10 04:45:26 +00:00
|
|
|
|
2007-09-21 10:38:50 +00:00
|
|
|
item = GetCurItem();
|
2007-09-06 04:34:03 +00:00
|
|
|
if( item )
|
|
|
|
flags = item->m_Flags;
|
2007-08-20 01:20:48 +00:00
|
|
|
else
|
|
|
|
flags = 0;
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2007-09-06 04:34:03 +00:00
|
|
|
if( item )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2007-09-06 04:34:03 +00:00
|
|
|
switch( item->Type() )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2008-12-04 04:28:11 +00:00
|
|
|
case TYPE_MODULE:
|
2007-09-15 04:25:54 +00:00
|
|
|
createPopUpMenuForFootprints( (MODULE*) item, aPopMenu );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOPLACE )
|
|
|
|
{
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-10-07 18:24:15 +00:00
|
|
|
|
|
|
|
if( !( (MODULE*) item )->IsLocked() )
|
2007-09-20 21:06:49 +00:00
|
|
|
{
|
2007-10-07 18:24:15 +00:00
|
|
|
msg = AddHotkeyName( _(
|
2009-08-03 18:54:48 +00:00
|
|
|
"Lock Module" ), s_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_LOCK_UNLOCK_FOOTPRINT );
|
2007-09-21 10:38:50 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, msg,
|
2009-08-03 18:54:48 +00:00
|
|
|
locked_xpm );
|
2007-09-20 21:06:49 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-10-07 18:24:15 +00:00
|
|
|
msg = AddHotkeyName( _(
|
2009-08-03 18:54:48 +00:00
|
|
|
"Unlock Module" ), s_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_LOCK_UNLOCK_FOOTPRINT );
|
2007-09-21 10:38:50 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FREE_MODULE, msg,
|
2009-08-03 18:54:48 +00:00
|
|
|
unlocked_xpm );
|
2007-09-20 21:06:49 +00:00
|
|
|
}
|
2007-10-07 18:24:15 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
if( !flags )
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->Append( ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Auto Place Module" ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOROUTE )
|
|
|
|
{
|
|
|
|
if( !flags )
|
2009-10-14 18:14:58 +00:00
|
|
|
aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_MODULE, _( "Autoroute Module" ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-12-04 04:28:11 +00:00
|
|
|
case TYPE_PAD:
|
2007-09-15 04:25:54 +00:00
|
|
|
createPopUpMenuForFpPads( (D_PAD*) item, aPopMenu );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2008-12-04 04:28:11 +00:00
|
|
|
case TYPE_TEXTE_MODULE:
|
2007-09-15 04:25:54 +00:00
|
|
|
createPopUpMenuForFpTexts( (TEXTE_MODULE*) item, aPopMenu );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2009-08-11 10:27:21 +00:00
|
|
|
case TYPE_DRAWSEGMENT: // Some graphic items on technical layers
|
|
|
|
if( (flags & IS_NEW) )
|
|
|
|
{
|
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_STOP_CURRENT_DRAWING,
|
|
|
|
_( "End Drawing" ), apply_xpm );
|
|
|
|
}
|
2007-08-20 01:20:48 +00:00
|
|
|
if( !flags )
|
|
|
|
{
|
2007-09-06 04:34:03 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_MOVE_DRAWING_REQUEST,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Move Drawing" ), move_xpm );
|
2009-08-11 10:27:21 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_DRAWING, _( "Edit Drawing" ), edit_xpm );
|
2009-08-11 14:10:34 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_DRAWING, _(
|
|
|
|
"Delete Drawing" ), delete_xpm );
|
2009-08-11 10:27:21 +00:00
|
|
|
if( item->GetLayer() > LAST_COPPER_LAYER )
|
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_DRAWING_LAYER,
|
2009-08-11 14:10:34 +00:00
|
|
|
_( "Delete All Drawing on Layer" ), delete_body_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-12-04 04:28:11 +00:00
|
|
|
case TYPE_ZONE: // Item used to fill a zone
|
2008-01-01 11:46:47 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_ZONE,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Delete Zone Filling" ), delete_xpm );
|
2008-01-01 11:46:47 +00:00
|
|
|
break;
|
|
|
|
|
2008-12-04 04:28:11 +00:00
|
|
|
case TYPE_ZONE_CONTAINER: // Item used to handle a zone area (outlines, holes ...)
|
2008-04-18 13:28:56 +00:00
|
|
|
if( flags & IS_NEW )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2007-09-06 04:34:03 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE,
|
2008-01-31 20:53:44 +00:00
|
|
|
_( "Close Zone Outline" ), apply_xpm );
|
2008-04-17 16:25:29 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER,
|
|
|
|
_( "Delete Last Corner" ), delete_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
2008-04-17 16:25:29 +00:00
|
|
|
else
|
2009-08-03 18:54:48 +00:00
|
|
|
createPopUpMenuForZones( (ZONE_CONTAINER*) item, aPopMenu );
|
2007-12-29 19:15:58 +00:00
|
|
|
break;
|
|
|
|
|
2008-12-04 04:28:11 +00:00
|
|
|
case TYPE_TEXTE:
|
2009-08-03 18:54:48 +00:00
|
|
|
createPopUpMenuForTexts( (TEXTE_PCB*) item, aPopMenu );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2008-12-04 04:28:11 +00:00
|
|
|
case TYPE_TRACK:
|
|
|
|
case TYPE_VIA:
|
2009-10-03 17:18:08 +00:00
|
|
|
locate_track = true;
|
2007-09-15 04:25:54 +00:00
|
|
|
createPopupMenuForTracks( (TRACK*) item, aPopMenu );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2009-08-01 19:26:05 +00:00
|
|
|
case TYPE_MARKER_PCB:
|
|
|
|
createPopUpMenuForMarkers( (MARKER_PCB*) item, aPopMenu );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2010-04-23 09:54:40 +00:00
|
|
|
case TYPE_DIMENSION:
|
2007-08-20 01:20:48 +00:00
|
|
|
if( !flags )
|
|
|
|
{
|
2010-04-23 09:54:40 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_DIMENSION,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Edit Dimension" ), edit_xpm );
|
2010-04-23 09:54:40 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_DIMENSION,
|
2009-08-11 14:10:34 +00:00
|
|
|
_( "Delete Dimension" ), delete_xpm );
|
2009-08-11 10:27:21 +00:00
|
|
|
}
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2008-12-04 04:28:11 +00:00
|
|
|
case TYPE_MIRE:
|
2007-08-20 01:20:48 +00:00
|
|
|
if( !flags )
|
|
|
|
{
|
2007-09-06 04:34:03 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_MOVE_MIRE_REQUEST,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Move Target" ), move_xpm );
|
2009-08-11 10:27:21 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_MIRE,
|
|
|
|
_( "Edit Target" ), edit_xpm );
|
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MIRE,
|
|
|
|
_( "Delete Target" ), delete_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-12-04 04:28:11 +00:00
|
|
|
case TYPE_EDGE_MODULE:
|
|
|
|
case TYPE_SCREEN:
|
2007-08-20 01:20:48 +00:00
|
|
|
case TYPE_NOT_INIT:
|
2008-12-04 04:28:11 +00:00
|
|
|
case TYPE_PCB:
|
2007-08-20 01:20:48 +00:00
|
|
|
msg.Printf(
|
2009-05-24 18:28:36 +00:00
|
|
|
wxT( "WinEDA_PcbFrame::OnRightClick() Error: unexpected DrawType %d" ),
|
2007-09-06 04:34:03 +00:00
|
|
|
item->Type() );
|
2007-08-20 01:20:48 +00:00
|
|
|
DisplayError( this, msg );
|
2008-01-28 18:44:14 +00:00
|
|
|
SetCurItem( NULL );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
msg.Printf(
|
|
|
|
wxT( "WinEDA_PcbFrame::OnRightClick() Error: unknown DrawType %d" ),
|
2007-09-06 04:34:03 +00:00
|
|
|
item->Type() );
|
2007-08-20 01:20:48 +00:00
|
|
|
DisplayError( this, msg );
|
2008-01-28 18:44:14 +00:00
|
|
|
|
|
|
|
// Attempt to clear error (but should no occurs )
|
|
|
|
if( item->Type() >= MAX_STRUCT_TYPE_ID )
|
|
|
|
SetCurItem( NULL );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
|
2007-09-12 02:14:07 +00:00
|
|
|
if( !flags )
|
|
|
|
{
|
2007-09-21 10:38:50 +00:00
|
|
|
msg = AddHotkeyName( _( "Get and Move Footprint" ),
|
2009-08-03 18:54:48 +00:00
|
|
|
s_Board_Editor_Hokeys_Descr, HK_GET_AND_MOVE_FOOTPRINT );
|
2007-09-12 02:14:07 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST,
|
2009-08-03 18:54:48 +00:00
|
|
|
msg, move_module_xpm );
|
2007-09-12 02:14:07 +00:00
|
|
|
}
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2009-10-30 17:58:15 +00:00
|
|
|
/* Display context sensitive comands: */
|
2007-08-20 01:20:48 +00:00
|
|
|
switch( m_ID_current_state )
|
|
|
|
{
|
|
|
|
case ID_PCB_ZONES_BUTT:
|
2009-01-05 05:21:35 +00:00
|
|
|
if( GetBoard()->m_ZoneDescriptorList.size() > 0 )
|
2008-01-01 11:46:47 +00:00
|
|
|
{
|
2008-10-11 19:27:43 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2008-01-01 11:46:47 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_FILL_ALL_ZONES,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Fill or Refill All Zones" ), fill_zone_xpm );
|
2008-10-29 15:26:53 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Remove Filled Areas in All Zones" ), fill_zone_xpm );
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2008-01-01 11:46:47 +00:00
|
|
|
}
|
2007-12-30 18:20:51 +00:00
|
|
|
|
2007-09-06 04:34:03 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_LAYER,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Select Working Layer" ), select_w_layer_xpm );
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_TRACK_BUTT:
|
2009-10-30 17:58:15 +00:00
|
|
|
if ( ! locate_track ) // This menu is already added when a track is located
|
|
|
|
ADD_MENUITEM_WITH_SUBMENU( aPopMenu, Append_Track_Width_List( GetBoard() ),
|
2009-08-03 18:54:48 +00:00
|
|
|
ID_POPUP_PCB_SELECT_WIDTH,
|
|
|
|
_( "Select Track Width" ), width_track_xpm );
|
2007-09-06 04:34:03 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_CU_LAYER,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Select Working Layer" ), select_w_layer_xpm );
|
2007-09-06 04:34:03 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_LAYER_PAIR,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Select Layer Pair for Vias" ), select_layer_pair_xpm );
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_PCB_CIRCLE_BUTT:
|
|
|
|
case ID_PCB_ARC_BUTT:
|
2009-09-22 12:27:57 +00:00
|
|
|
case ID_PCB_ADD_TEXT_BUTT:
|
|
|
|
case ID_PCB_ADD_LINE_BUTT:
|
2010-04-23 09:54:40 +00:00
|
|
|
case ID_PCB_DIMENSION_BUTT:
|
2007-09-06 04:34:03 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_NO_CU_LAYER,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Select Working Layer" ), select_w_layer_xpm );
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_COMPONENT_BUTT:
|
2007-09-06 04:34:03 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DISPLAY_FOOTPRINT_DOC,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Footprint Documentation" ), book_xpm );
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0:
|
|
|
|
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOPLACE )
|
|
|
|
{
|
|
|
|
wxMenu* commands = new wxMenu;
|
2007-09-06 04:34:03 +00:00
|
|
|
ADD_MENUITEM_WITH_SUBMENU( aPopMenu, commands,
|
2009-08-03 18:54:48 +00:00
|
|
|
ID_POPUP_PCB_AUTOPLACE_COMMANDS, _(
|
|
|
|
"Glob Move and Place" ), move_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( commands, ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Unlock All Modules" ), unlocked_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( commands, ID_POPUP_PCB_AUTOPLACE_FIXE_ALL_MODULES,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Lock All Modules" ), locked_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
commands->AppendSeparator();
|
|
|
|
ADD_MENUITEM( commands, ID_POPUP_PCB_AUTOMOVE_ALL_MODULES,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Move All Modules" ), move_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
commands->Append( ID_POPUP_PCB_AUTOMOVE_NEW_MODULES, _( "Move New Modules" ) );
|
|
|
|
commands->AppendSeparator();
|
|
|
|
commands->Append( ID_POPUP_PCB_AUTOPLACE_ALL_MODULES, _( "Autoplace All Modules" ) );
|
|
|
|
commands->Append( ID_POPUP_PCB_AUTOPLACE_NEW_MODULES, _( "Autoplace New Modules" ) );
|
|
|
|
commands->Append( ID_POPUP_PCB_AUTOPLACE_NEXT_MODULE, _( "Autoplace Next Module" ) );
|
|
|
|
commands->AppendSeparator();
|
|
|
|
ADD_MENUITEM( commands, ID_POPUP_PCB_REORIENT_ALL_MODULES,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Orient All Modules" ), rotate_module_pos_xpm );
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOROUTE )
|
|
|
|
{
|
|
|
|
wxMenu* commands = new wxMenu;
|
2009-10-14 18:14:58 +00:00
|
|
|
aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_COMMANDS, _( "Autoroute" ), commands );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( commands, ID_POPUP_PCB_SELECT_LAYER_PAIR,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Select Layer Pair" ), select_layer_pair_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
commands->AppendSeparator();
|
|
|
|
commands->Append( ID_POPUP_PCB_AUTOROUTE_ALL_MODULES, _( "Autoroute All Modules" ) );
|
|
|
|
commands->AppendSeparator();
|
2008-10-18 23:41:16 +00:00
|
|
|
commands->Append( ID_POPUP_PCB_AUTOROUTE_RESET_UNROUTED, _( "Reset Unrouted" ) );
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if( locate_track )
|
2009-09-28 16:14:45 +00:00
|
|
|
ADD_MENUITEM_WITH_SUBMENU( aPopMenu, Append_Track_Width_List( GetBoard() ),
|
2009-08-03 18:54:48 +00:00
|
|
|
ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ),
|
|
|
|
width_track_xpm );
|
2007-09-06 04:34:03 +00:00
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_LAYER,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Select Working Layer" ), select_w_layer_xpm );
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
DrawPanel->CursorOn( &dc );
|
2008-01-01 11:46:47 +00:00
|
|
|
return true;
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2007-09-29 13:31:10 +00:00
|
|
|
/*********************************************************/
|
2007-09-15 04:25:54 +00:00
|
|
|
void WinEDA_PcbFrame::createPopUpBlockMenu( wxMenu* menu )
|
2007-09-29 13:31:10 +00:00
|
|
|
/*********************************************************/
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/* Create Pop sub menu for block commands
|
2007-08-20 01:20:48 +00:00
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( menu, ID_POPUP_CANCEL_CURRENT_COMMAND,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Cancel Block" ), cancel_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( menu, ID_POPUP_ZOOM_BLOCK,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Zoom Block" ), zoom_selected_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
menu->AppendSeparator();
|
|
|
|
ADD_MENUITEM( menu, ID_POPUP_PLACE_BLOCK,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Place Block" ), apply_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( menu, ID_POPUP_COPY_BLOCK,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Copy Block" ), copyblock_xpm );
|
2009-08-12 10:40:01 +00:00
|
|
|
ADD_MENUITEM( menu, ID_POPUP_FLIP_BLOCK,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Flip Block" ), invert_module_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( menu, ID_POPUP_ROTATE_BLOCK,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Rotate Block" ), rotate_pos_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( menu, ID_POPUP_DELETE_BLOCK,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Delete Block" ), delete_xpm );
|
2007-05-28 18:09:49 +00:00
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
2007-09-21 10:38:50 +00:00
|
|
|
/******************************************************************************/
|
2007-09-15 04:25:54 +00:00
|
|
|
void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
|
2007-09-21 10:38:50 +00:00
|
|
|
/******************************************************************************/
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2009-10-30 17:58:15 +00:00
|
|
|
/* Create command lines for a popup menu, for track and via editing
|
2009-10-26 19:00:46 +00:00
|
|
|
* also update Netclass selection
|
2007-08-20 01:20:48 +00:00
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2007-09-21 10:38:50 +00:00
|
|
|
wxPoint cursorPosition = GetScreen()->m_Curseur;
|
|
|
|
wxString msg;
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2009-10-26 19:00:46 +00:00
|
|
|
GetBoard()->SetCurrentNetClass( Track->GetNetClassName() );
|
|
|
|
m_TrackAndViasSizesList_Changed = true;
|
|
|
|
AuxiliaryToolBar_Update_UI();
|
|
|
|
|
2009-10-30 17:58:15 +00:00
|
|
|
int flags = Track->m_Flags;
|
2007-08-20 01:20:48 +00:00
|
|
|
if( flags == 0 )
|
|
|
|
{
|
2008-12-04 04:28:11 +00:00
|
|
|
if( Track->Type() == TYPE_VIA )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2008-10-18 23:41:16 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_TRACK_NODE, _( "Drag Via" ), move_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-09-15 04:25:54 +00:00
|
|
|
if( Track->IsPointOnEnds( cursorPosition, -1 ) != 0 )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_TRACK_NODE,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Move Node" ), move_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Drag Segments, Keep Slope" ), drag_segment_withslope_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Drag Segment" ), drag_track_segment_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_BREAK_TRACK,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Break Track" ), break_line_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( flags & IS_DRAGGED ) // Drag via or node in progress
|
|
|
|
{
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_PLACE_MOVED_TRACK_NODE,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Place Node" ), apply_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
else // Edition in progress
|
|
|
|
{
|
|
|
|
if( flags & IS_NEW )
|
2007-09-21 10:38:50 +00:00
|
|
|
{
|
|
|
|
msg = AddHotkeyName( _( "End Track" ), s_Board_Editor_Hokeys_Descr, HK_END_TRACK );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_END_TRACK, msg, apply_xpm );
|
|
|
|
}
|
|
|
|
msg = AddHotkeyName( _( "Place Via" ), s_Board_Editor_Hokeys_Descr, HK_ADD_VIA );
|
|
|
|
PopMenu->Append( ID_POPUP_PCB_PLACE_VIA, msg );
|
2008-01-28 18:44:14 +00:00
|
|
|
|
2010-06-16 15:01:45 +00:00
|
|
|
msg = AddHotkeyName( _( "Switch Track Posture" ), s_Board_Editor_Hokeys_Descr, HK_SWITCH_TRACK_POSTURE );
|
|
|
|
PopMenu->Append( ID_POPUP_PCB_SWITCH_TRACK_POSTURE, msg );
|
|
|
|
|
2008-01-28 18:44:14 +00:00
|
|
|
// See if we can place a Micro Via (4 or more layers, and start from an external layer):
|
2010-01-31 20:01:46 +00:00
|
|
|
if( IsMicroViaAcceptable() )
|
2008-01-28 18:44:14 +00:00
|
|
|
{
|
|
|
|
msg = AddHotkeyName( _(
|
2009-08-03 18:54:48 +00:00
|
|
|
"Place Micro Via" ), s_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_ADD_MICROVIA );
|
2008-01-28 18:44:14 +00:00
|
|
|
PopMenu->Append( ID_POPUP_PCB_PLACE_MICROVIA, msg );
|
|
|
|
}
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// track Width control :
|
2010-02-07 11:39:22 +00:00
|
|
|
if( !flags )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2009-10-26 19:00:46 +00:00
|
|
|
if( Track->Type() == TYPE_VIA )
|
|
|
|
{
|
2009-10-30 17:58:15 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, _(
|
|
|
|
"Change Via Size and Drill" ), width_segment_xpm );
|
2009-10-26 19:00:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-10-30 17:58:15 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, _(
|
|
|
|
"Change Segment Width" ), width_segment_xpm );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TRACK,
|
|
|
|
_( "Change Track Width" ), width_track_xpm );
|
2009-10-26 19:00:46 +00:00
|
|
|
}
|
2009-10-30 17:58:15 +00:00
|
|
|
ADD_MENUITEM_WITH_SUBMENU( PopMenu, Append_Track_Width_List( GetBoard() ),
|
|
|
|
ID_POPUP_PCB_SELECT_WIDTH,
|
|
|
|
_( "Select Track Width" ), width_track_xpm );
|
|
|
|
PopMenu->AppendSeparator();
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE,
|
|
|
|
_( "Global Tracks and Vias Edition" ), width_track_via_xpm );
|
|
|
|
PopMenu->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
|
2010-02-07 11:39:22 +00:00
|
|
|
else // Allows switching to an other track/via size when routing
|
|
|
|
{
|
|
|
|
ADD_MENUITEM_WITH_SUBMENU( PopMenu, Append_Track_Width_List( GetBoard() ),
|
|
|
|
ID_POPUP_PCB_SELECT_WIDTH,
|
|
|
|
_( "Select Track Width" ), width_track_xpm );
|
|
|
|
PopMenu->AppendSeparator();
|
|
|
|
}
|
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
// Delete control:
|
2009-10-30 17:58:15 +00:00
|
|
|
wxMenu* track_mnu = new wxMenu;
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu,
|
2009-08-03 18:54:48 +00:00
|
|
|
ID_POPUP_PCB_DELETE_TRACK_MNU, _( "Delete" ), delete_xpm );
|
2008-01-01 11:46:47 +00:00
|
|
|
|
2009-10-30 17:58:15 +00:00
|
|
|
msg = AddHotkeyName( Track->Type()==TYPE_VIA ?
|
|
|
|
_( "Delete Via" ) : _( "Delete Segment" ),
|
2009-08-03 18:54:48 +00:00
|
|
|
s_Board_Editor_Hokeys_Descr, HK_BACK_SPACE );
|
2008-01-01 11:46:47 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACKSEG,
|
2009-08-03 18:54:48 +00:00
|
|
|
msg, delete_line_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
if( !flags )
|
|
|
|
{
|
2008-10-18 23:41:16 +00:00
|
|
|
msg = AddHotkeyName( _( "Delete Track" ), s_Board_Editor_Hokeys_Descr, HK_DELETE );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACK,
|
2009-08-03 18:54:48 +00:00
|
|
|
msg, delete_track_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACKNET,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Delete Net" ), delete_net_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
track_mnu = new wxMenu;
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu,
|
2009-08-03 18:54:48 +00:00
|
|
|
ID_POPUP_PCB_SETFLAGS_TRACK_MNU, _( "Set Flags" ), flag_xpm );
|
2009-10-03 17:18:08 +00:00
|
|
|
track_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACKSEG, _( "Locked: Yes" ), wxEmptyString, true );
|
|
|
|
track_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, _( "Locked: No" ), wxEmptyString, true );
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
if( Track->GetState( SEGM_FIXE ) )
|
2009-10-03 17:18:08 +00:00
|
|
|
track_mnu->Check( ID_POPUP_PCB_LOCK_ON_TRACKSEG, true );
|
2007-08-20 01:20:48 +00:00
|
|
|
else
|
2009-10-03 17:18:08 +00:00
|
|
|
track_mnu->Check( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, true );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
if( !flags )
|
|
|
|
{
|
|
|
|
track_mnu->AppendSeparator();
|
2008-10-18 23:41:16 +00:00
|
|
|
track_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACK, _( "Track Locked: Yes" ) );
|
|
|
|
track_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACK, _( "Track Locked: No" ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
track_mnu->AppendSeparator();
|
2008-10-18 23:41:16 +00:00
|
|
|
track_mnu->Append( ID_POPUP_PCB_LOCK_ON_NET, _( "Net Locked: Yes" ) );
|
|
|
|
track_mnu->Append( ID_POPUP_PCB_LOCK_OFF_NET, _( "Net Locked: No" ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2008-01-01 11:46:47 +00:00
|
|
|
/********************************************************************************************/
|
|
|
|
void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu )
|
|
|
|
/********************************************************************************************/
|
|
|
|
|
|
|
|
/* Create the wxMenuitem list for zone outlines editing and zone filling
|
|
|
|
*/
|
|
|
|
{
|
2008-04-18 13:28:56 +00:00
|
|
|
if( edge_zone->m_Flags == IS_DRAGGED )
|
2008-02-01 21:30:45 +00:00
|
|
|
{
|
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_DRAGGED_ZONE_OUTLINE_SEGMENT,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Place Edge Outline" ), apply_xpm );
|
2008-02-01 21:30:45 +00:00
|
|
|
}
|
|
|
|
else if( edge_zone->m_Flags )
|
2008-01-01 11:46:47 +00:00
|
|
|
{
|
2008-01-28 18:44:14 +00:00
|
|
|
if( (edge_zone->m_Flags & IN_EDIT ) )
|
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_CORNER,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Place Corner" ), apply_xpm );
|
2008-01-28 18:44:14 +00:00
|
|
|
else
|
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_OUTLINES,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Place Zone" ), apply_xpm );
|
2008-01-01 11:46:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-01-28 18:44:14 +00:00
|
|
|
wxMenu* zones_menu = new wxMenu();
|
2008-04-18 13:28:56 +00:00
|
|
|
|
2008-01-28 18:44:14 +00:00
|
|
|
ADD_MENUITEM_WITH_SUBMENU( aPopMenu, zones_menu,
|
2009-08-03 18:54:48 +00:00
|
|
|
-1, _( "Zones" ), add_zone_xpm );
|
2008-04-18 13:28:56 +00:00
|
|
|
int index;
|
2008-01-18 08:54:15 +00:00
|
|
|
if( ( index = edge_zone->HitTestForCorner( GetScreen()->RefPos( true ) ) ) >= 0 )
|
2008-01-01 11:46:47 +00:00
|
|
|
{
|
2008-01-05 13:37:51 +00:00
|
|
|
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_MOVE_ZONE_CORNER,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Move Corner" ), move_xpm );
|
2008-01-05 13:37:51 +00:00
|
|
|
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CORNER,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Delete Corner" ), delete_xpm );
|
2008-01-01 11:46:47 +00:00
|
|
|
}
|
2008-01-18 08:54:15 +00:00
|
|
|
else if( ( index = edge_zone->HitTestForEdge( GetScreen()->RefPos( true ) ) ) >= 0 )
|
2008-01-01 11:46:47 +00:00
|
|
|
{
|
2008-01-05 13:37:51 +00:00
|
|
|
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_ADD_ZONE_CORNER,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Create Corner" ), add_corner_xpm );
|
2008-02-01 21:30:45 +00:00
|
|
|
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_DRAG_ZONE_OUTLINE_SEGMENT,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Drag Outline Segment" ), drag_outline_segment_xpm );
|
2008-01-01 11:46:47 +00:00
|
|
|
}
|
|
|
|
|
2008-01-05 13:37:51 +00:00
|
|
|
zones_menu->AppendSeparator();
|
|
|
|
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Add Similar Zone" ), add_zone_xpm );
|
2008-01-01 11:46:47 +00:00
|
|
|
|
2008-01-05 13:37:51 +00:00
|
|
|
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Add Cutout Area" ), add_zone_cutout );
|
2008-01-05 13:37:51 +00:00
|
|
|
zones_menu->AppendSeparator();
|
2008-01-01 11:46:47 +00:00
|
|
|
|
2008-01-05 13:37:51 +00:00
|
|
|
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_FILL_ZONE,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Fill Zone" ), fill_zone_xpm );
|
2008-01-01 11:46:47 +00:00
|
|
|
|
2009-08-03 18:54:48 +00:00
|
|
|
if( edge_zone->m_FilledPolysList.size() > 0 )
|
2008-10-29 15:26:53 +00:00
|
|
|
{
|
|
|
|
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Remove Filled Areas in Zone" ), fill_zone_xpm );
|
2008-10-29 15:26:53 +00:00
|
|
|
}
|
|
|
|
|
2008-01-16 20:37:50 +00:00
|
|
|
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Move Zone" ), move_xpm );
|
2008-01-16 20:37:50 +00:00
|
|
|
|
2008-01-05 13:37:51 +00:00
|
|
|
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_EDIT_ZONE_PARAMS,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Edit Zone Params" ), edit_xpm );
|
2008-01-05 13:37:51 +00:00
|
|
|
|
2008-01-16 20:37:50 +00:00
|
|
|
zones_menu->AppendSeparator();
|
2008-01-28 18:44:14 +00:00
|
|
|
if( index >= 0 && edge_zone->m_Poly->IsCutoutContour( edge_zone->m_CornerSelection ) )
|
|
|
|
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CUTOUT,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Delete Cutout" ), delete_xpm );
|
2008-01-28 18:44:14 +00:00
|
|
|
|
2008-01-05 13:37:51 +00:00
|
|
|
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CONTAINER,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Delete Zone Outline" ), delete_xpm );
|
2008-01-01 11:46:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-05-28 18:09:49 +00:00
|
|
|
/*********************************************************************************/
|
2007-09-15 04:25:54 +00:00
|
|
|
void WinEDA_PcbFrame::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu )
|
2007-05-28 18:09:49 +00:00
|
|
|
/*********************************************************************************/
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2007-05-28 18:09:49 +00:00
|
|
|
/* Create the wxMenuitem list for footprint editing
|
2007-08-20 01:20:48 +00:00
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-08-20 01:20:48 +00:00
|
|
|
wxMenu* sub_menu_footprint;
|
2007-09-06 04:34:03 +00:00
|
|
|
int flags = aModule->m_Flags;
|
2007-09-21 10:38:50 +00:00
|
|
|
wxString msg;
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
sub_menu_footprint = new wxMenu;
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2009-01-05 05:21:35 +00:00
|
|
|
msg = aModule->MenuText( GetBoard() );
|
2007-09-11 17:29:33 +00:00
|
|
|
ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_footprint, -1, msg, module_xpm );
|
2007-09-15 04:25:54 +00:00
|
|
|
if( !flags )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2007-09-21 10:38:50 +00:00
|
|
|
msg = AddHotkeyName( _( "Move" ), s_Board_Editor_Hokeys_Descr, HK_MOVE_FOOTPRINT );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_MOVE_MODULE_REQUEST,
|
2009-08-03 18:54:48 +00:00
|
|
|
msg, move_module_xpm );
|
2007-09-21 10:38:50 +00:00
|
|
|
msg = AddHotkeyName( _( "Drag" ), s_Board_Editor_Hokeys_Descr, HK_DRAG_FOOTPRINT );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_DRAG_MODULE_REQUEST,
|
2009-08-03 18:54:48 +00:00
|
|
|
msg, drag_module_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
2009-08-06 07:11:04 +00:00
|
|
|
msg = AddHotkeyName( _( "Rotate +" ), s_Board_Editor_Hokeys_Descr, HK_ROTATE_FOOTPRINT );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE,
|
2009-08-06 07:11:04 +00:00
|
|
|
msg, rotate_module_pos_xpm );
|
|
|
|
ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Rotate -" ), rotate_module_neg_xpm );
|
2007-09-21 10:38:50 +00:00
|
|
|
msg = AddHotkeyName( _( "Flip" ), s_Board_Editor_Hokeys_Descr, HK_FLIP_FOOTPRINT );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_CHANGE_SIDE_MODULE,
|
2009-08-03 18:54:48 +00:00
|
|
|
msg, invert_module_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
if( !flags )
|
|
|
|
{
|
2009-08-06 07:11:04 +00:00
|
|
|
ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE,
|
|
|
|
_( "Edit" ), edit_module_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
sub_menu_footprint->AppendSeparator();
|
|
|
|
ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_DELETE_MODULE,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Delete Module" ), delete_module_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
2007-05-28 18:09:49 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2007-05-28 18:09:49 +00:00
|
|
|
/********************************************************************/
|
2007-09-15 04:25:54 +00:00
|
|
|
void WinEDA_PcbFrame::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* menu )
|
2007-05-28 18:09:49 +00:00
|
|
|
/********************************************************************/
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2007-05-28 18:09:49 +00:00
|
|
|
/* Create the wxMenuitem list for editing texts on footprints
|
2007-08-20 01:20:48 +00:00
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-08-20 01:20:48 +00:00
|
|
|
wxMenu* sub_menu_Fp_text;
|
|
|
|
int flags = FpText->m_Flags;
|
|
|
|
|
2009-01-05 05:21:35 +00:00
|
|
|
wxString msg = FpText->MenuText( GetBoard() );
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
sub_menu_Fp_text = new wxMenu;
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2007-09-11 17:29:33 +00:00
|
|
|
ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Fp_text, -1, msg, footprint_text_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
if( !flags )
|
|
|
|
ADD_MENUITEM( sub_menu_Fp_text, ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Move" ), move_field_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
ADD_MENUITEM( sub_menu_Fp_text, ID_POPUP_PCB_ROTATE_TEXTMODULE,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Rotate" ), rotate_field_xpm );
|
2009-08-11 14:10:34 +00:00
|
|
|
if( !flags )
|
|
|
|
ADD_MENUITEM( sub_menu_Fp_text, ID_POPUP_PCB_EDIT_TEXTMODULE,
|
|
|
|
_( "Edit" ), edit_text_xpm );
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2009-08-11 10:27:21 +00:00
|
|
|
if( !flags && FpText->m_Type == TEXT_is_DIVERS ) // Graphic texts can be deleted only if are not currently edited
|
|
|
|
{
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( sub_menu_Fp_text, ID_POPUP_PCB_DELETE_TEXTMODULE,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Delete" ), delete_xpm );
|
2009-08-11 10:27:21 +00:00
|
|
|
}
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2007-09-15 04:25:54 +00:00
|
|
|
if( !flags )
|
|
|
|
{
|
|
|
|
MODULE* module = (MODULE*) FpText->GetParent();
|
|
|
|
if( module )
|
|
|
|
{
|
|
|
|
menu->AppendSeparator();
|
|
|
|
createPopUpMenuForFootprints( module, menu );
|
|
|
|
}
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-01 11:46:47 +00:00
|
|
|
/************************************************************************/
|
2007-09-15 04:25:54 +00:00
|
|
|
void WinEDA_PcbFrame::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu )
|
2008-01-01 11:46:47 +00:00
|
|
|
/************************************************************************/
|
2009-10-30 17:58:15 +00:00
|
|
|
|
2009-10-26 19:00:46 +00:00
|
|
|
/* Create pop menu for pads
|
|
|
|
* also update Netclass selection
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-08-03 18:54:48 +00:00
|
|
|
wxMenu* sub_menu_Pad;
|
|
|
|
int flags = Pad->m_Flags;
|
|
|
|
|
|
|
|
if( flags ) // Currently in edit, no others commands possible
|
|
|
|
return;
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2009-10-26 19:00:46 +00:00
|
|
|
GetBoard()->SetCurrentNetClass( Pad->GetNetClassName() );
|
|
|
|
m_TrackAndViasSizesList_Changed = true;
|
|
|
|
AuxiliaryToolBar_Update_UI();
|
|
|
|
|
2009-01-05 05:21:35 +00:00
|
|
|
wxString msg = Pad->MenuText( GetBoard() );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
sub_menu_Pad = new wxMenu;
|
2007-09-11 17:29:33 +00:00
|
|
|
ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Pad, -1, msg, pad_xpm );
|
2009-08-03 18:54:48 +00:00
|
|
|
|
|
|
|
ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_MOVE_PAD_REQUEST,
|
|
|
|
_( "Move" ), move_pad_xpm );
|
|
|
|
ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_DRAG_PAD_REQUEST,
|
|
|
|
_( "Drag" ), drag_pad_xpm );
|
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_EDIT_PAD, _( "Edit Pad" ), options_pad_xpm );
|
|
|
|
sub_menu_Pad->AppendSeparator();
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2008-04-18 13:28:56 +00:00
|
|
|
ADD_MENUITEM_WITH_HELP( sub_menu_Pad, ID_POPUP_PCB_IMPORT_PAD_SETTINGS,
|
2009-12-13 10:30:19 +00:00
|
|
|
_( "Copy Current Settings to this Pad" ),
|
|
|
|
wxEmptyString,
|
2009-08-03 18:54:48 +00:00
|
|
|
options_new_pad_xpm );
|
2008-04-18 13:28:56 +00:00
|
|
|
ADD_MENUITEM_WITH_HELP( sub_menu_Pad, ID_POPUP_PCB_EXPORT_PAD_SETTINGS,
|
2009-12-13 10:30:19 +00:00
|
|
|
_( "Copy this Pad Settings to Current Settings" ),
|
|
|
|
wxEmptyString,
|
2009-08-03 18:54:48 +00:00
|
|
|
export_options_pad_xpm );
|
|
|
|
|
|
|
|
ADD_MENUITEM_WITH_HELP( sub_menu_Pad, ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS,
|
2009-12-13 10:30:19 +00:00
|
|
|
_( "Global Pads Edition" ),
|
|
|
|
_( "Copy this pad settings to all pads in this footprint (or similar footprints)" ),
|
2009-08-03 18:54:48 +00:00
|
|
|
global_options_pad_xpm );
|
|
|
|
sub_menu_Pad->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2009-08-03 18:54:48 +00:00
|
|
|
ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_DELETE_PAD,
|
|
|
|
_( "Delete" ), delete_pad_xpm );
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2007-09-15 04:25:54 +00:00
|
|
|
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOROUTE )
|
|
|
|
{
|
2009-08-03 18:54:48 +00:00
|
|
|
menu->Append( ID_POPUP_PCB_AUTOROUTE_PAD, _( "Autoroute Pad" ) );
|
|
|
|
menu->Append( ID_POPUP_PCB_AUTOROUTE_NET, _( "Autoroute Net" ) );
|
2007-09-15 04:25:54 +00:00
|
|
|
}
|
2009-08-03 18:54:48 +00:00
|
|
|
MODULE* module = (MODULE*) Pad->GetParent();
|
|
|
|
if( module )
|
2007-09-15 04:25:54 +00:00
|
|
|
{
|
2009-08-03 18:54:48 +00:00
|
|
|
menu->AppendSeparator();
|
|
|
|
createPopUpMenuForFootprints( module, menu );
|
2007-09-15 04:25:54 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-21 10:38:50 +00:00
|
|
|
/*****************************************************************************/
|
2007-09-15 04:25:54 +00:00
|
|
|
void WinEDA_PcbFrame::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu )
|
2007-09-21 10:38:50 +00:00
|
|
|
/*****************************************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
/* Create pop menu for pcb texts */
|
|
|
|
{
|
2007-08-20 01:20:48 +00:00
|
|
|
wxMenu* sub_menu_Text;
|
|
|
|
int flags = Text->m_Flags;
|
|
|
|
|
2009-01-05 05:21:35 +00:00
|
|
|
wxString msg = Text->MenuText( GetBoard() );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
sub_menu_Text = new wxMenu;
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2007-09-11 17:29:33 +00:00
|
|
|
ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Text, -1, msg, add_text_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
if( !flags )
|
|
|
|
{
|
|
|
|
ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Move" ), move_text_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_ROTATE_TEXTEPCB,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Rotate" ), rotate_pos_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_EDIT_TEXTEPCB,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Edit" ), edit_text_xpm );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
sub_menu_Text->AppendSeparator();
|
|
|
|
ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_DELETE_TEXTEPCB,
|
2009-08-03 18:54:48 +00:00
|
|
|
_( "Delete" ), delete_text_xpm );
|
2007-05-28 18:09:49 +00:00
|
|
|
}
|
2009-07-13 15:25:41 +00:00
|
|
|
|
2009-08-03 18:54:48 +00:00
|
|
|
|
2009-07-13 15:25:41 +00:00
|
|
|
/**********************************************************************/
|
2009-08-01 19:26:05 +00:00
|
|
|
void WinEDA_PcbFrame::createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu )
|
2009-07-13 15:25:41 +00:00
|
|
|
/**********************************************************************/
|
|
|
|
{
|
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MARKER, _( "Delete Marker" ), delete_xpm );
|
|
|
|
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_GETINFO_MARKER, _( "Marker Error Info" ), info_xpm );
|
|
|
|
}
|
2009-08-06 07:11:04 +00:00
|
|
|
|
|
|
|
|
2009-09-28 16:14:45 +00:00
|
|
|
/*******************************************************/
|
2009-10-30 17:58:15 +00:00
|
|
|
static wxMenu* Append_Track_Width_List( BOARD* aBoard )
|
2009-09-28 16:14:45 +00:00
|
|
|
/*******************************************************/
|
2009-08-06 07:11:04 +00:00
|
|
|
|
2009-10-03 17:18:08 +00:00
|
|
|
/** function Append_Track_Width_List
|
|
|
|
* creates a wxMenu * which shows the last used track widths and via diameters
|
|
|
|
* @return a pointeur to the menu
|
2009-08-06 07:11:04 +00:00
|
|
|
*/
|
|
|
|
{
|
2009-10-30 17:58:15 +00:00
|
|
|
wxString msg;
|
2009-08-06 07:11:04 +00:00
|
|
|
wxMenu* trackwidth_menu;
|
2009-10-30 17:58:15 +00:00
|
|
|
wxString value;
|
2009-08-06 07:11:04 +00:00
|
|
|
|
|
|
|
trackwidth_menu = new wxMenu;
|
|
|
|
|
|
|
|
trackwidth_menu->Append( ID_POPUP_PCB_SELECT_AUTO_WIDTH,
|
|
|
|
_( "Auto Width" ),
|
|
|
|
_(
|
|
|
|
"Use the track width when starting on a track, otherwise the current track width" ),
|
2009-10-03 17:18:08 +00:00
|
|
|
true );
|
2009-08-06 07:11:04 +00:00
|
|
|
|
2010-01-31 20:01:46 +00:00
|
|
|
if( aBoard->GetBoardDesignSettings()->m_UseConnectedTrackWidth )
|
2009-10-03 17:18:08 +00:00
|
|
|
trackwidth_menu->Check( ID_POPUP_PCB_SELECT_AUTO_WIDTH, true );
|
|
|
|
|
2009-10-30 17:58:15 +00:00
|
|
|
if( aBoard->m_ViaSizeSelector != 0
|
|
|
|
|| aBoard->m_TrackWidthSelector != 0
|
2010-01-31 20:01:46 +00:00
|
|
|
|| aBoard->GetBoardDesignSettings()->m_UseConnectedTrackWidth )
|
2009-10-03 17:18:08 +00:00
|
|
|
trackwidth_menu->Append( ID_POPUP_PCB_SELECT_USE_NETCLASS_VALUES,
|
2009-10-30 17:58:15 +00:00
|
|
|
_( "Use Netclass Values" ),
|
|
|
|
_( "Use track and via sizes from their Netclass values" ),
|
|
|
|
true );
|
2009-08-06 07:11:04 +00:00
|
|
|
|
2009-10-06 13:19:40 +00:00
|
|
|
for( unsigned ii = 0; ii < aBoard->m_TrackWidthList.size(); ii++ )
|
2009-08-06 07:11:04 +00:00
|
|
|
{
|
2009-10-30 17:58:15 +00:00
|
|
|
value = ReturnStringFromValue( g_UnitMetric, aBoard->m_TrackWidthList[ii],
|
|
|
|
PCB_INTERNAL_UNIT, true );
|
|
|
|
msg.Printf( _( "Track %s" ), GetChars( value ) );
|
|
|
|
if( ii == 0 )
|
|
|
|
msg << _( " (use NetClass)" );
|
2009-10-03 17:18:08 +00:00
|
|
|
trackwidth_menu->Append( ID_POPUP_PCB_SELECT_WIDTH1 + ii, msg, wxEmptyString, true );
|
|
|
|
}
|
2009-10-30 17:58:15 +00:00
|
|
|
|
2010-01-31 20:01:46 +00:00
|
|
|
if( aBoard->GetBoardDesignSettings()->m_UseConnectedTrackWidth )
|
2009-10-03 17:18:08 +00:00
|
|
|
trackwidth_menu->Check( ID_POPUP_PCB_SELECT_AUTO_WIDTH, true );
|
|
|
|
else
|
|
|
|
{
|
2009-10-06 13:19:40 +00:00
|
|
|
if( aBoard->m_TrackWidthSelector < aBoard->m_TrackWidthList.size() )
|
2009-10-30 17:58:15 +00:00
|
|
|
trackwidth_menu->Check( ID_POPUP_PCB_SELECT_WIDTH1 + aBoard->m_TrackWidthSelector,
|
|
|
|
true );
|
2009-08-06 07:11:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
trackwidth_menu->AppendSeparator();
|
2009-10-30 17:58:15 +00:00
|
|
|
for( unsigned ii = 0; ii < aBoard->m_ViasDimensionsList.size(); ii++ )
|
2009-08-06 07:11:04 +00:00
|
|
|
{
|
2009-10-30 17:58:15 +00:00
|
|
|
value = ReturnStringFromValue( g_UnitMetric, aBoard->m_ViasDimensionsList[ii].m_Diameter,
|
|
|
|
PCB_INTERNAL_UNIT, true );
|
|
|
|
wxString drill = ReturnStringFromValue( g_UnitMetric,
|
|
|
|
aBoard->m_ViasDimensionsList[ii].m_Drill,
|
|
|
|
PCB_INTERNAL_UNIT, true );
|
|
|
|
if( aBoard->m_ViasDimensionsList[ii].m_Drill <= 0 )
|
|
|
|
msg.Printf( _( "Via %s" ), GetChars( value ) );
|
2009-08-06 07:11:04 +00:00
|
|
|
else
|
2009-10-30 17:58:15 +00:00
|
|
|
{
|
|
|
|
msg.Printf( _( "Via %s; (drl %s)" ), GetChars( value ), GetChars( drill ) );
|
|
|
|
}
|
|
|
|
if( ii == 0 )
|
|
|
|
msg << _( " (use NetClass)" );
|
2009-10-03 17:18:08 +00:00
|
|
|
trackwidth_menu->Append( ID_POPUP_PCB_SELECT_VIASIZE1 + ii, msg, wxEmptyString, true );
|
2009-08-06 07:11:04 +00:00
|
|
|
}
|
2009-10-30 17:58:15 +00:00
|
|
|
|
|
|
|
if( aBoard->m_ViaSizeSelector < aBoard->m_ViasDimensionsList.size() )
|
2009-10-03 17:18:08 +00:00
|
|
|
trackwidth_menu->Check( ID_POPUP_PCB_SELECT_VIASIZE1 + aBoard->m_ViaSizeSelector, true );
|
2009-08-06 07:11:04 +00:00
|
|
|
|
|
|
|
return trackwidth_menu;
|
|
|
|
}
|