2009-09-22 12:27:57 +00:00
|
|
|
/****************************/
|
|
|
|
/* EESchema - 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"
|
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"
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "program.h"
|
|
|
|
#include "general.h"
|
|
|
|
#include "protos.h"
|
2009-09-22 12:27:57 +00:00
|
|
|
#include "libeditfrm.h"
|
2009-09-25 18:49:04 +00:00
|
|
|
#include "class_libentry.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* functions to add commands and submenus depending on the item */
|
2009-09-22 12:27:57 +00:00
|
|
|
static void AddMenusForBlock( wxMenu* PopMenu, WinEDA_LibeditFrame* frame );
|
2009-10-08 13:19:28 +00:00
|
|
|
static void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin,
|
2009-09-22 12:27:57 +00:00
|
|
|
WinEDA_LibeditFrame* frame );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
bool WinEDA_LibeditFrame::OnRightClick( const wxPoint& MousePos,
|
|
|
|
wxMenu* PopMenu )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-09-25 18:49:04 +00:00
|
|
|
LIB_DRAW_ITEM* DrawEntry = LocateItemUsingCursor();
|
2009-09-22 12:27:57 +00:00
|
|
|
bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
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
|
|
|
|
|
|
|
// If Command in progresss: put the menu "cancel" and "end tool"
|
2009-09-22 12:27:57 +00:00
|
|
|
if( m_ID_current_state )
|
2008-10-18 23:41:16 +00:00
|
|
|
{
|
2009-09-22 12:27:57 +00:00
|
|
|
if( DrawEntry && DrawEntry->m_Flags )
|
2008-10-18 23:41:16 +00:00
|
|
|
{
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING,
|
|
|
|
_( "Cancel" ), cancel_xpm );
|
2008-10-18 23:41:16 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING,
|
|
|
|
_( "End Tool" ), cancel_tool_xpm );
|
2008-10-18 23:41:16 +00:00
|
|
|
}
|
|
|
|
PopMenu->AppendSeparator();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-09-22 12:27:57 +00:00
|
|
|
if( (DrawEntry && DrawEntry->m_Flags) || BlockActive )
|
2008-10-18 23:41:16 +00:00
|
|
|
{
|
2009-09-22 12:27:57 +00:00
|
|
|
if( BlockActive )
|
|
|
|
AddMenusForBlock( PopMenu, this );
|
|
|
|
else
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING,
|
|
|
|
_( "Cancel" ), cancel_xpm );
|
2008-10-18 23:41:16 +00:00
|
|
|
PopMenu->AppendSeparator();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
if( DrawEntry )
|
2009-04-05 20:49:15 +00:00
|
|
|
DrawEntry->DisplayInfo( this );
|
|
|
|
else
|
|
|
|
return true;
|
2008-10-18 23:41:16 +00:00
|
|
|
|
2009-09-25 18:49:04 +00:00
|
|
|
m_drawItem = DrawEntry;
|
2008-10-18 23:41:16 +00:00
|
|
|
wxString msg;
|
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
switch( DrawEntry->Type() )
|
2008-10-18 23:41:16 +00:00
|
|
|
{
|
2009-09-22 12:27:57 +00:00
|
|
|
case COMPONENT_PIN_DRAW_TYPE:
|
2009-10-08 13:19:28 +00:00
|
|
|
AddMenusForPin( PopMenu, (LIB_PIN*) DrawEntry, this );
|
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
|
|
|
case COMPONENT_ARC_DRAW_TYPE:
|
|
|
|
if( DrawEntry->m_Flags == 0 )
|
|
|
|
{
|
|
|
|
msg = AddHotkeyName( _( "Move Arc " ), s_Libedit_Hokeys_Descr,
|
2009-12-06 18:04:41 +00:00
|
|
|
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST,
|
|
|
|
msg, move_arc_xpm );
|
2010-02-04 17:46:12 +00:00
|
|
|
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
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Edit Arc Options" ), s_Libedit_Hokeys_Descr,
|
|
|
|
HK_EDIT );
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM,
|
2010-02-04 17:46:12 +00:00
|
|
|
msg, options_arc_xpm );
|
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
if( DrawEntry->m_Flags == 0 )
|
|
|
|
{
|
|
|
|
msg = AddHotkeyName( _( "Delete Arc " ), s_Libedit_Hokeys_Descr,
|
|
|
|
HK_DELETE_PIN );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM,
|
|
|
|
msg, delete_arc_xpm );
|
|
|
|
}
|
|
|
|
break;
|
2008-10-18 23:41:16 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
case COMPONENT_CIRCLE_DRAW_TYPE:
|
|
|
|
if( DrawEntry->m_Flags == 0 )
|
|
|
|
{
|
|
|
|
msg = AddHotkeyName( _( "Move Circle " ), s_Libedit_Hokeys_Descr,
|
2009-12-06 18:04:41 +00:00
|
|
|
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST,
|
|
|
|
msg, move_circle_xpm );
|
|
|
|
}
|
2010-02-04 17:46:12 +00:00
|
|
|
|
|
|
|
if( DrawEntry->m_Flags == 0 )
|
|
|
|
{
|
|
|
|
msg = AddHotkeyName( _( "Drag Circle Outline" ), s_Libedit_Hokeys_Descr,
|
|
|
|
HK_DRAG );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM,
|
|
|
|
msg, move_rectangle_xpm );
|
|
|
|
}
|
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Edit Circle Options" ), s_Libedit_Hokeys_Descr,
|
|
|
|
HK_EDIT );
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM,
|
2010-02-04 17:46:12 +00:00
|
|
|
msg, options_circle_xpm );
|
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
if( DrawEntry->m_Flags == 0 )
|
|
|
|
{
|
|
|
|
msg = AddHotkeyName( _( "Delete Circle " ),
|
|
|
|
s_Libedit_Hokeys_Descr, HK_DELETE_PIN );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM,
|
|
|
|
msg, delete_circle_xpm );
|
|
|
|
}
|
|
|
|
break;
|
2008-10-18 23:41:16 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
case COMPONENT_RECT_DRAW_TYPE:
|
|
|
|
if( DrawEntry->m_Flags == 0 )
|
|
|
|
{
|
2010-02-04 17:46:12 +00:00
|
|
|
msg = AddHotkeyName( _( "Move Rectangle " ), s_Libedit_Hokeys_Descr,
|
2009-12-06 18:04:41 +00:00
|
|
|
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST,
|
|
|
|
msg, move_rectangle_xpm );
|
|
|
|
}
|
2010-02-04 17:46:12 +00:00
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Edit Rectangle Options" ), s_Libedit_Hokeys_Descr,
|
|
|
|
HK_EDIT );
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM,
|
2010-02-04 17:46:12 +00:00
|
|
|
msg, options_rectangle_xpm );
|
|
|
|
|
|
|
|
if( DrawEntry->m_Flags == 0 )
|
|
|
|
{
|
|
|
|
msg = AddHotkeyName( _( "Drag Rectangle Edge" ), s_Libedit_Hokeys_Descr,
|
|
|
|
HK_DRAG );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM,
|
|
|
|
msg, move_rectangle_xpm );
|
|
|
|
}
|
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
if( DrawEntry->m_Flags == 0 )
|
|
|
|
{
|
2010-02-04 17:46:12 +00:00
|
|
|
msg = AddHotkeyName( _( "Delete Rectangle " ), s_Libedit_Hokeys_Descr,
|
2009-09-22 12:27:57 +00:00
|
|
|
HK_DELETE_PIN );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM,
|
|
|
|
msg, delete_rectangle_xpm );
|
|
|
|
}
|
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
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
|
|
|
|
if( DrawEntry->m_Flags == 0 )
|
|
|
|
{
|
|
|
|
msg = AddHotkeyName( _( "Move Text " ), s_Libedit_Hokeys_Descr,
|
2009-12-06 18:04:41 +00:00
|
|
|
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST,
|
|
|
|
msg, move_text_xpm );
|
|
|
|
}
|
2010-02-04 17:46:12 +00:00
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Edit Text " ), s_Libedit_Hokeys_Descr,
|
|
|
|
HK_EDIT );
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM,
|
2010-02-04 17:46:12 +00:00
|
|
|
msg, edit_text_xpm );
|
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Rotate Text " ), s_Libedit_Hokeys_Descr,
|
|
|
|
HK_ROTATE );
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_ROTATE_GRAPHIC_TEXT,
|
2010-02-04 17:46:12 +00:00
|
|
|
msg, edit_text_xpm );
|
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
if( DrawEntry->m_Flags == 0 )
|
|
|
|
{
|
|
|
|
msg = AddHotkeyName( _( "Delete Text " ), s_Libedit_Hokeys_Descr,
|
|
|
|
HK_DELETE_PIN );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM,
|
|
|
|
msg, delete_text_xpm );
|
|
|
|
}
|
|
|
|
break;
|
2008-10-18 23:41:16 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
case COMPONENT_POLYLINE_DRAW_TYPE:
|
|
|
|
if( DrawEntry->m_Flags == 0 )
|
|
|
|
{
|
|
|
|
msg = AddHotkeyName( _( "Move Line " ), s_Libedit_Hokeys_Descr,
|
2009-12-06 18:04:41 +00:00
|
|
|
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST,
|
|
|
|
msg, move_line_xpm );
|
2010-02-04 17:46:12 +00:00
|
|
|
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
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
if( DrawEntry->m_Flags & IS_NEW )
|
|
|
|
{
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_END_CREATE_ITEM,
|
|
|
|
_( "Line End" ), apply_xpm );
|
|
|
|
}
|
2010-02-04 17:46:12 +00:00
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Edit Line Options" ), s_Libedit_Hokeys_Descr,
|
|
|
|
HK_EDIT );
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM,
|
2010-02-04 17:46:12 +00:00
|
|
|
msg, options_segment_xpm );
|
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
if( DrawEntry->m_Flags == 0 )
|
|
|
|
{
|
|
|
|
msg = AddHotkeyName( _( "Delete Line " ), s_Libedit_Hokeys_Descr,
|
|
|
|
HK_DELETE_PIN );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM,
|
|
|
|
msg, delete_segment_xpm );
|
|
|
|
}
|
|
|
|
else if( (DrawEntry->m_Flags & IS_NEW) )
|
|
|
|
{
|
2009-10-08 13:19:28 +00:00
|
|
|
if( ( (LIB_POLYLINE*) DrawEntry )->GetCornerCount() > 2 )
|
2008-10-18 23:41:16 +00:00
|
|
|
{
|
2009-09-22 12:27:57 +00:00
|
|
|
msg = AddHotkeyName( _( "Delete Segment " ),
|
|
|
|
s_Libedit_Hokeys_Descr, HK_DELETE_PIN );
|
|
|
|
ADD_MENUITEM( PopMenu,
|
|
|
|
ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT,
|
|
|
|
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
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
case COMPONENT_FIELD_DRAW_TYPE:
|
|
|
|
if( DrawEntry->m_Flags == 0 )
|
|
|
|
{
|
|
|
|
msg = AddHotkeyName( _( "Move Field " ), s_Libedit_Hokeys_Descr,
|
2009-12-06 18:04:41 +00:00
|
|
|
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST,
|
|
|
|
msg, move_field_xpm );
|
|
|
|
}
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_FIELD_ROTATE_ITEM,
|
|
|
|
_( "Field Rotate" ), rotate_field_xpm );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM,
|
|
|
|
_( "Field Edit" ), edit_text_xpm );
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
wxString msg;
|
|
|
|
msg.Printf( wxT( "WinEDA_LibeditFrame::OnRightClick Error: unknown \
|
|
|
|
StructType %d" ),
|
|
|
|
DrawEntry->Type() );
|
|
|
|
DisplayError( this, msg );
|
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
|
|
|
|
|
|
|
void AddMenusForPin( wxMenu* PopMenu,
|
2009-10-08 13:19:28 +00:00
|
|
|
LIB_PIN* Pin,
|
2009-09-22 12:27:57 +00:00
|
|
|
WinEDA_LibeditFrame* 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;
|
|
|
|
bool not_in_move = (Pin->m_Flags == 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 );
|
2009-09-22 12:27:57 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST,
|
2009-12-06 18:04:41 +00:00
|
|
|
msg, move_xpm );
|
|
|
|
}
|
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 );
|
2010-01-17 20:25:10 +00:00
|
|
|
ADD_MENUITEM( PopMenu, ID_LIBEDIT_ROTATE_PIN, msg, rotate_pin_xpm );
|
|
|
|
|
2008-10-18 23:41:16 +00:00
|
|
|
if( not_in_move )
|
|
|
|
{
|
2009-09-22 12:27:57 +00:00
|
|
|
msg = AddHotkeyName( _( "Delete Pin " ), s_Libedit_Hokeys_Descr,
|
|
|
|
HK_DELETE_PIN );
|
|
|
|
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM,
|
|
|
|
msg, delete_pin_xpm );
|
2008-10-18 23:41:16 +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 */
|
|
|
|
|
|
|
|
void AddMenusForBlock( wxMenu* PopMenu, WinEDA_LibeditFrame* frame )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-09-22 12:27:57 +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)" ),
|
|
|
|
zoom_selected_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
|
|
|
|
2009-09-22 12:27:57 +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
|
|
|
{
|
2009-09-22 12:27:57 +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 );
|
|
|
|
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
|
|
|
}
|