2011-03-21 20:35:16 +00:00
|
|
|
/**
|
|
|
|
* @file libedit_onrightclick.cpp
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
/* , In library editor, create the pop menu when clicking on mouse right button
|
2009-09-22 12:27:57 +00:00
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
#include "gr_basic.h"
|
|
|
|
#include "common.h"
|
2010-11-10 15:30:12 +00:00
|
|
|
#include "macros.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "confirm.h"
|
2009-09-22 12:27:57 +00:00
|
|
|
#include "bitmaps.h"
|
|
|
|
#include "eeschema_id.h"
|
|
|
|
#include "hotkeys.h"
|
2011-04-27 19:44:32 +00:00
|
|
|
#include "class_drawpanel.h"
|
2010-11-10 15:30:12 +00:00
|
|
|
#include "class_sch_screen.h"
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "general.h"
|
|
|
|
#include "protos.h"
|
2010-02-16 16:21:52 +00:00
|
|
|
#include "libeditframe.h"
|
2009-09-25 18:49:04 +00:00
|
|
|
#include "class_libentry.h"
|
2010-10-22 12:11:52 +00:00
|
|
|
#include "lib_pin.h"
|
2010-10-08 20:40:57 +00:00
|
|
|
#include "lib_polyline.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* functions to add commands and submenus depending on the item */
|
2010-11-19 16:28:46 +00:00
|
|
|
static void AddMenusForBlock( wxMenu* PopMenu, LIB_EDIT_FRAME* frame );
|
|
|
|
static void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin, LIB_EDIT_FRAME* frame );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2011-04-27 19:44:32 +00:00
|
|
|
LIB_ITEM* item = GetDrawItem();
|
2011-02-05 19:22:58 +00:00
|
|
|
bool BlockActive = GetScreen()->IsBlockActive();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-02-16 10:14:02 +00:00
|
|
|
if( BlockActive )
|
|
|
|
{
|
|
|
|
AddMenusForBlock( PopMenu, this );
|
|
|
|
PopMenu->AppendSeparator();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2009-09-25 18:49:04 +00:00
|
|
|
if( m_component == NULL )
|
2009-09-22 12:27:57 +00:00
|
|
|
return true;
|
2008-10-18 23:41:16 +00:00
|
|
|
|
2011-02-16 10:14:02 +00:00
|
|
|
// If Command in progress, put menu "cancel"
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item && item->GetFlags() )
|
2008-10-18 23:41:16 +00:00
|
|
|
{
|
2011-02-24 20:22:12 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, _( "Cancel" ), cancel_xpm );
|
2008-10-18 23:41:16 +00:00
|
|
|
PopMenu->AppendSeparator();
|
|
|
|
}
|
2011-03-21 20:35:16 +00:00
|
|
|
else
|
|
|
|
{
|
2011-04-27 19:44:32 +00:00
|
|
|
item = LocateItemUsingCursor( aPosition );
|
|
|
|
|
|
|
|
// If the clarify item selection context menu is aborted, don't show the context menu.
|
|
|
|
if( item == NULL && DrawPanel->m_AbortRequest )
|
|
|
|
{
|
|
|
|
DrawPanel->m_AbortRequest = false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-03-21 20:35:16 +00:00
|
|
|
if( GetToolId() != ID_NO_TOOL_SELECTED )
|
|
|
|
{
|
|
|
|
// If a tool is active, put menu "end tool"
|
2011-04-27 19:44:32 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, _( "End Tool" ),
|
|
|
|
cancel_tool_xpm );
|
2011-03-21 20:35:16 +00:00
|
|
|
PopMenu->AppendSeparator();
|
|
|
|
}
|
2008-10-18 23:41:16 +00:00
|
|
|
}
|
2011-02-23 13:48:19 +00:00
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item )
|
|
|
|
item->DisplayInfo( this );
|
2009-04-05 20:49:15 +00:00
|
|
|
else
|
|
|
|
return true;
|
2008-10-18 23:41:16 +00:00
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
m_drawItem = item;
|
2008-10-18 23:41:16 +00:00
|
|
|
wxString msg;
|
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
switch( item->Type() )
|
2008-10-18 23:41:16 +00:00
|
|
|
{
|
2010-12-10 19:47:44 +00:00
|
|
|
case LIB_PIN_T:
|
2011-04-27 19:44:32 +00:00
|
|
|
AddMenusForPin( PopMenu, (LIB_PIN*) item, this );
|
2009-09-22 12:27:57 +00:00
|
|
|
break;
|
2008-10-18 23:41:16 +00:00
|
|
|
|
2010-12-10 19:47:44 +00:00
|
|
|
case LIB_ARC_T:
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item->GetFlags() == 0 )
|
2009-09-22 12:27:57 +00:00
|
|
|
{
|
2010-10-23 10:09:23 +00:00
|
|
|
msg = AddHotkeyName( _( "Move Arc" ), s_Libedit_Hokeys_Descr,
|
2009-12-06 18:04:41 +00:00
|
|
|
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
|
2010-12-10 19:47:44 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_arc_xpm );
|
|
|
|
msg = AddHotkeyName( _( "Drag Arc Size" ), s_Libedit_Hokeys_Descr, HK_DRAG );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg, move_arc_xpm );
|
2009-09-22 12:27:57 +00:00
|
|
|
}
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Edit Arc Options" ), s_Libedit_Hokeys_Descr, HK_EDIT );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, options_arc_xpm );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item->GetFlags() == 0 )
|
2009-09-22 12:27:57 +00:00
|
|
|
{
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Delete Arc" ), s_Libedit_Hokeys_Descr, HK_DELETE );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_arc_xpm );
|
2009-09-22 12:27:57 +00:00
|
|
|
}
|
|
|
|
break;
|
2008-10-18 23:41:16 +00:00
|
|
|
|
2010-12-10 19:47:44 +00:00
|
|
|
case LIB_CIRCLE_T:
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item->GetFlags() == 0 )
|
2009-09-22 12:27:57 +00:00
|
|
|
{
|
2010-10-23 10:09:23 +00:00
|
|
|
msg = AddHotkeyName( _( "Move Circle" ), s_Libedit_Hokeys_Descr,
|
2009-12-06 18:04:41 +00:00
|
|
|
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
|
2010-12-10 19:47:44 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_circle_xpm );
|
2009-09-22 12:27:57 +00:00
|
|
|
}
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item->GetFlags() == 0 )
|
2010-07-26 17:06:36 +00:00
|
|
|
{
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Drag Circle Outline" ), s_Libedit_Hokeys_Descr, HK_DRAG );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg, move_rectangle_xpm );
|
2010-07-26 17:06:36 +00:00
|
|
|
}
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Edit Circle Options" ), s_Libedit_Hokeys_Descr, HK_EDIT );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, options_circle_xpm );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item->GetFlags() == 0 )
|
2009-09-22 12:27:57 +00:00
|
|
|
{
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Delete Circle" ), s_Libedit_Hokeys_Descr, HK_DELETE );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_circle_xpm );
|
2009-09-22 12:27:57 +00:00
|
|
|
}
|
|
|
|
break;
|
2008-10-18 23:41:16 +00:00
|
|
|
|
2010-12-10 19:47:44 +00:00
|
|
|
case LIB_RECTANGLE_T:
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item->GetFlags() == 0 )
|
2009-09-22 12:27:57 +00:00
|
|
|
{
|
2010-10-23 10:09:23 +00:00
|
|
|
msg = AddHotkeyName( _( "Move Rectangle" ), s_Libedit_Hokeys_Descr,
|
2009-12-06 18:04:41 +00:00
|
|
|
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
|
2010-12-10 19:47:44 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_rectangle_xpm );
|
2009-09-22 12:27:57 +00:00
|
|
|
}
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Edit Rectangle Options" ), s_Libedit_Hokeys_Descr, HK_EDIT );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, options_rectangle_xpm );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item->GetFlags() == 0 )
|
2010-07-26 17:06:36 +00:00
|
|
|
{
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Drag Rectangle Edge" ), s_Libedit_Hokeys_Descr, HK_DRAG );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg, move_rectangle_xpm );
|
2010-07-26 17:06:36 +00:00
|
|
|
}
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item->GetFlags() == 0 )
|
2009-09-22 12:27:57 +00:00
|
|
|
{
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Delete Rectangle" ), s_Libedit_Hokeys_Descr, HK_DELETE );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_rectangle_xpm );
|
2009-09-22 12:27:57 +00:00
|
|
|
}
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
break;
|
2008-10-18 23:41:16 +00:00
|
|
|
|
2010-12-10 19:47:44 +00:00
|
|
|
case LIB_TEXT_T:
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item->GetFlags() == 0 )
|
2009-09-22 12:27:57 +00:00
|
|
|
{
|
2010-10-23 10:09:23 +00:00
|
|
|
msg = AddHotkeyName( _( "Move Text" ), s_Libedit_Hokeys_Descr,
|
2009-12-06 18:04:41 +00:00
|
|
|
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
|
2010-12-10 19:47:44 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_text_xpm );
|
2009-09-22 12:27:57 +00:00
|
|
|
}
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Edit Text" ), s_Libedit_Hokeys_Descr, HK_EDIT );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, edit_text_xpm );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Rotate Text" ), s_Libedit_Hokeys_Descr, HK_ROTATE );
|
2011-02-28 13:53:49 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_LIBEDIT_ROTATE_ITEM, msg, edit_text_xpm );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item->GetFlags() == 0 )
|
2009-09-22 12:27:57 +00:00
|
|
|
{
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Delete Text" ), s_Libedit_Hokeys_Descr, HK_DELETE );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_text_xpm );
|
2009-09-22 12:27:57 +00:00
|
|
|
}
|
|
|
|
break;
|
2008-10-18 23:41:16 +00:00
|
|
|
|
2010-12-10 19:47:44 +00:00
|
|
|
case LIB_POLYLINE_T:
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item->GetFlags() == 0 )
|
2009-09-22 12:27:57 +00:00
|
|
|
{
|
2010-10-23 10:09:23 +00:00
|
|
|
msg = AddHotkeyName( _( "Move Line" ), s_Libedit_Hokeys_Descr,
|
2009-12-06 18:04:41 +00:00
|
|
|
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
|
2010-12-10 19:47:44 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_line_xpm );
|
|
|
|
msg = AddHotkeyName( _( "Drag Edge Point" ), s_Libedit_Hokeys_Descr, HK_DRAG );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg, move_line_xpm );
|
2009-09-22 12:27:57 +00:00
|
|
|
}
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item->IsNew() )
|
2009-09-22 12:27:57 +00:00
|
|
|
{
|
2010-12-10 19:47:44 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_END_CREATE_ITEM, _( "Line End" ), apply_xpm );
|
2009-09-22 12:27:57 +00:00
|
|
|
}
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Edit Line Options" ), s_Libedit_Hokeys_Descr, HK_EDIT );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, options_segment_xpm );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item->GetFlags() == 0 )
|
2009-09-22 12:27:57 +00:00
|
|
|
{
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Delete Line " ), s_Libedit_Hokeys_Descr, HK_DELETE );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_segment_xpm );
|
2009-09-22 12:27:57 +00:00
|
|
|
}
|
2011-04-27 19:44:32 +00:00
|
|
|
else if( item->IsNew() )
|
2009-09-22 12:27:57 +00:00
|
|
|
{
|
2011-04-27 19:44:32 +00:00
|
|
|
if( ( (LIB_POLYLINE*) item )->GetCornerCount() > 2 )
|
2008-10-18 23:41:16 +00:00
|
|
|
{
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Delete Segment" ), s_Libedit_Hokeys_Descr, HK_DELETE );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT,
|
2009-09-22 12:27:57 +00:00
|
|
|
msg, delete_segment_xpm );
|
2008-10-18 23:41:16 +00:00
|
|
|
}
|
2009-09-22 12:27:57 +00:00
|
|
|
}
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
break;
|
2008-10-18 23:41:16 +00:00
|
|
|
|
2010-12-10 19:47:44 +00:00
|
|
|
case LIB_FIELD_T:
|
2011-04-27 19:44:32 +00:00
|
|
|
if( item->GetFlags() == 0 )
|
2009-09-22 12:27:57 +00:00
|
|
|
{
|
2010-10-23 10:09:23 +00:00
|
|
|
msg = AddHotkeyName( _( "Move Field" ), s_Libedit_Hokeys_Descr,
|
2009-12-06 18:04:41 +00:00
|
|
|
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
|
2010-12-10 19:47:44 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_field_xpm );
|
2009-09-22 12:27:57 +00:00
|
|
|
}
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Field Rotate" ), s_Libedit_Hokeys_Descr, HK_ROTATE );
|
2011-02-28 13:53:49 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_LIBEDIT_ROTATE_ITEM, msg, rotate_field_xpm );
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Field Edit" ), s_Libedit_Hokeys_Descr, HK_EDIT );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM, msg, edit_text_xpm );
|
2009-09-22 12:27:57 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
2011-04-27 19:44:32 +00:00
|
|
|
wxFAIL_MSG( wxString::Format( wxT( "Unknown library item type %d" ),
|
|
|
|
item->Type() ) );
|
2009-09-25 18:49:04 +00:00
|
|
|
m_drawItem = NULL;
|
2009-09-22 12:27:57 +00:00
|
|
|
break;
|
2008-10-18 23:41:16 +00:00
|
|
|
}
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2008-10-18 23:41:16 +00:00
|
|
|
PopMenu->AppendSeparator();
|
|
|
|
return true;
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2010-11-19 16:28:46 +00:00
|
|
|
void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin, LIB_EDIT_FRAME* frame )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-09-22 12:27:57 +00:00
|
|
|
bool selected = (Pin->m_Selected & IS_SELECTED) != 0;
|
2011-04-27 19:44:32 +00:00
|
|
|
bool not_in_move = (Pin->GetFlags() == 0);
|
2009-12-06 18:04:41 +00:00
|
|
|
wxString msg;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2008-10-18 23:41:16 +00:00
|
|
|
if( not_in_move )
|
2009-12-06 18:04:41 +00:00
|
|
|
{
|
|
|
|
msg = AddHotkeyName( _( "Move Pin " ), s_Libedit_Hokeys_Descr,
|
|
|
|
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
|
2010-12-10 19:47:44 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_xpm );
|
2009-12-06 18:04:41 +00:00
|
|
|
}
|
2008-10-18 23:41:16 +00:00
|
|
|
|
2010-02-04 17:46:12 +00:00
|
|
|
msg = AddHotkeyName( _( "Edit Pin " ), s_Libedit_Hokeys_Descr, HK_EDIT);
|
2009-10-30 19:26:25 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_LIBEDIT_EDIT_PIN, msg, edit_xpm );
|
2008-10-18 23:41:16 +00:00
|
|
|
|
2010-02-04 17:46:12 +00:00
|
|
|
msg = AddHotkeyName( _( "Rotate Pin " ), s_Libedit_Hokeys_Descr, HK_ROTATE );
|
2011-02-28 13:53:49 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_LIBEDIT_ROTATE_ITEM, msg, rotate_pin_xpm );
|
2010-01-17 20:25:10 +00:00
|
|
|
|
2008-10-18 23:41:16 +00:00
|
|
|
if( not_in_move )
|
|
|
|
{
|
2010-12-10 19:47:44 +00:00
|
|
|
msg = AddHotkeyName( _( "Delete Pin " ), s_Libedit_Hokeys_Descr, HK_DELETE );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_pin_xpm );
|
2008-10-18 23:41:16 +00:00
|
|
|
}
|
2010-12-10 19:47:44 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
wxMenu* global_pin_change = new wxMenu;
|
|
|
|
ADD_MENUITEM_WITH_SUBMENU( PopMenu, global_pin_change,
|
|
|
|
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM,
|
|
|
|
_( "Global" ), pin_to_xpm );
|
|
|
|
ADD_MENUITEM( global_pin_change,
|
|
|
|
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM,
|
|
|
|
selected ? _( "Pin Size to selected pins" ) :
|
|
|
|
_( "Pin Size to Others" ), pin_size_to_xpm );
|
|
|
|
ADD_MENUITEM( global_pin_change,
|
|
|
|
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM,
|
|
|
|
selected ? _( "Pin Name Size to selected pin" ) :
|
|
|
|
_( "Pin Name Size to Others" ), pin_name_to_xpm );
|
|
|
|
ADD_MENUITEM( global_pin_change,
|
|
|
|
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM,
|
|
|
|
selected ? _( "Pin Num Size to selected pin" ) :
|
|
|
|
_( "Pin Num Size to Others" ), pin_number_to_xpm );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
/* Add menu commands for block */
|
|
|
|
|
2010-11-19 16:28:46 +00:00
|
|
|
void AddMenusForBlock( wxMenu* PopMenu, LIB_EDIT_FRAME* frame )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2010-12-10 19:47:44 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, _( "Cancel Block" ), cancel_xpm );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-07-25 04:53:39 +00:00
|
|
|
if( frame->GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE )
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_ZOOM_BLOCK,
|
|
|
|
_( "Zoom Block (drag middle mouse)" ),
|
2011-03-20 17:10:38 +00:00
|
|
|
zoom_area_xpm );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2008-10-18 23:41:16 +00:00
|
|
|
PopMenu->AppendSeparator();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2010-12-10 19:47:44 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), apply_xpm );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-07-25 04:53:39 +00:00
|
|
|
if( frame->GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE )
|
2008-10-18 23:41:16 +00:00
|
|
|
{
|
2010-12-10 19:47:44 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_SELECT_ITEMS_BLOCK, _( "Select Items" ), green_xpm );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), copyblock_xpm );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_MIRROR_Y_BLOCK, _( "Mirror Block ||" ), mirror_H_xpm );
|
2011-05-20 18:29:35 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_MIRROR_X_BLOCK, _( "Mirror Block --" ), mirror_V_xpm );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_ROTATE_BLOCK, _( "Rotate Block ccw" ), rotate_pos_xpm );
|
2010-12-10 19:47:44 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), delete_xpm );
|
2008-10-18 23:41:16 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|