Commit 4a7dc4ad authored by Wayne Stambaugh's avatar Wayne Stambaugh

Add menu item function fixes and other minor improvements.

* Rename all ADD_MENUITEM_* functions to AddMenuItem and move them to
  wxstruct.h since they are used by the Kicad main frame classes.
* Move SET_BITMAP and SETBITMAPS definitions to wxstruct.h.
* Fix a bug in SET_BITMAPS that prevented enabling menu item images on
  OSX.
* Rename MsgItem to EDA_MSG_ITEM.
* Remove redundant includes from modified files.
* Doxygen and coding style policy fixes.
parent fd486a11
......@@ -3,8 +3,6 @@
/********************/
#include "fctsys.h"
#include "macros.h"
#include "bitmaps.h"
#include "3d_viewer.h"
......@@ -136,30 +134,30 @@ void EDA_3D_FRAME::ReCreateMenuBar()
wxMenu* referencesMenu = new wxMenu;
menuBar->Append( referencesMenu, _( "&Preferences" ) );
ADD_MENUITEM( referencesMenu, ID_MENU3D_BGCOLOR_SELECTION,
AddMenuItem( referencesMenu, ID_MENU3D_BGCOLOR_SELECTION,
_( "Choose background color" ), KiBitmap( palette_xpm ) );
ADD_MENUITEM( referencesMenu, ID_MENU3D_AXIS_ONOFF,
AddMenuItem( referencesMenu, ID_MENU3D_AXIS_ONOFF,
_( "3D Axis On/Off" ), KiBitmap( axis3d_front_xpm ) );
if( full_options )
{
ADD_MENUITEM( referencesMenu, ID_MENU3D_MODULE_ONOFF,
AddMenuItem( referencesMenu, ID_MENU3D_MODULE_ONOFF,
_( "3D Footprints Shapes On/Off" ), KiBitmap( shape_3d_xpm ) );
ADD_MENUITEM( referencesMenu, ID_MENU3D_ZONE_ONOFF,
AddMenuItem( referencesMenu, ID_MENU3D_ZONE_ONOFF,
_( "Zone Filling On/Off" ), KiBitmap( add_zone_xpm ) );
ADD_MENUITEM( referencesMenu, ID_MENU3D_COMMENTS_ONOFF,
AddMenuItem( referencesMenu, ID_MENU3D_COMMENTS_ONOFF,
_( "Comments Layer On/Off" ), KiBitmap( edit_sheet_xpm ) );
ADD_MENUITEM( referencesMenu, ID_MENU3D_DRAWINGS_ONOFF,
AddMenuItem( referencesMenu, ID_MENU3D_DRAWINGS_ONOFF,
_( "Drawings Layer On/Off" ), KiBitmap( add_polygon_xpm ) );
ADD_MENUITEM( referencesMenu, ID_MENU3D_ECO1_ONOFF,
AddMenuItem( referencesMenu, ID_MENU3D_ECO1_ONOFF,
_( "Eco1 Layer On/Off" ), KiBitmap( tools_xpm ) );
ADD_MENUITEM( referencesMenu, ID_MENU3D_ECO2_ONOFF,
AddMenuItem( referencesMenu, ID_MENU3D_ECO2_ONOFF,
_( "Eco2 Layer On/Off" ), KiBitmap( tools_xpm ) );
}
......
......@@ -12,14 +12,13 @@
#include "build_version.h"
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "online_help.h"
#include "id.h"
#include "confirm.h"
#include "eda_doc.h"
#include "wxstruct.h"
#include "macros.h"
#include "bitmaps.h"
/*
* Class constructor for EDA_BASE_FRAME general options
......@@ -364,7 +363,7 @@ void EDA_BASE_FRAME::AddHelpVersionInfoMenuEntry( wxMenu* aMenu )
wxASSERT( aMenu != NULL );
// Copy version string to clipboard for bug report purposes.
ADD_MENUITEM_WITH_HELP( aMenu, ID_HELP_COPY_VERSION_STRING,
AddMenuItem( aMenu, ID_HELP_COPY_VERSION_STRING,
_( "Copy &Version Information" ),
_( "Copy the version string to clipboard to send with bug reports" ),
KiBitmap( copy_button_xpm ) );
......
/***************/
/* edaappl.cpp */
/***************/
/***
* @file edaapl.cpp
*
......@@ -21,15 +17,14 @@
#include <wx/tokenzr.h>
#include "appl_wxstruct.h"
#include "common.h"
#include "wxstruct.h"
#include "macros.h"
#include "param_config.h"
#include "worksheet.h"
#include "id.h"
#include "build_version.h"
#include "hotkeys_basic.h"
#include "macros.h"
#include "online_help.h"
#include "bitmaps.h"
#include "gestfich.h"
......@@ -242,15 +237,12 @@ static struct LANGUAGE_DESCR s_Language_List[] =
};
/**
* WinEDA_App Constructor
*/
WinEDA_App::WinEDA_App()
{
m_Checker = NULL;
m_HtmlCtrl = NULL;
m_EDA_Config = NULL;
m_Env_Defined = FALSE;
m_Env_Defined = false;
m_LanguageId = wxLANGUAGE_DEFAULT;
m_PdfBrowserIsDefault = true;
m_Locale = NULL;
......@@ -259,9 +251,6 @@ WinEDA_App::WinEDA_App()
}
/**
* WinEDA_App Destructor
*/
WinEDA_App::~WinEDA_App()
{
SaveSettings();
......@@ -269,11 +258,15 @@ WinEDA_App::~WinEDA_App()
/* delete user datas */
if( m_ProjectConfig )
delete m_ProjectConfig;
if( m_EDA_CommonConfig )
delete m_EDA_CommonConfig;
delete m_EDA_Config;
if( m_Checker )
delete m_Checker;
delete m_Locale;
}
......@@ -848,7 +841,7 @@ void WinEDA_App::AddMenuLanguageList( wxMenu* MasterMenu )
menu->Append( item );
}
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( MasterMenu, menu,
AddMenuItem( MasterMenu, menu,
ID_LANGUAGE_CHOICE,
_( "Language" ),
_( "Select application language (only for testing!)" ),
......
......@@ -7,15 +7,13 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "hotkeys_basic.h"
#include "macros.h"
#include "bitmaps.h"
#include "id.h"
#include "confirm.h"
#include "kicad_string.h"
#include "gestfich.h"
#include "wxstruct.h"
#include "macros.h"
#include "dialog_hotkeys_editor.h"
#include <wx/apptrait.h>
......@@ -133,8 +131,10 @@ wxString ReturnKeyNameFromKeyCode( int aKeycode, bool* aIsFound )
if( (aKeycode & GR_KB_CTRL) != 0 )
modifier << MODIFIER_CTRL;
if( (aKeycode & GR_KB_ALT) != 0 )
modifier << MODIFIER_ALT;
if( (aKeycode & GR_KB_SHIFT) != 0 )
modifier << MODIFIER_SHIFT;
......@@ -143,7 +143,7 @@ wxString ReturnKeyNameFromKeyCode( int aKeycode, bool* aIsFound )
if( (aKeycode > ' ') && (aKeycode < 0x7F ) )
{
found = true;
keyname.Append((wxChar)aKeycode);
keyname.Append( (wxChar)aKeycode );
}
else
{
......@@ -165,6 +165,7 @@ wxString ReturnKeyNameFromKeyCode( int aKeycode, bool* aIsFound )
if( aIsFound )
*aIsFound = found;
fullkeyname = modifier + keyname;
return fullkeyname;
}
......@@ -195,6 +196,7 @@ wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList,
else
msg << wxT( " <" ) << keyname << wxT( ">" );
}
return msg;
}
......@@ -223,12 +225,14 @@ wxString AddHotkeyName( const wxString& aText,
{
List = aDescList->m_HK_InfoList;
keyname = ReturnKeyNameFromCommandId( List, aCommandId );
if( !keyname.IsEmpty() )
{
if( aIsShortCut )
msg << wxT( "\t" ) << keyname;
else
msg << wxT( " <" ) << keyname << wxT( ">" );
break;
}
}
......@@ -252,6 +256,7 @@ wxString ReturnKeyNameFromCommandId( Ki_HotkeyInfo** aList, int aCommandId )
for( ; *aList != NULL; aList++ )
{
Ki_HotkeyInfo* hk_decr = *aList;
if( hk_decr->m_Idcommand == aCommandId )
{
keyname = ReturnKeyNameFromKeyCode( hk_decr->m_KeyCode );
......@@ -285,7 +290,6 @@ int ReturnKeyCodeFromKeyName( const wxString& keyname )
modifier |= GR_KB_CTRL;
key.Remove( 0, 5 );
}
else if( key.StartsWith( MODIFIER_ALT ) )
{
modifier |= GR_KB_ALT;
......@@ -297,8 +301,10 @@ int ReturnKeyCodeFromKeyName( const wxString& keyname )
key.Remove( 0, 6 );
}
else
{
break;
}
}
if( (key.length() == 1) && (key[0] > ' ') && (key[0] < 0x7F) )
{
......@@ -338,6 +344,7 @@ void DisplayHotkeyList( EDA_DRAW_FRAME* aFrame,
for( ; aDescList->m_HK_InfoList != NULL; aDescList++ )
{
List = aDescList->m_HK_InfoList;
for( ; *List != NULL; List++ )
{
Ki_HotkeyInfo* hk_decr = *List;
......@@ -392,6 +399,7 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aD
/* Print the current hotkey list */
Ki_HotkeyInfo** List;
for( ; aDescList->m_HK_InfoList != NULL; aDescList++ )
{
if( aDescList->m_Comment )
......@@ -400,10 +408,12 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aD
msg += wxString( aDescList->m_Comment );
msg += wxT( "\n" );
}
msg += *aDescList->m_SectionTag;
msg += wxT( "\n" );
List = aDescList->m_HK_InfoList;
for( ; *List != NULL; List++ )
{
Ki_HotkeyInfo* hk_decr = *List;
......@@ -421,8 +431,11 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aD
if( aFullFileName )
{
FILE* file = wxFopen( *aFullFileName, wxT( "wt" ) );
if( file )
{
fputs( TO_UTF8( msg ), file );
}
else
{
msg.Printf( wxT( "Unable to write file %s" ), GetChars( *aFullFileName ) );
......@@ -504,8 +517,7 @@ int EDA_BASE_FRAME::ReadHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aDe
* lines starting by # are ignored (comments)
* lines like [xxx] are tags (example: [common] or [libedit] which identify sections
*/
void ParseHotkeyConfig(
const wxString& data,
void ParseHotkeyConfig( const wxString& data,
struct Ki_HotkeyInfoSectionDescriptor* aDescList )
{
/* Read the config */
......@@ -525,6 +537,7 @@ void ParseHotkeyConfig(
{
CurrentHotkeyList = 0;
Ki_HotkeyInfoSectionDescriptor* DList = aDescList;
for( ; DList->m_HK_InfoList; DList++ )
{
if( *DList->m_SectionTag == line_type )
......@@ -536,10 +549,13 @@ void ParseHotkeyConfig(
continue;
}
if( line_type == wxT( "$Endlist" ) )
break;
if( line_type != wxT( "shortcut" ) )
continue;
if( CurrentHotkeyList == NULL )
continue;
......@@ -559,6 +575,7 @@ void ParseHotkeyConfig(
if( hk_decr->m_InfoMsg == fctname )
{
int code = ReturnKeyCodeFromKeyName( keyname );
if( code )
hk_decr->m_KeyCode = code;
......@@ -635,14 +652,14 @@ void AddHotkeyConfigMenu( wxMenu* aMenu )
wxMenu* HotkeySubmenu = new wxMenu();
/* List existing hotkey menu*/
ADD_MENUITEM_WITH_HELP( HotkeySubmenu,
AddMenuItem( HotkeySubmenu,
ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
_( "List Current Keys" ),
_( "Displays the current hotkeys list and corresponding commands" ),
KiBitmap( info_xpm ) );
/* Call hotkeys editor*/
ADD_MENUITEM_WITH_HELP( HotkeySubmenu, ID_PREFERENCES_HOTKEY_SHOW_EDITOR,
AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_SHOW_EDITOR,
_( "Edit Hotkeys" ),
_( "Call the hotkeys editor" ),
KiBitmap( editor_xpm ) );
......@@ -650,21 +667,20 @@ void AddHotkeyConfigMenu( wxMenu* aMenu )
HotkeySubmenu->AppendSeparator();
/* create hotkey file to export current hotkeys config */
ADD_MENUITEM_WITH_HELP( HotkeySubmenu, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG,
AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG,
_( "Export Hotkeys Config" ),
_( "Create a hotkey configuration file to export the current hotkey config" ),
KiBitmap( save_setup_xpm ) );
/* Reload hotkey file */
ADD_MENUITEM_WITH_HELP( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG,
AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG,
_( "Import Hotkeys Config" ),
_( "Load an existing hotkey configuration file" ),
KiBitmap( reload_xpm ) );
/* Append HotkeySubmenu to menu */
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( aMenu, HotkeySubmenu,
AddMenuItem( aMenu, HotkeySubmenu,
ID_PREFERENCES_HOTKEY_SUBMENU, _( "Hotkeys" ),
_( "Hotkeys configuration and preferences" ),
KiBitmap( hotkeys_xpm ) );
}
......@@ -97,7 +97,7 @@ void EDA_MSG_PANEL::AppendMessage( const wxString& textUpper,
text = ( textUpper.Len() > textLower.Len() ) ? textUpper : textLower;
text.Append( ' ', pad );
MsgItem item;
EDA_MSG_ITEM item;
/* Don't put the first message a window client position 0. Offset by
* one 'W' character width. */
......@@ -133,7 +133,7 @@ void EDA_MSG_PANEL::SetMessage( int aXPosition, const wxString& aUpperText,
else
pos.x = m_last_x;
MsgItem item;
EDA_MSG_ITEM item;
item.m_X = pos.x;
......@@ -174,7 +174,7 @@ void EDA_MSG_PANEL::SetMessage( int aXPosition, const wxString& aUpperText,
}
void EDA_MSG_PANEL::showItem( wxDC& dc, const MsgItem& aItem )
void EDA_MSG_PANEL::showItem( wxDC& dc, const EDA_MSG_ITEM& aItem )
{
int color = aItem.m_Color;
......@@ -205,6 +205,7 @@ void EDA_MSG_PANEL::EraseMsgBox()
Refresh();
}
void EDA_MSG_PANEL::erase( wxDC* DC )
{
wxPen pen;
......
......@@ -7,9 +7,7 @@
*/
#include "fctsys.h"
#include "common.h"
#include "macros.h"
#include "bitmaps.h"
#include "id.h"
#include "class_drawpanel.h"
#include "class_base_screen.h"
......@@ -154,19 +152,19 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
BASE_SCREEN * screen = DrawPanel->GetScreen();
msg = AddHotkeyName( _( "Center" ), m_HotkeysZoomAndGridList, HK_ZOOM_CENTER );
ADD_MENUITEM( MasterMenu, ID_POPUP_ZOOM_CENTER, msg, KiBitmap( zoom_center_on_screen_xpm ) );
AddMenuItem( MasterMenu, ID_POPUP_ZOOM_CENTER, msg, KiBitmap( zoom_center_on_screen_xpm ) );
msg = AddHotkeyName( _( "Zoom in" ), m_HotkeysZoomAndGridList, HK_ZOOM_IN );
ADD_MENUITEM( MasterMenu, ID_POPUP_ZOOM_IN, msg, KiBitmap( zoom_in_xpm ) );
AddMenuItem( MasterMenu, ID_POPUP_ZOOM_IN, msg, KiBitmap( zoom_in_xpm ) );
msg = AddHotkeyName( _( "Zoom out" ), m_HotkeysZoomAndGridList, HK_ZOOM_OUT );
ADD_MENUITEM( MasterMenu, ID_POPUP_ZOOM_OUT, msg, KiBitmap( zoom_out_xpm ) );
AddMenuItem( MasterMenu, ID_POPUP_ZOOM_OUT, msg, KiBitmap( zoom_out_xpm ) );
msg = AddHotkeyName( _( "Redraw view" ), m_HotkeysZoomAndGridList, HK_ZOOM_REDRAW );
ADD_MENUITEM( MasterMenu, ID_ZOOM_REDRAW, msg, KiBitmap( zoom_redraw_xpm ) );
AddMenuItem( MasterMenu, ID_ZOOM_REDRAW, msg, KiBitmap( zoom_redraw_xpm ) );
msg = AddHotkeyName( _( "Zoom auto" ), m_HotkeysZoomAndGridList, HK_ZOOM_AUTO );
ADD_MENUITEM( MasterMenu, ID_ZOOM_PAGE, msg, KiBitmap( zoom_fit_in_page_xpm ) );
AddMenuItem( MasterMenu, ID_ZOOM_PAGE, msg, KiBitmap( zoom_fit_in_page_xpm ) );
wxMenu* zoom_choice = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( MasterMenu, zoom_choice,
AddMenuItem( MasterMenu, zoom_choice,
ID_POPUP_ZOOM_SELECT, _( "Zoom select" ),
KiBitmap( zoom_selection_xpm ) );
......@@ -190,7 +188,7 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
if( screen->GetGridCount() )
{
wxMenu* gridMenu = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( MasterMenu, gridMenu, ID_POPUP_GRID_SELECT,
AddMenuItem( MasterMenu, gridMenu, ID_POPUP_GRID_SELECT,
_( "Grid Select" ), KiBitmap( grid_select_xpm ) );
GRID_TYPE tmp;
......@@ -234,5 +232,5 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
}
MasterMenu->AppendSeparator();
ADD_MENUITEM( MasterMenu, ID_POPUP_CANCEL, _( "Close" ), KiBitmap( cancel_xpm ) );
AddMenuItem( MasterMenu, ID_POPUP_CANCEL, _( "Close" ), KiBitmap( cancel_xpm ) );
}
......@@ -4,7 +4,6 @@
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "confirm.h"
#include "gestfich.h"
......@@ -12,7 +11,6 @@
#include "cvpcb_mainframe.h"
#include "cvpcb_id.h"
#include "bitmaps.h"
/**
* @brief (Re)Create the menubar for the cvpcb mainframe
......@@ -39,7 +37,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
wxMenu* filesMenu = new wxMenu;
// Open
ADD_MENUITEM_WITH_HELP( filesMenu,
AddMenuItem( filesMenu,
ID_LOAD_PROJECT,
_( "&Open" ),
_( "Open a net list file" ),
......@@ -56,7 +54,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu();
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu, -1,
AddMenuItem( filesMenu, openRecentMenu, -1,
_( "Open &Recent" ),
_( "Open a recent opened netlist document" ),
open_project_xpm );
......@@ -65,14 +63,14 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
filesMenu->AppendSeparator();
// Save
ADD_MENUITEM_WITH_HELP( filesMenu,
AddMenuItem( filesMenu,
wxID_SAVE,
_( "&Save\tCtrl+S" ),
_( "Save net list and footprint list files" ),
save_xpm );
// Save as
ADD_MENUITEM_WITH_HELP( filesMenu,
AddMenuItem( filesMenu,
wxID_SAVEAS,
_( "Save &As..." ),
_( "Save new net list and footprint list files" ),
......@@ -82,7 +80,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
filesMenu->AppendSeparator();
// Quit
ADD_MENUITEM_WITH_HELP( filesMenu,
AddMenuItem( filesMenu,
wxID_EXIT,
_( "&Quit" ),
_( "Quit CvPcb" ),
......@@ -92,7 +90,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
wxMenu* preferencesMenu = new wxMenu;
// Options (Preferences on WXMAC)
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
wxID_PREFERENCES,
#ifdef __WXMAC__
_( "&Preferences..." ),
......@@ -115,11 +113,11 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
// Separator
preferencesMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( preferencesMenu, ID_SAVE_PROJECT,
AddMenuItem( preferencesMenu, ID_SAVE_PROJECT,
_( "&Save Project File" ),
_( "Save changes to the project configuration file" ),
save_setup_xpm );
ADD_MENUITEM_WITH_HELP( preferencesMenu, ID_SAVE_PROJECT_AS,
AddMenuItem( preferencesMenu, ID_SAVE_PROJECT_AS,
_( "&Save Project File As" ),
_( "Save changes to the project configuration to a new file" ),
save_setup_xpm );
......@@ -131,12 +129,12 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu, wxID_HELP, _( "&Contents" ),
AddMenuItem( helpMenu, wxID_HELP, _( "&Contents" ),
_( "Open the CvPcb handbook" ),
online_help_xpm );
// About
ADD_MENUITEM_WITH_HELP( helpMenu, wxID_ABOUT,
AddMenuItem( helpMenu, wxID_ABOUT,
_( "&About CvPcb" ),
_( "About CvPcb schematic to pcb converter" ),
info_xpm );
......
......@@ -4,7 +4,6 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h"
#include "eda_dde.h"
#include "wxEeschemaStruct.h"
......@@ -144,7 +143,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF
{
wxString text = m_collectedItems[i]->GetSelectMenuText();
BITMAP_DEF xpm = m_collectedItems[i]->GetMenuImage();
ADD_MENUITEM( &selectMenu, ID_SELECT_ITEM_START + i, text, xpm );
AddMenuItem( &selectMenu, ID_SELECT_ITEM_START + i, text, xpm );
}
// Set to NULL in case user aborts the clarification context menu.
......
......@@ -6,11 +6,7 @@
*/
#include "fctsys.h"
//#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "confirm.h"
#include "bitmaps.h"
#include "eeschema_id.h"
#include "hotkeys.h"
#include "class_drawpanel.h"
......@@ -47,7 +43,7 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
// If Command in progress, put menu "cancel"
if( item && item->GetFlags() )
{
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, _( "Cancel" ), cancel_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, _( "Cancel" ), cancel_xpm );
PopMenu->AppendSeparator();
}
else
......@@ -64,7 +60,7 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
if( GetToolId() != ID_NO_TOOL_SELECTED )
{
// If a tool is active, put menu "end tool"
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, _( "End Tool" ),
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, _( "End Tool" ),
cancel_tool_xpm );
PopMenu->AppendSeparator();
}
......@@ -89,18 +85,18 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
msg = AddHotkeyName( _( "Move Arc" ), s_Libedit_Hokeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_arc_xpm );
AddMenuItem( 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 );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg, move_arc_xpm );
}
msg = AddHotkeyName( _( "Edit Arc Options" ), s_Libedit_Hokeys_Descr, HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, options_arc_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, options_arc_xpm );
if( item->GetFlags() == 0 )
{
msg = AddHotkeyName( _( "Delete Arc" ), s_Libedit_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_arc_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_arc_xpm );
}
break;
......@@ -109,22 +105,22 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
msg = AddHotkeyName( _( "Move Circle" ), s_Libedit_Hokeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_circle_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_circle_xpm );
}
if( item->GetFlags() == 0 )
{
msg = AddHotkeyName( _( "Drag Circle Outline" ), s_Libedit_Hokeys_Descr, HK_DRAG );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg, move_rectangle_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg, move_rectangle_xpm );
}
msg = AddHotkeyName( _( "Edit Circle Options" ), s_Libedit_Hokeys_Descr, HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, options_circle_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, options_circle_xpm );
if( item->GetFlags() == 0 )
{
msg = AddHotkeyName( _( "Delete Circle" ), s_Libedit_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_circle_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_circle_xpm );
}
break;
......@@ -133,22 +129,22 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
msg = AddHotkeyName( _( "Move Rectangle" ), s_Libedit_Hokeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_rectangle_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_rectangle_xpm );
}
msg = AddHotkeyName( _( "Edit Rectangle Options" ), s_Libedit_Hokeys_Descr, HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, options_rectangle_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, options_rectangle_xpm );
if( item->GetFlags() == 0 )
{
msg = AddHotkeyName( _( "Drag Rectangle Edge" ), s_Libedit_Hokeys_Descr, HK_DRAG );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg, move_rectangle_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg, move_rectangle_xpm );
}
if( item->GetFlags() == 0 )
{
msg = AddHotkeyName( _( "Delete Rectangle" ), s_Libedit_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_rectangle_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_rectangle_xpm );
}
break;
......@@ -158,19 +154,19 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
msg = AddHotkeyName( _( "Move Text" ), s_Libedit_Hokeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_text_xpm );
}
msg = AddHotkeyName( _( "Edit Text" ), s_Libedit_Hokeys_Descr, HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, edit_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, edit_text_xpm );
msg = AddHotkeyName( _( "Rotate Text" ), s_Libedit_Hokeys_Descr, HK_ROTATE );
ADD_MENUITEM( PopMenu, ID_LIBEDIT_ROTATE_ITEM, msg, edit_text_xpm );
AddMenuItem( PopMenu, ID_LIBEDIT_ROTATE_ITEM, msg, edit_text_xpm );
if( item->GetFlags() == 0 )
{
msg = AddHotkeyName( _( "Delete Text" ), s_Libedit_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_text_xpm );
}
break;
......@@ -179,30 +175,30 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
msg = AddHotkeyName( _( "Move Line" ), s_Libedit_Hokeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_line_xpm );
AddMenuItem( 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 );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg, move_line_xpm );
}
if( item->IsNew() )
{
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_END_CREATE_ITEM, _( "Line End" ), apply_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_END_CREATE_ITEM, _( "Line End" ), apply_xpm );
}
msg = AddHotkeyName( _( "Edit Line Options" ), s_Libedit_Hokeys_Descr, HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, options_segment_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, options_segment_xpm );
if( item->GetFlags() == 0 )
{
msg = AddHotkeyName( _( "Delete Line " ), s_Libedit_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_segment_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_segment_xpm );
}
else if( item->IsNew() )
{
if( ( (LIB_POLYLINE*) item )->GetCornerCount() > 2 )
{
msg = AddHotkeyName( _( "Delete Segment" ), s_Libedit_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT,
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT,
msg, delete_segment_xpm );
}
}
......@@ -214,12 +210,13 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
msg = AddHotkeyName( _( "Move Field" ), s_Libedit_Hokeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_field_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_field_xpm );
}
msg = AddHotkeyName( _( "Field Rotate" ), s_Libedit_Hokeys_Descr, HK_ROTATE );
ADD_MENUITEM( PopMenu, ID_LIBEDIT_ROTATE_ITEM, msg, rotate_field_xpm );
AddMenuItem( PopMenu, ID_LIBEDIT_ROTATE_ITEM, msg, rotate_field_xpm );
msg = AddHotkeyName( _( "Field Edit" ), s_Libedit_Hokeys_Descr, HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM, msg, edit_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM, msg, edit_text_xpm );
break;
......@@ -245,34 +242,34 @@ void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin, LIB_EDIT_FRAME* frame )
{
msg = AddHotkeyName( _( "Move Pin " ), s_Libedit_Hokeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_xpm );
}
msg = AddHotkeyName( _( "Edit Pin " ), s_Libedit_Hokeys_Descr, HK_EDIT);
ADD_MENUITEM( PopMenu, ID_LIBEDIT_EDIT_PIN, msg, edit_xpm );
AddMenuItem( PopMenu, ID_LIBEDIT_EDIT_PIN, msg, edit_xpm );
msg = AddHotkeyName( _( "Rotate Pin " ), s_Libedit_Hokeys_Descr, HK_ROTATE );
ADD_MENUITEM( PopMenu, ID_LIBEDIT_ROTATE_ITEM, msg, rotate_pin_xpm );
AddMenuItem( PopMenu, ID_LIBEDIT_ROTATE_ITEM, msg, rotate_pin_xpm );
if( not_in_move )
{
msg = AddHotkeyName( _( "Delete Pin " ), s_Libedit_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_pin_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_pin_xpm );
}
wxMenu* global_pin_change = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( PopMenu, global_pin_change,
AddMenuItem( PopMenu, global_pin_change,
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM,
_( "Global" ), pin_to_xpm );
ADD_MENUITEM( global_pin_change,
AddMenuItem( 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,
AddMenuItem( 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,
AddMenuItem( 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 );
......@@ -283,24 +280,24 @@ void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin, LIB_EDIT_FRAME* frame )
void AddMenusForBlock( wxMenu* PopMenu, LIB_EDIT_FRAME* frame )
{
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, _( "Cancel Block" ), cancel_xpm );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, _( "Cancel Block" ), cancel_xpm );
if( frame->GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE )
ADD_MENUITEM( PopMenu, ID_POPUP_ZOOM_BLOCK,
AddMenuItem( PopMenu, ID_POPUP_ZOOM_BLOCK,
_( "Zoom Block (drag middle mouse)" ),
zoom_area_xpm );
PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), apply_xpm );
AddMenuItem( PopMenu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), apply_xpm );
if( frame->GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE )
{
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_MIRROR_X_BLOCK, _( "Mirror Block --" ), mirror_v_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_ROTATE_BLOCK, _( "Rotate Block ccw" ), rotate_ccw_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), delete_xpm );
AddMenuItem( PopMenu, ID_POPUP_SELECT_ITEMS_BLOCK, _( "Select Items" ), green_xpm );
AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), copyblock_xpm );
AddMenuItem( PopMenu, ID_POPUP_MIRROR_Y_BLOCK, _( "Mirror Block ||" ), mirror_h_xpm );
AddMenuItem( PopMenu, ID_POPUP_MIRROR_X_BLOCK, _( "Mirror Block --" ), mirror_v_xpm );
AddMenuItem( PopMenu, ID_POPUP_ROTATE_BLOCK, _( "Rotate Block ccw" ), rotate_ccw_xpm );
AddMenuItem( PopMenu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), delete_xpm );
}
}
......@@ -6,12 +6,9 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "macros.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "eda_doc.h"
#include "bitmaps.h"
#include "gr_basic.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
......@@ -745,11 +742,14 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM:
if( m_drawItem == NULL )
break;
DrawPanel->CrossHairOff( &dc );
if( m_drawItem->Type() == LIB_FIELD_T )
{
EditField( &dc, (LIB_FIELD*) m_drawItem );
}
DrawPanel->MoveCursorToCrossHair();
DrawPanel->CrossHairOn( &dc );
break;
......@@ -759,6 +759,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM:
if( ( m_drawItem == NULL ) || ( m_drawItem->Type() != LIB_PIN_T ) )
break;
SaveCopyInUndoList( m_component );
GlobalSetPins( &dc, (LIB_PIN*) m_drawItem, id );
DrawPanel->MoveCursorToCrossHair();
......@@ -1130,7 +1131,7 @@ LIB_ITEM* LIB_EDIT_FRAME::locateItem( const wxPoint& aPosition, const KICAD_T aF
{
wxString text = m_collectedItems[i]->GetSelectMenuText();
BITMAP_DEF xpm = m_collectedItems[i]->GetMenuImage();
ADD_MENUITEM( &selectMenu, ID_SELECT_ITEM_START + i, text, xpm );
AddMenuItem( &selectMenu, ID_SELECT_ITEM_START + i, text, xpm );
}
// Set to NULL in case user aborts the clarification context menu.
......
......@@ -318,7 +318,7 @@ private:
*
* @param aLibEntry A pointer to the LIB_ALIAS object to load.
* @param aLibrary A pointer to the CMP_LIBRARY object to load \a aLibEntry from.
* @returns True if a copy of \a aLibEntry was successfully loaded from \aLibrary.
* @return True if a copy of \a aLibEntry was successfully loaded from \a aLibrary.
*/
bool LoadOneLibraryPartAux( LIB_ALIAS* aLibEntry, CMP_LIBRARY* aLibrary );
......
......@@ -7,16 +7,13 @@
#endif
#include "fctsys.h"
#include "common.h"
#include "appl_wxstruct.h"
#include "bitmaps.h"
#include "wxEeschemaStruct.h"
#include "general.h"
#include "protos.h"
#include "eeschema_id.h"
#include "hotkeys.h"
#include "macros.h"
#include "help_common_strings.h"
......@@ -44,14 +41,14 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
wxMenu* fileMenu = new wxMenu;
// New
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_NEW_PROJECT,
_( "&New\tCtrl+N" ),
_( "New schematic project" ),
new_xpm );
// Open
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_LOAD_PROJECT,
_( "&Open\tCtrl+O" ),
_( "Open an existing schematic project" ),
......@@ -64,10 +61,11 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// (the file history will be updated when adding/removing files in history
if( openRecentMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu );
openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentMenu,
AddMenuItem( fileMenu, openRecentMenu,
wxID_ANY, _( "Open &Recent" ),
_( "Open a recent opened schematic project" ),
open_project_xpm );
......@@ -76,21 +74,21 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
fileMenu->AppendSeparator();
// Save schematic project
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_SAVE_PROJECT,
_( "&Save Whole Schematic Project\tCtrl+S" ),
_( "Save all sheets in the schematic project" ),
save_project_xpm );
// Save current sheet
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_SAVE_ONE_SHEET,
_( "Save &Current Sheet Only" ),
_( "Save only current schematic sheet" ),
save_xpm );
// Save current sheet as
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_SAVE_ONE_SHEET_AS,
_( "Save Current Sheet &as" ),
_( "Save current schematic sheet as..." ),
......@@ -100,14 +98,14 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
fileMenu->AppendSeparator();
// Page settings
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_SHEET_SET,
_( "P&age Settings" ),
_( "Settigns for page size and information" ),
sheetset_xpm );
// Print
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
wxID_PRINT,
_( "P&rint" ),
_( "Print schematic" ),
......@@ -117,27 +115,27 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
wxMenu* choice_plot_fmt = new wxMenu;
// Plot PostScript
ADD_MENUITEM_WITH_HELP( choice_plot_fmt, ID_GEN_PLOT_PS,
AddMenuItem( choice_plot_fmt, ID_GEN_PLOT_PS,
_( "Plot PostScript" ),
_( "Plot schematic sheet in PostScript format" ),
plot_ps_xpm );
// Plot HPGL
ADD_MENUITEM_WITH_HELP( choice_plot_fmt,
AddMenuItem( choice_plot_fmt,
ID_GEN_PLOT_HPGL,
_( "Plot HPGL" ),
_( "Plot schematic sheet in HPGL format" ),
plot_hpg_xpm );
// Plot SVG
ADD_MENUITEM_WITH_HELP( choice_plot_fmt,
AddMenuItem( choice_plot_fmt,
ID_GEN_PLOT_SVG,
_( "Plot SVG" ),
_( "Plot schematic sheet in SVG format" ),
plot_xpm );
// Plot DXF
ADD_MENUITEM_WITH_HELP( choice_plot_fmt,
AddMenuItem( choice_plot_fmt,
ID_GEN_PLOT_DXF,
_( "Plot DXF" ),
_( "Plot schematic sheet in DXF format" ),
......@@ -146,7 +144,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Plot to Clipboard (Windows only)
#ifdef __WINDOWS__
ADD_MENUITEM_WITH_HELP( choice_plot_fmt, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
AddMenuItem( choice_plot_fmt, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
_( "Plot to Clipboard" ),
_( "Export drawings to clipboard" ),
copy_button_xpm );
......@@ -154,7 +152,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
#endif // __WINDOWS__
// Plot submenu
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, choice_plot_fmt,
AddMenuItem( fileMenu, choice_plot_fmt,
ID_GEN_PLOT, _( "&Plot" ),
_( "Plot schematic sheet in HPGL, PostScript or SVG format" ),
plot_xpm );
......@@ -163,7 +161,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
fileMenu->AppendSeparator();
// Quit
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
wxID_EXIT,
_( "&Quit" ),
_( "Quit EESchema" ),
......@@ -175,38 +173,32 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Undo
text = AddHotkeyName( _( "Undo" ), s_Schematic_Hokeys_Descr, HK_UNDO );
ADD_MENUITEM_WITH_HELP( editMenu, wxID_UNDO, text, HELP_UNDO,
undo_xpm );
AddMenuItem( editMenu, wxID_UNDO, text, HELP_UNDO, undo_xpm );
// Redo
text = AddHotkeyName( _( "Redo" ), s_Schematic_Hokeys_Descr, HK_REDO );
ADD_MENUITEM_WITH_HELP( editMenu, wxID_REDO, text, HELP_REDO,
redo_xpm );
AddMenuItem( editMenu, wxID_REDO, text, HELP_REDO, redo_xpm );
// Delete
editMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( editMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT,
AddMenuItem( editMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT,
_( "Delete" ), HELP_DELETE_ITEMS,
delete_body_xpm );
// Find
editMenu->AppendSeparator();
text = AddHotkeyName( _( "&Find" ), s_Schematic_Hokeys_Descr, HK_FIND_ITEM );
ADD_MENUITEM_WITH_HELP( editMenu, ID_FIND_ITEMS, text, HELP_FIND,
find_xpm );
AddMenuItem( editMenu, ID_FIND_ITEMS, text, HELP_FIND, find_xpm );
// Backannotate
editMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( editMenu,
AddMenuItem( editMenu,
ID_BACKANNO_ITEMS,
_( "&Backannotate" ),
_( "Back annotate the footprint fields" ),
import_footprint_names_xpm );
// Menu View:
wxMenu* viewMenu = new wxMenu;
......@@ -228,26 +220,23 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Zoom in
text = AddHotkeyName( _( "Zoom In" ), s_Schematic_Hokeys_Descr,
ID_ZOOM_IN, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN,
zoom_in_xpm );
AddMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, zoom_in_xpm );
// Zoom out
text = AddHotkeyName( _( "Zoom Out" ), s_Schematic_Hokeys_Descr,
ID_ZOOM_OUT, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT,
zoom_out_xpm );
AddMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, zoom_out_xpm );
// Fit on screen
text = AddHotkeyName( _( "Fit on Screen" ), s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT,
zoom_fit_in_page_xpm );
AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, zoom_fit_in_page_xpm );
// Separator
viewMenu->AppendSeparator();
// Hierarchy
ADD_MENUITEM_WITH_HELP( viewMenu,
AddMenuItem( viewMenu,
ID_HIERARCHY,
_( "H&ierarchy" ),
_( "Navigate schematic hierarchy" ),
......@@ -255,8 +244,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Redraw
text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW,
zoom_redraw_xpm );
AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, zoom_redraw_xpm );
// Menu place:
// @todo unify IDs
......@@ -265,69 +253,68 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Component
text = AddHotkeyName( _( "Component" ), s_Schematic_Hokeys_Descr,
HK_ADD_NEW_COMPONENT, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_SCH_PLACE_COMPONENT, text,
AddMenuItem( placeMenu, ID_SCH_PLACE_COMPONENT, text,
HELP_PLACE_COMPONENTS,
add_component_xpm );
// Power port
text = AddHotkeyName( _( "Power port" ), s_Schematic_Hokeys_Descr,
HK_ADD_NEW_POWER, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_PLACE_POWER_BUTT, text,
AddMenuItem( placeMenu, ID_PLACE_POWER_BUTT, text,
HELP_PLACE_POWERPORT,
add_power_xpm );
// Wire
text = AddHotkeyName( _( "Wire" ), s_Schematic_Hokeys_Descr,
HK_BEGIN_WIRE, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_WIRE_BUTT, text,
AddMenuItem( placeMenu, ID_WIRE_BUTT, text,
HELP_PLACE_WIRE,
add_line_xpm );
// Bus
text = AddHotkeyName( _( "Bus" ), s_Schematic_Hokeys_Descr,
HK_BEGIN_BUS, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_BUS_BUTT, text,
AddMenuItem( placeMenu, ID_BUS_BUTT, text,
HELP_PLACE_BUS,
add_bus_xpm );
// Wire to Bus entry
text = AddHotkeyName( _( "Wire to bus entry" ), s_Schematic_Hokeys_Descr,
HK_ADD_WIRE_ENTRY, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_WIRETOBUS_ENTRY_BUTT, text,
AddMenuItem( placeMenu, ID_WIRETOBUS_ENTRY_BUTT, text,
HELP_PLACE_WIRE2BUS_ENTRY,
add_line2bus_xpm );
// Bus to Bus entry
text = AddHotkeyName( _( "Bus to bus entry" ), s_Schematic_Hokeys_Descr,
HK_ADD_BUS_ENTRY, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_BUSTOBUS_ENTRY_BUTT, text,
AddMenuItem( placeMenu, ID_BUSTOBUS_ENTRY_BUTT, text,
HELP_PLACE_BUS2BUS_ENTRY,
add_bus2bus_xpm );
// No connect flag
text = AddHotkeyName( _( "No connect flag" ), s_Schematic_Hokeys_Descr,
HK_ADD_NOCONN_FLAG, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG,
noconn_xpm );
AddMenuItem( placeMenu, ID_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, noconn_xpm );
// Net name
text = AddHotkeyName( _( "Label" ), s_Schematic_Hokeys_Descr,
HK_ADD_LABEL, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_LABEL_BUTT, text,
AddMenuItem( placeMenu, ID_LABEL_BUTT, text,
HELP_PLACE_NETLABEL,
add_line_label_xpm );
// Global label
text = AddHotkeyName( _( "Global label" ), s_Schematic_Hokeys_Descr,
HK_ADD_GLABEL, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_GLABEL_BUTT, text,
AddMenuItem( placeMenu, ID_GLABEL_BUTT, text,
HELP_PLACE_GLOBALLABEL,
add_glabel_xpm );
// Junction
text = AddHotkeyName( _( "Junction" ), s_Schematic_Hokeys_Descr,
HK_ADD_JUNCTION, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_JUNCTION_BUTT, text,
AddMenuItem( placeMenu, ID_JUNCTION_BUTT, text,
HELP_PLACE_JUNCTION,
add_junction_xpm );
......@@ -339,7 +326,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
HK_ADD_HLABEL, false ); // add comment, not a shortcut
text = AddHotkeyName( _( "Hierarchical label" ), s_Schematic_Hokeys_Descr,
HK_ADD_HLABEL, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_HIERLABEL_BUTT,
AddMenuItem( placeMenu, ID_HIERLABEL_BUTT,
text, HELP_PLACE_HIER_LABEL,
add_hierarchical_label_xpm );
......@@ -347,19 +334,19 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Hierarchical sheet
text = AddHotkeyName( _( "Hierarchical sheet" ), s_Schematic_Hokeys_Descr,
HK_ADD_HIER_SHEET, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_SHEET_SYMBOL_BUTT, text,
AddMenuItem( placeMenu, ID_SHEET_SYMBOL_BUTT, text,
HELP_PLACE_SHEET,
add_hierarchical_subsheet_xpm );
// Import hierarchical sheet
ADD_MENUITEM_WITH_HELP( placeMenu,
AddMenuItem( placeMenu,
ID_IMPORT_HLABEL_BUTT,
_( "Import Hierarchical Label" ),
HELP_IMPORT_SHEETPIN,
import_hierarchical_label_xpm );
// Add hierarchical Pin to Sheet
ADD_MENUITEM_WITH_HELP( placeMenu,
AddMenuItem( placeMenu,
ID_SHEET_PIN_BUTT,
_( "Add Hierarchical Pin to Sheet" ),
HELP_PLACE_SHEETPIN,
......@@ -371,14 +358,14 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Graphic line or polygon
text = AddHotkeyName( _( "Graphic polyline" ), s_Schematic_Hokeys_Descr,
HK_ADD_GRAPHIC_POLYLINE, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_LINE_COMMENT_BUTT, text,
AddMenuItem( placeMenu, ID_LINE_COMMENT_BUTT, text,
HELP_PLACE_GRAPHICLINES,
add_dashed_line_xpm );
// Graphic text
text = AddHotkeyName( _( "Graphic text" ), s_Schematic_Hokeys_Descr,
HK_ADD_GRAPHIC_TEXT, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_TEXT_COMMENT_BUTT, text,
AddMenuItem( placeMenu, ID_TEXT_COMMENT_BUTT, text,
HELP_PLACE_GRAPHICTEXTS,
add_text_xpm );
......@@ -387,14 +374,14 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
wxMenu* preferencesMenu = new wxMenu;
// Library
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
ID_CONFIG_REQ,
_( "&Library" ),
_( "Library preferences" ),
library_xpm );
// Colors
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
ID_COLORS_SETUP,
_( "&Colors" ),
_( "Color preferences" ),
......@@ -405,7 +392,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
#ifdef __WXMAC__
preferencesMenu->Append(wxID_PREFERENCES);
#else
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
wxID_PREFERENCES,
_( "&Options" ),
_( "EESchema preferences" ),
......@@ -423,14 +410,14 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
preferencesMenu->AppendSeparator();
// Save preferences
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
ID_CONFIG_SAVE,
_( "&Save preferences" ),
_( "Save application preferences" ),
save_setup_xpm );
// Read preferences
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
ID_CONFIG_READ,
_( "&Read preferences" ),
_( "Read application preferences" ),
......@@ -440,7 +427,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
wxMenu* toolsMenu = new wxMenu;
// Library viewer
ADD_MENUITEM_WITH_HELP( toolsMenu,
AddMenuItem( toolsMenu,
ID_TO_LIBRARY,
_( "Library &Browser" ),
_( "Library browser" ),
......@@ -448,7 +435,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Library editor
ADD_MENUITEM_WITH_HELP( toolsMenu,
AddMenuItem( toolsMenu,
ID_TO_LIBRARY,
_( "Library &Editor" ),
_( "Library editor" ),
......@@ -458,28 +445,28 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
toolsMenu->AppendSeparator();
// Annotate
ADD_MENUITEM_WITH_HELP( toolsMenu,
AddMenuItem( toolsMenu,
ID_GET_ANNOTATE,
_( "&Annotate" ),
_( "Annotate the components in the schematic" ),
annotate_xpm );
// ERC
ADD_MENUITEM_WITH_HELP( toolsMenu,
AddMenuItem( toolsMenu,
ID_GET_ERC,
_( "ER&C" ),
_( "Perform electrical rule check" ),
erc_xpm );
// Generate netlist
ADD_MENUITEM_WITH_HELP( toolsMenu,
AddMenuItem( toolsMenu,
ID_GET_NETLIST,
_( "Generate &Netlist" ),
_( "Generate the component netlist" ),
netlist_xpm );
// Generate bill of materials
ADD_MENUITEM_WITH_HELP( toolsMenu,
AddMenuItem( toolsMenu,
ID_GET_TOOLS,
_( "Generate Bill of Materials" ),
_( "Generate bill of materials" ),
......@@ -489,13 +476,14 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
toolsMenu->AppendSeparator();
//Run CVPcb
ADD_MENUITEM_WITH_HELP( toolsMenu,
AddMenuItem( toolsMenu,
ID_TO_CVPCB,
_( "A&ssign component footprints" ),
_( "Run CVPcb" ),
cvpcb_xpm );
// Run PCBNew
ADD_MENUITEM_WITH_HELP( toolsMenu,
AddMenuItem( toolsMenu,
ID_TO_PCB,
_( "&Layout printed circuit board" ),
_( "Run PCBNew" ),
......@@ -509,12 +497,12 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_HELP,
_( "&Contents" ),
_( "Open the Eeschema handbook" ),
online_help_xpm );
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
......@@ -522,7 +510,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// About EESchema
helpMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_ABOUT,
_( "&About EESchema" ),
_( "About EESchema schematic designer" ),
......
......@@ -3,9 +3,7 @@
* @brief (Re)Create the main menubar for the component editor frame (LibEdit)
*/
#include "fctsys.h"
#include "common.h"
#include "appl_wxstruct.h"
#include "bitmaps.h"
#include "general.h"
#include "libeditframe.h"
......@@ -29,6 +27,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// Delete all existing menus so they can be rebuilt.
// This allows language changes of the menu text on the fly.
menuBar->Freeze();
while( menuBar->GetMenuCount() )
delete menuBar->Remove( 0 );
......@@ -38,14 +37,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
wxMenu* fileMenu = new wxMenu;
// Save current library
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_LIBEDIT_SAVE_CURRENT_LIB,
_( "&Save Current Library\tCtrl+S" ),
_( "Save the current active library" ),
save_xpm );
// Save current library as...
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_LIBEDIT_SAVE_CURRENT_LIB_AS,
_( "Save Current Library &as" ),
_( "Save current active library as..." ),
......@@ -55,14 +54,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
fileMenu->AppendSeparator();
// Export as png file
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_LIBEDIT_GEN_PNG_FILE,
_( "&Create PNG File from Screen" ),
_( "Create a PNG file from the component displayed on screen" ),
plot_xpm );
// Export as SVG file
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_LIBEDIT_GEN_SVG_FILE,
_( "&Create SVG File" ),
_( "Create a SVG file from the current loaded component" ),
......@@ -72,7 +71,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
fileMenu->AppendSeparator();
// Quit
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
wxID_EXIT,
_( "&Quit" ),
_( "Quit Library Editor" ),
......@@ -84,7 +83,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// Undo
text = AddHotkeyName( _( "Undo" ), s_Libedit_Hokeys_Descr, HK_UNDO );
ADD_MENUITEM_WITH_HELP( editMenu,
AddMenuItem( editMenu,
wxID_UNDO,
text,
_( "Undo last edition" ),
......@@ -92,7 +91,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// Redo
text = AddHotkeyName( _( "Redo" ), s_Libedit_Hokeys_Descr, HK_REDO );
ADD_MENUITEM_WITH_HELP( editMenu,
AddMenuItem( editMenu,
wxID_REDO,
text,
_( "Redo the last undo command" ),
......@@ -102,7 +101,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
editMenu->AppendSeparator();
// Delete
ADD_MENUITEM_WITH_HELP( editMenu,
AddMenuItem( editMenu,
ID_LIBEDIT_DELETE_ITEM_BUTT,
_( "Delete" ),
HELP_DELETE_ITEMS,
......@@ -126,67 +125,63 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// Zoom in
text = _( "Zoom In" );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN,
zoom_in_xpm );
AddMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, zoom_in_xpm );
// Zoom out
text = _( "Zoom Out" );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT,
zoom_out_xpm );
AddMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, zoom_out_xpm );
// Fit on screen
text = AddHotkeyName( _( "Fit on Screen" ), s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT,
zoom_fit_in_page_xpm );
AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, zoom_fit_in_page_xpm );
// Separator
viewMenu->AppendSeparator();
// Redraw
text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW,
zoom_redraw_xpm );
AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, zoom_redraw_xpm );
// Menu Place:
wxMenu* placeMenu = new wxMenu;
// Pin
ADD_MENUITEM_WITH_HELP( placeMenu,
AddMenuItem( placeMenu,
ID_LIBEDIT_PIN_BUTT,
_( "&Pin" ),
HELP_ADD_PIN,
pin_xpm );
// Graphic text
ADD_MENUITEM_WITH_HELP( placeMenu,
AddMenuItem( placeMenu,
ID_LIBEDIT_BODY_TEXT_BUTT,
_( "Graphic text" ),
HELP_ADD_BODYTEXT,
add_text_xpm );
// Graphic rectangle
ADD_MENUITEM_WITH_HELP( placeMenu,
AddMenuItem( placeMenu,
ID_LIBEDIT_BODY_RECT_BUTT,
_( "Rectangle" ),
HELP_ADD_BODYRECT,
add_rectangle_xpm );
// Graphic Circle
ADD_MENUITEM_WITH_HELP( placeMenu,
AddMenuItem( placeMenu,
ID_LIBEDIT_BODY_CIRCLE_BUTT,
_( "Circle" ),
HELP_ADD_BODYCIRCLE,
add_circle_xpm );
// Graphic Arc
ADD_MENUITEM_WITH_HELP( placeMenu,
AddMenuItem( placeMenu,
ID_LIBEDIT_BODY_ARC_BUTT,
_( "Arc" ),
HELP_ADD_BODYARC,
add_arc_xpm );
// Graphic Line or Polygon
ADD_MENUITEM_WITH_HELP( placeMenu,
AddMenuItem( placeMenu,
ID_LIBEDIT_BODY_LINE_BUTT,
_( "Line or Polygon" ),
HELP_ADD_BODYPOLYGON,
......@@ -196,14 +191,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
wxMenu* preferencesMenu = new wxMenu;
// Library
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
ID_CONFIG_REQ,
_( "&Library" ),
_( "Library preferences" ),
library_xpm );
// Colors
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
ID_COLORS_SETUP,
_( "&Colors" ),
_( "Color preferences" ),
......@@ -219,14 +214,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
preferencesMenu->AppendSeparator();
// Save preferences
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
ID_CONFIG_SAVE,
_( "&Save preferences" ),
_( "Save application preferences" ),
save_setup_xpm );
// Read preferences
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
ID_CONFIG_READ,
_( "&Read preferences" ),
_( "Read application preferences" ),
......@@ -239,12 +234,12 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_HELP,
_( "&Contents" ),
_( "Open the eeschema manual" ),
online_help_xpm );
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
......@@ -252,7 +247,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// About EESchema
helpMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_ABOUT,
_( "&About EESchema" ),
_( "About EESchema schematic designer" ),
......
......@@ -3,11 +3,9 @@
/********************/
#include "fctsys.h"
#include "common.h"
#include "eeschema_id.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "bitmaps.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
......@@ -80,19 +78,20 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
if( item && item->GetFlags() )
{
ADD_MENUITEM( PopMenu, ID_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm );
AddMenuItem( PopMenu, ID_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm );
}
else
{
ADD_MENUITEM( PopMenu, ID_CANCEL_CURRENT_COMMAND, _( "End Tool" ), cancel_tool_xpm );
AddMenuItem( PopMenu, ID_CANCEL_CURRENT_COMMAND, _( "End Tool" ), cancel_tool_xpm );
}
PopMenu->AppendSeparator();
}
else
{
if( item && item->GetFlags() )
{
ADD_MENUITEM( PopMenu, ID_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm );
AddMenuItem( PopMenu, ID_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm );
PopMenu->AppendSeparator();
}
}
......@@ -100,7 +99,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
if( item == NULL )
{
if( GetSheet()->Last() != g_RootSheet )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_LEAVE_SHEET, _( "Leave Sheet" ), leave_sheet_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_LEAVE_SHEET, _( "Leave Sheet" ), leave_sheet_xpm );
PopMenu->AppendSeparator();
return true;
......@@ -113,7 +112,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
case SCH_NO_CONNECT_T:
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete No Connect" ), delete_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete No Connect" ), delete_xpm );
break;
case SCH_JUNCTION_T:
......@@ -125,14 +124,15 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
wxString msg = AddHotkeyName( _( "Move Bus Entry" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_xpm );
}
if( GetBusEntryShape( (SCH_BUS_ENTRY*) item ) == '\\' )
PopMenu->Append( ID_POPUP_SCH_ENTRY_SELECT_SLASH, _( "Set Bus Entry /" ) );
else
PopMenu->Append( ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH, _( "Set Bus Entry \\" ) );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Bus Entry" ), delete_bus_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Bus Entry" ), delete_bus_xpm );
break;
case SCH_MARKER_T:
......@@ -176,8 +176,9 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
default:
if( is_new )
ADD_MENUITEM( PopMenu, ID_POPUP_END_LINE, _( "End Drawing" ), apply_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Drawing" ), delete_xpm );
AddMenuItem( PopMenu, ID_POPUP_END_LINE, _( "End Drawing" ), apply_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Drawing" ), delete_xpm );
break;
}
break;
......@@ -209,13 +210,13 @@ void AddMenusForComponentField( wxMenu* PopMenu, SCH_FIELD* Field )
{
msg = AddHotkeyName( _( "Move Field" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_text_xpm );
}
msg = AddHotkeyName( _( "Rotate Field" ), s_Schematic_Hokeys_Descr, HK_ROTATE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ROTATE_FIELD, msg, rotate_field_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_ROTATE_FIELD, msg, rotate_field_xpm );
msg = AddHotkeyName( _( "Edit Field" ), s_Schematic_Hokeys_Descr, HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_FIELD, msg, edit_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_EDIT_FIELD, msg, edit_text_xpm );
}
......@@ -241,47 +242,48 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
msg = _( "Move Component" );
msg << wxT( " " ) << Component->GetField( REFERENCE )->m_Text;
msg = AddHotkeyName( msg, s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_xpm );
msg = AddHotkeyName( _( "Drag Component" ), s_Schematic_Hokeys_Descr, HK_DRAG );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, move_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, move_xpm );
}
wxMenu* orientmenu = new wxMenu;
msg = AddHotkeyName( _( "Rotate +" ), s_Schematic_Hokeys_Descr, HK_ROTATE );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_ROTATE_CMP_COUNTERCLOCKWISE, msg, rotate_ccw_xpm );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_ROTATE_CMP_CLOCKWISE, _( "Rotate -" ), rotate_cw_xpm );
AddMenuItem( orientmenu, ID_POPUP_SCH_ROTATE_CMP_COUNTERCLOCKWISE, msg, rotate_ccw_xpm );
AddMenuItem( orientmenu, ID_POPUP_SCH_ROTATE_CMP_CLOCKWISE, _( "Rotate -" ), rotate_cw_xpm );
msg = AddHotkeyName( _( "Mirror --" ), s_Schematic_Hokeys_Descr, HK_MIRROR_X_COMPONENT );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_MIROR_X_CMP, msg, mirror_v_xpm );
AddMenuItem( orientmenu, ID_POPUP_SCH_MIROR_X_CMP, msg, mirror_v_xpm );
msg = AddHotkeyName( _( "Mirror ||" ), s_Schematic_Hokeys_Descr, HK_MIRROR_Y_COMPONENT );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_MIROR_Y_CMP, msg, mirror_h_xpm );
AddMenuItem( orientmenu, ID_POPUP_SCH_MIROR_Y_CMP, msg, mirror_h_xpm );
msg = AddHotkeyName( _( "Normal" ), s_Schematic_Hokeys_Descr, HK_ORIENT_NORMAL_COMPONENT );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_ORIENT_NORMAL_CMP, msg, normal_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, orientmenu, ID_POPUP_SCH_GENERIC_ORIENT_CMP,
AddMenuItem( orientmenu, ID_POPUP_SCH_ORIENT_NORMAL_CMP, msg, normal_xpm );
AddMenuItem( PopMenu, orientmenu, ID_POPUP_SCH_GENERIC_ORIENT_CMP,
_( "Orient Component" ), orient_xpm );
wxMenu* editmenu = new wxMenu;
msg = AddHotkeyName( _( "Edit" ), s_Schematic_Hokeys_Descr, HK_EDIT );
ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_CMP, msg, edit_component_xpm );
AddMenuItem( editmenu, ID_POPUP_SCH_EDIT_CMP, msg, edit_component_xpm );
if( libComponent && libComponent->IsNormal() )
{
msg = AddHotkeyName( _( "Value " ), s_Schematic_Hokeys_Descr, HK_EDIT_COMPONENT_VALUE );
ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_VALUE_CMP, msg, edit_comp_value_xpm );
AddMenuItem( editmenu, ID_POPUP_SCH_EDIT_VALUE_CMP, msg, edit_comp_value_xpm );
ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_REF_CMP, _( "Reference" ), edit_comp_ref_xpm );
AddMenuItem( editmenu, ID_POPUP_SCH_EDIT_REF_CMP, _( "Reference" ), edit_comp_ref_xpm );
msg = AddHotkeyName( _( "Footprint " ), s_Schematic_Hokeys_Descr,
HK_EDIT_COMPONENT_FOOTPRINT );
ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_FOOTPRINT_CMP, msg, edit_comp_footprint_xpm );
AddMenuItem( editmenu, ID_POPUP_SCH_EDIT_FOOTPRINT_CMP, msg, edit_comp_footprint_xpm );
}
if( libComponent && libComponent->HasConversion() )
ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_CONVERT_CMP, _( "Convert" ),
AddMenuItem( editmenu, ID_POPUP_SCH_EDIT_CONVERT_CMP, _( "Convert" ),
component_select_alternate_shape_xpm );
if( libComponent && ( libComponent->GetPartCount() >= 2 ) )
{
wxMenu* sel_unit_menu = new wxMenu; int ii;
for( ii = 0; ii < libComponent->GetPartCount(); ii++ )
{
wxString num_unit;
......@@ -295,30 +297,31 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
item->Check(true);
}
ADD_MENUITEM_WITH_SUBMENU( editmenu, sel_unit_menu, ID_POPUP_SCH_SELECT_UNIT_CMP,
AddMenuItem( editmenu, sel_unit_menu, ID_POPUP_SCH_SELECT_UNIT_CMP,
_( "Unit" ), component_select_unit_xpm );
}
if( !Component->GetFlags() )
{
ADD_MENUITEM( editmenu, ID_POPUP_SCH_CALL_LIBEDIT_AND_LOAD_CMP, _( "Edit with Library Editor" ),
AddMenuItem( editmenu, ID_POPUP_SCH_CALL_LIBEDIT_AND_LOAD_CMP,
_( "Edit with Library Editor" ),
libedit_xpm );
}
ADD_MENUITEM_WITH_SUBMENU( PopMenu, editmenu, ID_POPUP_SCH_GENERIC_EDIT_CMP,
AddMenuItem( PopMenu, editmenu, ID_POPUP_SCH_GENERIC_EDIT_CMP,
_( "Edit Component" ), edit_component_xpm );
if( !Component->GetFlags() )
{
msg = AddHotkeyName( _( "Copy Component" ), s_Schematic_Hokeys_Descr,
HK_COPY_COMPONENT_OR_LABEL );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_COPY_ITEM, msg, copy_button_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_COPY_ITEM, msg, copy_button_xpm );
msg = AddHotkeyName( _( "Delete Component" ), s_Schematic_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_CMP, msg, delete_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE_CMP, msg, delete_xpm );
}
if( libEntry && !libEntry->GetDocFileName().IsEmpty() )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DISPLAYDOC_CMP, _( "Doc" ), datasheet_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DISPLAYDOC_CMP, _( "Doc" ), datasheet_xpm );
}
......@@ -331,30 +334,30 @@ void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel )
{
msg = AddHotkeyName( _( "Move Global Label" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_text_xpm );
msg = AddHotkeyName( _( "Drag Global Label" ), s_Schematic_Hokeys_Descr,
HK_DRAG );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, move_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, move_text_xpm );
msg = AddHotkeyName( _( "Copy Global Label" ), s_Schematic_Hokeys_Descr,
HK_COPY_COMPONENT_OR_LABEL );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_COPY_ITEM, msg, copy_button_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_COPY_ITEM, msg, copy_button_xpm );
}
msg = AddHotkeyName( _( "Rotate Global Label" ), s_Schematic_Hokeys_Descr, HK_ROTATE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ROTATE_TEXT, msg, rotate_glabel_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_ROTATE_TEXT, msg, rotate_glabel_xpm );
msg = AddHotkeyName( _( "Edit Global Label" ), s_Schematic_Hokeys_Descr, HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_TEXT, msg, edit_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_EDIT_TEXT, msg, edit_text_xpm );
msg = AddHotkeyName( _( "Delete Global Label" ), s_Schematic_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_text_xpm );
// add menu change type text (to label, glabel, text):
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL,
AddMenuItem( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL,
_( "Change to Hierarchical Label" ), label2glabel_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL,
AddMenuItem( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL,
_( "Change to Label" ), glabel2label_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT,
AddMenuItem( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT,
_( "Change to Text" ), glabel2text_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT,
AddMenuItem( PopMenu, menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT,
_( "Change Type" ), gl_change_xpm );
}
......@@ -368,29 +371,29 @@ void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel )
{
msg = AddHotkeyName( _( "Move Hierarchical Label" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_text_xpm );
msg = AddHotkeyName( _( "Drag Hierarchical Label" ), s_Schematic_Hokeys_Descr,
HK_DRAG );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, move_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_text_xpm );
msg = AddHotkeyName( _( "Drag Hierarchical Label" ), s_Schematic_Hokeys_Descr, HK_DRAG );
AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, move_text_xpm );
msg = AddHotkeyName( _( "Copy Hierarchical Label" ), s_Schematic_Hokeys_Descr,
HK_COPY_COMPONENT_OR_LABEL );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_COPY_ITEM, msg, copy_button_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_COPY_ITEM, msg, copy_button_xpm );
}
msg = AddHotkeyName( _( "Rotate Hierarchical Label" ), s_Schematic_Hokeys_Descr, HK_ROTATE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ROTATE_TEXT, msg, rotate_glabel_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_ROTATE_TEXT, msg, rotate_glabel_xpm );
msg = AddHotkeyName( _( "Edit Hierarchical Label" ), s_Schematic_Hokeys_Descr, HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_TEXT, msg, edit_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_EDIT_TEXT, msg, edit_text_xpm );
msg = AddHotkeyName( _( "Delete Hierarchical Label" ), s_Schematic_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_text_xpm );
// add menu change type text (to label, glabel, text):
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL,
AddMenuItem( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL,
_( "Change to Label" ), glabel2label_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT,
AddMenuItem( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT,
_( "Change to Text" ), glabel2text_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL,
AddMenuItem( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL,
_( "Change to Global Label" ), label2glabel_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT,
AddMenuItem( PopMenu, menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT,
_( "Change Type" ), gl_change_xpm );
}
......@@ -404,29 +407,29 @@ void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label )
{
msg = AddHotkeyName( _( "Move Label" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_text_xpm );
msg = AddHotkeyName( _( "Drag Label" ), s_Schematic_Hokeys_Descr,
HK_DRAG );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, move_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_text_xpm );
msg = AddHotkeyName( _( "Drag Label" ), s_Schematic_Hokeys_Descr, HK_DRAG );
AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, move_text_xpm );
msg = AddHotkeyName( _( "Copy Label" ), s_Schematic_Hokeys_Descr,
HK_COPY_COMPONENT_OR_LABEL );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_COPY_ITEM, msg, copy_button_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_COPY_ITEM, msg, copy_button_xpm );
}
msg = AddHotkeyName( _( "Rotate Label" ), s_Schematic_Hokeys_Descr, HK_ROTATE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ROTATE_TEXT, msg, rotate_ccw_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_ROTATE_TEXT, msg, rotate_ccw_xpm );
msg = AddHotkeyName( _( "Edit Label" ), s_Schematic_Hokeys_Descr, HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_TEXT, msg, edit_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_EDIT_TEXT, msg, edit_text_xpm );
msg = AddHotkeyName( _( "Delete Label" ), s_Schematic_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_text_xpm );
// add menu change type text (to label, glabel, text):
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL,
AddMenuItem( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL,
_( "Change to Hierarchical Label" ), label2glabel_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT,
AddMenuItem( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT,
_( "Change to Text" ), label2text_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL,
AddMenuItem( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL,
_( "Change to Global Label" ), label2glabel_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT,
AddMenuItem( PopMenu, menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT,
_( "Change Type" ), gl_change_xpm );
}
......@@ -440,31 +443,31 @@ void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text )
{
msg = AddHotkeyName( _( "Move Text" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_text_xpm );
msg = AddHotkeyName( _( "Copy Text" ), s_Schematic_Hokeys_Descr,
HK_COPY_COMPONENT_OR_LABEL );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_COPY_ITEM, msg, copy_button_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_COPY_ITEM, msg, copy_button_xpm );
}
msg = AddHotkeyName( _( "Rotate Text" ), s_Schematic_Hokeys_Descr, HK_ROTATE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ROTATE_TEXT, msg, rotate_ccw_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_ROTATE_TEXT, msg, rotate_ccw_xpm );
msg = AddHotkeyName( _( "Edit Text" ), s_Schematic_Hokeys_Descr, HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_TEXT, msg, edit_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_EDIT_TEXT, msg, edit_text_xpm );
msg = AddHotkeyName( _( "Delete Text" ), s_Schematic_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_text_xpm );
/* add menu change type text (to label, glabel, text),
* but only if this is a single line text
*/
if( Text->m_Text.Find( wxT( "\n" ) ) == wxNOT_FOUND )
{
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL,
AddMenuItem( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL,
_( "Change to Label" ), label2text_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL,
AddMenuItem( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL,
_( "Change to Hierarchical Label" ), label2glabel_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL,
AddMenuItem( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL,
_( "Change to Global Label" ), label2glabel_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT,
AddMenuItem( PopMenu, menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT,
_( "Change Type" ), gl_change_xpm );
}
}
......@@ -476,21 +479,21 @@ void SCH_EDIT_FRAME::addJunctionMenuEntries( wxMenu* aMenu, SCH_JUNCTION* aJunct
SCH_SCREEN* screen = GetScreen();
msg = AddHotkeyName( _( "Delete Junction" ), s_Schematic_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( aMenu, ID_POPUP_SCH_DELETE, msg, delete_xpm );
AddMenuItem( aMenu, ID_POPUP_SCH_DELETE, msg, delete_xpm );
if( !aJunction->IsNew() )
{
if( m_collectedItems.IsDraggableJunction() )
ADD_MENUITEM( aMenu, ID_POPUP_SCH_DRAG_WIRE_REQUEST, _( "Drag Junction" ), move_xpm );
AddMenuItem( aMenu, ID_POPUP_SCH_DRAG_WIRE_REQUEST, _( "Drag Junction" ), move_xpm );
if( screen->GetWire( aJunction->m_Pos, EXCLUDE_END_POINTS_T ) )
ADD_MENUITEM( aMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Wire" ), break_line_xpm );
AddMenuItem( aMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Wire" ), break_line_xpm );
}
if( screen->GetWireOrBus( aJunction->m_Pos ) )
{
ADD_MENUITEM( aMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete Node" ), delete_node_xpm );
ADD_MENUITEM( aMenu, ID_POPUP_SCH_DELETE_CONNECTION, _( "Delete Connection" ),
AddMenuItem( aMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete Node" ), delete_node_xpm );
AddMenuItem( aMenu, ID_POPUP_SCH_DELETE_CONNECTION, _( "Delete Connection" ),
delete_connection_xpm );
}
}
......@@ -505,34 +508,34 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame )
if( is_new )
{
ADD_MENUITEM( PopMenu, ID_POPUP_END_LINE, _( "Wire End" ), apply_xpm );
AddMenuItem( PopMenu, ID_POPUP_END_LINE, _( "Wire End" ), apply_xpm );
return;
}
msg = AddHotkeyName( _( "Drag Wire" ), s_Schematic_Hokeys_Descr, HK_DRAG );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DRAG_WIRE_REQUEST, msg, move_track_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_WIRE_REQUEST, msg, move_track_xpm );
PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Delete Wire" ), s_Schematic_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete Node" ), delete_node_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_CONNECTION, _( "Delete Connection" ),
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete Node" ), delete_node_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE_CONNECTION, _( "Delete Connection" ),
delete_connection_xpm );
SCH_LINE* line = screen->GetWireOrBus( screen->GetCrossHairPosition() );
if( line && !line->IsEndPoint( screen->GetCrossHairPosition() ) )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Wire" ), break_line_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Wire" ), break_line_xpm );
PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Add Junction" ), s_Schematic_Hokeys_Descr, HK_ADD_JUNCTION );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, msg, add_junction_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, msg, add_junction_xpm );
msg = AddHotkeyName( _( "Add Label" ), s_Schematic_Hokeys_Descr, HK_ADD_LABEL );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_LABEL, msg, add_line_label_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_ADD_LABEL, msg, add_line_label_xpm );
// Add global label command only if the cursor is over one end of the wire.
if( ( pos == Wire->m_Start ) || ( pos == Wire->m_End ) )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_GLABEL, _( "Add Global Label" ), add_glabel_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_ADD_GLABEL, _( "Add Global Label" ), add_glabel_xpm );
}
......@@ -544,24 +547,24 @@ void AddMenusForBus( wxMenu* PopMenu, SCH_LINE* Bus, SCH_EDIT_FRAME* frame )
if( is_new )
{
ADD_MENUITEM( PopMenu, ID_POPUP_END_LINE, _( "Bus End" ), apply_xpm );
AddMenuItem( PopMenu, ID_POPUP_END_LINE, _( "Bus End" ), apply_xpm );
return;
}
msg = AddHotkeyName( _( "Delete Bus" ), s_Schematic_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_bus_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_bus_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Bus" ), break_bus_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Bus" ), break_bus_xpm );
PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Add Junction" ), s_Schematic_Hokeys_Descr, HK_ADD_JUNCTION );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, msg, add_junction_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, msg, add_junction_xpm );
msg = AddHotkeyName( _( "Add Label" ), s_Schematic_Hokeys_Descr, HK_ADD_LABEL );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_LABEL, msg, add_line_label_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_ADD_LABEL, msg, add_line_label_xpm );
// Add global label command only if the cursor is over one end of the bus.
if( ( pos == Bus->m_Start ) || ( pos == Bus->m_End ) )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_GLABEL, _( "Add Global Label" ), add_glabel_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_ADD_GLABEL, _( "Add Global Label" ), add_glabel_xpm );
}
......@@ -571,37 +574,38 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet )
if( !Sheet->GetFlags() )
{
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ENTER_SHEET, _( "Enter Sheet" ), enter_sheet_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_ENTER_SHEET, _( "Enter Sheet" ), enter_sheet_xpm );
PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Move Sheet" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_sheet_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_MOVE_ITEM, msg, move_sheet_xpm );
msg = AddHotkeyName( _( "Drag Sheet" ), s_Schematic_Hokeys_Descr, HK_DRAG );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, move_sheet_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, move_sheet_xpm );
}
if( Sheet->GetFlags() )
{
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_END_SHEET, _( "Place Sheet" ), apply_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_END_SHEET, _( "Place Sheet" ), apply_xpm );
}
else
{
msg = AddHotkeyName( _( "Edit Sheet" ), s_Schematic_Hokeys_Descr, HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_SHEET, msg, edit_sheet_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_EDIT_SHEET, msg, edit_sheet_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_RESIZE_SHEET, _( "Resize Sheet" ),
AddMenuItem( PopMenu, ID_POPUP_SCH_RESIZE_SHEET, _( "Resize Sheet" ),
resize_sheet_xpm );
PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_IMPORT_GLABEL, _( "Import Sheet Pins" ),
AddMenuItem( PopMenu, ID_POPUP_IMPORT_GLABEL, _( "Import Sheet Pins" ),
import_hierarchical_label_xpm );
if( Sheet->HasUndefinedPins() ) // Sheet has pin labels, and can be cleaned
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_CLEANUP_SHEET, _( "Cleanup Sheet Pins" ),
AddMenuItem( PopMenu, ID_POPUP_SCH_CLEANUP_SHEET, _( "Cleanup Sheet Pins" ),
options_pinsheet_xpm );
PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Delete Sheet" ), s_Schematic_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_sheet_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_sheet_xpm );
}
}
......@@ -614,13 +618,13 @@ void AddMenusForSheetPin( wxMenu* PopMenu, SCH_SHEET_PIN* PinSheet )
{
msg = AddHotkeyName( _( "Move Sheet Pin" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_SHEET_PIN, msg, move_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_MOVE_SHEET_PIN, msg, move_xpm );
}
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_SHEET_PIN, _( "Edit Sheet Pin" ), edit_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_EDIT_SHEET_PIN, _( "Edit Sheet Pin" ), edit_xpm );
if( !PinSheet->GetFlags() )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Sheet Pin" ), delete_pinsheet_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Sheet Pin" ), delete_pinsheet_xpm );
}
......@@ -628,33 +632,32 @@ void AddMenusForBlock( wxMenu* PopMenu, SCH_EDIT_FRAME* frame )
{
wxString msg;
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ), cancel_xpm );
AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ), cancel_xpm );
PopMenu->AppendSeparator();
if( frame->GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE )
ADD_MENUITEM( PopMenu, ID_POPUP_ZOOM_BLOCK, _( "Window Zoom" ),
zoom_area_xpm );
AddMenuItem( PopMenu, ID_POPUP_ZOOM_BLOCK, _( "Window Zoom" ), zoom_area_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), apply_xpm );
AddMenuItem( PopMenu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), apply_xpm );
// After a block move (that is also a block selection) one can reselect
// a block function.
if( frame->GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE )
{
ADD_MENUITEM( PopMenu, wxID_COPY, _( "Save Block" ), copy_button_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), copyblock_xpm );
AddMenuItem( PopMenu, wxID_COPY, _( "Save Block" ), copy_button_xpm );
AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), copyblock_xpm );
msg = AddHotkeyName( _( "Drag Block" ), s_Schematic_Hokeys_Descr,
HK_MOVEBLOCK_TO_DRAGBLOCK );
ADD_MENUITEM( PopMenu, ID_POPUP_DRAG_BLOCK, msg, move_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), delete_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_MIRROR_Y_BLOCK, _( "Mirror Block ||" ), mirror_h_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_MIRROR_X_BLOCK, _( "Mirror Block --" ), mirror_v_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_ROTATE_BLOCK, _( "Rotate Block ccw" ), rotate_ccw_xpm );
AddMenuItem( PopMenu, ID_POPUP_DRAG_BLOCK, msg, move_xpm );
AddMenuItem( PopMenu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), delete_xpm );
AddMenuItem( PopMenu, ID_POPUP_MIRROR_Y_BLOCK, _( "Mirror Block ||" ), mirror_h_xpm );
AddMenuItem( PopMenu, ID_POPUP_MIRROR_X_BLOCK, _( "Mirror Block --" ), mirror_v_xpm );
AddMenuItem( PopMenu, ID_POPUP_ROTATE_BLOCK, _( "Rotate Block ccw" ), rotate_ccw_xpm );
#if 0
#ifdef __WINDOWS__
ADD_MENUITEM( menu_other_block_commands, ID_GEN_COPY_BLOCK_TO_CLIPBOARD,
AddMenuItem( menu_other_block_commands, ID_GEN_COPY_BLOCK_TO_CLIPBOARD,
_( "Copy to Clipboard" ), copy_button_xpm );
#endif
#endif
......@@ -664,6 +667,6 @@ void AddMenusForBlock( wxMenu* PopMenu, SCH_EDIT_FRAME* frame )
void AddMenusForMarkers( wxMenu* aPopMenu, SCH_MARKER* aMarker, SCH_EDIT_FRAME* aFrame )
{
ADD_MENUITEM( aPopMenu, ID_POPUP_SCH_DELETE, _( "Delete Marker" ), delete_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_SCH_GETINFO_MARKER, _( "Marker Error Info" ), info_xpm );
AddMenuItem( aPopMenu, ID_POPUP_SCH_DELETE, _( "Delete Marker" ), delete_xpm );
AddMenuItem( aPopMenu, ID_POPUP_SCH_GETINFO_MARKER, _( "Marker Error Info" ), info_xpm );
}
......@@ -151,7 +151,7 @@ public:
* checks for \a aName in the the template field name list.
*
* @param aName A wxString object containing the field name to search for.
* @param True if \a aName is found in the list.
* @return True if \a aName is found in the list.
*/
bool HasFieldName( const wxString& aName ) const;
};
......
......@@ -19,6 +19,8 @@ class GERBVIEW_FRAME;
//class BOARD;
class GERBER_IMAGE;
class Ki_PageDescr;
// Type of photoplotter action:
#define GERB_ACTIVE_DRAW 1 // Activate light (lower pen)
......
......@@ -5,10 +5,8 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "gerbview.h"
#include "bitmaps.h"
#include "gerbview_id.h"
#include "hotkeys.h"
......@@ -26,6 +24,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
// Delete all existing menus so they can be rebuilt.
// This allows language changes of the menu text on the fly.
menuBar->Freeze();
while( menuBar->GetMenuCount() )
delete menuBar->Remove( 0 );
......@@ -35,35 +34,37 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
wxMenu* fileMenu = new wxMenu;
// Load
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
wxID_FILE,
_( "Load &Gerber File" ),
_( "Load a new Gerber file on the current layer. Previous data will be deleted" ),
gerber_file_xpm );
// Excellon
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_GERBVIEW_LOAD_DRILL_FILE,
_( "Load &EXCELLON Drill File" ),
_( "Load excellon drill file" ),
gerbview_drill_file_xpm );
// Dcodes
ADD_MENUITEM_WITH_HELP( fileMenu, ID_GERBVIEW_LOAD_DCODE_FILE,
AddMenuItem( fileMenu, ID_GERBVIEW_LOAD_DCODE_FILE,
_( "Load &DCodes" ),
_( "Load D-Codes definition file" ),
gerber_open_dcode_file_xpm );
// Recent gerber files
static wxMenu* openRecentGbrMenu;
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if( openRecentGbrMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentGbrMenu );
openRecentGbrMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentGbrMenu );
wxGetApp().m_fileHistory.AddFilesToMenu();
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentGbrMenu,
AddMenuItem( fileMenu, openRecentGbrMenu,
wxID_ANY,
_( "Open &Recent Gerber File" ),
_( "Open a recent opened Gerber file" ),
......@@ -71,12 +72,14 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
// Recent drill files
static wxMenu* openRecentDrlMenu;
if( openRecentDrlMenu )
m_drillFileHistory.RemoveMenu( openRecentDrlMenu );
openRecentDrlMenu = new wxMenu();
m_drillFileHistory.UseMenu( openRecentDrlMenu );
m_drillFileHistory.AddFilesToMenu( );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentDrlMenu,
AddMenuItem( fileMenu, openRecentDrlMenu,
wxID_ANY,
_( "Open Recent &Drill File" ),
_( "Open a recent opened drill file" ),
......@@ -86,7 +89,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
fileMenu->AppendSeparator();
// Clear all
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_GERBVIEW_ERASE_ALL,
_( "&Clear All" ),
_( "Clear all layers. All data will be deleted" ),
......@@ -96,7 +99,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
fileMenu->AppendSeparator();
// Export to pcbnew
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_GERBVIEW_EXPORT_TO_PCBNEW,
_( "Export to &Pcbnew" ),
_( "Export data in pcbnew format" ),
......@@ -106,7 +109,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
fileMenu->AppendSeparator();
// Print
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
wxID_PRINT,
_( "P&rint" ),
_( "Print gerber" ),
......@@ -116,7 +119,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
fileMenu->AppendSeparator();
// Exit
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
wxID_EXIT,
_( "E&xit" ),
_( "Quit Gerbview" ),
......@@ -126,7 +129,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
wxMenu* configMenu = new wxMenu;
// Hide layer manager
ADD_MENUITEM_WITH_HELP( configMenu,
AddMenuItem( configMenu,
ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
_( "Hide &Layers Manager" ),
_( "Show/hide the layers manager toolbar" ),
......@@ -137,7 +140,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
#ifdef __WXMAC__
configMenu->Append(wxID_PREFERENCES);
#else
ADD_MENUITEM_WITH_HELP( configMenu,
AddMenuItem( configMenu,
wxID_PREFERENCES,
_( "&Options" ),
_( "Set options to draw items" ),
......@@ -155,14 +158,14 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
wxMenu* miscellaneousMenu = new wxMenu;
// List dcodes
ADD_MENUITEM_WITH_HELP( miscellaneousMenu,
AddMenuItem( miscellaneousMenu,
ID_GERBVIEW_SHOW_LIST_DCODES,
_( "&List DCodes" ),
_( "List and edit D-codes" ),
show_dcodenumber_xpm );
// Show source
ADD_MENUITEM_WITH_HELP( miscellaneousMenu,
AddMenuItem( miscellaneousMenu,
ID_GERBVIEW_SHOW_SOURCE,
_( "&Show Source" ),
_( "Show source file for the current layer" ),
......@@ -172,7 +175,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
miscellaneousMenu->AppendSeparator();
// Clear layer
ADD_MENUITEM_WITH_HELP( miscellaneousMenu,
AddMenuItem( miscellaneousMenu,
ID_GERBVIEW_GLOBAL_DELETE,
_( "&Clear Layer" ),
_( "Clear current layer" ),
......@@ -182,7 +185,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
miscellaneousMenu->AppendSeparator();
// Text editor
ADD_MENUITEM_WITH_HELP( miscellaneousMenu,
AddMenuItem( miscellaneousMenu,
ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR,
_( "&Text Editor" ),
_( "Select your preferred text editor" ),
......@@ -195,14 +198,14 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_HELP,
_( "&Contents" ),
_( "Open the Gerbview handbook" ),
help_xpm );
// About gerbview
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_ABOUT,
_( "&About GerbView" ),
_( "About gerbview gerber and drill viewer" ),
......
......@@ -3,10 +3,8 @@
/********************/
#include "fctsys.h"
#include "common.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "bitmaps.h"
#include "gerbview.h"
......@@ -34,10 +32,10 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
if( GetToolId() != ID_NO_TOOL_SELECTED )
{
if( DrawStruct && DrawStruct->m_Flags )
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel" ), cancel_xpm );
else
ADD_MENUITEM( PopMenu, ID_POPUP_CLOSE_CURRENT_TOOL,
AddMenuItem( PopMenu, ID_POPUP_CLOSE_CURRENT_TOOL,
_( "End Tool" ), cancel_tool_xpm );
PopMenu->AppendSeparator();
......@@ -48,17 +46,20 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
if( BlockActive )
{
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel Block" ), cancel_xpm );
PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_PLACE_BLOCK,
AddMenuItem( PopMenu, ID_POPUP_PLACE_BLOCK,
_( "Place Block" ), apply_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_DELETE_BLOCK,
AddMenuItem( PopMenu, ID_POPUP_DELETE_BLOCK,
_( "Delete Block (ctrl + drag mouse)" ), delete_xpm );
}
else
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
{
AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel" ), cancel_xpm );
}
PopMenu->AppendSeparator();
}
}
......
......@@ -224,7 +224,7 @@ public: WinEDA_App();
/**
* Function GetHelpFile
* get the help file path.
* <p?
* <p>
* Return the Kicad help file with path. The base paths defined in
* m_searchPaths are tested for a valid file. The path returned can
* be relative depending on the paths added to m_searchPaths. See the
......@@ -233,8 +233,8 @@ public: WinEDA_App();
* version of the help file is made.
* wxEmptyString is returned if help file not found.
* Help file is searched in directories in this order:
* help/<canonical name> like help/en_GB
* help/<short name> like help/en
* help/\<canonical name\> like help/en_GB
* help/\<short name\> like help/en
* help/en
* </p>
*/
......
......@@ -11,6 +11,9 @@
#define DEFAULT_HOTKEY_FILENAME_EXT wxT( "key" )
class EDA_DRAW_FRAME;
/* Class to handle hotkey commnands. hotkeys have a default value
* This class allows the real key code changed by user(from a key code list file)
*/
......
/**************************************/
/* Useful macros and inline functions */
/**************************************/
/**
* @file macros.h
* @brief This file contains miscellaneous helper definitions and functions.
*/
#ifndef MACROS_H
#define MACROS_H
#include <wx/wx.h>
#include "bitmaps.h"
/**
* Macro TO_UTF8
* converts a wxString to a UTF8 encoded C string for all wxWidgets build modes.
......@@ -26,8 +24,10 @@
static inline wxString FROM_UTF8( const char* cstring )
{
wxString line = wxString::FromUTF8( cstring );
if( line.IsEmpty() ) // happens when cstring is not a valid UTF8 sequence
line = wxConvCurrent->cMB2WC( cstring ); // try to use locale conversion
return line;
}
......@@ -78,33 +78,39 @@ static inline const wxChar* GetChars( const wxString& s )
#define RAD2DEG( Rad ) ( (Rad) * 180.0 / M_PI )
// Normalize angle to be in the -360.0 .. 360.0:
#define NORMALIZE_ANGLE_360( Angle ) { while( Angle < -3600 ) \
Angle += 3600;\
#define NORMALIZE_ANGLE_360( Angle ) { \
while( Angle < -3600 ) \
Angle += 3600; \
while( Angle > 3600 ) \
Angle -= 3600;}
Angle -= 3600; }
/* Normalize angle to be in the 0.0 .. 360.0 range: */
#define NORMALIZE_ANGLE_POS( Angle ) { while( Angle < 0 ) \
Angle += 3600;\
#define NORMALIZE_ANGLE_POS( Angle ) { \
while( Angle < 0 ) \
Angle += 3600; \
while( Angle >= 3600 ) \
Angle -= 3600;}
Angle -= 3600; }
#define NEGATE_AND_NORMALIZE_ANGLE_POS( Angle ) \
{ Angle = -Angle; while( Angle < 0 ) \
Angle += 3600;while( Angle >= 3600 ) \
Angle -= 3600;}
#define NEGATE_AND_NORMALIZE_ANGLE_POS( Angle ) { \
Angle = -Angle; \
while( Angle < 0 ) \
Angle += 3600; \
while( Angle >= 3600 ) \
Angle -= 3600; }
/* Normalize angle to be in the -90.0 .. 90.0 range */
#define NORMALIZE_ANGLE_90( Angle ) { while( Angle < -900 ) \
Angle += 1800;\
#define NORMALIZE_ANGLE_90( Angle ) { \
while( Angle < -900 ) \
Angle += 1800; \
while( Angle > 900 ) \
Angle -= 1800;}
Angle -= 1800; }
/* Normalize angle to be in the -180.0 .. 180.0 range */
#define NORMALIZE_ANGLE_180( Angle ) { while( Angle <= -1800 ) \
Angle += 3600;\
#define NORMALIZE_ANGLE_180( Angle ) { \
while( Angle <= -1800 ) \
Angle += 3600; \
while( Angle > 1800 ) \
Angle -= 3600;}
Angle -= 3600; }
/*****************************/
/* macro to exchange 2 items */
......@@ -140,92 +146,4 @@ BOOST_TYPEOF_REGISTER_TYPE( BOARD_ITEM* )
(b) = __temp__; }
/*****************************************************/
/* inline functions to insert menuitems with a icon: */
/*****************************************************/
static inline void ADD_MENUITEM( wxMenu* menu,
int id,
const wxString& text,
const wxBitmap& icon )
{
wxMenuItem* l_item;
l_item = new wxMenuItem( menu, id, text );
#if defined( USE_IMAGES_IN_MENUS )
l_item->SetBitmap( icon );
#endif
menu->Append( l_item );
}
static inline void ADD_MENUITEM_WITH_HELP( wxMenu* menu,
int id,
const wxString& text,
const wxString& help,
const wxBitmap& icon )
{
wxMenuItem* l_item;
l_item = new wxMenuItem( menu, id, text, help );
#if defined( USE_IMAGES_IN_MENUS )
l_item->SetBitmap( icon );
#endif
menu->Append( l_item );
}
static inline void ADD_MENUITEM_WITH_SUBMENU( wxMenu* menu,
wxMenu* submenu,
int id,
const wxString& text,
const wxBitmap& icon )
{
wxMenuItem* l_item;
l_item = new wxMenuItem( menu, id, text );
l_item->SetSubMenu( submenu );
#if defined( USE_IMAGES_IN_MENUS )
l_item->SetBitmap( icon );
#endif
menu->Append( l_item );
};
static inline void ADD_MENUITEM_WITH_HELP_AND_SUBMENU( wxMenu* menu,
wxMenu* submenu,
int id,
const wxString& text,
const wxString& help,
const wxBitmap& icon )
{
wxMenuItem* l_item;
l_item = new wxMenuItem( menu, id, text, help );
l_item->SetSubMenu( submenu );
#if defined( USE_IMAGES_IN_MENUS )
l_item->SetBitmap( icon );
#endif
menu->Append( l_item );
};
// macro to add a bitmap list to check menus (do not use with normal menus)
#if defined( USE_IMAGES_IN_MENUS ) && defined( __WINDOWS__ )
# define SETBITMAPS( icon ) item->SetBitmaps( KiBitmap( apply_xpm ), KiBitmap( icon ) )
#else
# define SETBITMAPS( icon )
#endif
// macro to add a bitmap menus (do not use with check menus)
#if !defined( USE_IMAGES_IN_MENUS ) || defined( __WXMAC__ )
# define SET_BITMAP( icon )
#else
# define SET_BITMAP( icon ) item->SetBitmap( (icon) )
#endif
#endif /* ifdef MACRO_H */
/****************/
/* wxstruct.h */
/****************/
/**
* @file wxstruct.h
* @brief Base window classes and related definitions.
*/
#ifndef WXSTRUCT_H
#define WXSTRUCT_H
......@@ -16,10 +17,11 @@
#include <wx/aui/aui.h>
#include <wx/docview.h>
#include "bitmaps.h"
#include "colors.h"
#include "common.h"
//C++ guarantees that operator delete checks its argument for null-ness
// C++ guarantees that operator delete checks its argument for null-ness
#ifndef SAFE_DELETE
#define SAFE_DELETE( p ) delete (p); (p) = NULL;
#endif
......@@ -74,16 +76,11 @@ enum id_toolbar {
};
/***********************************************/
/* Classes for basic main frames used in kicad */
/***********************************************/
/******************************************************************/
/* Basic frame for kicad, eeschema, pcbnew and gerbview. */
/* not directly used: the real frames are derived from this class */
/******************************************************************/
/**
* Class EDA_BASE_FRAME
* is the base frame for deriving all Kicad main window classes. This class is not
* intended to be used directly.
*/
class EDA_BASE_FRAME : public wxFrame
{
public:
......@@ -101,8 +98,7 @@ public:
wxAuiManager m_auimgr;
public:
EDA_BASE_FRAME( wxWindow* father, int idtype,
const wxString& title,
EDA_BASE_FRAME( wxWindow* father, int idtype, const wxString& title,
const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~EDA_BASE_FRAME();
......@@ -111,9 +107,11 @@ public:
void GetKicadAbout( wxCommandEvent& event );
/**
* Copy the version information to the clipboard for bug reporting purposes.
* Function CopyVersionInfoToClipboard
* copies the version information to the clipboard for bug reporting purposes.
*/
void CopyVersionInfoToClipboard( wxCommandEvent& event );
void PrintMsg( const wxString& text );
/**
......@@ -139,7 +137,7 @@ public:
/**
* Function ReadHotkeyConfig
* Read configuration data and fill the current hotkey list with hotkeys
* @param aDescList = current hotkey list descr. to initialise.
* @param aDescList = current hotkey list descr. to initialize.
*/
int ReadHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aDescList );
......@@ -149,20 +147,20 @@ public:
* It is stored using the standard wxConfig mechanism or a file.
*
* @param aDescList = pointer to the current hotkey list.
* @param aFullFileName = a wxString pointer to a fuill file name.
* @param aFullFileName = a wxString pointer to a full file name.
* if NULL, use the standard wxConfig mechanism (default)
* the output format is: shortcut "key" "function"
* lines starting with # are comments
*/
int WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aDescList,
wxString * aFullFileName = NULL);
wxString* aFullFileName = NULL);
/**
* Function ReadHotkeyConfigFile
* Read an old configuration file (&ltfile&gt.key) and fill the current hotkey list
* with hotkeys
* @param aFilename = file name to read.
* @param aDescList = current hotkey list descr. to initialise.
* @param aDescList = current hotkey list descr. to initialize.
*/
int ReadHotkeyConfigFile( const wxString& aFilename,
struct Ki_HotkeyInfoSectionDescriptor* aDescList );
......@@ -170,14 +168,14 @@ public:
/**
* Function ImportHotkeyConfigFromFile
* Prompt the user for an old hotkey file to read, and read it.
* @param aDescList = current hotkey list descr. to initialise.
* @param aDescList = current hotkey list descr. to initialize.
*/
void ImportHotkeyConfigFromFile( struct Ki_HotkeyInfoSectionDescriptor* aDescList );
/**
* Function ExportHotkeyConfigToFile
* Prompt the user for an old hotkey file to read, and read it.
* @param aDescList = current hotkey list descr. to initialise.
* @param aDescList = current hotkey list descr. to initialize.
*/
void ExportHotkeyConfigToFile( struct Ki_HotkeyInfoSectionDescriptor* aDescList );
......@@ -201,7 +199,7 @@ public:
* @return a wxString containing the selected filename
*/
wxString GetFileFromHistory( int cmdId, const wxString& type,
wxFileHistory* aFileHistory = NULL);
wxFileHistory* aFileHistory = NULL );
/**
* Function UpdateFileHistory
......@@ -212,8 +210,7 @@ public:
* @param aFileHistory The wxFileHistory in use.
* If NULL, the main application file history is used.
*/
void UpdateFileHistory( const wxString& FullFileName,
wxFileHistory * aFileHistory = NULL );
void UpdateFileHistory( const wxString& FullFileName, wxFileHistory * aFileHistory = NULL );
void DisplayActivity( int PerCent, const wxString& Text );
......@@ -240,10 +237,11 @@ public:
};
/*******************************************************/
/* Basic draw frame for eeschema, pcbnew and gerbview. */
/*******************************************************/
/**
* Class EDA_DRAW_FRAME
* is the base class for create windows for drawing purpose. The eeschema, pcbnew and
* gerbview main windows are just a few examples of classes derived from EDA_DRAW_FRAME.
*/
class EDA_DRAW_FRAME : public EDA_BASE_FRAME
{
int m_toolId; ///< Id of active button on the vertical toolbar.
......@@ -273,7 +271,7 @@ public:
// for PCBnew and Gerbview
bool m_Draw_Axis; // TRUE to show X and Y axis
bool m_Draw_Grid_Axis; /* TRUE to show grid axis. */
bool m_Draw_Grid_Axis; // TRUE to show grid axis.
bool m_Draw_Sheet_Ref; // TRUE to show frame references
bool m_Print_Sheet_Ref; // TRUE to print frame references
......@@ -283,7 +281,7 @@ public:
* coordinates for drill, gerber
* and component position files
*/
wxPoint m_Auxiliary_Axis_Position; /* position of the auxiliary axis */
wxPoint m_Auxiliary_Axis_Position; // position of the auxiliary axis
protected:
Ki_HotkeyInfoSectionDescriptor * m_HotkeysZoomAndGridList;
......@@ -311,8 +309,7 @@ protected:
virtual void unitsChangeRefresh();
public:
EDA_DRAW_FRAME( wxWindow* father, int idtype,
const wxString& title,
EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& title,
const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
......@@ -415,7 +412,7 @@ public:
/**
* Function GetGridPosition
* returns the nearest grid position to \a aPosition if a screen is defined and snap to
* grid is enabled. Otherwise, the origianl positions is returned.
* grid is enabled. Otherwise, the original positions is returned.
* @see m_snapToGrid and m_BaseScreen members.
* @param aPosition The position to test.
* @return The wxPoint of the appropriate cursor position.
......@@ -457,7 +454,7 @@ public:
*</p>
* @param aDC A device context.
* @param aPosition The current cursor position in logical (drawing) units.
* @param aHotKey A key event used for appication specific control if not zero.
* @param aHotKey A key event used for application specific control if not zero.
*/
virtual void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 ) { }
......@@ -597,7 +594,8 @@ public:
*/
void ClearMsgPanel( void );
/** Virtual function PrintPage
/**
* Function PrintPage
* used to print a page
* Print the page pointed by current screen, set by the calling print function
* @param aDC = wxDC given by the calling print function
......@@ -622,17 +620,11 @@ public:
};
/*********************************************************
* class EDA_MSG_PANEL : this is a panel to display various infos
* and messages on items in eeschema an pcbnew
*********************************************************/
/**
* Struct MsgItem
* is used privately by EDA_MSG_PANEL as the item type of its vector.
* These items are the pairs of text strings shown in the MsgPanel.
* Struct EDA_MSG_ITEM
* is used privately by EDA_MSG_PANEL as the item type for displaying messages.
*/
struct MsgItem
struct EDA_MSG_ITEM
{
int m_X;
int m_UpperY;
......@@ -644,10 +636,10 @@ struct MsgItem
/**
* Function operator=
* overload the assignment operator so that the wxStrings get copied
* properly when copying a MsgItem.
* properly when copying a EDA_MSG_ITEM.
* No, actually I'm not sure this needed, C++ compiler may auto-generate it.
*/
MsgItem& operator=( const MsgItem& rv )
EDA_MSG_ITEM& operator=( const EDA_MSG_ITEM& rv )
{
m_X = rv.m_X;
m_UpperY = rv.m_UpperY;
......@@ -661,15 +653,18 @@ struct MsgItem
};
/**
* class EDA_MSG_PANEL
* is a panel to display various information messages.
*/
class EDA_MSG_PANEL : public wxPanel
{
protected:
std::vector<MsgItem> m_Items;
std::vector<EDA_MSG_ITEM> m_Items;
int m_last_x; ///< the last used x coordinate
wxSize m_fontSize;
void showItem( wxDC& dc, const MsgItem& aItem );
void showItem( wxDC& dc, const EDA_MSG_ITEM& aItem );
void erase( wxDC* DC );
......@@ -735,10 +730,10 @@ public:
};
/*********************/
/* class EDA_TOOLBAR */
/*********************/
/**
* Class EDA_TOOLBAR
* is the base class for deriving Kicad tool bars.
*/
class EDA_TOOLBAR : public wxAuiToolBar
{
public:
......@@ -770,8 +765,150 @@ public:
* Function GetDimension
* @return the dimension of this toolbar (Height if horizontal, Width if vertical.
*/
int GetDimension( );
int GetDimension();
};
/**
* Function AddMenuItem
* is an inline helper function to create and insert a menu item with an image
* into \a aMenu
*
* @param aMenu is the menu to add the new item.
* @param aId is the command ID for the new menu item.
* @param aText is the string for the new menu item.
* @param aImage is the image to add to the new menu item.
*/
static inline void AddMenuItem( wxMenu* aMenu,
int aId,
const wxString& aText,
const wxBitmap& aImage )
{
wxMenuItem* item;
item = new wxMenuItem( aMenu, aId, aText );
#if defined( USE_IMAGES_IN_MENUS )
item->SetBitmap( aImage );
#endif
aMenu->Append( item );
}
/**
* Function AddMenuItem
* is an inline helper function to create and insert a menu item with an image
* and a help message string into \a aMenu
*
* @param aMenu is the menu to add the new item.
* @param aId is the command ID for the new menu item.
* @param aText is the string for the new menu item.
* @param aHelpText is the help message string for the new menu item.
* @param aImage is the image to add to the new menu item.
*/
static inline void AddMenuItem( wxMenu* aMenu,
int aId,
const wxString& aText,
const wxString& aHelpText,
const wxBitmap& aImage )
{
wxMenuItem* item;
item = new wxMenuItem( aMenu, aId, aText, aHelpText );
#if defined( USE_IMAGES_IN_MENUS )
item->SetBitmap( aImage );
#endif
aMenu->Append( item );
}
/**
* Function AddMenuItem
* is an inline helper function to create and insert a menu item with an image
* into \a aSubMenu in \a aMenu
*
* @param aMenu is the menu to add the new submenu item.
* @param aSubMenu is the submenu to add the new menu.
* @param aId is the command ID for the new menu item.
* @param aText is the string for the new menu item.
* @param aImage is the image to add to the new menu item.
*/
static inline void AddMenuItem( wxMenu* aMenu,
wxMenu* aSubMenu,
int aId,
const wxString& aText,
const wxBitmap& aImage )
{
wxMenuItem* item;
item = new wxMenuItem( aMenu, aId, aText );
item->SetSubMenu( aSubMenu );
#if defined( USE_IMAGES_IN_MENUS )
item->SetBitmap( aImage );
#endif
aMenu->Append( item );
};
/**
* Function AddMenuItem
* is an inline helper function to create and insert a menu item with an image
* and a help message string into \a aSubMenu in \a aMenu
*
* @param aMenu is the menu to add the new submenu item.
* @param aSubMenu is the submenu to add the new menu.
* @param aId is the command ID for the new menu item.
* @param aText is the string for the new menu item.
* @param aHelpText is the help message string for the new menu item.
* @param aImage is the image to add to the new menu item.
*/
static inline void AddMenuItem( wxMenu* aMenu,
wxMenu* aSubMenu,
int aId,
const wxString& aText,
const wxString& aHelpText,
const wxBitmap& aImage )
{
wxMenuItem* item;
item = new wxMenuItem( aMenu, aId, aText, aHelpText );
item->SetSubMenu( aSubMenu );
#if defined( USE_IMAGES_IN_MENUS )
item->SetBitmap( aImage );
#endif
aMenu->Append( item );
};
/**
* Definition SETBITMAPS
* is a macro use to add a bitmaps to check menu item.
* @note Do not use with normal menu items or any platform other than Windows.
* @param aImage is the image to add the menu item.
*/
#if defined( USE_IMAGES_IN_MENUS ) && defined( __WINDOWS__ )
# define SETBITMAPS( aImage ) item->SetBitmaps( KiBitmap( apply_xpm ), KiBitmap( aImage ) )
#else
# define SETBITMAPS( aImage )
#endif
/**
* Definition SETBITMAP
* is a macro use to add a bitmap to a menu items.
* @note Do not use with checked menu items.
* @param aImage is the image to add the menu item.
*/
#if !defined( USE_IMAGES_IN_MENUS )
# define SET_BITMAP( aImage )
#else
# define SET_BITMAP( aImage ) item->SetBitmap( aImage )
#endif
#endif /* WXSTRUCT_H */
......@@ -4,10 +4,8 @@
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "kicad.h"
#include "macros.h"
#include "bitmaps.h"
/* Menubar and toolbar event table */
BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME )
......@@ -74,6 +72,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Delete all existing menus so they can be rebuilt.
// This allows language changes of the menu text on the fly.
menuBar->Freeze();
while( menuBar->GetMenuCount() )
delete menuBar->Remove( 0 );
......@@ -83,7 +82,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
wxMenu* fileMenu = new wxMenu;
// Open
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_LOAD_PROJECT,
_( "&Open\tCtrl+O" ),
_( "Open an existing project" ),
......@@ -91,27 +90,29 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Open Recent submenu
static wxMenu* openRecentMenu;
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if( openRecentMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu );
openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu( );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentMenu,
AddMenuItem( fileMenu, openRecentMenu,
wxID_ANY,
_( "Open &Recent" ),
_( "Open a recent opened schematic project" ),
open_project_xpm );
// New
ADD_MENUITEM_WITH_HELP( fileMenu, ID_NEW_PROJECT,
AddMenuItem( fileMenu, ID_NEW_PROJECT,
_( "&New\tCtrl+N" ),
_( "Start a new project" ),
new_project_xpm );
// Save
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_SAVE_PROJECT,
_( "&Save\tCtrl+S" ),
_( "Save current project" ),
......@@ -119,14 +120,14 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Archive
fileMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_SAVE_AND_ZIP_FILES,
_( "&Archive" ),
_( "Archive project files in zip archive" ),
zip_xpm );
// Unarchive
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_READ_ZIP_ARCHIVE,
_( "&Unarchive" ),
_( "Unarchive project files from zip file" ),
......@@ -136,7 +137,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
fileMenu->AppendSeparator();
// Quit
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
wxID_EXIT,
_( "&Quit" ),
_( "Quit KiCad" ),
......@@ -146,14 +147,14 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
wxMenu* browseMenu = new wxMenu();
// Text editor
ADD_MENUITEM_WITH_HELP( browseMenu,
AddMenuItem( browseMenu,
ID_TO_EDITOR,
_( "Text E&ditor" ),
_( "Launch preferred text editor" ),
editor_xpm );
// View file
ADD_MENUITEM_WITH_HELP( browseMenu,
AddMenuItem( browseMenu,
ID_BROWSE_AN_SELECT_FILE,
_( "&View File" ),
_( "View, read or edit file with a text editor" ),
......@@ -163,7 +164,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
wxMenu* preferencesMenu = new wxMenu;
// Text editor
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
ID_SELECT_PREFERED_EDITOR,
_( "&Text Editor" ),
_( "Select your preferred text editor" ),
......@@ -200,14 +201,14 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
!wxGetApp().m_PdfBrowserIsDefault );
// Append PDF Viewer submenu to preferences
ADD_MENUITEM_WITH_HELP( SubMenuPdfBrowserChoice,
AddMenuItem( SubMenuPdfBrowserChoice,
ID_SELECT_PREFERED_PDF_BROWSER_NAME,
_( "PDF Viewer" ),
_( "Select your favourite PDF viewer used to browse datasheets" ),
datasheet_xpm );
// PDF viewer submenu
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( preferencesMenu,
AddMenuItem( preferencesMenu,
SubMenuPdfBrowserChoice, -1,
_( "PDF Viewer" ),
_( "PDF viewer preferences" ),
......@@ -224,12 +225,12 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_HELP,
_( "&Contents" ),
_( "Open the Kicad handbook" ),
online_help_xpm );
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
......@@ -239,7 +240,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
helpMenu->AppendSeparator();
// About
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_ABOUT,
_( "&About KiCad" ),
_( "About kicad project manager" ),
......
......@@ -3,7 +3,6 @@
/****************/
#include "fctsys.h"
#include "common.h"
#include "class_drawpanel.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
......@@ -176,16 +175,16 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
wxMenu itemMenu;
/* Give a title to the selection menu. This is also a cancel menu item */
wxMenuItem * item_title = new wxMenuItem(&itemMenu, -1, _( "Selection Clarification" ) );
wxMenuItem * item_title = new wxMenuItem( &itemMenu, -1, _( "Selection Clarification" ) );
#ifdef __WINDOWS__
wxFont bold_font(*wxNORMAL_FONT);
bold_font.SetWeight(wxFONTWEIGHT_BOLD);
bold_font.SetStyle( wxFONTSTYLE_ITALIC);
item_title->SetFont(bold_font);
wxFont bold_font( *wxNORMAL_FONT );
bold_font.SetWeight( wxFONTWEIGHT_BOLD );
bold_font.SetStyle( wxFONTSTYLE_ITALIC );
item_title->SetFont( bold_font );
#endif
itemMenu.Append(item_title);
itemMenu.Append( item_title );
itemMenu.AppendSeparator();
int limit = MIN( MAX_ITEMS_IN_PICKER, m_Collector->GetCount() );
......@@ -199,7 +198,7 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
BITMAP_DEF xpm = item->GetMenuImage();
ADD_MENUITEM( &itemMenu, ID_POPUP_PCB_ITEM_SELECTION_START + i, text, xpm );
AddMenuItem( &itemMenu, ID_POPUP_PCB_ITEM_SELECTION_START + i, text, xpm );
}
/* @todo: rather than assignment to true, these should be increment and decrement
......
......@@ -188,12 +188,14 @@ private:
* Function BuildHolesList
* Create the list of holes and tools for a given board
* The list is sorted by increasing drill values
* Only holes from aFirstLayer to aLastLayer copper layers are listed (for vias, because pad holes are always through holes)
* Only holes from aFirstLayer to aLastLayer copper layers are listed (for vias, because
* pad holes are always through holes)
* @param aPcb : the given board
* @param aHoleListBuffer : the std::vector<HOLE_INFO> to fill with pcb holes info
* @param aToolListBuffer : the std::vector<DRILL_TOOL> to fill with tools to use
* @param aFirstLayer = first layer to consider. if < 0 aFirstLayer is ignored
* @param aLastLayer = last layer to consider. if < 0 aLastLayer is ignored
* @param aExcludeThroughHoles Exclude through holes if true.
* @param aGenerateNPTH_list :
* true to create NPTH only list (with no plated holes)
* false to created plated holes list (with no NPTH )
......
......@@ -3,13 +3,11 @@
* @brief (Re)Create the main menubar for the module editor
*/
#include "fctsys.h"
#include "common.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "module_editor_frame.h"
#include "bitmaps.h"
#include "protos.h"
#include "pcbnew_id.h"
......@@ -71,7 +69,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
openSubmenu->Append( item );
/* Append openSubmenu to fileMenu */
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openSubmenu, -1,
AddMenuItem( fileMenu, openSubmenu, -1,
_( "&Load Module" ),
_( "Load a footprint module" ),
open_document_xpm );
......@@ -188,7 +186,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
dimensions_Submenu->Append( item );
// Append dimensions_Submenu to editMenu
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( editMenu,
AddMenuItem( editMenu,
dimensions_Submenu, -1,
_( "&Dimensions" ),
_( "Edit dimensions preferences" ),
......@@ -302,12 +300,12 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_HELP,
_( "&Contents" ),
_( "Open the PCBNew handbook" ),
online_help_xpm );
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
......@@ -315,7 +313,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// About PCBNew
helpMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( helpMenu, wxID_ABOUT,
AddMenuItem( helpMenu, wxID_ABOUT,
_( "&About PCBNew" ),
_( "About PCBNew PCB designer" ),
info_xpm );
......
......@@ -4,14 +4,11 @@
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "bitmaps.h"
#include "protos.h"
#include "hotkeys.h"
#include "pcbnew_id.h"
#include "macros.h"
#include "help_common_strings.h"
......@@ -30,6 +27,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// Delete all existing menus so they can be rebuilt.
// This allows language changes of the menu text on the fly.
menuBar->Freeze();
while( menuBar->GetMenuCount() )
delete menuBar->Remove(0);
......@@ -54,14 +52,16 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// Load Recent submenu
static wxMenu* openRecentMenu;
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if( openRecentMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu );
openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu();
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
AddMenuItem( filesMenu, openRecentMenu,
-1, _( "Open &Recent" ),
_( "Open a recent opened board" ),
open_project_xpm );
......@@ -136,7 +136,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
fabricationOutputsMenu->Append( item );
// Fabrications Outputs submenu append
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, fabricationOutputsMenu,
AddMenuItem( filesMenu, fabricationOutputsMenu,
-1, _( "Fabrication Outputs" ),
_( "Generate files for fabrication" ),
fabrication_xpm );
......@@ -153,7 +153,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
SET_BITMAP( import_xpm ); // @todo need better bitmap
submenuImport->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuImport,
AddMenuItem( filesMenu, submenuImport,
ID_GEN_IMPORT_FILE, _( "Import" ),
_( "Import files" ), import_xpm );
......@@ -189,7 +189,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
SET_BITMAP( three_d_xpm );
submenuexport->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuexport,
AddMenuItem( filesMenu, submenuexport,
ID_GEN_EXPORT_FILE, _( "&Export" ),
_( "Export board" ), export_xpm );
......@@ -240,7 +240,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
SET_BITMAP( library_xpm );
submenuarchive->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuarchive,
AddMenuItem( filesMenu, submenuarchive,
ID_MENU_ARCHIVE_MODULES,
_( "Archive Footprints" ),
_( "Archive or add footprints in a library file" ),
......@@ -337,36 +337,29 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
* for Zoom in and Zoom out sub menus
*/
// Zoom In
text = AddHotkeyName( _( "Zoom In" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_IN, false );
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text,
HELP_ZOOM_IN, wxITEM_NORMAL );
text = AddHotkeyName( _( "Zoom In" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_IN, false );
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, wxITEM_NORMAL );
SET_BITMAP( zoom_in_xpm );
viewMenu->Append( item );
// Zoom Out
text = AddHotkeyName( _( "Zoom Out" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_OUT, false );
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text,
HELP_ZOOM_OUT, wxITEM_NORMAL );
text = AddHotkeyName( _( "Zoom Out" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_OUT, false );
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, wxITEM_NORMAL );
SET_BITMAP( zoom_out_xpm );
viewMenu->Append( item );
// Fit on Screen
text = AddHotkeyName( _( "Fit on Screen" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_AUTO );
text = AddHotkeyName( _( "Fit on Screen" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_AUTO );
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text,
HELP_ZOOM_FIT, wxITEM_NORMAL );
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, wxITEM_NORMAL );
SET_BITMAP( zoom_fit_in_page_xpm );
viewMenu->Append( item );
viewMenu->AppendSeparator();
// Redraw
text = AddHotkeyName( _( "Redraw" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_REDRAW );
text = AddHotkeyName( _( "Redraw" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_REDRAW );
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text,
HELP_ZOOM_REDRAW,
......@@ -403,8 +396,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
placeMenu->Append( item );
// Track
text = AddHotkeyName( _( "Track" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ADD_NEW_TRACK, false );
text = AddHotkeyName( _( "Track" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ADD_NEW_TRACK, false );
item = new wxMenuItem( placeMenu, ID_TRACK_BUTT, text,
_( "Add tracks and vias" ), wxITEM_NORMAL );
......@@ -556,7 +548,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
dimensionsMenu->Append( item );
// Append dimension menu to config menu
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( configmenu, dimensionsMenu,
AddMenuItem( configmenu, dimensionsMenu,
-1, _( "Di&mensions" ),
_( "Global dimensions preferences" ),
add_dimension_xpm );
......@@ -634,7 +626,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
SET_BITMAP( copper_layers_setup_xpm );
designRulesMenu->Append( item );
/**
* Help menu
*/
......@@ -643,12 +634,12 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_HELP,
_( "&Contents" ),
_( "Open the PCBNew handbook" ),
online_help_xpm );
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
......@@ -656,7 +647,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// About
helpMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( helpMenu, wxID_ABOUT,
AddMenuItem( helpMenu, wxID_ABOUT,
_( "&About PCBNew" ),
_( "About PCBnew printed circuit board designer" ),
info_xpm );
......
......@@ -8,7 +8,6 @@
#include "confirm.h"
#include "gestfich.h"
#include "appl_wxstruct.h"
#include "bitmaps.h"
#include "pcbnew_id.h"
#include "trigo.h"
......@@ -100,7 +99,7 @@ BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode )
text = item->GetSelectMenuText();
xpm = item->GetMenuImage();
ADD_MENUITEM( &itemMenu,
AddMenuItem( &itemMenu,
ID_POPUP_PCB_ITEM_SELECTION_START + ii,
text,
xpm );
......@@ -735,6 +734,7 @@ void FOOTPRINT_EDIT_FRAME::Transform( MODULE* module, int transform )
edgemod->m_Start0 = edgemod->m_Start;
edgemod->m_End0 = edgemod->m_End;
}
if( PtStruct->Type() == TYPE_TEXTE_MODULE )
{
textmod = (TEXTE_MODULE*) PtStruct;
......@@ -775,6 +775,7 @@ void FOOTPRINT_EDIT_FRAME::Transform( MODULE* module, int transform )
/* Reverse mirror of footprints. */
PtStruct = module->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
{
switch( PtStruct->Type() )
......
......@@ -3,7 +3,6 @@
/************************/
#include "fctsys.h"
#include "common.h"
#include "class_drawpanel.h"
#include "confirm.h"
......@@ -13,7 +12,6 @@
#include "module_editor_frame.h"
#include "dialog_edit_module_for_Modedit.h"
#include "bitmaps.h"
#include "protos.h"
#include "pcbnew_id.h"
......@@ -199,9 +197,9 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
if( GetToolId() != ID_NO_TOOL_SELECTED )
{
if( item && item->m_Flags )
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm );
AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm );
else
ADD_MENUITEM( PopMenu, ID_POPUP_CLOSE_CURRENT_TOOL, _( "End Tool" ), cancel_tool_xpm );
AddMenuItem( PopMenu, ID_POPUP_CLOSE_CURRENT_TOOL, _( "End Tool" ), cancel_tool_xpm );
PopMenu->AppendSeparator();
}
......@@ -211,30 +209,30 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
{
if( blockActive ) // Put block commands in list
{
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel Block" ), cancel_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_ZOOM_BLOCK,
AddMenuItem( PopMenu, ID_POPUP_ZOOM_BLOCK,
_( "Zoom Block (drag middle mouse)" ),
zoom_area_xpm );
PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_PLACE_BLOCK,
AddMenuItem( PopMenu, ID_POPUP_PLACE_BLOCK,
_( "Place Block" ), apply_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_COPY_BLOCK,
AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK,
_( "Copy Block (shift + drag mouse)" ),
copyblock_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_MIRROR_X_BLOCK,
AddMenuItem( PopMenu, ID_POPUP_MIRROR_X_BLOCK,
_( "Mirror Block (alt + drag mouse)" ),
mirror_h_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_ROTATE_BLOCK,
AddMenuItem( PopMenu, ID_POPUP_ROTATE_BLOCK,
_( "Rotate Block (ctrl + drag mouse)" ),
rotate_ccw_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_DELETE_BLOCK,
AddMenuItem( PopMenu, ID_POPUP_DELETE_BLOCK,
_( "Delete Block (shift+ctrl + drag mouse)" ),
delete_xpm );
}
else
{
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel" ), cancel_xpm );
}
......@@ -252,12 +250,12 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
case TYPE_MODULE:
{
wxMenu* transform_choice = new wxMenu;
ADD_MENUITEM( transform_choice, ID_MODEDIT_MODULE_ROTATE, _( "Rotate" ),
AddMenuItem( transform_choice, ID_MODEDIT_MODULE_ROTATE, _( "Rotate" ),
rotate_module_pos_xpm );
ADD_MENUITEM( transform_choice, ID_MODEDIT_MODULE_MIRROR, _( "Mirror" ), mirror_h_xpm );
AddMenuItem( transform_choice, ID_MODEDIT_MODULE_MIRROR, _( "Mirror" ), mirror_h_xpm );
msg = AddHotkeyName( _( "Edit Module" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_MODULE, msg, edit_module_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, transform_choice, ID_MODEDIT_TRANSFORM_MODULE,
AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_MODULE, msg, edit_module_xpm );
AddMenuItem( PopMenu, transform_choice, ID_MODEDIT_TRANSFORM_MODULE,
_( "Transform Module" ), edit_xpm );
break;
}
......@@ -266,22 +264,22 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
if( !flags )
{
msg = AddHotkeyName( _("Move Pad" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_PAD_REQUEST, msg, move_pad_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_PAD_REQUEST, msg, move_pad_xpm );
}
msg = AddHotkeyName( _("Edit Pad" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_PAD, msg, options_pad_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_IMPORT_PAD_SETTINGS,
AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_PAD, msg, options_pad_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_IMPORT_PAD_SETTINGS,
_( "New Pad Settings" ), options_new_pad_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EXPORT_PAD_SETTINGS,
AddMenuItem( PopMenu, ID_POPUP_PCB_EXPORT_PAD_SETTINGS,
_( "Export Pad Settings" ), export_options_pad_xpm );
msg = AddHotkeyName( _("Delete Pad" ), g_Module_Editor_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DELETE_PAD, msg, delete_pad_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_PAD, msg, delete_pad_xpm );
if( !flags )
{
PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS,
AddMenuItem( PopMenu, ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS,
_( "Global Pad Settings" ), global_options_pad_xpm );
}
......@@ -292,24 +290,24 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
{
msg = AddHotkeyName( _("Move Text Mod." ), g_Module_Editor_Hokeys_Descr,
HK_MOVE_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST, msg, move_field_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST, msg, move_field_xpm );
}
msg = AddHotkeyName( _("Rotate Text Mod." ), g_Module_Editor_Hokeys_Descr,
HK_ROTATE_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_ROTATE_TEXTMODULE, msg, rotate_field_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_ROTATE_TEXTMODULE, msg, rotate_field_xpm );
if( !flags )
{
msg = AddHotkeyName( _("Edit Text Mod." ), g_Module_Editor_Hokeys_Descr,
HK_EDIT_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TEXTMODULE, msg, edit_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TEXTMODULE, msg, edit_text_xpm );
if( ( (TEXTE_MODULE*) item )->m_Type == TEXT_is_DIVERS )
{
msg = AddHotkeyName( _("Delete Text Mod." ), g_Module_Editor_Hokeys_Descr,
HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DELETE_TEXTMODULE, msg, delete_text_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_TEXTMODULE, msg, delete_text_xpm );
}
}
break;
......@@ -317,29 +315,29 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
case TYPE_EDGE_MODULE:
{
if( (flags & IS_NEW) )
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_STOP_CURRENT_DRAWING, _( "End edge" ), apply_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_STOP_CURRENT_DRAWING, _( "End edge" ), apply_xpm );
if( !flags )
{
msg = AddHotkeyName( _("Move edge" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_EDGE, msg, move_line_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EDGE, msg, move_line_xpm );
}
if( ( flags & (IS_NEW | IS_MOVED) ) == IS_MOVED )
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_PLACE_EDGE, _( "Place edge" ), apply_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_EDGE, _( "Place edge" ), apply_xpm );
wxMenu* edit_mnu = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( PopMenu, edit_mnu, ID_POPUP_PCB_EDIT_EDGE, _( "Edit" ),
edit_xpm );
ADD_MENUITEM( edit_mnu, ID_POPUP_PCB_EDIT_WIDTH_CURRENT_EDGE,
AddMenuItem( PopMenu, edit_mnu, ID_POPUP_PCB_EDIT_EDGE, _( "Edit" ), edit_xpm );
AddMenuItem( edit_mnu, ID_POPUP_PCB_EDIT_WIDTH_CURRENT_EDGE,
_( "Edit Width (Current)" ), width_segment_xpm );
ADD_MENUITEM( edit_mnu, ID_POPUP_PCB_EDIT_WIDTH_ALL_EDGE,
AddMenuItem( edit_mnu, ID_POPUP_PCB_EDIT_WIDTH_ALL_EDGE,
_( "Edit Width (All)" ), width_segment_xpm );
ADD_MENUITEM( edit_mnu, ID_POPUP_PCB_EDIT_LAYER_CURRENT_EDGE,
AddMenuItem( edit_mnu, ID_POPUP_PCB_EDIT_LAYER_CURRENT_EDGE,
_( "Edit Layer (Current)" ), select_layer_pair_xpm );
ADD_MENUITEM( edit_mnu, ID_POPUP_PCB_EDIT_LAYER_ALL_EDGE,
AddMenuItem( edit_mnu, ID_POPUP_PCB_EDIT_LAYER_ALL_EDGE,
_( "Edit Layer (All)" ), select_layer_pair_xpm );
msg = AddHotkeyName( _("Delete edge" ), g_Module_Editor_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DELETE_EDGE, msg, delete_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_EDGE, msg, delete_xpm );
append_set_width = TRUE;
}
break;
......@@ -377,7 +375,7 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
|| ( GetToolId() == ID_PCB_CIRCLE_BUTT )
|| ( GetToolId() == ID_PCB_ARC_BUTT ) ) ) )
{
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_ENTER_EDGE_WIDTH, _("Set Width" ), width_segment_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_ENTER_EDGE_WIDTH, _("Set Width" ), width_segment_xpm );
PopMenu->AppendSeparator();
}
......@@ -441,6 +439,7 @@ void FOOTPRINT_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
SetCurItem( NULL );
DrawPanel->Refresh();
}
break;
}
......
......@@ -30,7 +30,7 @@ public:
/**
* Function RedrawActiveWindoow
* daws the footprint editor BOARD, and others elements : axis, grid ..
* daws the footprint editor BOARD, and others elements such as axis and grid.
*/
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
......
......@@ -4,8 +4,6 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "macros.h"
#include "common.h"
#include "class_drawpanel.h"
#include "confirm.h"
......@@ -17,8 +15,6 @@
#include "hotkeys.h"
#include "collectors.h"
/* Bitmaps */
#include "bitmaps.h"
static wxMenu* Append_Track_Width_List( BOARD* aBoard );
......@@ -36,7 +32,6 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
DrawPanel->m_CanStartBlock = -1; // Avoid to start a block coomand when clicking on menu
// If a command or a block is in progress:
// Put the Cancel command (if needed) and the End command
......@@ -53,11 +48,11 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{
if( item && item->m_Flags )
{
ADD_MENUITEM( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm );
AddMenuItem( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm );
}
else
{
ADD_MENUITEM( aPopMenu, ID_POPUP_CLOSE_CURRENT_TOOL,
AddMenuItem( aPopMenu, ID_POPUP_CLOSE_CURRENT_TOOL,
_( "End Tool" ), cancel_tool_xpm );
}
......@@ -67,7 +62,7 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{
if( item && item->m_Flags )
{
ADD_MENUITEM( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
AddMenuItem( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel" ), cancel_xpm );
aPopMenu->AppendSeparator();
}
......@@ -106,6 +101,7 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
}
item = GetCurItem();
if( item )
flags = item->m_Flags;
else
......@@ -126,14 +122,14 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{
msg = AddHotkeyName( _("Lock Module" ), g_Board_Editor_Hokeys_Descr,
HK_LOCK_UNLOCK_FOOTPRINT );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, msg,
AddMenuItem( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, msg,
locked_xpm );
}
else
{
msg = AddHotkeyName( _( "Unlock Module" ), g_Board_Editor_Hokeys_Descr,
HK_LOCK_UNLOCK_FOOTPRINT );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FREE_MODULE, msg,
AddMenuItem( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FREE_MODULE, msg,
unlocked_xpm );
}
......@@ -160,7 +156,7 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
case TYPE_DRAWSEGMENT: // Some graphic items on technical layers
if( (flags & IS_NEW) )
{
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_STOP_CURRENT_DRAWING,
AddMenuItem( aPopMenu, ID_POPUP_PCB_STOP_CURRENT_DRAWING,
_( "End Drawing" ), apply_xpm );
}
......@@ -168,33 +164,37 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{
msg = AddHotkeyName( _( "Move Drawing" ), g_Board_Editor_Hokeys_Descr,
HK_MOVE_ITEM );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_MOVE_DRAWING_REQUEST,
AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_DRAWING_REQUEST,
msg, move_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_DRAWING, _( "Edit Drawing" ), edit_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_DRAWING, _(
"Delete Drawing" ), delete_xpm );
AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_DRAWING, _( "Edit Drawing" ), edit_xpm );
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_DRAWING,
_( "Delete Drawing" ), delete_xpm );
if( item->GetLayer() > LAST_COPPER_LAYER )
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_DRAWING_LAYER,
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_DRAWING_LAYER,
_( "Delete All Drawing on Layer" ), delete_body_xpm );
}
break;
case TYPE_ZONE: // Item used to fill a zone
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_ZONE,
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_ZONE,
_( "Delete Zone Filling" ), delete_xpm );
break;
case TYPE_ZONE_CONTAINER: // Item used to handle a zone area (outlines, holes ...)
if( flags & IS_NEW )
{
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE,
AddMenuItem( aPopMenu, ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE,
_( "Close Zone Outline" ), apply_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER,
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER,
_( "Delete Last Corner" ), delete_xpm );
}
else
{
createPopUpMenuForZones( (ZONE_CONTAINER*) item, aPopMenu );
}
break;
case TYPE_TEXTE:
......@@ -216,10 +216,11 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{
msg = AddHotkeyName( _( "Edit Dimension" ), g_Board_Editor_Hokeys_Descr,
HK_EDIT_ITEM );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_DIMENSION, msg, edit_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_DIMENSION,
AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_DIMENSION, msg, edit_xpm );
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_DIMENSION,
_( "Delete Dimension" ), delete_xpm );
}
break;
case TYPE_MIRE:
......@@ -227,35 +228,35 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{
msg = AddHotkeyName( _( "Move Target" ), g_Board_Editor_Hokeys_Descr,
HK_MOVE_ITEM );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_MOVE_MIRE_REQUEST, msg, move_xpm );
AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_MIRE_REQUEST, msg, move_xpm );
msg = AddHotkeyName( _( "Edit Target" ), g_Board_Editor_Hokeys_Descr,
HK_EDIT_ITEM );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_MIRE, msg, edit_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MIRE,
AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_MIRE, msg, edit_xpm );
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_MIRE,
_( "Delete Target" ), delete_xpm );
}
break;
case TYPE_EDGE_MODULE:
case TYPE_SCREEN:
case TYPE_NOT_INIT:
case TYPE_PCB:
msg.Printf(
wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unexpected DrawType %d" ),
msg.Printf( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unexpected DrawType %d" ),
item->Type() );
DisplayError( this, msg );
SetCurItem( NULL );
break;
default:
msg.Printf(
wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unknown DrawType %d" ),
msg.Printf( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unknown DrawType %d" ),
item->Type() );
DisplayError( this, msg );
// Attempt to clear error (but should no occurs )
if( item->Type() >= MAX_STRUCT_TYPE_ID )
SetCurItem( NULL );
break;
}
......@@ -266,7 +267,7 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{
msg = AddHotkeyName( _( "Get and Move Footprint" ),
g_Board_Editor_Hokeys_Descr, HK_GET_AND_MOVE_FOOTPRINT );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST,
AddMenuItem( aPopMenu, ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST,
msg, move_module_xpm );
}
......@@ -277,26 +278,26 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
if( GetBoard()->m_ZoneDescriptorList.size() > 0 )
{
aPopMenu->AppendSeparator();
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_FILL_ALL_ZONES,
AddMenuItem( aPopMenu, ID_POPUP_PCB_FILL_ALL_ZONES,
_( "Fill or Refill All Zones" ), fill_zone_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES,
AddMenuItem( aPopMenu, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES,
_( "Remove Filled Areas in All Zones" ), fill_zone_xpm );
aPopMenu->AppendSeparator();
}
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_LAYER,
AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_LAYER,
_( "Select Working Layer" ), select_w_layer_xpm );
aPopMenu->AppendSeparator();
break;
case ID_TRACK_BUTT:
if ( ! locate_track ) // This menu is already added when a track is located
ADD_MENUITEM_WITH_SUBMENU( aPopMenu, Append_Track_Width_List( GetBoard() ),
ID_POPUP_PCB_SELECT_WIDTH,
_( "Select Track Width" ), width_track_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_CU_LAYER,
AddMenuItem( aPopMenu, Append_Track_Width_List( GetBoard() ),
ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ), width_track_xpm );
AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_CU_LAYER,
_( "Select Working Layer" ), select_w_layer_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_LAYER_PAIR,
AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_LAYER_PAIR,
_( "Select Layer Pair for Vias" ), select_layer_pair_xpm );
aPopMenu->AppendSeparator();
break;
......@@ -306,13 +307,13 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
case ID_PCB_ADD_TEXT_BUTT:
case ID_PCB_ADD_LINE_BUTT:
case ID_PCB_DIMENSION_BUTT:
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_NO_CU_LAYER,
AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_NO_CU_LAYER,
_( "Select Working Layer" ), select_w_layer_xpm );
aPopMenu->AppendSeparator();
break;
case ID_PCB_MODULE_BUTT:
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DISPLAY_FOOTPRINT_DOC,
AddMenuItem( aPopMenu, ID_POPUP_PCB_DISPLAY_FOOTPRINT_DOC,
_( "Footprint Documentation" ), book_xpm );
aPopMenu->AppendSeparator();
break;
......@@ -321,14 +322,14 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_MODE_MODULE )
{
wxMenu* commands = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( aPopMenu, commands, ID_POPUP_PCB_AUTOPLACE_COMMANDS,
AddMenuItem( aPopMenu, commands, ID_POPUP_PCB_AUTOPLACE_COMMANDS,
_( "Glob Move and Place" ), move_xpm );
ADD_MENUITEM( commands, ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES,
AddMenuItem( commands, ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES,
_( "Unlock All Modules" ), unlocked_xpm );
ADD_MENUITEM( commands, ID_POPUP_PCB_AUTOPLACE_FIXE_ALL_MODULES,
AddMenuItem( commands, ID_POPUP_PCB_AUTOPLACE_FIXE_ALL_MODULES,
_( "Lock All Modules" ), locked_xpm );
commands->AppendSeparator();
ADD_MENUITEM( commands, ID_POPUP_PCB_AUTOMOVE_ALL_MODULES,
AddMenuItem( commands, ID_POPUP_PCB_AUTOMOVE_ALL_MODULES,
_( "Move All Modules" ), move_xpm );
commands->Append( ID_POPUP_PCB_AUTOMOVE_NEW_MODULES, _( "Move New Modules" ) );
commands->AppendSeparator();
......@@ -336,7 +337,7 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
commands->Append( ID_POPUP_PCB_AUTOPLACE_NEW_MODULES, _( "Autoplace New Modules" ) );
commands->Append( ID_POPUP_PCB_AUTOPLACE_NEXT_MODULE, _( "Autoplace Next Module" ) );
commands->AppendSeparator();
ADD_MENUITEM( commands, ID_POPUP_PCB_REORIENT_ALL_MODULES,
AddMenuItem( commands, ID_POPUP_PCB_REORIENT_ALL_MODULES,
_( "Orient All Modules" ), rotate_module_pos_xpm );
aPopMenu->AppendSeparator();
}
......@@ -345,7 +346,7 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{
wxMenu* commands = new wxMenu;
aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_COMMANDS, _( "Autoroute" ), commands );
ADD_MENUITEM( commands, ID_POPUP_PCB_SELECT_LAYER_PAIR,
AddMenuItem( commands, ID_POPUP_PCB_SELECT_LAYER_PAIR,
_( "Select Layer Pair" ), select_layer_pair_xpm );
commands->AppendSeparator();
commands->Append( ID_POPUP_PCB_AUTOROUTE_ALL_MODULES, _( "Autoroute All Modules" ) );
......@@ -355,10 +356,11 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
}
if( locate_track )
ADD_MENUITEM_WITH_SUBMENU( aPopMenu, Append_Track_Width_List( GetBoard() ),
AddMenuItem( aPopMenu, Append_Track_Width_List( GetBoard() ),
ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ),
width_track_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_LAYER,
AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_LAYER,
_( "Select Working Layer" ), select_w_layer_xpm );
aPopMenu->AppendSeparator();
break;
......@@ -373,14 +375,14 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
*/
void PCB_EDIT_FRAME::createPopUpBlockMenu( wxMenu* menu )
{
ADD_MENUITEM( menu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ), cancel_xpm );
ADD_MENUITEM( menu, ID_POPUP_ZOOM_BLOCK, _( "Zoom Block" ), zoom_area_xpm );
AddMenuItem( menu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ), cancel_xpm );
AddMenuItem( menu, ID_POPUP_ZOOM_BLOCK, _( "Zoom Block" ), zoom_area_xpm );
menu->AppendSeparator();
ADD_MENUITEM( menu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), apply_xpm );
ADD_MENUITEM( menu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), copyblock_xpm );
ADD_MENUITEM( menu, ID_POPUP_FLIP_BLOCK, _( "Flip Block" ), invert_module_xpm );
ADD_MENUITEM( menu, ID_POPUP_ROTATE_BLOCK, _( "Rotate Block" ), rotate_ccw_xpm );
ADD_MENUITEM( menu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), delete_xpm );
AddMenuItem( menu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), apply_xpm );
AddMenuItem( menu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), copyblock_xpm );
AddMenuItem( menu, ID_POPUP_FLIP_BLOCK, _( "Flip Block" ), invert_module_xpm );
AddMenuItem( menu, ID_POPUP_ROTATE_BLOCK, _( "Rotate Block" ), rotate_ccw_xpm );
AddMenuItem( menu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), delete_xpm );
}
......@@ -402,34 +404,34 @@ void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
{
if( Track->Type() == TYPE_VIA )
{
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_TRACK_NODE, _( "Drag Via" ), move_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_TRACK_NODE, _( "Drag Via" ), move_xpm );
}
else
{
if( Track->IsPointOnEnds( cursorPosition, -1 ) != 0 )
{
msg = AddHotkeyName( _( "Move Node" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_TRACK_NODE,
AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_TRACK_NODE,
msg, move_xpm );
}
else
{
msg = AddHotkeyName( _( "Drag Segments, Keep Slope" ), g_Board_Editor_Hokeys_Descr,
HK_DRAG_TRACK_KEEP_SLOPE );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE,
AddMenuItem( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE,
msg, drag_segment_withslope_xpm );
msg = AddHotkeyName( _( "Drag Segment" ), g_Board_Editor_Hokeys_Descr,
HK_DRAG_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT,
AddMenuItem( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT,
msg, drag_track_segment_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_BREAK_TRACK,
AddMenuItem( PopMenu, ID_POPUP_PCB_BREAK_TRACK,
_( "Break Track" ), break_line_xpm );
}
}
}
else if( flags & IS_DRAGGED ) // Drag via or node in progress
{
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_PLACE_MOVED_TRACK_NODE,
AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_MOVED_TRACK_NODE,
_( "Place Node" ), apply_xpm );
return;
}
......@@ -438,8 +440,9 @@ void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
if( flags & IS_NEW )
{
msg = AddHotkeyName( _( "End Track" ), g_Board_Editor_Hokeys_Descr, HK_END_TRACK );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_END_TRACK, msg, apply_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_END_TRACK, msg, apply_xpm );
}
msg = AddHotkeyName( _( "Place Via" ), g_Board_Editor_Hokeys_Descr, HK_ADD_VIA );
PopMenu->Append( ID_POPUP_PCB_PLACE_VIA, msg );
......@@ -463,55 +466,52 @@ void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
{
msg = AddHotkeyName( _( "Change Via Size and Drill" ), g_Board_Editor_Hokeys_Descr,
HK_EDIT_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, width_segment_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, width_segment_xpm );
}
else
{
msg = AddHotkeyName( _( "Change Segment Width" ), g_Board_Editor_Hokeys_Descr,
HK_EDIT_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, width_segment_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TRACK,
AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, width_segment_xpm );
AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TRACK,
_( "Change Track Width" ), width_track_xpm );
}
}
// Allows switching to an other track/via size when routing
ADD_MENUITEM_WITH_SUBMENU( PopMenu, Append_Track_Width_List( GetBoard() ),
ID_POPUP_PCB_SELECT_WIDTH,
AddMenuItem( PopMenu, Append_Track_Width_List( GetBoard() ), ID_POPUP_PCB_SELECT_WIDTH,
_( "Select Track Width" ), width_track_xpm );
// Delete control:
PopMenu->AppendSeparator();
wxMenu* track_mnu = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu, ID_POPUP_PCB_DELETE_TRACK_MNU,
_( "Delete" ), delete_xpm );
AddMenuItem( PopMenu, track_mnu, ID_POPUP_PCB_DELETE_TRACK_MNU, _( "Delete" ), delete_xpm );
msg = AddHotkeyName( Track->Type()==TYPE_VIA ?
_( "Delete Via" ) : _( "Delete Segment" ),
g_Board_Editor_Hokeys_Descr, HK_BACK_SPACE );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACKSEG, msg, delete_line_xpm );
AddMenuItem( track_mnu, ID_POPUP_PCB_DELETE_TRACKSEG, msg, delete_line_xpm );
if( !flags )
{
msg = AddHotkeyName( _( "Delete Track" ), g_Board_Editor_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACK, msg, delete_track_xpm );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACKNET, _( "Delete Net" ), delete_net_xpm );
AddMenuItem( track_mnu, ID_POPUP_PCB_DELETE_TRACK, msg, delete_track_xpm );
AddMenuItem( track_mnu, ID_POPUP_PCB_DELETE_TRACKNET, _( "Delete Net" ), delete_net_xpm );
}
// Add global edition command
if( !flags )
{
PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE,
AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE,
_( "Global Tracks and Vias Edition" ), width_track_via_xpm );
}
// Add lock/unlock flags menu:
track_mnu = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu,
ID_POPUP_PCB_SETFLAGS_TRACK_MNU, _( "Set Flags" ), flag_xpm );
AddMenuItem( PopMenu, track_mnu, ID_POPUP_PCB_SETFLAGS_TRACK_MNU, _( "Set Flags" ), flag_xpm );
track_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACKSEG, _( "Locked: Yes" ), wxEmptyString, true );
track_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, _( "Locked: No" ), wxEmptyString, true );
......@@ -539,71 +539,72 @@ void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu*
if( edge_zone->m_Flags == IS_DRAGGED )
{
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_DRAGGED_ZONE_OUTLINE_SEGMENT,
AddMenuItem( aPopMenu, ID_POPUP_PCB_PLACE_DRAGGED_ZONE_OUTLINE_SEGMENT,
_( "Place Edge Outline" ), apply_xpm );
}
else if( edge_zone->m_Flags )
{
if( (edge_zone->m_Flags & IN_EDIT ) )
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_CORNER,
AddMenuItem( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_CORNER,
_( "Place Corner" ), apply_xpm );
else
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_OUTLINES,
AddMenuItem( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_OUTLINES,
_( "Place Zone" ), apply_xpm );
}
else
{
wxMenu* zones_menu = new wxMenu();
ADD_MENUITEM_WITH_SUBMENU( aPopMenu, zones_menu,
-1, _( "Zones" ), add_zone_xpm );
AddMenuItem( aPopMenu, zones_menu, -1, _( "Zones" ), add_zone_xpm );
if( edge_zone->HitTestForCorner( GetScreen()->RefPos( true ) ) )
{
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_MOVE_ZONE_CORNER,
AddMenuItem( zones_menu, ID_POPUP_PCB_MOVE_ZONE_CORNER,
_( "Move Corner" ), move_xpm );
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CORNER,
AddMenuItem( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CORNER,
_( "Delete Corner" ), delete_xpm );
}
else if( edge_zone->HitTestForEdge( GetScreen()->RefPos( true ) ) )
{
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_ADD_ZONE_CORNER,
AddMenuItem( zones_menu, ID_POPUP_PCB_ADD_ZONE_CORNER,
_( "Create Corner" ), add_corner_xpm );
msg = AddHotkeyName( _( "Drag Outline Segment" ), g_Board_Editor_Hokeys_Descr,
HK_DRAG_ITEM );
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_DRAG_ZONE_OUTLINE_SEGMENT,
AddMenuItem( zones_menu, ID_POPUP_PCB_DRAG_ZONE_OUTLINE_SEGMENT,
msg, drag_outline_segment_xpm );
}
zones_menu->AppendSeparator();
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE,
AddMenuItem( zones_menu, ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE,
_( "Add Similar Zone" ), add_zone_xpm );
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE,
AddMenuItem( zones_menu, ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE,
_( "Add Cutout Area" ), add_zone_cutout_xpm );
zones_menu->AppendSeparator();
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_FILL_ZONE, _( "Fill Zone" ), fill_zone_xpm );
AddMenuItem( zones_menu, ID_POPUP_PCB_FILL_ZONE, _( "Fill Zone" ), fill_zone_xpm );
if( edge_zone->m_FilledPolysList.size() > 0 )
{
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE,
AddMenuItem( zones_menu, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE,
_( "Remove Filled Areas in Zone" ), fill_zone_xpm );
}
msg = AddHotkeyName( _( "Move Zone" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM );
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES, msg, move_xpm );
AddMenuItem( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES, msg, move_xpm );
msg = AddHotkeyName( _( "Edit Zone Params" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM );
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_EDIT_ZONE_PARAMS,
AddMenuItem( zones_menu, ID_POPUP_PCB_EDIT_ZONE_PARAMS,
msg, edit_xpm );
zones_menu->AppendSeparator();
if( edge_zone->m_CornerSelection >= 0 &&
edge_zone->m_Poly->IsCutoutContour( edge_zone->m_CornerSelection ) )
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CUTOUT,
AddMenuItem( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CUTOUT,
_( "Delete Cutout" ), delete_xpm );
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CONTAINER,
AddMenuItem( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CONTAINER,
_( "Delete Zone Outline" ), delete_xpm );
}
}
......@@ -620,33 +621,33 @@ void PCB_EDIT_FRAME::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu
sub_menu_footprint = new wxMenu;
msg = aModule->GetSelectMenuText();
ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_footprint, -1, msg, module_xpm );
AddMenuItem( menu, sub_menu_footprint, -1, msg, module_xpm );
if( !flags )
{
msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM );
ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_MOVE_MODULE_REQUEST,
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_MOVE_MODULE_REQUEST,
msg, move_module_xpm );
msg = AddHotkeyName( _( "Drag" ), g_Board_Editor_Hokeys_Descr, HK_DRAG_ITEM );
ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_DRAG_MODULE_REQUEST,
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DRAG_MODULE_REQUEST,
msg, drag_module_xpm );
}
msg = AddHotkeyName( _( "Rotate +" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM );
ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE,
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE,
msg, rotate_module_pos_xpm );
ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE,
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE,
_( "Rotate -" ), rotate_module_neg_xpm );
msg = AddHotkeyName( _( "Flip" ), g_Board_Editor_Hokeys_Descr, HK_FLIP_FOOTPRINT );
ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_CHANGE_SIDE_MODULE,
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_CHANGE_SIDE_MODULE,
msg, invert_module_xpm );
if( !flags )
{
msg = AddHotkeyName( _( "Edit" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM );
ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE, msg, edit_module_xpm );
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE, msg, edit_module_xpm );
sub_menu_footprint->AppendSeparator();
ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_DELETE_MODULE,
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DELETE_MODULE,
_( "Delete Module" ), delete_module_xpm );
}
}
......@@ -663,31 +664,31 @@ void PCB_EDIT_FRAME::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* me
sub_menu_Fp_text = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Fp_text, -1, msg, footprint_text_xpm );
AddMenuItem( menu, sub_menu_Fp_text, -1, msg, footprint_text_xpm );
if( !flags )
{
msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM );
ADD_MENUITEM( sub_menu_Fp_text, ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST,
AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST,
msg, move_field_xpm );
}
msg = AddHotkeyName( _( "Rotate" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM );
ADD_MENUITEM( sub_menu_Fp_text, ID_POPUP_PCB_ROTATE_TEXTMODULE,
AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_ROTATE_TEXTMODULE,
msg, rotate_field_xpm );
if( !flags )
{
msg = AddHotkeyName( _( "Edit" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM );
ADD_MENUITEM( sub_menu_Fp_text, ID_POPUP_PCB_EDIT_TEXTMODULE,
AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_EDIT_TEXTMODULE,
msg, edit_text_xpm );
ADD_MENUITEM( sub_menu_Fp_text, ID_POPUP_PCB_RESET_TEXT_SIZE,
AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_RESET_TEXT_SIZE,
_( "Reset Size" ), reset_text_xpm );
}
// Graphic texts can be deleted only if are not currently edited.
if( !flags && FpText->m_Type == TEXT_is_DIVERS )
{
ADD_MENUITEM( sub_menu_Fp_text, ID_POPUP_PCB_DELETE_TEXTMODULE,
AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_DELETE_TEXTMODULE,
_( "Delete" ), delete_xpm );
}
......@@ -722,30 +723,30 @@ void PCB_EDIT_FRAME::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu )
wxString msg = Pad->GetSelectMenuText();
sub_menu_Pad = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Pad, -1, msg, pad_xpm );
AddMenuItem( menu, sub_menu_Pad, -1, msg, pad_xpm );
ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_MOVE_PAD_REQUEST, _( "Move" ), move_pad_xpm );
ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_DRAG_PAD_REQUEST, _( "Drag" ), drag_pad_xpm );
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_MOVE_PAD_REQUEST, _( "Move" ), move_pad_xpm );
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_DRAG_PAD_REQUEST, _( "Drag" ), drag_pad_xpm );
ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_EDIT_PAD, _( "Edit" ), options_pad_xpm );
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_EDIT_PAD, _( "Edit" ), options_pad_xpm );
sub_menu_Pad->AppendSeparator();
ADD_MENUITEM_WITH_HELP( sub_menu_Pad, ID_POPUP_PCB_IMPORT_PAD_SETTINGS,
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_IMPORT_PAD_SETTINGS,
_( "Copy Current Settings to this Pad" ),
wxEmptyString,
options_new_pad_xpm );
ADD_MENUITEM_WITH_HELP( sub_menu_Pad, ID_POPUP_PCB_EXPORT_PAD_SETTINGS,
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_EXPORT_PAD_SETTINGS,
_( "Copy this Pad Settings to Current Settings" ),
wxEmptyString,
export_options_pad_xpm );
ADD_MENUITEM_WITH_HELP( sub_menu_Pad, ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS,
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS,
_( "Global Pads Edition" ),
_( "Copy this pad settings to all pads in this footprint (or similar footprints)" ),
global_options_pad_xpm );
sub_menu_Pad->AppendSeparator();
ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_DELETE_PAD, _( "Delete" ), delete_pad_xpm );
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_DELETE_PAD, _( "Delete" ), delete_pad_xpm );
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_MODE_TRACKS )
{
......@@ -773,30 +774,30 @@ void PCB_EDIT_FRAME::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu )
sub_menu_Text = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Text, -1, msg, add_text_xpm );
AddMenuItem( menu, sub_menu_Text, -1, msg, add_text_xpm );
if( !flags )
{
msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM );
ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST,
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST,
msg, move_text_xpm );
}
msg = AddHotkeyName( _( "Rotate" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM );
ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_ROTATE_TEXTEPCB, msg, rotate_ccw_xpm );
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_ROTATE_TEXTEPCB, msg, rotate_ccw_xpm );
msg = AddHotkeyName( _( "Edit" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM );
ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_EDIT_TEXTEPCB, msg, edit_text_xpm );
ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_RESET_TEXT_SIZE,
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_EDIT_TEXTEPCB, msg, edit_text_xpm );
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_RESET_TEXT_SIZE,
_( "Reset Size" ), reset_text_xpm );
sub_menu_Text->AppendSeparator();
ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_DELETE_TEXTEPCB, _( "Delete" ), delete_text_xpm );
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_DELETE_TEXTEPCB, _( "Delete" ), delete_text_xpm );
}
void PCB_EDIT_FRAME::createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu )
{
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MARKER, _( "Delete Marker" ), delete_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_GETINFO_MARKER, _( "Marker Error Info" ), info_xpm );
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_MARKER, _( "Delete Marker" ), delete_xpm );
AddMenuItem( aPopMenu, ID_POPUP_PCB_GETINFO_MARKER, _( "Marker Error Info" ), info_xpm );
}
......@@ -851,11 +852,14 @@ static wxMenu* Append_Track_Width_List( BOARD* aBoard )
PCB_INTERNAL_UNIT, true );
if( aBoard->m_ViasDimensionsList[ii].m_Drill <= 0 )
{
msg.Printf( _( "Via %s" ), GetChars( value ) );
}
else
{
msg.Printf( _( "Via %s; (drl %s)" ), GetChars( value ), GetChars( drill ) );
}
if( ii == 0 )
msg << _( " (use NetClass)" );
......
......@@ -224,8 +224,9 @@ void Calcule_Coord_Extremite_45( const wxPoint& aPosition, int ox, int oy, int*
* interesting segments
* @param aTrackLen = a pointer to an integer where to return the lenght of the
* track
* @param aLengthDie = a pointer to an integer where to return the extra lengths inside integrated circuits
* from the pads connected to this track to the die (if any)
* @param aLengthDie = a pointer to an integer where to return the extra lengths inside
* integrated circuits from the pads connected to this track to the
* die (if any)
* @param aReorder = true for reorder the interesting segments (useful for
* track edition/deletion) in this case the flag BUSY is
* set (the user is responsible of flag clearing). False
......
......@@ -28,30 +28,6 @@ static void Marque_Chaine_segments( BOARD* Pcb,
TRACK_PTRS* aList );
/**
* Function Marque_Une_Piste
* marks a chain of track segments, connected to aTrackList.
* Each segment is marked by setting the BUSY bit into m_Flags. Electrical
* continuity is detected by walking each segment, and finally the segments
* are rearranged into a contiguous chain within the given list.
* @param aPcb = the board to analyze
* @param aStartSegm - The first interesting segment within a list of track
* segment of aPcb
* @param aSegmCount = a pointer to an integer where to return the number of
* interesting segments
* @param aTrackLen = a pointer to an integer where to return the length of the
* track on board
* @param aLengthDie = a pointer to an integer where to return the extra lengths inside integrated circuits
* from the pads connected to this track to the die (if any)
* @param aReorder = bool:
* true for reorder the interesting segments (useful for track
*edition/deletion)
* in this case the flag BUSY is set (the user is responsible of flag
*clearing)
* false for no reorder : useful when we want just calculate the track length
* in this case, flags are reset
* @return TRACK* the first in the chain of interesting segments.
*/
TRACK* Marque_Une_Piste( BOARD* aPcb,
TRACK* aStartSegm,
int* aSegmCount,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment