2011-12-16 13:32:23 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2015-04-03 19:10:09 +00:00
|
|
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2013-07-05 17:48:01 +00:00
|
|
|
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
|
|
|
* Copyright (C) 2007-2013 Wayne Stambaugh <stambaughw@verizon.net>
|
2016-06-08 11:19:53 +00:00
|
|
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-12-16 13:32:23 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2011-09-23 13:57:12 +00:00
|
|
|
/**
|
|
|
|
* @file pcbnew/onrightclick.cpp
|
|
|
|
* @brief Right mouse button functions.
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
|
|
|
#include <class_drawpanel.h>
|
|
|
|
#include <macros.h>
|
2012-04-13 18:51:24 +00:00
|
|
|
#include <base_units.h>
|
2017-02-20 12:20:39 +00:00
|
|
|
#include <bitmaps.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
|
|
|
|
#include <class_board.h>
|
|
|
|
#include <class_module.h>
|
|
|
|
#include <class_track.h>
|
|
|
|
#include <class_pcb_text.h>
|
|
|
|
#include <class_zone.h>
|
|
|
|
|
|
|
|
#include <pcbnew.h>
|
|
|
|
#include <wxPcbStruct.h>
|
|
|
|
#include <pcbnew_id.h>
|
|
|
|
#include <hotkeys.h>
|
|
|
|
#include <collectors.h>
|
2012-04-09 09:16:47 +00:00
|
|
|
#include <menus_helpers.h>
|
2009-08-03 18:54:48 +00:00
|
|
|
|
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
|
|
|
|
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2007-10-07 18:24:15 +00:00
|
|
|
wxString msg;
|
2013-03-28 19:12:46 +00:00
|
|
|
STATUS_FLAGS flags = 0;
|
2013-09-20 10:52:33 +00:00
|
|
|
bool trackFound = false; // Flag set to true,
|
|
|
|
// if a track is being the cursor, to avoid
|
|
|
|
// to display menus relative to tracks twice
|
2012-03-26 23:47:08 +00:00
|
|
|
bool blockActive = !GetScreen()->m_BlockLocate.IsIdle();
|
2007-09-21 10:38:50 +00:00
|
|
|
|
|
|
|
BOARD_ITEM* item = GetCurItem();
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2013-03-20 14:50:12 +00:00
|
|
|
m_canvas->SetCanStartBlock( -1 ); // Avoid to start a block command when clicking on menu
|
2007-08-20 01:20:48 +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
|
|
|
|
2011-01-26 07:43:59 +00:00
|
|
|
if( blockActive )
|
2007-10-07 18:24:15 +00:00
|
|
|
{
|
|
|
|
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
|
|
|
|
2016-06-08 11:19:53 +00:00
|
|
|
if( GetToolId() != ID_NO_TOOL_SELECTED && GetToolId() != ID_ZOOM_SELECTION )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2011-12-21 13:42:02 +00:00
|
|
|
if( item && item->GetFlags() )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2011-12-16 13:32:23 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ),
|
|
|
|
KiBitmap( cancel_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_CLOSE_CURRENT_TOOL,
|
2012-03-20 14:17:58 +00:00
|
|
|
_( "End Tool" ), KiBitmap( cursor_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
2011-03-01 19:26:17 +00:00
|
|
|
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-12-21 13:42:02 +00:00
|
|
|
if( item && item->GetFlags() )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Cancel" ), KiBitmap( cancel_xpm ) );
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-03 05:15:23 +00:00
|
|
|
// Select a proper item
|
2007-10-10 04:45:26 +00:00
|
|
|
|
2013-08-03 05:15:23 +00:00
|
|
|
wxPoint cursorPos = GetCrossHairPosition();
|
2007-10-10 04:45:26 +00:00
|
|
|
wxPoint selectPos = m_Collector->GetRefPos();
|
2008-01-01 11:46:47 +00:00
|
|
|
|
2013-08-03 05:15:23 +00:00
|
|
|
selectPos = GetNearestGridPosition( selectPos );
|
2008-01-01 11:46:47 +00:00
|
|
|
|
|
|
|
/* 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
|
|
|
*/
|
2011-12-21 13:42:02 +00:00
|
|
|
if( !item || (item->GetFlags() == 0) )
|
2008-01-01 11:46:47 +00:00
|
|
|
{
|
2013-09-20 10:52:33 +00:00
|
|
|
// show the "item selector" menu if no item selected or
|
|
|
|
// if there is a selected item but the mouse has moved
|
|
|
|
// (therefore a new item is perhaps under the cursor)
|
2008-01-01 11:46:47 +00:00
|
|
|
if( !item || cursorPos != selectPos )
|
|
|
|
{
|
2011-12-29 20:11:42 +00:00
|
|
|
m_canvas->SetAbortRequest( false );
|
2015-04-07 11:52:29 +00:00
|
|
|
PcbGeneralLocateAndDisplay();
|
2011-03-01 19:26:17 +00:00
|
|
|
|
2011-12-29 20:11:42 +00:00
|
|
|
if( m_canvas->GetAbortRequest() )
|
2008-01-01 11:46:47 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-10-10 04:45:26 +00:00
|
|
|
|
2007-09-21 10:38:50 +00:00
|
|
|
item = GetCurItem();
|
2014-03-31 18:14:01 +00:00
|
|
|
flags = item ? item->GetFlags() : 0;
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2013-09-20 10:52:33 +00:00
|
|
|
// Add the context menu, which depends on the picked item:
|
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
|
|
|
{
|
2011-10-01 19:24:27 +00:00
|
|
|
case PCB_MODULE_T:
|
2007-09-15 04:25:54 +00:00
|
|
|
createPopUpMenuForFootprints( (MODULE*) item, aPopMenu );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_MODULE ) )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
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
|
|
|
{
|
2014-10-08 06:26:26 +00:00
|
|
|
msg = AddHotkeyName( _("Lock Footprint" ), g_Board_Editor_Hokeys_Descr,
|
2009-08-03 18:54:48 +00:00
|
|
|
HK_LOCK_UNLOCK_FOOTPRINT );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, msg,
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( locked_xpm ) );
|
2007-09-20 21:06:49 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-10-08 06:26:26 +00:00
|
|
|
msg = AddHotkeyName( _( "Unlock Footprint" ), g_Board_Editor_Hokeys_Descr,
|
2009-08-03 18:54:48 +00:00
|
|
|
HK_LOCK_UNLOCK_FOOTPRINT );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FREE_MODULE, msg,
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( 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,
|
2014-10-08 06:26:26 +00:00
|
|
|
_( "Automatically Place Footprint" ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_TRACKS ) )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
|
|
|
if( !flags )
|
2013-03-20 14:50:12 +00:00
|
|
|
aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_MODULE,
|
2014-10-08 06:26:26 +00:00
|
|
|
_( "Automatically Route Footprint" ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2011-10-01 19:24:27 +00:00
|
|
|
case PCB_PAD_T:
|
2014-09-10 15:18:42 +00:00
|
|
|
createPopUpMenuForFpPads( static_cast<D_PAD*>( item ), aPopMenu );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2011-10-01 19:24:27 +00:00
|
|
|
case PCB_MODULE_TEXT_T:
|
2014-09-10 15:18:42 +00:00
|
|
|
createPopUpMenuForFpTexts( static_cast<TEXTE_MODULE*>( item ), aPopMenu );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2011-10-01 19:24:27 +00:00
|
|
|
case PCB_LINE_T: // Some graphic items on technical layers
|
2009-08-11 10:27:21 +00:00
|
|
|
if( (flags & IS_NEW) )
|
|
|
|
{
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_STOP_CURRENT_DRAWING,
|
2014-02-07 19:32:08 +00:00
|
|
|
_( "End Drawing" ), KiBitmap( checked_ok_xpm ) );
|
2009-08-11 10:27:21 +00:00
|
|
|
}
|
2011-03-01 19:26:17 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
if( !flags )
|
|
|
|
{
|
2011-03-01 19:26:17 +00:00
|
|
|
msg = AddHotkeyName( _( "Move Drawing" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_MOVE_ITEM );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_DRAWING_REQUEST,
|
2011-09-08 05:58:45 +00:00
|
|
|
msg, KiBitmap( move_xpm ) );
|
2015-02-12 03:22:24 +00:00
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _( "Duplicate Drawing" ), g_Board_Editor_Hokeys_Descr,
|
2015-02-12 03:22:24 +00:00
|
|
|
HK_DUPLICATE_ITEM );
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_DUPLICATE_ITEM,
|
|
|
|
msg, KiBitmap( duplicate_line_xpm ) );
|
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _("Move Drawing Exactly" ), g_Board_Editor_Hokeys_Descr,
|
2015-02-12 03:22:24 +00:00
|
|
|
HK_MOVE_ITEM_EXACT );
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_EXACT,
|
|
|
|
msg, KiBitmap( move_line_xpm ) );
|
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _("Create Drawing Array" ), g_Board_Editor_Hokeys_Descr,
|
2015-02-12 03:22:24 +00:00
|
|
|
HK_CREATE_ARRAY );
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_CREATE_ARRAY,
|
|
|
|
msg, KiBitmap( array_line_xpm ) );
|
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _( "Edit Drawing" ), g_Board_Editor_Hokeys_Descr,
|
2015-02-12 03:22:24 +00:00
|
|
|
HK_EDIT_ITEM );
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_DRAWING,
|
|
|
|
msg, KiBitmap( edit_xpm ) );
|
|
|
|
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_DRAWING,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Delete Drawing" ), KiBitmap( delete_xpm ) );
|
2011-03-01 19:26:17 +00:00
|
|
|
|
2013-04-09 16:00:46 +00:00
|
|
|
if( !IsCopperLayer( item->GetLayer() ) )
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_DRAWING_LAYER,
|
2013-03-20 14:50:12 +00:00
|
|
|
_( "Delete All Drawings on Layer" ), KiBitmap( delete_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2011-10-01 19:24:27 +00:00
|
|
|
case PCB_ZONE_T: // Item used to fill a zone
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_ZONE,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Delete Zone Filling" ), KiBitmap( delete_xpm ) );
|
2008-01-01 11:46:47 +00:00
|
|
|
break;
|
|
|
|
|
2011-10-01 19:24:27 +00:00
|
|
|
case PCB_ZONE_AREA_T: // 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
|
|
|
{
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE,
|
2014-02-07 19:32:08 +00:00
|
|
|
_( "Close Zone Outline" ), KiBitmap( checked_ok_xpm ) );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Delete Last Corner" ), KiBitmap( delete_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
2008-04-17 16:25:29 +00:00
|
|
|
else
|
2011-09-01 12:54:34 +00:00
|
|
|
{
|
2009-08-03 18:54:48 +00:00
|
|
|
createPopUpMenuForZones( (ZONE_CONTAINER*) item, aPopMenu );
|
2011-09-01 12:54:34 +00:00
|
|
|
}
|
|
|
|
|
2007-12-29 19:15:58 +00:00
|
|
|
break;
|
|
|
|
|
2011-10-01 19:24:27 +00:00
|
|
|
case PCB_TEXT_T:
|
2009-08-03 18:54:48 +00:00
|
|
|
createPopUpMenuForTexts( (TEXTE_PCB*) item, aPopMenu );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2011-10-01 19:24:27 +00:00
|
|
|
case PCB_TRACE_T:
|
|
|
|
case PCB_VIA_T:
|
2013-09-20 10:52:33 +00:00
|
|
|
trackFound = true;
|
2007-09-15 04:25:54 +00:00
|
|
|
createPopupMenuForTracks( (TRACK*) item, aPopMenu );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2011-10-01 19:24:27 +00:00
|
|
|
case PCB_MARKER_T:
|
2009-08-01 19:26:05 +00:00
|
|
|
createPopUpMenuForMarkers( (MARKER_PCB*) item, aPopMenu );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2011-10-01 19:24:27 +00:00
|
|
|
case PCB_DIMENSION_T:
|
2007-08-20 01:20:48 +00:00
|
|
|
if( !flags )
|
|
|
|
{
|
2011-03-01 19:26:17 +00:00
|
|
|
msg = AddHotkeyName( _( "Edit Dimension" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_EDIT_ITEM );
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_DIMENSION, msg, KiBitmap( edit_xpm ) );
|
2015-02-12 03:22:24 +00:00
|
|
|
|
2011-11-24 19:57:41 +00:00
|
|
|
msg = AddHotkeyName( _( "Move Dimension Text" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_MOVE_ITEM );
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_TEXT_DIMENSION_REQUEST,
|
2017-06-02 09:51:11 +00:00
|
|
|
msg, KiBitmap( move_xpm ) );
|
2015-02-12 03:22:24 +00:00
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _( "Duplicate Dimension" ), g_Board_Editor_Hokeys_Descr,
|
2015-02-12 03:22:24 +00:00
|
|
|
HK_DUPLICATE_ITEM );
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_DUPLICATE_ITEM,
|
|
|
|
msg, KiBitmap( duplicate_text_xpm ) );
|
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _("Move Dimension Exactly" ), g_Board_Editor_Hokeys_Descr,
|
2015-02-12 03:22:24 +00:00
|
|
|
HK_MOVE_ITEM_EXACT );
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_EXACT,
|
2017-06-02 09:51:11 +00:00
|
|
|
msg, KiBitmap( move_xpm ) );
|
2015-02-12 03:22:24 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
msg = AddHotkeyName( _( "Delete Dimension" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_DELETE );
|
2015-02-12 03:22:24 +00:00
|
|
|
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_DIMENSION,
|
2016-03-20 17:52:15 +00:00
|
|
|
msg, KiBitmap( delete_dimension_xpm ) );
|
2009-08-11 10:27:21 +00:00
|
|
|
}
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2011-09-07 19:41:04 +00:00
|
|
|
case PCB_TARGET_T:
|
2007-08-20 01:20:48 +00:00
|
|
|
if( !flags )
|
|
|
|
{
|
2011-03-01 19:26:17 +00:00
|
|
|
msg = AddHotkeyName( _( "Move Target" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_MOVE_ITEM );
|
2015-02-12 03:22:24 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_MIRE_REQUEST,
|
|
|
|
msg, KiBitmap( move_target_xpm ) );
|
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _("Move Target Exactly" ), g_Board_Editor_Hokeys_Descr,
|
2015-02-12 03:22:24 +00:00
|
|
|
HK_MOVE_ITEM_EXACT );
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_EXACT,
|
|
|
|
msg, KiBitmap( move_target_xpm ) );
|
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _( "Duplicate Target" ), g_Board_Editor_Hokeys_Descr,
|
2015-02-12 03:22:24 +00:00
|
|
|
HK_DUPLICATE_ITEM );
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_DUPLICATE_ITEM,
|
|
|
|
msg, KiBitmap( duplicate_target_xpm ) );
|
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
msg = AddHotkeyName( _( "Edit Target" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_EDIT_ITEM );
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_MIRE, msg, KiBitmap( edit_xpm ) );
|
2015-02-12 03:22:24 +00:00
|
|
|
|
2011-11-24 19:57:41 +00:00
|
|
|
msg = AddHotkeyName( _( "Delete Target" ), g_Board_Editor_Hokeys_Descr, HK_DELETE );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_MIRE,
|
2011-11-24 19:57:41 +00:00
|
|
|
msg, KiBitmap( delete_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2011-10-01 19:24:27 +00:00
|
|
|
case PCB_MODULE_EDGE_T:
|
|
|
|
case SCREEN_T:
|
2007-08-20 01:20:48 +00:00
|
|
|
case TYPE_NOT_INIT:
|
2011-10-01 19:24:27 +00:00
|
|
|
case PCB_T:
|
2011-09-01 12:54:34 +00:00
|
|
|
msg.Printf( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unexpected DrawType %d" ),
|
|
|
|
item->Type() );
|
2011-11-24 19:57:41 +00:00
|
|
|
wxMessageBox( msg );
|
2008-01-28 18:44:14 +00:00
|
|
|
SetCurItem( NULL );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2011-09-01 12:54:34 +00:00
|
|
|
msg.Printf( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unknown DrawType %d" ),
|
|
|
|
item->Type() );
|
2011-11-24 19:57:41 +00:00
|
|
|
wxMessageBox( 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 );
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2013-09-20 10:52:33 +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" ),
|
2010-11-24 15:10:33 +00:00
|
|
|
g_Board_Editor_Hokeys_Descr, HK_GET_AND_MOVE_FOOTPRINT );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST,
|
2011-09-08 05:58:45 +00:00
|
|
|
msg, KiBitmap( move_module_xpm ) );
|
2007-09-12 02:14:07 +00:00
|
|
|
}
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2013-08-03 05:15:23 +00:00
|
|
|
// Display context sensitive commands:
|
2011-02-24 20:22:12 +00:00
|
|
|
switch( GetToolId() )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
|
|
|
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();
|
2014-12-06 21:21:13 +00:00
|
|
|
msg = AddHotkeyName( _( "Fill or Refill All Zones" ),
|
|
|
|
g_Board_Editor_Hokeys_Descr, HK_ZONE_FILL_OR_REFILL );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_FILL_ALL_ZONES,
|
2014-12-06 21:21:13 +00:00
|
|
|
msg, KiBitmap( fill_zone_xpm ) );
|
|
|
|
msg = AddHotkeyName( _( "Remove Filled Areas in All Zones" ),
|
|
|
|
g_Board_Editor_Hokeys_Descr, HK_ZONE_REMOVE_FILLED );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES,
|
2014-12-06 21:21:13 +00:00
|
|
|
msg, KiBitmap( zone_unfill_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
|
|
|
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_LAYER,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Select Working Layer" ), KiBitmap( select_w_layer_xpm ) );
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2012-07-13 18:55:29 +00:00
|
|
|
case ID_PCB_KEEPOUT_AREA_BUTT:
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_LAYER,
|
|
|
|
_( "Select Working Layer" ), KiBitmap( select_w_layer_xpm ) );
|
|
|
|
aPopMenu->AppendSeparator();
|
|
|
|
break;
|
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
case ID_TRACK_BUTT:
|
2013-09-20 10:52:33 +00:00
|
|
|
if ( ! trackFound ) // This menu is already added when a track is located
|
2012-12-01 20:03:33 +00:00
|
|
|
{
|
2013-09-20 10:52:33 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2012-12-01 20:03:33 +00:00
|
|
|
msg = AddHotkeyName( _( "Begin Track" ),
|
|
|
|
g_Board_Editor_Hokeys_Descr, HK_ADD_NEW_TRACK );
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_BEGIN_TRACK,
|
|
|
|
msg, KiBitmap( add_tracks_xpm ) );
|
|
|
|
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, Append_Track_Width_List( GetBoard() ),
|
2011-12-16 13:32:23 +00:00
|
|
|
ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ),
|
|
|
|
KiBitmap( width_track_xpm ) );
|
2013-09-20 10:52:33 +00:00
|
|
|
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_CU_LAYER,
|
|
|
|
_( "Select Working Layer" ), KiBitmap( select_w_layer_xpm ) );
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_LAYER_PAIR,
|
|
|
|
_( "Select Layer Pair for Vias" ), KiBitmap( select_layer_pair_xpm ) );
|
|
|
|
aPopMenu->AppendSeparator();
|
2012-12-01 20:03:33 +00:00
|
|
|
}
|
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:
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_NO_CU_LAYER,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Select Working Layer" ), KiBitmap( select_w_layer_xpm ) );
|
2007-09-06 04:34:03 +00:00
|
|
|
aPopMenu->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
case ID_PCB_MODULE_BUTT:
|
2013-09-20 10:52:33 +00:00
|
|
|
if( !flags )
|
|
|
|
{
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_DISPLAY_FOOTPRINT_DOC,
|
|
|
|
_( "Footprint Documentation" ), KiBitmap( book_xpm ) );
|
|
|
|
aPopMenu->AppendSeparator();
|
|
|
|
}
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2011-02-24 20:22:12 +00:00
|
|
|
case ID_NO_TOOL_SELECTED:
|
2011-12-16 13:32:23 +00:00
|
|
|
if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_MODULE ) )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
|
|
|
wxMenu* commands = new wxMenu;
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, commands, ID_POPUP_PCB_AUTOPLACE_COMMANDS,
|
2013-11-27 13:20:42 +00:00
|
|
|
_( "Global Spread and Place" ), KiBitmap( move_xpm ) );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( commands, ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES,
|
2013-11-27 13:20:42 +00:00
|
|
|
_( "Unlock All Footprints" ), KiBitmap( unlocked_xpm ) );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( commands, ID_POPUP_PCB_AUTOPLACE_FIXE_ALL_MODULES,
|
2013-11-27 13:20:42 +00:00
|
|
|
_( "Lock All Footprints" ), KiBitmap( locked_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
commands->AppendSeparator();
|
2013-11-27 13:20:42 +00:00
|
|
|
AddMenuItem( commands, ID_POPUP_PCB_SPREAD_ALL_MODULES,
|
|
|
|
_( "Spread out All Footprints" ), KiBitmap( move_xpm ) );
|
|
|
|
commands->Append( ID_POPUP_PCB_SPREAD_NEW_MODULES,
|
|
|
|
_( "Spread out Footprints not Already on Board" ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
commands->AppendSeparator();
|
2013-03-20 14:50:12 +00:00
|
|
|
commands->Append( ID_POPUP_PCB_AUTOPLACE_ALL_MODULES,
|
2013-11-27 13:20:42 +00:00
|
|
|
_( "Automatically Place All Footprints" ) );
|
2013-03-20 14:50:12 +00:00
|
|
|
commands->Append( ID_POPUP_PCB_AUTOPLACE_NEW_MODULES,
|
2013-11-27 13:20:42 +00:00
|
|
|
_( "Automatically Place New Footprints" ) );
|
2013-03-20 14:50:12 +00:00
|
|
|
commands->Append( ID_POPUP_PCB_AUTOPLACE_NEXT_MODULE,
|
2013-11-27 13:20:42 +00:00
|
|
|
_( "Automatically Place Next Footprints" ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_TRACKS ) )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
|
|
|
wxMenu* commands = new wxMenu;
|
2009-10-14 18:14:58 +00:00
|
|
|
aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_COMMANDS, _( "Autoroute" ), commands );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( commands, ID_POPUP_PCB_SELECT_LAYER_PAIR,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Select Layer Pair" ), KiBitmap( select_layer_pair_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
commands->AppendSeparator();
|
2013-03-20 14:50:12 +00:00
|
|
|
commands->Append( ID_POPUP_PCB_AUTOROUTE_ALL_MODULES,
|
2014-10-08 06:26:26 +00:00
|
|
|
_( "Automatically Route All Footprints" ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2013-09-20 10:52:33 +00:00
|
|
|
if( !trackFound )
|
|
|
|
{
|
|
|
|
msg = AddHotkeyName( _( "Begin Track" ), g_Board_Editor_Hokeys_Descr, HK_ADD_NEW_TRACK );
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_BEGIN_TRACK, msg, KiBitmap( add_tracks_xpm ) );
|
2012-12-01 20:03:33 +00:00
|
|
|
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, Append_Track_Width_List( GetBoard() ),
|
|
|
|
ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( width_track_xpm ) );
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2013-09-20 10:52:33 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_LAYER,
|
|
|
|
_( "Select Working Layer" ), KiBitmap( select_w_layer_xpm ) );
|
|
|
|
aPopMenu->AppendSeparator();
|
|
|
|
}
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
/* Create Pop sub menu for block commands
|
2007-08-20 01:20:48 +00:00
|
|
|
*/
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::createPopUpBlockMenu( wxMenu* menu )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2011-12-16 13:32:23 +00:00
|
|
|
AddMenuItem( menu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ),
|
|
|
|
KiBitmap( cancel_xpm ) );
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( menu, ID_POPUP_ZOOM_BLOCK, _( "Zoom Block" ), KiBitmap( zoom_area_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
menu->AppendSeparator();
|
2014-02-07 19:32:08 +00:00
|
|
|
AddMenuItem( menu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), KiBitmap( checked_ok_xpm ) );
|
2017-06-02 09:51:11 +00:00
|
|
|
AddMenuItem( menu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), KiBitmap( copy_xpm ) );
|
2014-05-31 15:49:15 +00:00
|
|
|
AddMenuItem( menu, ID_POPUP_FLIP_BLOCK, _( "Flip Block" ), KiBitmap( mirror_footprint_axisX_xpm ) );
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( menu, ID_POPUP_ROTATE_BLOCK, _( "Rotate Block" ), KiBitmap( rotate_ccw_xpm ) );
|
|
|
|
AddMenuItem( menu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), KiBitmap( delete_xpm ) );
|
2007-05-28 18:09:49 +00:00
|
|
|
}
|
2007-05-06 16:03:28 +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
|
|
|
*/
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2013-08-03 05:15:23 +00:00
|
|
|
wxPoint cursorPosition = GetCrossHairPosition();
|
2007-09-21 10:38:50 +00:00
|
|
|
wxString msg;
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2014-09-28 14:44:47 +00:00
|
|
|
SetCurrentNetClass( Track->GetNetClassName() );
|
2009-10-26 19:00:46 +00:00
|
|
|
|
2011-12-21 13:42:02 +00:00
|
|
|
int flags = Track->GetFlags();
|
2011-02-21 13:54:29 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
if( flags == 0 )
|
|
|
|
{
|
2013-09-20 10:52:33 +00:00
|
|
|
msg = AddHotkeyName( _( "Begin Track" ),
|
|
|
|
g_Board_Editor_Hokeys_Descr, HK_ADD_NEW_TRACK );
|
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_BEGIN_TRACK,
|
|
|
|
msg, KiBitmap( add_tracks_xpm ) );
|
|
|
|
|
2011-10-01 19:24:27 +00:00
|
|
|
if( Track->Type() == PCB_VIA_T )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2013-07-05 17:48:01 +00:00
|
|
|
msg = AddHotkeyName( _( "Drag Via" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_DRAG_ITEM );
|
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_TRACK_NODE, msg,
|
2011-12-16 13:32:23 +00:00
|
|
|
KiBitmap( 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
|
|
|
{
|
2010-11-24 15:10:33 +00:00
|
|
|
msg = AddHotkeyName( _( "Move Node" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_TRACK_NODE,
|
2011-09-08 05:58:45 +00:00
|
|
|
msg, KiBitmap( move_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-08-30 09:42:42 +00:00
|
|
|
msg = AddHotkeyName( _( "Drag Segments, Keep Slope" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_DRAG_TRACK_KEEP_SLOPE );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE,
|
2011-09-08 05:58:45 +00:00
|
|
|
msg, KiBitmap( drag_segment_withslope_xpm ) );
|
2015-02-12 03:22:24 +00:00
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
msg = AddHotkeyName( _( "Drag Segment" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_DRAG_ITEM );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT,
|
2011-09-08 05:58:45 +00:00
|
|
|
msg, KiBitmap( drag_track_segment_xpm ) );
|
2015-02-12 03:22:24 +00:00
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _( "Duplicate Track" ), g_Board_Editor_Hokeys_Descr,
|
2015-02-12 03:22:24 +00:00
|
|
|
HK_DUPLICATE_ITEM );
|
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM,
|
|
|
|
msg, KiBitmap( duplicate_line_xpm ) );
|
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _("Move Track Exactly" ), g_Board_Editor_Hokeys_Descr,
|
2015-02-12 03:22:24 +00:00
|
|
|
HK_MOVE_ITEM_EXACT );
|
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT,
|
|
|
|
msg, KiBitmap( move_line_xpm ) );
|
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _("Create Track Array" ), g_Board_Editor_Hokeys_Descr,
|
2015-02-12 03:22:24 +00:00
|
|
|
HK_CREATE_ARRAY );
|
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY,
|
|
|
|
msg, KiBitmap( array_line_xpm ) );
|
|
|
|
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_BREAK_TRACK,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Break Track" ), KiBitmap( break_line_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
}
|
2013-09-20 10:52:33 +00:00
|
|
|
|
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_SELECT_CU_LAYER,
|
|
|
|
_( "Select Working Layer" ), KiBitmap( select_w_layer_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
else if( flags & IS_DRAGGED ) // Drag via or node in progress
|
|
|
|
{
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_MOVED_TRACK_NODE,
|
2014-02-07 19:32:08 +00:00
|
|
|
_( "Place Node" ), KiBitmap( checked_ok_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
|
|
|
{
|
2014-04-03 07:40:55 +00:00
|
|
|
msg = AddHotkeyName( _( "End Track" ), g_Board_Editor_Hokeys_Descr, HK_LEFT_DCLICK );
|
2014-02-07 19:32:08 +00:00
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_END_TRACK, msg, KiBitmap( checked_ok_xpm ) );
|
2007-09-21 10:38:50 +00:00
|
|
|
}
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2013-08-28 16:14:39 +00:00
|
|
|
msg = AddHotkeyName( _( "Place Through Via" ), g_Board_Editor_Hokeys_Descr, HK_ADD_THROUGH_VIA );
|
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_THROUGH_VIA, msg, KiBitmap( via_xpm ) );
|
|
|
|
|
2013-09-20 10:52:33 +00:00
|
|
|
msg = AddHotkeyName( _( "Select Layer and Place Through Via" ),
|
|
|
|
g_Board_Editor_Hokeys_Descr, HK_SEL_LAYER_AND_ADD_THROUGH_VIA );
|
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_SELECT_CU_LAYER_AND_PLACE_THROUGH_VIA,
|
|
|
|
msg, KiBitmap( select_w_layer_xpm ) );
|
|
|
|
|
2014-05-13 09:22:51 +00:00
|
|
|
if( GetDesignSettings().m_BlindBuriedViaAllowed )
|
2013-08-28 16:14:39 +00:00
|
|
|
{
|
2013-09-20 10:52:33 +00:00
|
|
|
msg = AddHotkeyName( _( "Place Blind/Buried Via" ),
|
|
|
|
g_Board_Editor_Hokeys_Descr, HK_ADD_BLIND_BURIED_VIA );
|
2015-05-03 18:43:07 +00:00
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_BLIND_BURIED_VIA, msg, KiBitmap( via_buried_xpm ) );
|
2013-09-20 10:52:33 +00:00
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Select Layer and Place Blind/Buried Via" ),
|
|
|
|
g_Board_Editor_Hokeys_Descr, HK_SEL_LAYER_AND_ADD_BLIND_BURIED_VIA );
|
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_SELECT_CU_LAYER_AND_PLACE_BLIND_BURIED_VIA,
|
|
|
|
msg, KiBitmap( select_w_layer_xpm ) );
|
2013-08-28 16:14:39 +00:00
|
|
|
}
|
2008-01-28 18:44:14 +00:00
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
msg = AddHotkeyName( _( "Switch Track Posture" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_SWITCH_TRACK_POSTURE );
|
2011-12-17 21:21:03 +00:00
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_SWITCH_TRACK_POSTURE, msg,
|
|
|
|
KiBitmap( change_entry_orient_xpm ) );
|
2010-06-16 15:01:45 +00:00
|
|
|
|
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
|
|
|
{
|
2011-03-01 19:26:17 +00:00
|
|
|
msg = AddHotkeyName( _( "Place Micro Via" ), g_Board_Editor_Hokeys_Descr,
|
2009-08-03 18:54:48 +00:00
|
|
|
HK_ADD_MICROVIA );
|
2015-05-03 18:43:07 +00:00
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_MICROVIA, msg, KiBitmap( via_microvia_xpm ) );
|
2008-01-28 18:44:14 +00:00
|
|
|
}
|
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
|
|
|
{
|
2011-10-01 19:24:27 +00:00
|
|
|
if( Track->Type() == PCB_VIA_T )
|
2009-10-26 19:00:46 +00:00
|
|
|
{
|
2011-03-01 19:26:17 +00:00
|
|
|
msg = AddHotkeyName( _( "Change Via Size and Drill" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_EDIT_ITEM );
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, KiBitmap( width_segment_xpm ) );
|
2009-10-26 19:00:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-03-01 19:26:17 +00:00
|
|
|
msg = AddHotkeyName( _( "Change Segment Width" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_EDIT_ITEM );
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, KiBitmap( width_segment_xpm ) );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TRACK,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Change Track Width" ), KiBitmap( width_track_xpm ) );
|
2009-10-26 19:00:46 +00:00
|
|
|
}
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
|
2010-12-05 16:24:08 +00:00
|
|
|
// Allows switching to an other track/via size when routing
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( PopMenu, Append_Track_Width_List( GetBoard() ), ID_POPUP_PCB_SELECT_WIDTH,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Select Track Width" ), KiBitmap( width_track_xpm ) );
|
2010-02-07 11:39:22 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
// Delete control:
|
2010-09-03 14:33:09 +00:00
|
|
|
PopMenu->AppendSeparator();
|
2013-09-20 10:52:33 +00:00
|
|
|
wxMenu* trackdel_mnu = new wxMenu;
|
|
|
|
AddMenuItem( PopMenu, trackdel_mnu, ID_POPUP_PCB_DELETE_TRACK_MNU, _( "Delete" ),
|
2011-10-01 19:24:27 +00:00
|
|
|
KiBitmap( delete_xpm ) );
|
2008-01-01 11:46:47 +00:00
|
|
|
|
2011-10-01 19:24:27 +00:00
|
|
|
msg = AddHotkeyName( Track->Type()==PCB_VIA_T ?
|
2011-09-14 15:08:44 +00:00
|
|
|
_( "Delete Via" ) : _( "Delete Segment" ),
|
2010-11-24 15:10:33 +00:00
|
|
|
g_Board_Editor_Hokeys_Descr, HK_BACK_SPACE );
|
2008-01-01 11:46:47 +00:00
|
|
|
|
2013-09-20 10:52:33 +00:00
|
|
|
AddMenuItem( trackdel_mnu, ID_POPUP_PCB_DELETE_TRACKSEG, msg, KiBitmap( delete_line_xpm ) );
|
2011-03-01 19:26:17 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
if( !flags )
|
|
|
|
{
|
2010-11-24 15:10:33 +00:00
|
|
|
msg = AddHotkeyName( _( "Delete Track" ), g_Board_Editor_Hokeys_Descr, HK_DELETE );
|
2013-09-20 10:52:33 +00:00
|
|
|
AddMenuItem( trackdel_mnu, ID_POPUP_PCB_DELETE_TRACK, msg, KiBitmap( delete_track_xpm ) );
|
|
|
|
AddMenuItem( trackdel_mnu, ID_POPUP_PCB_DELETE_TRACKNET, _( "Delete Net" ),
|
2011-10-01 19:24:27 +00:00
|
|
|
KiBitmap( delete_net_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
2010-09-03 14:33:09 +00:00
|
|
|
|
|
|
|
// Add global edition command
|
|
|
|
if( !flags )
|
|
|
|
{
|
|
|
|
PopMenu->AppendSeparator();
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE,
|
2013-03-20 14:50:12 +00:00
|
|
|
_( "Edit All Tracks and Vias" ), KiBitmap( width_track_via_xpm ) );
|
2010-09-03 14:33:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Add lock/unlock flags menu:
|
2013-09-20 10:52:33 +00:00
|
|
|
wxMenu* trackflg_mnu = new wxMenu;
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2013-09-20 10:52:33 +00:00
|
|
|
AddMenuItem( PopMenu, trackflg_mnu, ID_POPUP_PCB_SETFLAGS_TRACK_MNU, _( "Set Flags" ),
|
2011-12-16 13:32:23 +00:00
|
|
|
KiBitmap( flag_xpm ) );
|
2013-09-20 10:52:33 +00:00
|
|
|
trackflg_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACKSEG, _( "Locked: Yes" ), wxEmptyString, true );
|
|
|
|
trackflg_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, _( "Locked: No" ), wxEmptyString, true );
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2011-02-13 17:53:48 +00:00
|
|
|
if( Track->GetState( TRACK_LOCKED ) )
|
2013-09-20 10:52:33 +00:00
|
|
|
trackflg_mnu->Check( ID_POPUP_PCB_LOCK_ON_TRACKSEG, true );
|
2007-08-20 01:20:48 +00:00
|
|
|
else
|
2013-09-20 10:52:33 +00:00
|
|
|
trackflg_mnu->Check( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, true );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
if( !flags )
|
|
|
|
{
|
2013-09-20 10:52:33 +00:00
|
|
|
trackflg_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACK, _( "Track Locked: Yes" ) );
|
|
|
|
trackflg_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACK, _( "Track Locked: No" ) );
|
|
|
|
trackflg_mnu->AppendSeparator();
|
|
|
|
trackflg_mnu->Append( ID_POPUP_PCB_LOCK_ON_NET, _( "Net Locked: Yes" ) );
|
|
|
|
trackflg_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
|
|
|
/* Create the wxMenuitem list for zone outlines editing and zone filling
|
|
|
|
*/
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu )
|
2008-01-01 11:46:47 +00:00
|
|
|
{
|
2010-08-10 18:34:26 +00:00
|
|
|
wxString msg;
|
|
|
|
|
2011-12-21 13:42:02 +00:00
|
|
|
if( edge_zone->GetFlags() == IS_DRAGGED )
|
2008-02-01 21:30:45 +00:00
|
|
|
{
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_PLACE_DRAGGED_ZONE_OUTLINE_SEGMENT,
|
2014-02-07 19:32:08 +00:00
|
|
|
_( "Place Edge Outline" ), KiBitmap( checked_ok_xpm ) );
|
2008-02-01 21:30:45 +00:00
|
|
|
}
|
2011-12-21 13:42:02 +00:00
|
|
|
else if( edge_zone->GetFlags() )
|
2008-01-01 11:46:47 +00:00
|
|
|
{
|
2011-12-21 13:42:02 +00:00
|
|
|
if( (edge_zone->GetFlags() & IN_EDIT ) )
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_CORNER,
|
2014-02-07 19:32:08 +00:00
|
|
|
_( "Place Corner" ), KiBitmap( checked_ok_xpm ) );
|
2008-01-28 18:44:14 +00:00
|
|
|
else
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_OUTLINES,
|
2014-02-07 19:32:08 +00:00
|
|
|
_( "Place Zone" ), KiBitmap( checked_ok_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
|
|
|
|
2012-07-13 18:55:29 +00:00
|
|
|
AddMenuItem( aPopMenu, zones_menu, -1,
|
|
|
|
edge_zone->GetIsKeepout() ? _("Keepout Area") : _( "Zones" ),
|
|
|
|
KiBitmap( add_zone_xpm ) );
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2017-03-07 12:06:00 +00:00
|
|
|
if( edge_zone->HitTestForCorner( RefPos( true ) ) )
|
2008-01-01 11:46:47 +00:00
|
|
|
{
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( zones_menu, ID_POPUP_PCB_MOVE_ZONE_CORNER,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Move Corner" ), KiBitmap( move_xpm ) );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CORNER,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Delete Corner" ), KiBitmap( delete_xpm ) );
|
2008-01-01 11:46:47 +00:00
|
|
|
}
|
2017-03-07 12:06:00 +00:00
|
|
|
else if( edge_zone->HitTestForEdge( RefPos( true ) ) )
|
2008-01-01 11:46:47 +00:00
|
|
|
{
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( zones_menu, ID_POPUP_PCB_ADD_ZONE_CORNER,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Create Corner" ), KiBitmap( add_corner_xpm ) );
|
2011-03-01 19:26:17 +00:00
|
|
|
msg = AddHotkeyName( _( "Drag Outline Segment" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_DRAG_ITEM );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( zones_menu, ID_POPUP_PCB_DRAG_ZONE_OUTLINE_SEGMENT,
|
2011-09-08 05:58:45 +00:00
|
|
|
msg, KiBitmap( drag_outline_segment_xpm ) );
|
2008-01-01 11:46:47 +00:00
|
|
|
}
|
|
|
|
|
2008-01-05 13:37:51 +00:00
|
|
|
zones_menu->AppendSeparator();
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( zones_menu, ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Add Similar Zone" ), KiBitmap( add_zone_xpm ) );
|
2008-01-01 11:46:47 +00:00
|
|
|
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( zones_menu, ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Add Cutout Area" ), KiBitmap( add_zone_cutout_xpm ) );
|
2012-06-20 09:57:36 +00:00
|
|
|
|
|
|
|
AddMenuItem( zones_menu, ID_POPUP_PCB_ZONE_DUPLICATE,
|
2015-02-12 03:22:24 +00:00
|
|
|
_( "Duplicate Zone Onto Layer" ), KiBitmap( zone_duplicate_xpm ) );
|
|
|
|
|
2008-01-05 13:37:51 +00:00
|
|
|
zones_menu->AppendSeparator();
|
2008-01-01 11:46:47 +00:00
|
|
|
|
2012-07-13 18:55:29 +00:00
|
|
|
if( ! edge_zone->GetIsKeepout() )
|
|
|
|
AddMenuItem( zones_menu, ID_POPUP_PCB_FILL_ZONE, _( "Fill Zone" ),
|
|
|
|
KiBitmap( fill_zone_xpm ) );
|
2008-01-01 11:46:47 +00:00
|
|
|
|
2015-07-27 19:45:57 +00:00
|
|
|
if( !edge_zone->GetFilledPolysList().IsEmpty() )
|
2008-10-29 15:26:53 +00:00
|
|
|
{
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( zones_menu, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE,
|
2012-02-25 19:55:40 +00:00
|
|
|
_( "Remove Filled Areas in Zone" ), KiBitmap( zone_unfill_xpm ) );
|
2008-10-29 15:26:53 +00:00
|
|
|
}
|
|
|
|
|
2010-11-24 15:10:33 +00:00
|
|
|
msg = AddHotkeyName( _( "Move Zone" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM );
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES, msg, KiBitmap( move_xpm ) );
|
2008-01-16 20:37:50 +00:00
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _("Move Zone Exactly" ), g_Board_Editor_Hokeys_Descr,
|
2015-02-12 03:22:24 +00:00
|
|
|
HK_MOVE_ITEM_EXACT );
|
|
|
|
AddMenuItem( zones_menu, ID_POPUP_PCB_MOVE_EXACT,
|
|
|
|
msg, KiBitmap( move_zone_xpm ) );
|
|
|
|
|
2013-03-20 14:50:12 +00:00
|
|
|
msg = AddHotkeyName( _( "Edit Zone Properties" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_EDIT_ITEM );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( zones_menu, ID_POPUP_PCB_EDIT_ZONE_PARAMS,
|
2011-09-08 05:58:45 +00:00
|
|
|
msg, KiBitmap( edit_xpm ) );
|
2008-01-05 13:37:51 +00:00
|
|
|
|
2008-01-16 20:37:50 +00:00
|
|
|
zones_menu->AppendSeparator();
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2013-03-20 14:50:12 +00:00
|
|
|
if( edge_zone->GetSelectedCorner() >= 0 &&
|
2017-03-07 12:06:00 +00:00
|
|
|
edge_zone->Outline()->IsVertexInHole( edge_zone->GetSelectedCorner() ) )
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CUTOUT,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Delete Cutout" ), KiBitmap( delete_xpm ) );
|
2008-01-28 18:44:14 +00:00
|
|
|
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CONTAINER,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Delete Zone Outline" ), KiBitmap( delete_xpm ) );
|
2008-01-01 11:46:47 +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
|
|
|
*/
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-08-20 01:20:48 +00:00
|
|
|
wxMenu* sub_menu_footprint;
|
2011-12-21 13:42:02 +00:00
|
|
|
int flags = aModule->GetFlags();
|
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
|
|
|
|
2011-07-14 15:42:44 +00:00
|
|
|
msg = aModule->GetSelectMenuText();
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( menu, sub_menu_footprint, -1, msg, KiBitmap( module_xpm ) );
|
2011-03-01 19:26:17 +00:00
|
|
|
|
2007-09-15 04:25:54 +00:00
|
|
|
if( !flags )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2010-11-24 15:10:33 +00:00
|
|
|
msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_MOVE_MODULE_REQUEST,
|
2011-09-08 05:58:45 +00:00
|
|
|
msg, KiBitmap( move_module_xpm ) );
|
2015-02-12 03:22:24 +00:00
|
|
|
|
2010-11-24 15:10:33 +00:00
|
|
|
msg = AddHotkeyName( _( "Drag" ), g_Board_Editor_Hokeys_Descr, HK_DRAG_ITEM );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DRAG_MODULE_REQUEST,
|
2017-06-02 09:51:11 +00:00
|
|
|
msg, KiBitmap( drag_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
2011-03-01 19:26:17 +00:00
|
|
|
|
2017-06-02 09:51:11 +00:00
|
|
|
msg = AddHotkeyName( _( "Rotate 90 deg CCW" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE,
|
2017-06-02 09:51:11 +00:00
|
|
|
msg, KiBitmap( rotate_ccw_xpm ) );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE,
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Rotate 90 deg CW" ), KiBitmap( rotate_cw_xpm ) );
|
2012-05-30 17:38:52 +00:00
|
|
|
msg = AddHotkeyName( _( "Flip" ), g_Board_Editor_Hokeys_Descr, HK_FLIP_ITEM );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_CHANGE_SIDE_MODULE,
|
2014-05-31 15:49:15 +00:00
|
|
|
msg, KiBitmap( mirror_footprint_axisX_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
if( !flags )
|
|
|
|
{
|
2013-03-04 12:08:35 +00:00
|
|
|
msg = AddHotkeyName( _( "Edit Parameters" ),
|
2013-03-01 19:59:29 +00:00
|
|
|
g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM );
|
|
|
|
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE_PRMS, msg,
|
2011-12-16 13:32:23 +00:00
|
|
|
KiBitmap( edit_module_xpm ) );
|
2015-03-14 07:43:36 +00:00
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Edit with Footprint Editor" ),
|
|
|
|
g_Board_Editor_Hokeys_Descr, HK_EDIT_MODULE_WITH_MODEDIT );
|
2013-03-01 19:59:29 +00:00
|
|
|
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE_WITH_MODEDIT,
|
2015-03-14 07:43:36 +00:00
|
|
|
msg, KiBitmap( module_editor_xpm ) );
|
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
sub_menu_footprint->AppendSeparator();
|
2015-03-14 07:43:36 +00:00
|
|
|
|
2014-10-08 06:26:26 +00:00
|
|
|
msg = AddHotkeyName( _( "Delete Footprint" ),
|
2013-03-01 19:59:29 +00:00
|
|
|
g_Board_Editor_Hokeys_Descr, HK_DELETE );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DELETE_MODULE,
|
2011-11-24 19:57:41 +00:00
|
|
|
msg, KiBitmap( delete_module_xpm ) );
|
2015-08-20 18:13:18 +00:00
|
|
|
|
|
|
|
sub_menu_footprint->AppendSeparator();
|
|
|
|
|
|
|
|
msg = AddHotkeyName( _("Move Footprint Exactly" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_MOVE_ITEM_EXACT );
|
|
|
|
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_MOVE_EXACT,
|
|
|
|
msg, KiBitmap( move_module_xpm ) );
|
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Duplicate Footprint" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_DUPLICATE_ITEM );
|
|
|
|
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DUPLICATE_ITEM,
|
|
|
|
msg, KiBitmap( duplicate_module_xpm ) );
|
|
|
|
|
|
|
|
msg = AddHotkeyName( _("Create Footprint Array" ), g_Board_Editor_Hokeys_Descr,
|
|
|
|
HK_CREATE_ARRAY );
|
|
|
|
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_CREATE_ARRAY,
|
|
|
|
msg, KiBitmap( array_module_xpm ) );
|
|
|
|
|
|
|
|
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EXCHANGE_FOOTPRINTS,
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Exchange Footprint" ), KiBitmap( exchange_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
|
|
|
/* Create the wxMenuitem list for editing texts on footprints
|
2007-08-20 01:20:48 +00:00
|
|
|
*/
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* menu )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-08-20 01:20:48 +00:00
|
|
|
wxMenu* sub_menu_Fp_text;
|
2011-12-21 13:42:02 +00:00
|
|
|
int flags = FpText->GetFlags();
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2011-07-14 15:42:44 +00:00
|
|
|
wxString msg = FpText->GetSelectMenuText();
|
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
|
|
|
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( menu, sub_menu_Fp_text, -1, msg, KiBitmap( footprint_text_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
if( !flags )
|
2010-08-12 19:41:13 +00:00
|
|
|
{
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _( "Move Text" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST,
|
2011-09-08 05:58:45 +00:00
|
|
|
msg, KiBitmap( move_field_xpm ) );
|
2015-02-12 03:22:24 +00:00
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _("Move Text Exactly" ), g_Board_Editor_Hokeys_Descr,
|
2015-02-12 03:22:24 +00:00
|
|
|
HK_MOVE_ITEM_EXACT );
|
2015-04-03 19:10:09 +00:00
|
|
|
AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_MOVE_EXACT,
|
2017-06-02 09:51:11 +00:00
|
|
|
msg, KiBitmap( move_xpm ) );
|
2010-08-12 19:41:13 +00:00
|
|
|
}
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _( "Rotate Text" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_ROTATE_TEXTMODULE,
|
2017-06-02 09:51:11 +00:00
|
|
|
msg, KiBitmap( rotate_cw_xpm ) );
|
2015-04-03 19:10:09 +00:00
|
|
|
|
2009-08-11 14:10:34 +00:00
|
|
|
if( !flags )
|
2010-08-10 18:34:26 +00:00
|
|
|
{
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _( "Edit Text" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_EDIT_TEXTMODULE,
|
2011-09-08 05:58:45 +00:00
|
|
|
msg, KiBitmap( edit_text_xpm ) );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_RESET_TEXT_SIZE,
|
2011-09-08 05:58:45 +00:00
|
|
|
_( "Reset Size" ), KiBitmap( reset_text_xpm ) );
|
2010-08-10 18:34:26 +00:00
|
|
|
}
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
// Graphic texts can be deleted only if are not currently edited.
|
2013-04-07 11:55:18 +00:00
|
|
|
if( !flags && FpText->GetType() == TEXTE_MODULE::TEXT_is_DIVERS )
|
2009-08-11 10:27:21 +00:00
|
|
|
{
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_DELETE_TEXTMODULE,
|
2015-04-03 19:10:09 +00:00
|
|
|
_( "Delete Text" ), KiBitmap( 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();
|
2011-03-01 19:26:17 +00:00
|
|
|
|
2007-09-15 04:25:54 +00:00
|
|
|
if( module )
|
|
|
|
{
|
|
|
|
menu->AppendSeparator();
|
|
|
|
createPopUpMenuForFootprints( module, menu );
|
|
|
|
}
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-10-26 19:00:46 +00:00
|
|
|
/* Create pop menu for pads
|
|
|
|
* also update Netclass selection
|
|
|
|
*/
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-08-03 18:54:48 +00:00
|
|
|
wxMenu* sub_menu_Pad;
|
2011-12-21 13:42:02 +00:00
|
|
|
int flags = Pad->GetFlags();
|
2009-08-03 18:54:48 +00:00
|
|
|
|
|
|
|
if( flags ) // Currently in edit, no others commands possible
|
|
|
|
return;
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2014-09-28 14:44:47 +00:00
|
|
|
SetCurrentNetClass( Pad->GetNetClassName() );
|
2009-10-26 19:00:46 +00:00
|
|
|
|
2011-07-14 15:42:44 +00:00
|
|
|
wxString msg = Pad->GetSelectMenuText();
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
sub_menu_Pad = new wxMenu;
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( menu, sub_menu_Pad, -1, msg, KiBitmap( pad_xpm ) );
|
2009-08-03 18:54:48 +00:00
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_MOVE_PAD_REQUEST, _( "Move Pad" ),
|
2011-12-16 13:32:23 +00:00
|
|
|
KiBitmap( move_pad_xpm ) );
|
2015-04-03 19:10:09 +00:00
|
|
|
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_DRAG_PAD_REQUEST, _( "Drag Pad" ),
|
2011-12-16 13:32:23 +00:00
|
|
|
KiBitmap( drag_pad_xpm ) );
|
2009-08-03 18:54:48 +00:00
|
|
|
|
2015-04-03 19:10:09 +00:00
|
|
|
msg = AddHotkeyName( _( "Edit Pad" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM );
|
2012-12-27 16:42:41 +00:00
|
|
|
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_EDIT_PAD, msg, KiBitmap( options_pad_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
sub_menu_Pad->AppendSeparator();
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2017-02-03 18:56:56 +00:00
|
|
|
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_COPY_PAD_SETTINGS,
|
|
|
|
_( "Copy Pad Settings" ),
|
2011-09-01 12:54:34 +00:00
|
|
|
wxEmptyString,
|
2017-02-03 18:56:56 +00:00
|
|
|
KiBitmap( copy_pad_settings_xpm ) );
|
|
|
|
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_APPLY_PAD_SETTINGS,
|
|
|
|
_( "Apply Pad Settings" ),
|
2011-09-01 12:54:34 +00:00
|
|
|
wxEmptyString,
|
2017-02-03 18:56:56 +00:00
|
|
|
KiBitmap( apply_pad_settings_xpm ) );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS,
|
2017-02-03 18:56:56 +00:00
|
|
|
_( "Push Pad Settings" ),
|
2013-03-20 14:50:12 +00:00
|
|
|
_( "Copy this pad's settings to all pads in this footprint (or similar footprints)" ),
|
2017-02-03 20:47:01 +00:00
|
|
|
KiBitmap( push_pad_settings_xpm ) );
|
2009-08-03 18:54:48 +00:00
|
|
|
sub_menu_Pad->AppendSeparator();
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_DELETE_PAD, _( "Delete" ), KiBitmap( delete_pad_xpm ) );
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_TRACKS ) )
|
2007-09-15 04:25:54 +00:00
|
|
|
{
|
2013-03-20 14:50:12 +00:00
|
|
|
menu->Append( ID_POPUP_PCB_AUTOROUTE_PAD, _( "Automatically Route Pad" ) );
|
|
|
|
menu->Append( ID_POPUP_PCB_AUTOROUTE_NET, _( "Automatically Route Net" ) );
|
2007-09-15 04:25:54 +00:00
|
|
|
}
|
2011-03-01 19:26:17 +00:00
|
|
|
|
2015-11-04 08:48:34 +00:00
|
|
|
MODULE* module = Pad->GetParent();
|
2011-03-01 19:26:17 +00:00
|
|
|
|
2009-08-03 18:54:48 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-03 05:15:23 +00:00
|
|
|
// Create pop menu for pcb texts
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-08-20 01:20:48 +00:00
|
|
|
wxMenu* sub_menu_Text;
|
2011-12-21 13:42:02 +00:00
|
|
|
int flags = Text->GetFlags();
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2011-07-14 15:42:44 +00:00
|
|
|
wxString msg = Text->GetSelectMenuText();
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
sub_menu_Text = new wxMenu;
|
2007-09-21 10:38:50 +00:00
|
|
|
|
2017-06-02 09:51:11 +00:00
|
|
|
AddMenuItem( menu, sub_menu_Text, -1, msg, KiBitmap( text_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
if( !flags )
|
|
|
|
{
|
2010-11-24 15:10:33 +00:00
|
|
|
msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST,
|
2017-06-02 09:51:11 +00:00
|
|
|
msg, KiBitmap( move_xpm ) );
|
2012-07-04 19:50:47 +00:00
|
|
|
msg = AddHotkeyName( _( "Copy" ), g_Board_Editor_Hokeys_Descr, HK_COPY_ITEM );
|
|
|
|
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_COPY_TEXTEPCB,
|
2017-06-02 09:51:11 +00:00
|
|
|
msg, KiBitmap( copy_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
2011-12-16 13:32:23 +00:00
|
|
|
|
2010-11-24 15:10:33 +00:00
|
|
|
msg = AddHotkeyName( _( "Rotate" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM );
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_ROTATE_TEXTEPCB, msg, KiBitmap( rotate_ccw_xpm ) );
|
2012-05-30 17:38:52 +00:00
|
|
|
msg = AddHotkeyName( _( "Flip" ), g_Board_Editor_Hokeys_Descr, HK_FLIP_ITEM );
|
2014-05-31 15:49:15 +00:00
|
|
|
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_FLIP_TEXTEPCB, msg, KiBitmap( mirror_h_xpm ) );
|
2010-11-24 15:10:33 +00:00
|
|
|
msg = AddHotkeyName( _( "Edit" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM );
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_EDIT_TEXTEPCB, msg, KiBitmap( edit_text_xpm ) );
|
2012-07-04 19:50:47 +00:00
|
|
|
if( !flags )
|
|
|
|
{
|
|
|
|
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_RESET_TEXT_SIZE,
|
|
|
|
_( "Reset Size" ), KiBitmap( reset_text_xpm ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2012-07-04 19:50:47 +00:00
|
|
|
sub_menu_Text->AppendSeparator();
|
|
|
|
msg = AddHotkeyName( _( "Delete" ), g_Board_Editor_Hokeys_Descr, HK_DELETE );
|
|
|
|
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_DELETE_TEXTEPCB, msg, KiBitmap( 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
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu )
|
2009-07-13 15:25:41 +00:00
|
|
|
{
|
2011-12-16 13:32:23 +00:00
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_MARKER, _( "Delete Marker" ),
|
|
|
|
KiBitmap( delete_xpm ) );
|
|
|
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_GETINFO_MARKER, _( "Marker Error Info" ),
|
|
|
|
KiBitmap( info_xpm ) );
|
2009-07-13 15:25:41 +00:00
|
|
|
}
|
2009-08-06 07:11:04 +00:00
|
|
|
|
|
|
|
|
2010-11-12 16:36:43 +00:00
|
|
|
/**
|
|
|
|
* Function Append_Track_Width_List
|
2009-10-03 17:18:08 +00:00
|
|
|
* creates a wxMenu * which shows the last used track widths and via diameters
|
2013-03-20 14:50:12 +00:00
|
|
|
* @return a pointer to the menu
|
2009-08-06 07:11:04 +00:00
|
|
|
*/
|
2011-03-01 19:26:17 +00:00
|
|
|
static wxMenu* Append_Track_Width_List( BOARD* aBoard )
|
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;
|
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
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
|
|
|
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
if( aBoard->GetDesignSettings().m_UseConnectedTrackWidth )
|
2009-10-03 17:18:08 +00:00
|
|
|
trackwidth_menu->Check( ID_POPUP_PCB_SELECT_AUTO_WIDTH, true );
|
|
|
|
|
2014-05-13 09:22:51 +00:00
|
|
|
if( aBoard->GetDesignSettings().GetViaSizeIndex() != 0
|
|
|
|
|| aBoard->GetDesignSettings().GetTrackWidthIndex() != 0
|
2013-01-09 18:52:44 +00:00
|
|
|
|| aBoard->GetDesignSettings().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
|
|
|
|
2014-05-13 09:22:51 +00:00
|
|
|
for( unsigned ii = 0; ii < aBoard->GetDesignSettings().m_TrackWidthList.size(); ii++ )
|
2009-08-06 07:11:04 +00:00
|
|
|
{
|
2014-05-13 09:22:51 +00:00
|
|
|
value = StringFromValue( g_UserUnit, aBoard->GetDesignSettings().m_TrackWidthList[ii], true );
|
2009-10-30 17:58:15 +00:00
|
|
|
msg.Printf( _( "Track %s" ), GetChars( value ) );
|
2011-03-01 19:26:17 +00:00
|
|
|
|
2009-10-30 17:58:15 +00:00
|
|
|
if( ii == 0 )
|
2013-03-20 14:50:12 +00:00
|
|
|
msg << _( " uses NetClass" );
|
2009-10-30 17:58:15 +00:00
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
trackwidth_menu->Append( ID_POPUP_PCB_SELECT_WIDTH1 + ii, msg, wxEmptyString, true );
|
2009-08-06 07:11:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
trackwidth_menu->AppendSeparator();
|
2011-03-01 19:26:17 +00:00
|
|
|
|
2014-05-13 09:22:51 +00:00
|
|
|
for( unsigned ii = 0; ii < aBoard->GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
|
2009-08-06 07:11:04 +00:00
|
|
|
{
|
2014-05-13 09:22:51 +00:00
|
|
|
value = StringFromValue( g_UserUnit,
|
|
|
|
aBoard->GetDesignSettings().m_ViasDimensionsList[ii].m_Diameter,
|
|
|
|
true );
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
wxString drill = StringFromValue( g_UserUnit,
|
2014-05-13 09:22:51 +00:00
|
|
|
aBoard->GetDesignSettings().m_ViasDimensionsList[ii].m_Drill,
|
|
|
|
true );
|
2011-03-01 19:26:17 +00:00
|
|
|
|
2014-05-13 09:22:51 +00:00
|
|
|
if( aBoard->GetDesignSettings().m_ViasDimensionsList[ii].m_Drill <= 0 )
|
2011-09-01 12:54:34 +00:00
|
|
|
{
|
2009-10-30 17:58:15 +00:00
|
|
|
msg.Printf( _( "Via %s" ), GetChars( value ) );
|
2011-09-01 12:54:34 +00:00
|
|
|
}
|
2009-08-06 07:11:04 +00:00
|
|
|
else
|
2009-10-30 17:58:15 +00:00
|
|
|
{
|
2013-03-20 14:50:12 +00:00
|
|
|
msg.Printf( _( "Via %s, drill %s" ), GetChars( value ), GetChars( drill ) );
|
2009-10-30 17:58:15 +00:00
|
|
|
}
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2009-10-30 17:58:15 +00:00
|
|
|
if( ii == 0 )
|
2013-03-20 14:50:12 +00:00
|
|
|
msg << _( " uses NetClass" );
|
2011-03-01 19:26:17 +00:00
|
|
|
|
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
|
|
|
|
2009-08-06 07:11:04 +00:00
|
|
|
return trackwidth_menu;
|
|
|
|
}
|