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 @@ ...@@ -3,8 +3,6 @@
/********************/ /********************/
#include "fctsys.h" #include "fctsys.h"
#include "macros.h"
#include "bitmaps.h"
#include "3d_viewer.h" #include "3d_viewer.h"
...@@ -128,7 +126,7 @@ void EDA_3D_FRAME::ReCreateMenuBar() ...@@ -128,7 +126,7 @@ void EDA_3D_FRAME::ReCreateMenuBar()
// Does not work properly under linux // Does not work properly under linux
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
fileMenu->Append( ID_TOOL_SCREENCOPY_TOCLIBBOARD, fileMenu->Append( ID_TOOL_SCREENCOPY_TOCLIBBOARD,
_( "Copy 3D Image to Clipboard" ) ); _( "Copy 3D Image to Clipboard" ) );
#endif #endif
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
fileMenu->Append( wxID_EXIT, _( "&Exit" ) ); fileMenu->Append( wxID_EXIT, _( "&Exit" ) );
...@@ -136,31 +134,31 @@ void EDA_3D_FRAME::ReCreateMenuBar() ...@@ -136,31 +134,31 @@ void EDA_3D_FRAME::ReCreateMenuBar()
wxMenu* referencesMenu = new wxMenu; wxMenu* referencesMenu = new wxMenu;
menuBar->Append( referencesMenu, _( "&Preferences" ) ); menuBar->Append( referencesMenu, _( "&Preferences" ) );
ADD_MENUITEM( referencesMenu, ID_MENU3D_BGCOLOR_SELECTION, AddMenuItem( referencesMenu, ID_MENU3D_BGCOLOR_SELECTION,
_( "Choose background color" ), KiBitmap( palette_xpm ) ); _( "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 ) ); _( "3D Axis On/Off" ), KiBitmap( axis3d_front_xpm ) );
if( full_options ) 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 ) ); _( "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 ) ); _( "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 ) ); _( "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 ) ); _( "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 ) ); _( "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 ) ); _( "Eco2 Layer On/Off" ), KiBitmap( tools_xpm ) );
} }
SetMenuBar( menuBar ); SetMenuBar( menuBar );
......
...@@ -12,14 +12,13 @@ ...@@ -12,14 +12,13 @@
#include "build_version.h" #include "build_version.h"
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h"
#include "online_help.h" #include "online_help.h"
#include "id.h" #include "id.h"
#include "confirm.h" #include "confirm.h"
#include "eda_doc.h" #include "eda_doc.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "macros.h" #include "macros.h"
#include "bitmaps.h"
/* /*
* Class constructor for EDA_BASE_FRAME general options * Class constructor for EDA_BASE_FRAME general options
...@@ -364,10 +363,10 @@ void EDA_BASE_FRAME::AddHelpVersionInfoMenuEntry( wxMenu* aMenu ) ...@@ -364,10 +363,10 @@ void EDA_BASE_FRAME::AddHelpVersionInfoMenuEntry( wxMenu* aMenu )
wxASSERT( aMenu != NULL ); wxASSERT( aMenu != NULL );
// Copy version string to clipboard for bug report purposes. // 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 &Version Information" ),
_( "Copy the version string to clipboard to send with bug reports" ), _( "Copy the version string to clipboard to send with bug reports" ),
KiBitmap( copy_button_xpm ) ); KiBitmap( copy_button_xpm ) );
} }
......
/***************/
/* edaappl.cpp */
/***************/
/*** /***
* @file edaapl.cpp * @file edaapl.cpp
* *
...@@ -21,15 +17,14 @@ ...@@ -21,15 +17,14 @@
#include <wx/tokenzr.h> #include <wx/tokenzr.h>
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "wxstruct.h"
#include "macros.h"
#include "param_config.h" #include "param_config.h"
#include "worksheet.h" #include "worksheet.h"
#include "id.h" #include "id.h"
#include "build_version.h" #include "build_version.h"
#include "hotkeys_basic.h" #include "hotkeys_basic.h"
#include "macros.h"
#include "online_help.h" #include "online_help.h"
#include "bitmaps.h"
#include "gestfich.h" #include "gestfich.h"
...@@ -242,15 +237,12 @@ static struct LANGUAGE_DESCR s_Language_List[] = ...@@ -242,15 +237,12 @@ static struct LANGUAGE_DESCR s_Language_List[] =
}; };
/**
* WinEDA_App Constructor
*/
WinEDA_App::WinEDA_App() WinEDA_App::WinEDA_App()
{ {
m_Checker = NULL; m_Checker = NULL;
m_HtmlCtrl = NULL; m_HtmlCtrl = NULL;
m_EDA_Config = NULL; m_EDA_Config = NULL;
m_Env_Defined = FALSE; m_Env_Defined = false;
m_LanguageId = wxLANGUAGE_DEFAULT; m_LanguageId = wxLANGUAGE_DEFAULT;
m_PdfBrowserIsDefault = true; m_PdfBrowserIsDefault = true;
m_Locale = NULL; m_Locale = NULL;
...@@ -259,9 +251,6 @@ WinEDA_App::WinEDA_App() ...@@ -259,9 +251,6 @@ WinEDA_App::WinEDA_App()
} }
/**
* WinEDA_App Destructor
*/
WinEDA_App::~WinEDA_App() WinEDA_App::~WinEDA_App()
{ {
SaveSettings(); SaveSettings();
...@@ -269,11 +258,15 @@ WinEDA_App::~WinEDA_App() ...@@ -269,11 +258,15 @@ WinEDA_App::~WinEDA_App()
/* delete user datas */ /* delete user datas */
if( m_ProjectConfig ) if( m_ProjectConfig )
delete m_ProjectConfig; delete m_ProjectConfig;
if( m_EDA_CommonConfig ) if( m_EDA_CommonConfig )
delete m_EDA_CommonConfig; delete m_EDA_CommonConfig;
delete m_EDA_Config; delete m_EDA_Config;
if( m_Checker ) if( m_Checker )
delete m_Checker; delete m_Checker;
delete m_Locale; delete m_Locale;
} }
...@@ -848,11 +841,11 @@ void WinEDA_App::AddMenuLanguageList( wxMenu* MasterMenu ) ...@@ -848,11 +841,11 @@ void WinEDA_App::AddMenuLanguageList( wxMenu* MasterMenu )
menu->Append( item ); menu->Append( item );
} }
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( MasterMenu, menu, AddMenuItem( MasterMenu, menu,
ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE,
_( "Language" ), _( "Language" ),
_( "Select application language (only for testing!)" ), _( "Select application language (only for testing!)" ),
KiBitmap( language_xpm ) ); KiBitmap( language_xpm ) );
// Set Check mark on current selected language // Set Check mark on current selected language
for( ii = 0; ii < LANGUAGE_DESCR_COUNT; ii++ ) for( ii = 0; ii < LANGUAGE_DESCR_COUNT; ii++ )
......
...@@ -7,15 +7,13 @@ ...@@ -7,15 +7,13 @@
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h"
#include "hotkeys_basic.h" #include "hotkeys_basic.h"
#include "macros.h"
#include "bitmaps.h"
#include "id.h" #include "id.h"
#include "confirm.h" #include "confirm.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "gestfich.h" #include "gestfich.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "macros.h"
#include "dialog_hotkeys_editor.h" #include "dialog_hotkeys_editor.h"
#include <wx/apptrait.h> #include <wx/apptrait.h>
...@@ -133,8 +131,10 @@ wxString ReturnKeyNameFromKeyCode( int aKeycode, bool* aIsFound ) ...@@ -133,8 +131,10 @@ wxString ReturnKeyNameFromKeyCode( int aKeycode, bool* aIsFound )
if( (aKeycode & GR_KB_CTRL) != 0 ) if( (aKeycode & GR_KB_CTRL) != 0 )
modifier << MODIFIER_CTRL; modifier << MODIFIER_CTRL;
if( (aKeycode & GR_KB_ALT) != 0 ) if( (aKeycode & GR_KB_ALT) != 0 )
modifier << MODIFIER_ALT; modifier << MODIFIER_ALT;
if( (aKeycode & GR_KB_SHIFT) != 0 ) if( (aKeycode & GR_KB_SHIFT) != 0 )
modifier << MODIFIER_SHIFT; modifier << MODIFIER_SHIFT;
...@@ -143,7 +143,7 @@ wxString ReturnKeyNameFromKeyCode( int aKeycode, bool* aIsFound ) ...@@ -143,7 +143,7 @@ wxString ReturnKeyNameFromKeyCode( int aKeycode, bool* aIsFound )
if( (aKeycode > ' ') && (aKeycode < 0x7F ) ) if( (aKeycode > ' ') && (aKeycode < 0x7F ) )
{ {
found = true; found = true;
keyname.Append((wxChar)aKeycode); keyname.Append( (wxChar)aKeycode );
} }
else else
{ {
...@@ -165,6 +165,7 @@ wxString ReturnKeyNameFromKeyCode( int aKeycode, bool* aIsFound ) ...@@ -165,6 +165,7 @@ wxString ReturnKeyNameFromKeyCode( int aKeycode, bool* aIsFound )
if( aIsFound ) if( aIsFound )
*aIsFound = found; *aIsFound = found;
fullkeyname = modifier + keyname; fullkeyname = modifier + keyname;
return fullkeyname; return fullkeyname;
} }
...@@ -195,6 +196,7 @@ wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList, ...@@ -195,6 +196,7 @@ wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList,
else else
msg << wxT( " <" ) << keyname << wxT( ">" ); msg << wxT( " <" ) << keyname << wxT( ">" );
} }
return msg; return msg;
} }
...@@ -223,12 +225,14 @@ wxString AddHotkeyName( const wxString& aText, ...@@ -223,12 +225,14 @@ wxString AddHotkeyName( const wxString& aText,
{ {
List = aDescList->m_HK_InfoList; List = aDescList->m_HK_InfoList;
keyname = ReturnKeyNameFromCommandId( List, aCommandId ); keyname = ReturnKeyNameFromCommandId( List, aCommandId );
if( !keyname.IsEmpty() ) if( !keyname.IsEmpty() )
{ {
if( aIsShortCut ) if( aIsShortCut )
msg << wxT( "\t" ) << keyname; msg << wxT( "\t" ) << keyname;
else else
msg << wxT( " <" ) << keyname << wxT( ">" ); msg << wxT( " <" ) << keyname << wxT( ">" );
break; break;
} }
} }
...@@ -252,6 +256,7 @@ wxString ReturnKeyNameFromCommandId( Ki_HotkeyInfo** aList, int aCommandId ) ...@@ -252,6 +256,7 @@ wxString ReturnKeyNameFromCommandId( Ki_HotkeyInfo** aList, int aCommandId )
for( ; *aList != NULL; aList++ ) for( ; *aList != NULL; aList++ )
{ {
Ki_HotkeyInfo* hk_decr = *aList; Ki_HotkeyInfo* hk_decr = *aList;
if( hk_decr->m_Idcommand == aCommandId ) if( hk_decr->m_Idcommand == aCommandId )
{ {
keyname = ReturnKeyNameFromKeyCode( hk_decr->m_KeyCode ); keyname = ReturnKeyNameFromKeyCode( hk_decr->m_KeyCode );
...@@ -285,7 +290,6 @@ int ReturnKeyCodeFromKeyName( const wxString& keyname ) ...@@ -285,7 +290,6 @@ int ReturnKeyCodeFromKeyName( const wxString& keyname )
modifier |= GR_KB_CTRL; modifier |= GR_KB_CTRL;
key.Remove( 0, 5 ); key.Remove( 0, 5 );
} }
else if( key.StartsWith( MODIFIER_ALT ) ) else if( key.StartsWith( MODIFIER_ALT ) )
{ {
modifier |= GR_KB_ALT; modifier |= GR_KB_ALT;
...@@ -297,7 +301,9 @@ int ReturnKeyCodeFromKeyName( const wxString& keyname ) ...@@ -297,7 +301,9 @@ int ReturnKeyCodeFromKeyName( const wxString& keyname )
key.Remove( 0, 6 ); key.Remove( 0, 6 );
} }
else else
{
break; break;
}
} }
if( (key.length() == 1) && (key[0] > ' ') && (key[0] < 0x7F) ) if( (key.length() == 1) && (key[0] > ' ') && (key[0] < 0x7F) )
...@@ -338,6 +344,7 @@ void DisplayHotkeyList( EDA_DRAW_FRAME* aFrame, ...@@ -338,6 +344,7 @@ void DisplayHotkeyList( EDA_DRAW_FRAME* aFrame,
for( ; aDescList->m_HK_InfoList != NULL; aDescList++ ) for( ; aDescList->m_HK_InfoList != NULL; aDescList++ )
{ {
List = aDescList->m_HK_InfoList; List = aDescList->m_HK_InfoList;
for( ; *List != NULL; List++ ) for( ; *List != NULL; List++ )
{ {
Ki_HotkeyInfo* hk_decr = *List; Ki_HotkeyInfo* hk_decr = *List;
...@@ -392,6 +399,7 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aD ...@@ -392,6 +399,7 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aD
/* Print the current hotkey list */ /* Print the current hotkey list */
Ki_HotkeyInfo** List; Ki_HotkeyInfo** List;
for( ; aDescList->m_HK_InfoList != NULL; aDescList++ ) for( ; aDescList->m_HK_InfoList != NULL; aDescList++ )
{ {
if( aDescList->m_Comment ) if( aDescList->m_Comment )
...@@ -400,10 +408,12 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aD ...@@ -400,10 +408,12 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aD
msg += wxString( aDescList->m_Comment ); msg += wxString( aDescList->m_Comment );
msg += wxT( "\n" ); msg += wxT( "\n" );
} }
msg += *aDescList->m_SectionTag; msg += *aDescList->m_SectionTag;
msg += wxT( "\n" ); msg += wxT( "\n" );
List = aDescList->m_HK_InfoList; List = aDescList->m_HK_InfoList;
for( ; *List != NULL; List++ ) for( ; *List != NULL; List++ )
{ {
Ki_HotkeyInfo* hk_decr = *List; Ki_HotkeyInfo* hk_decr = *List;
...@@ -421,8 +431,11 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aD ...@@ -421,8 +431,11 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aD
if( aFullFileName ) if( aFullFileName )
{ {
FILE* file = wxFopen( *aFullFileName, wxT( "wt" ) ); FILE* file = wxFopen( *aFullFileName, wxT( "wt" ) );
if( file ) if( file )
{
fputs( TO_UTF8( msg ), file ); fputs( TO_UTF8( msg ), file );
}
else else
{ {
msg.Printf( wxT( "Unable to write file %s" ), GetChars( *aFullFileName ) ); msg.Printf( wxT( "Unable to write file %s" ), GetChars( *aFullFileName ) );
...@@ -504,9 +517,8 @@ int EDA_BASE_FRAME::ReadHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aDe ...@@ -504,9 +517,8 @@ int EDA_BASE_FRAME::ReadHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aDe
* lines starting by # are ignored (comments) * lines starting by # are ignored (comments)
* lines like [xxx] are tags (example: [common] or [libedit] which identify sections * lines like [xxx] are tags (example: [common] or [libedit] which identify sections
*/ */
void ParseHotkeyConfig( void ParseHotkeyConfig( const wxString& data,
const wxString& data, struct Ki_HotkeyInfoSectionDescriptor* aDescList )
struct Ki_HotkeyInfoSectionDescriptor* aDescList )
{ {
/* Read the config */ /* Read the config */
wxStringTokenizer tokenizer( data, L"\r\n", wxTOKEN_STRTOK ); wxStringTokenizer tokenizer( data, L"\r\n", wxTOKEN_STRTOK );
...@@ -525,6 +537,7 @@ void ParseHotkeyConfig( ...@@ -525,6 +537,7 @@ void ParseHotkeyConfig(
{ {
CurrentHotkeyList = 0; CurrentHotkeyList = 0;
Ki_HotkeyInfoSectionDescriptor* DList = aDescList; Ki_HotkeyInfoSectionDescriptor* DList = aDescList;
for( ; DList->m_HK_InfoList; DList++ ) for( ; DList->m_HK_InfoList; DList++ )
{ {
if( *DList->m_SectionTag == line_type ) if( *DList->m_SectionTag == line_type )
...@@ -536,10 +549,13 @@ void ParseHotkeyConfig( ...@@ -536,10 +549,13 @@ void ParseHotkeyConfig(
continue; continue;
} }
if( line_type == wxT( "$Endlist" ) ) if( line_type == wxT( "$Endlist" ) )
break; break;
if( line_type != wxT( "shortcut" ) ) if( line_type != wxT( "shortcut" ) )
continue; continue;
if( CurrentHotkeyList == NULL ) if( CurrentHotkeyList == NULL )
continue; continue;
...@@ -559,6 +575,7 @@ void ParseHotkeyConfig( ...@@ -559,6 +575,7 @@ void ParseHotkeyConfig(
if( hk_decr->m_InfoMsg == fctname ) if( hk_decr->m_InfoMsg == fctname )
{ {
int code = ReturnKeyCodeFromKeyName( keyname ); int code = ReturnKeyCodeFromKeyName( keyname );
if( code ) if( code )
hk_decr->m_KeyCode = code; hk_decr->m_KeyCode = code;
...@@ -635,36 +652,35 @@ void AddHotkeyConfigMenu( wxMenu* aMenu ) ...@@ -635,36 +652,35 @@ void AddHotkeyConfigMenu( wxMenu* aMenu )
wxMenu* HotkeySubmenu = new wxMenu(); wxMenu* HotkeySubmenu = new wxMenu();
/* List existing hotkey menu*/ /* List existing hotkey menu*/
ADD_MENUITEM_WITH_HELP( HotkeySubmenu, AddMenuItem( HotkeySubmenu,
ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
_( "List Current Keys" ), _( "List Current Keys" ),
_( "Displays the current hotkeys list and corresponding commands" ), _( "Displays the current hotkeys list and corresponding commands" ),
KiBitmap( info_xpm ) ); KiBitmap( info_xpm ) );
/* Call hotkeys editor*/ /* Call hotkeys editor*/
ADD_MENUITEM_WITH_HELP( HotkeySubmenu, ID_PREFERENCES_HOTKEY_SHOW_EDITOR, AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_SHOW_EDITOR,
_( "Edit Hotkeys" ), _( "Edit Hotkeys" ),
_( "Call the hotkeys editor" ), _( "Call the hotkeys editor" ),
KiBitmap( editor_xpm ) ); KiBitmap( editor_xpm ) );
HotkeySubmenu->AppendSeparator(); HotkeySubmenu->AppendSeparator();
/* create hotkey file to export current hotkeys config */ /* 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" ), _( "Export Hotkeys Config" ),
_( "Create a hotkey configuration file to export the current hotkey config" ), _( "Create a hotkey configuration file to export the current hotkey config" ),
KiBitmap( save_setup_xpm ) ); KiBitmap( save_setup_xpm ) );
/* Reload hotkey file */ /* Reload hotkey file */
ADD_MENUITEM_WITH_HELP( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG, AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG,
_( "Import Hotkeys Config" ), _( "Import Hotkeys Config" ),
_( "Load an existing hotkey configuration file" ), _( "Load an existing hotkey configuration file" ),
KiBitmap( reload_xpm ) ); KiBitmap( reload_xpm ) );
/* Append HotkeySubmenu to menu */ /* Append HotkeySubmenu to menu */
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( aMenu, HotkeySubmenu, AddMenuItem( aMenu, HotkeySubmenu,
ID_PREFERENCES_HOTKEY_SUBMENU, _( "Hotkeys" ), ID_PREFERENCES_HOTKEY_SUBMENU, _( "Hotkeys" ),
_( "Hotkeys configuration and preferences" ), _( "Hotkeys configuration and preferences" ),
KiBitmap( hotkeys_xpm ) ); KiBitmap( hotkeys_xpm ) );
} }
...@@ -97,7 +97,7 @@ void EDA_MSG_PANEL::AppendMessage( const wxString& textUpper, ...@@ -97,7 +97,7 @@ void EDA_MSG_PANEL::AppendMessage( const wxString& textUpper,
text = ( textUpper.Len() > textLower.Len() ) ? textUpper : textLower; text = ( textUpper.Len() > textLower.Len() ) ? textUpper : textLower;
text.Append( ' ', pad ); text.Append( ' ', pad );
MsgItem item; EDA_MSG_ITEM item;
/* Don't put the first message a window client position 0. Offset by /* Don't put the first message a window client position 0. Offset by
* one 'W' character width. */ * one 'W' character width. */
...@@ -133,7 +133,7 @@ void EDA_MSG_PANEL::SetMessage( int aXPosition, const wxString& aUpperText, ...@@ -133,7 +133,7 @@ void EDA_MSG_PANEL::SetMessage( int aXPosition, const wxString& aUpperText,
else else
pos.x = m_last_x; pos.x = m_last_x;
MsgItem item; EDA_MSG_ITEM item;
item.m_X = pos.x; item.m_X = pos.x;
...@@ -174,7 +174,7 @@ void EDA_MSG_PANEL::SetMessage( int aXPosition, const wxString& aUpperText, ...@@ -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; int color = aItem.m_Color;
...@@ -205,6 +205,7 @@ void EDA_MSG_PANEL::EraseMsgBox() ...@@ -205,6 +205,7 @@ void EDA_MSG_PANEL::EraseMsgBox()
Refresh(); Refresh();
} }
void EDA_MSG_PANEL::erase( wxDC* DC ) void EDA_MSG_PANEL::erase( wxDC* DC )
{ {
wxPen pen; wxPen pen;
......
...@@ -7,9 +7,7 @@ ...@@ -7,9 +7,7 @@
*/ */
#include "fctsys.h" #include "fctsys.h"
#include "common.h"
#include "macros.h" #include "macros.h"
#include "bitmaps.h"
#include "id.h" #include "id.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "class_base_screen.h" #include "class_base_screen.h"
...@@ -154,21 +152,21 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu ) ...@@ -154,21 +152,21 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
BASE_SCREEN * screen = DrawPanel->GetScreen(); BASE_SCREEN * screen = DrawPanel->GetScreen();
msg = AddHotkeyName( _( "Center" ), m_HotkeysZoomAndGridList, HK_ZOOM_CENTER ); 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 ); 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 ); 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 ); 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 ); 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; wxMenu* zoom_choice = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( MasterMenu, zoom_choice, AddMenuItem( MasterMenu, zoom_choice,
ID_POPUP_ZOOM_SELECT, _( "Zoom select" ), ID_POPUP_ZOOM_SELECT, _( "Zoom select" ),
KiBitmap( zoom_selection_xpm ) ); KiBitmap( zoom_selection_xpm ) );
zoom = screen->GetZoom(); zoom = screen->GetZoom();
maxZoomIds = ID_POPUP_ZOOM_LEVEL_END - ID_POPUP_ZOOM_LEVEL_START; maxZoomIds = ID_POPUP_ZOOM_LEVEL_END - ID_POPUP_ZOOM_LEVEL_START;
...@@ -190,8 +188,8 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu ) ...@@ -190,8 +188,8 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
if( screen->GetGridCount() ) if( screen->GetGridCount() )
{ {
wxMenu* gridMenu = new wxMenu; 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 Select" ), KiBitmap( grid_select_xpm ) );
GRID_TYPE tmp; GRID_TYPE tmp;
wxRealPoint grid = screen->GetGridSize(); wxRealPoint grid = screen->GetGridSize();
...@@ -234,5 +232,5 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu ) ...@@ -234,5 +232,5 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
} }
MasterMenu->AppendSeparator(); 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 @@ ...@@ -4,7 +4,6 @@
*/ */
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
...@@ -12,7 +11,6 @@ ...@@ -12,7 +11,6 @@
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "cvpcb_id.h" #include "cvpcb_id.h"
#include "bitmaps.h"
/** /**
* @brief (Re)Create the menubar for the cvpcb mainframe * @brief (Re)Create the menubar for the cvpcb mainframe
...@@ -39,11 +37,11 @@ void CVPCB_MAINFRAME::ReCreateMenuBar() ...@@ -39,11 +37,11 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
wxMenu* filesMenu = new wxMenu; wxMenu* filesMenu = new wxMenu;
// Open // Open
ADD_MENUITEM_WITH_HELP( filesMenu, AddMenuItem( filesMenu,
ID_LOAD_PROJECT, ID_LOAD_PROJECT,
_( "&Open" ), _( "&Open" ),
_( "Open a net list file" ), _( "Open a net list file" ),
open_document_xpm ); open_document_xpm );
// Open Recent submenu // Open Recent submenu
static wxMenu* openRecentMenu; static wxMenu* openRecentMenu;
...@@ -56,51 +54,51 @@ void CVPCB_MAINFRAME::ReCreateMenuBar() ...@@ -56,51 +54,51 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
openRecentMenu = new wxMenu(); openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentMenu ); wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu(); wxGetApp().m_fileHistory.AddFilesToMenu();
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu, -1, AddMenuItem( filesMenu, openRecentMenu, -1,
_( "Open &Recent" ), _( "Open &Recent" ),
_( "Open a recent opened netlist document" ), _( "Open a recent opened netlist document" ),
open_project_xpm ); open_project_xpm );
// Separator // Separator
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
// Save // Save
ADD_MENUITEM_WITH_HELP( filesMenu, AddMenuItem( filesMenu,
wxID_SAVE, wxID_SAVE,
_( "&Save\tCtrl+S" ), _( "&Save\tCtrl+S" ),
_( "Save net list and footprint list files" ), _( "Save net list and footprint list files" ),
save_xpm ); save_xpm );
// Save as // Save as
ADD_MENUITEM_WITH_HELP( filesMenu, AddMenuItem( filesMenu,
wxID_SAVEAS, wxID_SAVEAS,
_( "Save &As..." ), _( "Save &As..." ),
_( "Save new net list and footprint list files" ), _( "Save new net list and footprint list files" ),
save_xpm ); save_xpm );
// Separator // Separator
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
// Quit // Quit
ADD_MENUITEM_WITH_HELP( filesMenu, AddMenuItem( filesMenu,
wxID_EXIT, wxID_EXIT,
_( "&Quit" ), _( "&Quit" ),
_( "Quit CvPcb" ), _( "Quit CvPcb" ),
exit_xpm ); exit_xpm );
// Menu Preferences: // Menu Preferences:
wxMenu* preferencesMenu = new wxMenu; wxMenu* preferencesMenu = new wxMenu;
// Options (Preferences on WXMAC) // Options (Preferences on WXMAC)
ADD_MENUITEM_WITH_HELP( preferencesMenu, AddMenuItem( preferencesMenu,
wxID_PREFERENCES, wxID_PREFERENCES,
#ifdef __WXMAC__ #ifdef __WXMAC__
_( "&Preferences..." ), _( "&Preferences..." ),
#else #else
_( "&Options" ), _( "&Options" ),
#endif // __WXMAC__ #endif // __WXMAC__
_( "Set libraries and library search paths" ), _( "Set libraries and library search paths" ),
config_xpm ); config_xpm );
// Language submenu // Language submenu
wxGetApp().AddMenuLanguageList( preferencesMenu ); wxGetApp().AddMenuLanguageList( preferencesMenu );
...@@ -115,14 +113,14 @@ void CVPCB_MAINFRAME::ReCreateMenuBar() ...@@ -115,14 +113,14 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
// Separator // Separator
preferencesMenu->AppendSeparator(); preferencesMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( preferencesMenu, ID_SAVE_PROJECT, AddMenuItem( preferencesMenu, ID_SAVE_PROJECT,
_( "&Save Project File" ), _( "&Save Project File" ),
_( "Save changes to the project configuration file" ), _( "Save changes to the project configuration file" ),
save_setup_xpm ); save_setup_xpm );
ADD_MENUITEM_WITH_HELP( preferencesMenu, ID_SAVE_PROJECT_AS, AddMenuItem( preferencesMenu, ID_SAVE_PROJECT_AS,
_( "&Save Project File As" ), _( "&Save Project File As" ),
_( "Save changes to the project configuration to a new file" ), _( "Save changes to the project configuration to a new file" ),
save_setup_xpm ); save_setup_xpm );
// Menu Help: // Menu Help:
wxMenu* helpMenu = new wxMenu; wxMenu* helpMenu = new wxMenu;
...@@ -131,15 +129,15 @@ void CVPCB_MAINFRAME::ReCreateMenuBar() ...@@ -131,15 +129,15 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu ); AddHelpVersionInfoMenuEntry( helpMenu );
// Contents // Contents
ADD_MENUITEM_WITH_HELP( helpMenu, wxID_HELP, _( "&Contents" ), AddMenuItem( helpMenu, wxID_HELP, _( "&Contents" ),
_( "Open the CvPcb handbook" ), _( "Open the CvPcb handbook" ),
online_help_xpm ); online_help_xpm );
// About // About
ADD_MENUITEM_WITH_HELP( helpMenu, wxID_ABOUT, AddMenuItem( helpMenu, wxID_ABOUT,
_( "&About CvPcb" ), _( "&About CvPcb" ),
_( "About CvPcb schematic to pcb converter" ), _( "About CvPcb schematic to pcb converter" ),
info_xpm ); info_xpm );
// Create the menubar and append all submenus // Create the menubar and append all submenus
menuBar->Append( filesMenu, _( "&File" ) ); menuBar->Append( filesMenu, _( "&File" ) );
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "eda_dde.h" #include "eda_dde.h"
#include "wxEeschemaStruct.h" #include "wxEeschemaStruct.h"
...@@ -144,7 +143,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF ...@@ -144,7 +143,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF
{ {
wxString text = m_collectedItems[i]->GetSelectMenuText(); wxString text = m_collectedItems[i]->GetSelectMenuText();
BITMAP_DEF xpm = m_collectedItems[i]->GetMenuImage(); 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. // Set to NULL in case user aborts the clarification context menu.
......
...@@ -6,11 +6,7 @@ ...@@ -6,11 +6,7 @@
*/ */
#include "fctsys.h" #include "fctsys.h"
//#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "confirm.h" #include "confirm.h"
#include "bitmaps.h"
#include "eeschema_id.h" #include "eeschema_id.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
...@@ -47,7 +43,7 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -47,7 +43,7 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
// If Command in progress, put menu "cancel" // If Command in progress, put menu "cancel"
if( item && item->GetFlags() ) 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(); PopMenu->AppendSeparator();
} }
else else
...@@ -64,8 +60,8 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -64,8 +60,8 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
if( GetToolId() != ID_NO_TOOL_SELECTED ) if( GetToolId() != ID_NO_TOOL_SELECTED )
{ {
// If a tool is active, put menu "end tool" // 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 ); cancel_tool_xpm );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
} }
} }
...@@ -89,18 +85,18 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -89,18 +85,18 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{ {
msg = AddHotkeyName( _( "Move Arc" ), s_Libedit_Hokeys_Descr, msg = AddHotkeyName( _( "Move Arc" ), s_Libedit_Hokeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM ); 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 ); 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 ); 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 ) if( item->GetFlags() == 0 )
{ {
msg = AddHotkeyName( _( "Delete Arc" ), s_Libedit_Hokeys_Descr, HK_DELETE ); 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; break;
...@@ -109,22 +105,22 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -109,22 +105,22 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{ {
msg = AddHotkeyName( _( "Move Circle" ), s_Libedit_Hokeys_Descr, msg = AddHotkeyName( _( "Move Circle" ), s_Libedit_Hokeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM ); 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 ) if( item->GetFlags() == 0 )
{ {
msg = AddHotkeyName( _( "Drag Circle Outline" ), s_Libedit_Hokeys_Descr, HK_DRAG ); 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 ); 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 ) if( item->GetFlags() == 0 )
{ {
msg = AddHotkeyName( _( "Delete Circle" ), s_Libedit_Hokeys_Descr, HK_DELETE ); 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; break;
...@@ -133,22 +129,22 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -133,22 +129,22 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{ {
msg = AddHotkeyName( _( "Move Rectangle" ), s_Libedit_Hokeys_Descr, msg = AddHotkeyName( _( "Move Rectangle" ), s_Libedit_Hokeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM ); 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 ); 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 ) if( item->GetFlags() == 0 )
{ {
msg = AddHotkeyName( _( "Drag Rectangle Edge" ), s_Libedit_Hokeys_Descr, HK_DRAG ); 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 ) if( item->GetFlags() == 0 )
{ {
msg = AddHotkeyName( _( "Delete Rectangle" ), s_Libedit_Hokeys_Descr, HK_DELETE ); 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; break;
...@@ -158,19 +154,19 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -158,19 +154,19 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{ {
msg = AddHotkeyName( _( "Move Text" ), s_Libedit_Hokeys_Descr, msg = AddHotkeyName( _( "Move Text" ), s_Libedit_Hokeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM ); 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 ); 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 ); 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 ) if( item->GetFlags() == 0 )
{ {
msg = AddHotkeyName( _( "Delete Text" ), s_Libedit_Hokeys_Descr, HK_DELETE ); 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; break;
...@@ -179,31 +175,31 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -179,31 +175,31 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{ {
msg = AddHotkeyName( _( "Move Line" ), s_Libedit_Hokeys_Descr, msg = AddHotkeyName( _( "Move Line" ), s_Libedit_Hokeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM ); 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 ); 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() ) 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 ); 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 ) if( item->GetFlags() == 0 )
{ {
msg = AddHotkeyName( _( "Delete Line " ), s_Libedit_Hokeys_Descr, HK_DELETE ); 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() ) else if( item->IsNew() )
{ {
if( ( (LIB_POLYLINE*) item )->GetCornerCount() > 2 ) if( ( (LIB_POLYLINE*) item )->GetCornerCount() > 2 )
{ {
msg = AddHotkeyName( _( "Delete Segment" ), s_Libedit_Hokeys_Descr, HK_DELETE ); 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 ); msg, delete_segment_xpm );
} }
} }
...@@ -214,12 +210,13 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -214,12 +210,13 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{ {
msg = AddHotkeyName( _( "Move Field" ), s_Libedit_Hokeys_Descr, msg = AddHotkeyName( _( "Move Field" ), s_Libedit_Hokeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM ); 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 ); 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 ); 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; break;
...@@ -245,37 +242,37 @@ void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin, LIB_EDIT_FRAME* frame ) ...@@ -245,37 +242,37 @@ void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin, LIB_EDIT_FRAME* frame )
{ {
msg = AddHotkeyName( _( "Move Pin " ), s_Libedit_Hokeys_Descr, msg = AddHotkeyName( _( "Move Pin " ), s_Libedit_Hokeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM ); 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); 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 ); 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 ) if( not_in_move )
{ {
msg = AddHotkeyName( _( "Delete Pin " ), s_Libedit_Hokeys_Descr, HK_DELETE ); 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; 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, ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM,
_( "Global" ), pin_to_xpm ); _( "Global" ), pin_to_xpm );
ADD_MENUITEM( global_pin_change, AddMenuItem( global_pin_change,
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM, ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM,
selected ? _( "Pin Size to selected pins" ) : selected ? _( "Pin Size to selected pins" ) :
_( "Pin Size to Others" ), pin_size_to_xpm ); _( "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, ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM,
selected ? _( "Pin Name Size to selected pin" ) : selected ? _( "Pin Name Size to selected pin" ) :
_( "Pin Name Size to Others" ), pin_name_to_xpm ); _( "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, ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM,
selected ? _( "Pin Num Size to selected pin" ) : selected ? _( "Pin Num Size to selected pin" ) :
_( "Pin Num Size to Others" ), pin_number_to_xpm ); _( "Pin Num Size to Others" ), pin_number_to_xpm );
} }
...@@ -283,24 +280,24 @@ void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin, LIB_EDIT_FRAME* frame ) ...@@ -283,24 +280,24 @@ void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin, LIB_EDIT_FRAME* frame )
void AddMenusForBlock( wxMenu* PopMenu, 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 ) 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 Block (drag middle mouse)" ),
zoom_area_xpm ); zoom_area_xpm );
PopMenu->AppendSeparator(); 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 ) if( frame->GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE )
{ {
ADD_MENUITEM( PopMenu, ID_POPUP_SELECT_ITEMS_BLOCK, _( "Select Items" ), green_xpm ); AddMenuItem( PopMenu, ID_POPUP_SELECT_ITEMS_BLOCK, _( "Select Items" ), green_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), copyblock_xpm ); AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), copyblock_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_MIRROR_Y_BLOCK, _( "Mirror Block ||" ), mirror_h_xpm ); AddMenuItem( PopMenu, ID_POPUP_MIRROR_Y_BLOCK, _( "Mirror Block ||" ), mirror_h_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_MIRROR_X_BLOCK, _( "Mirror Block --" ), mirror_v_xpm ); AddMenuItem( 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_ROTATE_BLOCK, _( "Rotate Block ccw" ), rotate_ccw_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), delete_xpm ); AddMenuItem( PopMenu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), delete_xpm );
} }
} }
...@@ -6,12 +6,9 @@ ...@@ -6,12 +6,9 @@
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h"
#include "macros.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "eda_doc.h" #include "eda_doc.h"
#include "bitmaps.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "class_sch_screen.h" #include "class_sch_screen.h"
#include "wxEeschemaStruct.h" #include "wxEeschemaStruct.h"
...@@ -745,11 +742,14 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -745,11 +742,14 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM: case ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM:
if( m_drawItem == NULL ) if( m_drawItem == NULL )
break; break;
DrawPanel->CrossHairOff( &dc ); DrawPanel->CrossHairOff( &dc );
if( m_drawItem->Type() == LIB_FIELD_T ) if( m_drawItem->Type() == LIB_FIELD_T )
{ {
EditField( &dc, (LIB_FIELD*) m_drawItem ); EditField( &dc, (LIB_FIELD*) m_drawItem );
} }
DrawPanel->MoveCursorToCrossHair(); DrawPanel->MoveCursorToCrossHair();
DrawPanel->CrossHairOn( &dc ); DrawPanel->CrossHairOn( &dc );
break; break;
...@@ -759,6 +759,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -759,6 +759,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM: case ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM:
if( ( m_drawItem == NULL ) || ( m_drawItem->Type() != LIB_PIN_T ) ) if( ( m_drawItem == NULL ) || ( m_drawItem->Type() != LIB_PIN_T ) )
break; break;
SaveCopyInUndoList( m_component ); SaveCopyInUndoList( m_component );
GlobalSetPins( &dc, (LIB_PIN*) m_drawItem, id ); GlobalSetPins( &dc, (LIB_PIN*) m_drawItem, id );
DrawPanel->MoveCursorToCrossHair(); DrawPanel->MoveCursorToCrossHair();
...@@ -1130,7 +1131,7 @@ LIB_ITEM* LIB_EDIT_FRAME::locateItem( const wxPoint& aPosition, const KICAD_T aF ...@@ -1130,7 +1131,7 @@ LIB_ITEM* LIB_EDIT_FRAME::locateItem( const wxPoint& aPosition, const KICAD_T aF
{ {
wxString text = m_collectedItems[i]->GetSelectMenuText(); wxString text = m_collectedItems[i]->GetSelectMenuText();
BITMAP_DEF xpm = m_collectedItems[i]->GetMenuImage(); 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. // Set to NULL in case user aborts the clarification context menu.
......
...@@ -318,7 +318,7 @@ private: ...@@ -318,7 +318,7 @@ private:
* *
* @param aLibEntry A pointer to the LIB_ALIAS object to load. * @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. * @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 ); bool LoadOneLibraryPartAux( LIB_ALIAS* aLibEntry, CMP_LIBRARY* aLibrary );
......
...@@ -7,16 +7,13 @@ ...@@ -7,16 +7,13 @@
#endif #endif
#include "fctsys.h" #include "fctsys.h"
#include "common.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "bitmaps.h"
#include "wxEeschemaStruct.h" #include "wxEeschemaStruct.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "eeschema_id.h" #include "eeschema_id.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "macros.h"
#include "help_common_strings.h" #include "help_common_strings.h"
...@@ -44,18 +41,18 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -44,18 +41,18 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
wxMenu* fileMenu = new wxMenu; wxMenu* fileMenu = new wxMenu;
// New // New
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_NEW_PROJECT, ID_NEW_PROJECT,
_( "&New\tCtrl+N" ), _( "&New\tCtrl+N" ),
_( "New schematic project" ), _( "New schematic project" ),
new_xpm ); new_xpm );
// Open // Open
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_LOAD_PROJECT, ID_LOAD_PROJECT,
_( "&Open\tCtrl+O" ), _( "&Open\tCtrl+O" ),
_( "Open an existing schematic project" ), _( "Open an existing schematic project" ),
open_document_xpm ); open_document_xpm );
// Open Recent submenu // Open Recent submenu
static wxMenu* openRecentMenu; static wxMenu* openRecentMenu;
...@@ -64,110 +61,111 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -64,110 +61,111 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// (the file history will be updated when adding/removing files in history // (the file history will be updated when adding/removing files in history
if( openRecentMenu ) if( openRecentMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu ); wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu );
openRecentMenu = new wxMenu(); openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentMenu ); wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu ); wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentMenu, AddMenuItem( fileMenu, openRecentMenu,
wxID_ANY, _( "Open &Recent" ), wxID_ANY, _( "Open &Recent" ),
_( "Open a recent opened schematic project" ), _( "Open a recent opened schematic project" ),
open_project_xpm ); open_project_xpm );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Save schematic project // Save schematic project
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_SAVE_PROJECT, ID_SAVE_PROJECT,
_( "&Save Whole Schematic Project\tCtrl+S" ), _( "&Save Whole Schematic Project\tCtrl+S" ),
_( "Save all sheets in the schematic project" ), _( "Save all sheets in the schematic project" ),
save_project_xpm ); save_project_xpm );
// Save current sheet // Save current sheet
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_SAVE_ONE_SHEET, ID_SAVE_ONE_SHEET,
_( "Save &Current Sheet Only" ), _( "Save &Current Sheet Only" ),
_( "Save only current schematic sheet" ), _( "Save only current schematic sheet" ),
save_xpm ); save_xpm );
// Save current sheet as // Save current sheet as
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_SAVE_ONE_SHEET_AS, ID_SAVE_ONE_SHEET_AS,
_( "Save Current Sheet &as" ), _( "Save Current Sheet &as" ),
_( "Save current schematic sheet as..." ), _( "Save current schematic sheet as..." ),
save_as_xpm ); save_as_xpm );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Page settings // Page settings
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_SHEET_SET, ID_SHEET_SET,
_( "P&age Settings" ), _( "P&age Settings" ),
_( "Settigns for page size and information" ), _( "Settigns for page size and information" ),
sheetset_xpm ); sheetset_xpm );
// Print // Print
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
wxID_PRINT, wxID_PRINT,
_( "P&rint" ), _( "P&rint" ),
_( "Print schematic" ), _( "Print schematic" ),
print_button_xpm ); print_button_xpm );
// Plot submenu // Plot submenu
wxMenu* choice_plot_fmt = new wxMenu; wxMenu* choice_plot_fmt = new wxMenu;
// Plot PostScript // Plot PostScript
ADD_MENUITEM_WITH_HELP( choice_plot_fmt, ID_GEN_PLOT_PS, AddMenuItem( choice_plot_fmt, ID_GEN_PLOT_PS,
_( "Plot PostScript" ), _( "Plot PostScript" ),
_( "Plot schematic sheet in PostScript format" ), _( "Plot schematic sheet in PostScript format" ),
plot_ps_xpm ); plot_ps_xpm );
// Plot HPGL // Plot HPGL
ADD_MENUITEM_WITH_HELP( choice_plot_fmt, AddMenuItem( choice_plot_fmt,
ID_GEN_PLOT_HPGL, ID_GEN_PLOT_HPGL,
_( "Plot HPGL" ), _( "Plot HPGL" ),
_( "Plot schematic sheet in HPGL format" ), _( "Plot schematic sheet in HPGL format" ),
plot_hpg_xpm ); plot_hpg_xpm );
// Plot SVG // Plot SVG
ADD_MENUITEM_WITH_HELP( choice_plot_fmt, AddMenuItem( choice_plot_fmt,
ID_GEN_PLOT_SVG, ID_GEN_PLOT_SVG,
_( "Plot SVG" ), _( "Plot SVG" ),
_( "Plot schematic sheet in SVG format" ), _( "Plot schematic sheet in SVG format" ),
plot_xpm ); plot_xpm );
// Plot DXF // Plot DXF
ADD_MENUITEM_WITH_HELP( choice_plot_fmt, AddMenuItem( choice_plot_fmt,
ID_GEN_PLOT_DXF, ID_GEN_PLOT_DXF,
_( "Plot DXF" ), _( "Plot DXF" ),
_( "Plot schematic sheet in DXF format" ), _( "Plot schematic sheet in DXF format" ),
plot_xpm ); plot_xpm );
// Plot to Clipboard (Windows only) // Plot to Clipboard (Windows only)
#ifdef __WINDOWS__ #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" ), _( "Plot to Clipboard" ),
_( "Export drawings to clipboard" ), _( "Export drawings to clipboard" ),
copy_button_xpm ); copy_button_xpm );
#endif // __WINDOWS__ #endif // __WINDOWS__
// Plot submenu // Plot submenu
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, choice_plot_fmt, AddMenuItem( fileMenu, choice_plot_fmt,
ID_GEN_PLOT, _( "&Plot" ), ID_GEN_PLOT, _( "&Plot" ),
_( "Plot schematic sheet in HPGL, PostScript or SVG format" ), _( "Plot schematic sheet in HPGL, PostScript or SVG format" ),
plot_xpm ); plot_xpm );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Quit // Quit
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
wxID_EXIT, wxID_EXIT,
_( "&Quit" ), _( "&Quit" ),
_( "Quit EESchema" ), _( "Quit EESchema" ),
exit_xpm ); exit_xpm );
// Menu Edit: // Menu Edit:
wxMenu* editMenu = new wxMenu; wxMenu* editMenu = new wxMenu;
...@@ -175,37 +173,31 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -175,37 +173,31 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Undo // Undo
text = AddHotkeyName( _( "Undo" ), s_Schematic_Hokeys_Descr, HK_UNDO ); text = AddHotkeyName( _( "Undo" ), s_Schematic_Hokeys_Descr, HK_UNDO );
ADD_MENUITEM_WITH_HELP( editMenu, wxID_UNDO, text, HELP_UNDO, AddMenuItem( editMenu, wxID_UNDO, text, HELP_UNDO, undo_xpm );
undo_xpm );
// Redo // Redo
text = AddHotkeyName( _( "Redo" ), s_Schematic_Hokeys_Descr, HK_REDO ); text = AddHotkeyName( _( "Redo" ), s_Schematic_Hokeys_Descr, HK_REDO );
ADD_MENUITEM_WITH_HELP( editMenu, wxID_REDO, text, HELP_REDO, AddMenuItem( editMenu, wxID_REDO, text, HELP_REDO, redo_xpm );
redo_xpm );
// Delete // Delete
editMenu->AppendSeparator(); editMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( editMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT, AddMenuItem( editMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT,
_( "Delete" ), HELP_DELETE_ITEMS, _( "Delete" ), HELP_DELETE_ITEMS,
delete_body_xpm ); delete_body_xpm );
// Find // Find
editMenu->AppendSeparator(); editMenu->AppendSeparator();
text = AddHotkeyName( _( "&Find" ), s_Schematic_Hokeys_Descr, HK_FIND_ITEM ); text = AddHotkeyName( _( "&Find" ), s_Schematic_Hokeys_Descr, HK_FIND_ITEM );
ADD_MENUITEM_WITH_HELP( editMenu, ID_FIND_ITEMS, text, HELP_FIND, AddMenuItem( editMenu, ID_FIND_ITEMS, text, HELP_FIND, find_xpm );
find_xpm );
// Backannotate // Backannotate
editMenu->AppendSeparator(); editMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( editMenu, AddMenuItem( editMenu,
ID_BACKANNO_ITEMS, ID_BACKANNO_ITEMS,
_( "&Backannotate" ), _( "&Backannotate" ),
_( "Back annotate the footprint fields" ), _( "Back annotate the footprint fields" ),
import_footprint_names_xpm ); import_footprint_names_xpm );
// Menu View: // Menu View:
wxMenu* viewMenu = new wxMenu; wxMenu* viewMenu = new wxMenu;
...@@ -228,35 +220,31 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -228,35 +220,31 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Zoom in // Zoom in
text = AddHotkeyName( _( "Zoom In" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Zoom In" ), s_Schematic_Hokeys_Descr,
ID_ZOOM_IN, false ); // add comment, not a shortcut ID_ZOOM_IN, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, AddMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, zoom_in_xpm );
zoom_in_xpm );
// Zoom out // Zoom out
text = AddHotkeyName( _( "Zoom Out" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Zoom Out" ), s_Schematic_Hokeys_Descr,
ID_ZOOM_OUT, false ); // add comment, not a shortcut ID_ZOOM_OUT, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, AddMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, zoom_out_xpm );
zoom_out_xpm );
// Fit on screen // Fit on screen
text = AddHotkeyName( _( "Fit on Screen" ), s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO ); text = AddHotkeyName( _( "Fit on Screen" ), s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, zoom_fit_in_page_xpm );
zoom_fit_in_page_xpm );
// Separator // Separator
viewMenu->AppendSeparator(); viewMenu->AppendSeparator();
// Hierarchy // Hierarchy
ADD_MENUITEM_WITH_HELP( viewMenu, AddMenuItem( viewMenu,
ID_HIERARCHY, ID_HIERARCHY,
_( "H&ierarchy" ), _( "H&ierarchy" ),
_( "Navigate schematic hierarchy" ), _( "Navigate schematic hierarchy" ),
hierarchy_nav_xpm ); hierarchy_nav_xpm );
// Redraw // Redraw
text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW ); text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, zoom_redraw_xpm );
zoom_redraw_xpm );
// Menu place: // Menu place:
// @todo unify IDs // @todo unify IDs
...@@ -265,71 +253,70 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -265,71 +253,70 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Component // Component
text = AddHotkeyName( _( "Component" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Component" ), s_Schematic_Hokeys_Descr,
HK_ADD_NEW_COMPONENT, false ); // add comment, not a shortcut 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, HELP_PLACE_COMPONENTS,
add_component_xpm ); add_component_xpm );
// Power port // Power port
text = AddHotkeyName( _( "Power port" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Power port" ), s_Schematic_Hokeys_Descr,
HK_ADD_NEW_POWER, false ); // add comment, not a shortcut 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, HELP_PLACE_POWERPORT,
add_power_xpm ); add_power_xpm );
// Wire // Wire
text = AddHotkeyName( _( "Wire" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Wire" ), s_Schematic_Hokeys_Descr,
HK_BEGIN_WIRE, false ); // add comment, not a shortcut 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, HELP_PLACE_WIRE,
add_line_xpm ); add_line_xpm );
// Bus // Bus
text = AddHotkeyName( _( "Bus" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Bus" ), s_Schematic_Hokeys_Descr,
HK_BEGIN_BUS, false ); // add comment, not a shortcut 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, HELP_PLACE_BUS,
add_bus_xpm ); add_bus_xpm );
// Wire to Bus entry // Wire to Bus entry
text = AddHotkeyName( _( "Wire to bus entry" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Wire to bus entry" ), s_Schematic_Hokeys_Descr,
HK_ADD_WIRE_ENTRY, false ); // add comment, not a shortcut 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, HELP_PLACE_WIRE2BUS_ENTRY,
add_line2bus_xpm ); add_line2bus_xpm );
// Bus to Bus entry // Bus to Bus entry
text = AddHotkeyName( _( "Bus to bus entry" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Bus to bus entry" ), s_Schematic_Hokeys_Descr,
HK_ADD_BUS_ENTRY, false ); // add comment, not a shortcut 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, HELP_PLACE_BUS2BUS_ENTRY,
add_bus2bus_xpm ); add_bus2bus_xpm );
// No connect flag // No connect flag
text = AddHotkeyName( _( "No connect flag" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "No connect flag" ), s_Schematic_Hokeys_Descr,
HK_ADD_NOCONN_FLAG, false ); // add comment, not a shortcut HK_ADD_NOCONN_FLAG, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, AddMenuItem( placeMenu, ID_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, noconn_xpm );
noconn_xpm );
// Net name // Net name
text = AddHotkeyName( _( "Label" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Label" ), s_Schematic_Hokeys_Descr,
HK_ADD_LABEL, false ); // add comment, not a shortcut 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, HELP_PLACE_NETLABEL,
add_line_label_xpm ); add_line_label_xpm );
// Global label // Global label
text = AddHotkeyName( _( "Global label" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Global label" ), s_Schematic_Hokeys_Descr,
HK_ADD_GLABEL, false ); // add comment, not a shortcut 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, HELP_PLACE_GLOBALLABEL,
add_glabel_xpm ); add_glabel_xpm );
// Junction // Junction
text = AddHotkeyName( _( "Junction" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Junction" ), s_Schematic_Hokeys_Descr,
HK_ADD_JUNCTION, false ); // add comment, not a shortcut 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, HELP_PLACE_JUNCTION,
add_junction_xpm ); add_junction_xpm );
// Separator // Separator
placeMenu->AppendSeparator(); placeMenu->AppendSeparator();
...@@ -339,31 +326,31 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -339,31 +326,31 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
HK_ADD_HLABEL, false ); // add comment, not a shortcut HK_ADD_HLABEL, false ); // add comment, not a shortcut
text = AddHotkeyName( _( "Hierarchical label" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Hierarchical label" ), s_Schematic_Hokeys_Descr,
HK_ADD_HLABEL, false ); // add comment, not a shortcut 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, text, HELP_PLACE_HIER_LABEL,
add_hierarchical_label_xpm ); add_hierarchical_label_xpm );
// Hierarchical sheet // Hierarchical sheet
text = AddHotkeyName( _( "Hierarchical sheet" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Hierarchical sheet" ), s_Schematic_Hokeys_Descr,
HK_ADD_HIER_SHEET, false ); // add comment, not a shortcut 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, HELP_PLACE_SHEET,
add_hierarchical_subsheet_xpm ); add_hierarchical_subsheet_xpm );
// Import hierarchical sheet // Import hierarchical sheet
ADD_MENUITEM_WITH_HELP( placeMenu, AddMenuItem( placeMenu,
ID_IMPORT_HLABEL_BUTT, ID_IMPORT_HLABEL_BUTT,
_( "Import Hierarchical Label" ), _( "Import Hierarchical Label" ),
HELP_IMPORT_SHEETPIN, HELP_IMPORT_SHEETPIN,
import_hierarchical_label_xpm ); import_hierarchical_label_xpm );
// Add hierarchical Pin to Sheet // Add hierarchical Pin to Sheet
ADD_MENUITEM_WITH_HELP( placeMenu, AddMenuItem( placeMenu,
ID_SHEET_PIN_BUTT, ID_SHEET_PIN_BUTT,
_( "Add Hierarchical Pin to Sheet" ), _( "Add Hierarchical Pin to Sheet" ),
HELP_PLACE_SHEETPIN, HELP_PLACE_SHEETPIN,
add_hierar_pin_xpm ); add_hierar_pin_xpm );
// Separator // Separator
placeMenu->AppendSeparator(); placeMenu->AppendSeparator();
...@@ -371,45 +358,45 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -371,45 +358,45 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Graphic line or polygon // Graphic line or polygon
text = AddHotkeyName( _( "Graphic polyline" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Graphic polyline" ), s_Schematic_Hokeys_Descr,
HK_ADD_GRAPHIC_POLYLINE, false ); // add comment, not a shortcut 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, HELP_PLACE_GRAPHICLINES,
add_dashed_line_xpm ); add_dashed_line_xpm );
// Graphic text // Graphic text
text = AddHotkeyName( _( "Graphic text" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Graphic text" ), s_Schematic_Hokeys_Descr,
HK_ADD_GRAPHIC_TEXT, false ); // add comment, not a shortcut 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, HELP_PLACE_GRAPHICTEXTS,
add_text_xpm ); add_text_xpm );
// Menu Preferences: // Menu Preferences:
wxMenu* preferencesMenu = new wxMenu; wxMenu* preferencesMenu = new wxMenu;
// Library // Library
ADD_MENUITEM_WITH_HELP( preferencesMenu, AddMenuItem( preferencesMenu,
ID_CONFIG_REQ, ID_CONFIG_REQ,
_( "&Library" ), _( "&Library" ),
_( "Library preferences" ), _( "Library preferences" ),
library_xpm ); library_xpm );
// Colors // Colors
ADD_MENUITEM_WITH_HELP( preferencesMenu, AddMenuItem( preferencesMenu,
ID_COLORS_SETUP, ID_COLORS_SETUP,
_( "&Colors" ), _( "&Colors" ),
_( "Color preferences" ), _( "Color preferences" ),
palette_xpm ); palette_xpm );
// Options (Preferences on WXMAC) // Options (Preferences on WXMAC)
#ifdef __WXMAC__ #ifdef __WXMAC__
preferencesMenu->Append(wxID_PREFERENCES); preferencesMenu->Append(wxID_PREFERENCES);
#else #else
ADD_MENUITEM_WITH_HELP( preferencesMenu, AddMenuItem( preferencesMenu,
wxID_PREFERENCES, wxID_PREFERENCES,
_( "&Options" ), _( "&Options" ),
_( "EESchema preferences" ), _( "EESchema preferences" ),
preference_xpm ); preference_xpm );
#endif // __WXMAC__ #endif // __WXMAC__
...@@ -423,83 +410,84 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -423,83 +410,84 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
preferencesMenu->AppendSeparator(); preferencesMenu->AppendSeparator();
// Save preferences // Save preferences
ADD_MENUITEM_WITH_HELP( preferencesMenu, AddMenuItem( preferencesMenu,
ID_CONFIG_SAVE, ID_CONFIG_SAVE,
_( "&Save preferences" ), _( "&Save preferences" ),
_( "Save application preferences" ), _( "Save application preferences" ),
save_setup_xpm ); save_setup_xpm );
// Read preferences // Read preferences
ADD_MENUITEM_WITH_HELP( preferencesMenu, AddMenuItem( preferencesMenu,
ID_CONFIG_READ, ID_CONFIG_READ,
_( "&Read preferences" ), _( "&Read preferences" ),
_( "Read application preferences" ), _( "Read application preferences" ),
read_setup_xpm ); read_setup_xpm );
// Menu Tools: // Menu Tools:
wxMenu* toolsMenu = new wxMenu; wxMenu* toolsMenu = new wxMenu;
// Library viewer // Library viewer
ADD_MENUITEM_WITH_HELP( toolsMenu, AddMenuItem( toolsMenu,
ID_TO_LIBRARY, ID_TO_LIBRARY,
_( "Library &Browser" ), _( "Library &Browser" ),
_( "Library browser" ), _( "Library browser" ),
library_browse_xpm ); library_browse_xpm );
// Library editor // Library editor
ADD_MENUITEM_WITH_HELP( toolsMenu, AddMenuItem( toolsMenu,
ID_TO_LIBRARY, ID_TO_LIBRARY,
_( "Library &Editor" ), _( "Library &Editor" ),
_( "Library editor" ), _( "Library editor" ),
libedit_xpm ); libedit_xpm );
// Separator // Separator
toolsMenu->AppendSeparator(); toolsMenu->AppendSeparator();
// Annotate // Annotate
ADD_MENUITEM_WITH_HELP( toolsMenu, AddMenuItem( toolsMenu,
ID_GET_ANNOTATE, ID_GET_ANNOTATE,
_( "&Annotate" ), _( "&Annotate" ),
_( "Annotate the components in the schematic" ), _( "Annotate the components in the schematic" ),
annotate_xpm ); annotate_xpm );
// ERC // ERC
ADD_MENUITEM_WITH_HELP( toolsMenu, AddMenuItem( toolsMenu,
ID_GET_ERC, ID_GET_ERC,
_( "ER&C" ), _( "ER&C" ),
_( "Perform electrical rule check" ), _( "Perform electrical rule check" ),
erc_xpm ); erc_xpm );
// Generate netlist // Generate netlist
ADD_MENUITEM_WITH_HELP( toolsMenu, AddMenuItem( toolsMenu,
ID_GET_NETLIST, ID_GET_NETLIST,
_( "Generate &Netlist" ), _( "Generate &Netlist" ),
_( "Generate the component netlist" ), _( "Generate the component netlist" ),
netlist_xpm ); netlist_xpm );
// Generate bill of materials // Generate bill of materials
ADD_MENUITEM_WITH_HELP( toolsMenu, AddMenuItem( toolsMenu,
ID_GET_TOOLS, ID_GET_TOOLS,
_( "Generate Bill of Materials" ), _( "Generate Bill of Materials" ),
_( "Generate bill of materials" ), _( "Generate bill of materials" ),
tools_xpm ); tools_xpm );
// Separator // Separator
toolsMenu->AppendSeparator(); toolsMenu->AppendSeparator();
//Run CVPcb //Run CVPcb
ADD_MENUITEM_WITH_HELP( toolsMenu, AddMenuItem( toolsMenu,
ID_TO_CVPCB, ID_TO_CVPCB,
_( "A&ssign component footprints" ), _( "A&ssign component footprints" ),
_( "Run CVPcb" ), _( "Run CVPcb" ),
cvpcb_xpm ); cvpcb_xpm );
// Run PCBNew // Run PCBNew
ADD_MENUITEM_WITH_HELP( toolsMenu, AddMenuItem( toolsMenu,
ID_TO_PCB, ID_TO_PCB,
_( "&Layout printed circuit board" ), _( "&Layout printed circuit board" ),
_( "Run PCBNew" ), _( "Run PCBNew" ),
pcbnew_xpm ); pcbnew_xpm );
// Help Menu: // Help Menu:
...@@ -509,24 +497,24 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -509,24 +497,24 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu ); AddHelpVersionInfoMenuEntry( helpMenu );
// Contents // Contents
ADD_MENUITEM_WITH_HELP( helpMenu, AddMenuItem( helpMenu,
wxID_HELP, wxID_HELP,
_( "&Contents" ), _( "&Contents" ),
_( "Open the Eeschema handbook" ), _( "Open the Eeschema handbook" ),
online_help_xpm ); online_help_xpm );
ADD_MENUITEM_WITH_HELP( helpMenu, AddMenuItem( helpMenu,
wxID_INDEX, wxID_INDEX,
_( "&Getting Started in KiCad" ), _( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ), _( "Open the \"Getting Started in KiCad\" guide for beginners" ),
help_xpm ); help_xpm );
// About EESchema // About EESchema
helpMenu->AppendSeparator(); helpMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( helpMenu, AddMenuItem( helpMenu,
wxID_ABOUT, wxID_ABOUT,
_( "&About EESchema" ), _( "&About EESchema" ),
_( "About EESchema schematic designer" ), _( "About EESchema schematic designer" ),
info_xpm ); info_xpm );
// Create the menubar and append all submenus // Create the menubar and append all submenus
menuBar->Append( fileMenu, _( "&File" ) ); menuBar->Append( fileMenu, _( "&File" ) );
......
...@@ -3,9 +3,7 @@ ...@@ -3,9 +3,7 @@
* @brief (Re)Create the main menubar for the component editor frame (LibEdit) * @brief (Re)Create the main menubar for the component editor frame (LibEdit)
*/ */
#include "fctsys.h" #include "fctsys.h"
#include "common.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "bitmaps.h"
#include "general.h" #include "general.h"
#include "libeditframe.h" #include "libeditframe.h"
...@@ -29,6 +27,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -29,6 +27,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// Delete all existing menus so they can be rebuilt. // Delete all existing menus so they can be rebuilt.
// This allows language changes of the menu text on the fly. // This allows language changes of the menu text on the fly.
menuBar->Freeze(); menuBar->Freeze();
while( menuBar->GetMenuCount() ) while( menuBar->GetMenuCount() )
delete menuBar->Remove( 0 ); delete menuBar->Remove( 0 );
...@@ -38,45 +37,45 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -38,45 +37,45 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
wxMenu* fileMenu = new wxMenu; wxMenu* fileMenu = new wxMenu;
// Save current library // Save current library
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_LIBEDIT_SAVE_CURRENT_LIB, ID_LIBEDIT_SAVE_CURRENT_LIB,
_( "&Save Current Library\tCtrl+S" ), _( "&Save Current Library\tCtrl+S" ),
_( "Save the current active library" ), _( "Save the current active library" ),
save_xpm ); save_xpm );
// Save current library as... // Save current library as...
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_LIBEDIT_SAVE_CURRENT_LIB_AS, ID_LIBEDIT_SAVE_CURRENT_LIB_AS,
_( "Save Current Library &as" ), _( "Save Current Library &as" ),
_( "Save current active library as..." ), _( "Save current active library as..." ),
save_as_xpm ); save_as_xpm );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Export as png file // Export as png file
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_LIBEDIT_GEN_PNG_FILE, ID_LIBEDIT_GEN_PNG_FILE,
_( "&Create PNG File from Screen" ), _( "&Create PNG File from Screen" ),
_( "Create a PNG file from the component displayed on screen" ), _( "Create a PNG file from the component displayed on screen" ),
plot_xpm ); plot_xpm );
// Export as SVG file // Export as SVG file
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_LIBEDIT_GEN_SVG_FILE, ID_LIBEDIT_GEN_SVG_FILE,
_( "&Create SVG File" ), _( "&Create SVG File" ),
_( "Create a SVG file from the current loaded component" ), _( "Create a SVG file from the current loaded component" ),
plot_xpm ); plot_xpm );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Quit // Quit
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
wxID_EXIT, wxID_EXIT,
_( "&Quit" ), _( "&Quit" ),
_( "Quit Library Editor" ), _( "Quit Library Editor" ),
exit_xpm ); exit_xpm );
// Edit menu // Edit menu
wxMenu* editMenu = new wxMenu; wxMenu* editMenu = new wxMenu;
...@@ -84,29 +83,29 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -84,29 +83,29 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// Undo // Undo
text = AddHotkeyName( _( "Undo" ), s_Libedit_Hokeys_Descr, HK_UNDO ); text = AddHotkeyName( _( "Undo" ), s_Libedit_Hokeys_Descr, HK_UNDO );
ADD_MENUITEM_WITH_HELP( editMenu, AddMenuItem( editMenu,
wxID_UNDO, wxID_UNDO,
text, text,
_( "Undo last edition" ), _( "Undo last edition" ),
undo_xpm ); undo_xpm );
// Redo // Redo
text = AddHotkeyName( _( "Redo" ), s_Libedit_Hokeys_Descr, HK_REDO ); text = AddHotkeyName( _( "Redo" ), s_Libedit_Hokeys_Descr, HK_REDO );
ADD_MENUITEM_WITH_HELP( editMenu, AddMenuItem( editMenu,
wxID_REDO, wxID_REDO,
text, text,
_( "Redo the last undo command" ), _( "Redo the last undo command" ),
redo_xpm ); redo_xpm );
// Separator // Separator
editMenu->AppendSeparator(); editMenu->AppendSeparator();
// Delete // Delete
ADD_MENUITEM_WITH_HELP( editMenu, AddMenuItem( editMenu,
ID_LIBEDIT_DELETE_ITEM_BUTT, ID_LIBEDIT_DELETE_ITEM_BUTT,
_( "Delete" ), _( "Delete" ),
HELP_DELETE_ITEMS, HELP_DELETE_ITEMS,
delete_body_xpm ); delete_body_xpm );
// Menu View: // Menu View:
wxMenu* viewMenu = new wxMenu; wxMenu* viewMenu = new wxMenu;
...@@ -126,88 +125,84 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -126,88 +125,84 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// Zoom in // Zoom in
text = _( "Zoom In" ); text = _( "Zoom In" );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, AddMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, zoom_in_xpm );
zoom_in_xpm );
// Zoom out // Zoom out
text = _( "Zoom Out" ); text = _( "Zoom Out" );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, AddMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, zoom_out_xpm );
zoom_out_xpm );
// Fit on screen // Fit on screen
text = AddHotkeyName( _( "Fit on Screen" ), s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO ); text = AddHotkeyName( _( "Fit on Screen" ), s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, zoom_fit_in_page_xpm );
zoom_fit_in_page_xpm );
// Separator // Separator
viewMenu->AppendSeparator(); viewMenu->AppendSeparator();
// Redraw // Redraw
text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW ); text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, zoom_redraw_xpm );
zoom_redraw_xpm );
// Menu Place: // Menu Place:
wxMenu* placeMenu = new wxMenu; wxMenu* placeMenu = new wxMenu;
// Pin // Pin
ADD_MENUITEM_WITH_HELP( placeMenu, AddMenuItem( placeMenu,
ID_LIBEDIT_PIN_BUTT, ID_LIBEDIT_PIN_BUTT,
_( "&Pin" ), _( "&Pin" ),
HELP_ADD_PIN, HELP_ADD_PIN,
pin_xpm ); pin_xpm );
// Graphic text // Graphic text
ADD_MENUITEM_WITH_HELP( placeMenu, AddMenuItem( placeMenu,
ID_LIBEDIT_BODY_TEXT_BUTT, ID_LIBEDIT_BODY_TEXT_BUTT,
_( "Graphic text" ), _( "Graphic text" ),
HELP_ADD_BODYTEXT, HELP_ADD_BODYTEXT,
add_text_xpm ); add_text_xpm );
// Graphic rectangle // Graphic rectangle
ADD_MENUITEM_WITH_HELP( placeMenu, AddMenuItem( placeMenu,
ID_LIBEDIT_BODY_RECT_BUTT, ID_LIBEDIT_BODY_RECT_BUTT,
_( "Rectangle" ), _( "Rectangle" ),
HELP_ADD_BODYRECT, HELP_ADD_BODYRECT,
add_rectangle_xpm ); add_rectangle_xpm );
// Graphic Circle // Graphic Circle
ADD_MENUITEM_WITH_HELP( placeMenu, AddMenuItem( placeMenu,
ID_LIBEDIT_BODY_CIRCLE_BUTT, ID_LIBEDIT_BODY_CIRCLE_BUTT,
_( "Circle" ), _( "Circle" ),
HELP_ADD_BODYCIRCLE, HELP_ADD_BODYCIRCLE,
add_circle_xpm ); add_circle_xpm );
// Graphic Arc // Graphic Arc
ADD_MENUITEM_WITH_HELP( placeMenu, AddMenuItem( placeMenu,
ID_LIBEDIT_BODY_ARC_BUTT, ID_LIBEDIT_BODY_ARC_BUTT,
_( "Arc" ), _( "Arc" ),
HELP_ADD_BODYARC, HELP_ADD_BODYARC,
add_arc_xpm ); add_arc_xpm );
// Graphic Line or Polygon // Graphic Line or Polygon
ADD_MENUITEM_WITH_HELP( placeMenu, AddMenuItem( placeMenu,
ID_LIBEDIT_BODY_LINE_BUTT, ID_LIBEDIT_BODY_LINE_BUTT,
_( "Line or Polygon" ), _( "Line or Polygon" ),
HELP_ADD_BODYPOLYGON, HELP_ADD_BODYPOLYGON,
add_polygon_xpm ); add_polygon_xpm );
// Menu Preferences: // Menu Preferences:
wxMenu* preferencesMenu = new wxMenu; wxMenu* preferencesMenu = new wxMenu;
// Library // Library
ADD_MENUITEM_WITH_HELP( preferencesMenu, AddMenuItem( preferencesMenu,
ID_CONFIG_REQ, ID_CONFIG_REQ,
_( "&Library" ), _( "&Library" ),
_( "Library preferences" ), _( "Library preferences" ),
library_xpm ); library_xpm );
// Colors // Colors
ADD_MENUITEM_WITH_HELP( preferencesMenu, AddMenuItem( preferencesMenu,
ID_COLORS_SETUP, ID_COLORS_SETUP,
_( "&Colors" ), _( "&Colors" ),
_( "Color preferences" ), _( "Color preferences" ),
palette_xpm ); palette_xpm );
// Language submenu // Language submenu
wxGetApp().AddMenuLanguageList( preferencesMenu ); wxGetApp().AddMenuLanguageList( preferencesMenu );
...@@ -219,18 +214,18 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -219,18 +214,18 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
preferencesMenu->AppendSeparator(); preferencesMenu->AppendSeparator();
// Save preferences // Save preferences
ADD_MENUITEM_WITH_HELP( preferencesMenu, AddMenuItem( preferencesMenu,
ID_CONFIG_SAVE, ID_CONFIG_SAVE,
_( "&Save preferences" ), _( "&Save preferences" ),
_( "Save application preferences" ), _( "Save application preferences" ),
save_setup_xpm ); save_setup_xpm );
// Read preferences // Read preferences
ADD_MENUITEM_WITH_HELP( preferencesMenu, AddMenuItem( preferencesMenu,
ID_CONFIG_READ, ID_CONFIG_READ,
_( "&Read preferences" ), _( "&Read preferences" ),
_( "Read application preferences" ), _( "Read application preferences" ),
read_setup_xpm ); read_setup_xpm );
// Menu Help: // Menu Help:
wxMenu* helpMenu = new wxMenu; wxMenu* helpMenu = new wxMenu;
...@@ -239,24 +234,24 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -239,24 +234,24 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu ); AddHelpVersionInfoMenuEntry( helpMenu );
// Contents // Contents
ADD_MENUITEM_WITH_HELP( helpMenu, AddMenuItem( helpMenu,
wxID_HELP, wxID_HELP,
_( "&Contents" ), _( "&Contents" ),
_( "Open the eeschema manual" ), _( "Open the eeschema manual" ),
online_help_xpm ); online_help_xpm );
ADD_MENUITEM_WITH_HELP( helpMenu, AddMenuItem( helpMenu,
wxID_INDEX, wxID_INDEX,
_( "&Getting Started in KiCad" ), _( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ), _( "Open the \"Getting Started in KiCad\" guide for beginners" ),
help_xpm ); help_xpm );
// About EESchema // About EESchema
helpMenu->AppendSeparator(); helpMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( helpMenu, AddMenuItem( helpMenu,
wxID_ABOUT, wxID_ABOUT,
_( "&About EESchema" ), _( "&About EESchema" ),
_( "About EESchema schematic designer" ), _( "About EESchema schematic designer" ),
info_xpm ); info_xpm );
// Create the menubar and append all submenus // Create the menubar and append all submenus
menuBar->Append( fileMenu, _( "&File" ) ); menuBar->Append( fileMenu, _( "&File" ) );
......
...@@ -3,11 +3,9 @@ ...@@ -3,11 +3,9 @@
/********************/ /********************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h"
#include "eeschema_id.h" #include "eeschema_id.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "bitmaps.h"
#include "class_sch_screen.h" #include "class_sch_screen.h"
#include "wxEeschemaStruct.h" #include "wxEeschemaStruct.h"
...@@ -80,19 +78,20 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -80,19 +78,20 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{ {
if( item && item->GetFlags() ) if( item && item->GetFlags() )
{ {
ADD_MENUITEM( PopMenu, ID_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm ); AddMenuItem( PopMenu, ID_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm );
} }
else 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(); PopMenu->AppendSeparator();
} }
else else
{ {
if( item && item->GetFlags() ) 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(); PopMenu->AppendSeparator();
} }
} }
...@@ -100,7 +99,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -100,7 +99,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
if( item == NULL ) if( item == NULL )
{ {
if( GetSheet()->Last() != g_RootSheet ) 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(); PopMenu->AppendSeparator();
return true; return true;
...@@ -113,7 +112,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -113,7 +112,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{ {
case SCH_NO_CONNECT_T: 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; break;
case SCH_JUNCTION_T: case SCH_JUNCTION_T:
...@@ -125,14 +124,15 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -125,14 +124,15 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{ {
wxString msg = AddHotkeyName( _( "Move Bus Entry" ), s_Schematic_Hokeys_Descr, wxString msg = AddHotkeyName( _( "Move Bus Entry" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM ); 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 ) == '\\' ) if( GetBusEntryShape( (SCH_BUS_ENTRY*) item ) == '\\' )
PopMenu->Append( ID_POPUP_SCH_ENTRY_SELECT_SLASH, _( "Set Bus Entry /" ) ); PopMenu->Append( ID_POPUP_SCH_ENTRY_SELECT_SLASH, _( "Set Bus Entry /" ) );
else else
PopMenu->Append( ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH, _( "Set Bus Entry \\" ) ); 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; break;
case SCH_MARKER_T: case SCH_MARKER_T:
...@@ -176,8 +176,9 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -176,8 +176,9 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
default: default:
if( is_new ) if( is_new )
ADD_MENUITEM( PopMenu, ID_POPUP_END_LINE, _( "End Drawing" ), apply_xpm ); AddMenuItem( PopMenu, ID_POPUP_END_LINE, _( "End Drawing" ), apply_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Drawing" ), delete_xpm );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Drawing" ), delete_xpm );
break; break;
} }
break; break;
...@@ -209,13 +210,13 @@ void AddMenusForComponentField( wxMenu* PopMenu, SCH_FIELD* Field ) ...@@ -209,13 +210,13 @@ void AddMenusForComponentField( wxMenu* PopMenu, SCH_FIELD* Field )
{ {
msg = AddHotkeyName( _( "Move Field" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Move Field" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM ); 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 ); 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 ); 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 ) ...@@ -241,47 +242,48 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
msg = _( "Move Component" ); msg = _( "Move Component" );
msg << wxT( " " ) << Component->GetField( REFERENCE )->m_Text; msg << wxT( " " ) << Component->GetField( REFERENCE )->m_Text;
msg = AddHotkeyName( msg, s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM ); 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 ); 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; wxMenu* orientmenu = new wxMenu;
msg = AddHotkeyName( _( "Rotate +" ), s_Schematic_Hokeys_Descr, HK_ROTATE ); msg = AddHotkeyName( _( "Rotate +" ), s_Schematic_Hokeys_Descr, HK_ROTATE );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_ROTATE_CMP_COUNTERCLOCKWISE, msg, rotate_ccw_xpm ); AddMenuItem( 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_CLOCKWISE, _( "Rotate -" ), rotate_cw_xpm );
msg = AddHotkeyName( _( "Mirror --" ), s_Schematic_Hokeys_Descr, HK_MIRROR_X_COMPONENT ); 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 ); 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 ); msg = AddHotkeyName( _( "Normal" ), s_Schematic_Hokeys_Descr, HK_ORIENT_NORMAL_COMPONENT );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_ORIENT_NORMAL_CMP, msg, normal_xpm ); AddMenuItem( orientmenu, ID_POPUP_SCH_ORIENT_NORMAL_CMP, msg, normal_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, orientmenu, ID_POPUP_SCH_GENERIC_ORIENT_CMP, AddMenuItem( PopMenu, orientmenu, ID_POPUP_SCH_GENERIC_ORIENT_CMP,
_( "Orient Component" ), orient_xpm ); _( "Orient Component" ), orient_xpm );
wxMenu* editmenu = new wxMenu; wxMenu* editmenu = new wxMenu;
msg = AddHotkeyName( _( "Edit" ), s_Schematic_Hokeys_Descr, HK_EDIT ); 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() ) if( libComponent && libComponent->IsNormal() )
{ {
msg = AddHotkeyName( _( "Value " ), s_Schematic_Hokeys_Descr, HK_EDIT_COMPONENT_VALUE ); 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, msg = AddHotkeyName( _( "Footprint " ), s_Schematic_Hokeys_Descr,
HK_EDIT_COMPONENT_FOOTPRINT ); 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() ) 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 ); component_select_alternate_shape_xpm );
if( libComponent && ( libComponent->GetPartCount() >= 2 ) ) if( libComponent && ( libComponent->GetPartCount() >= 2 ) )
{ {
wxMenu* sel_unit_menu = new wxMenu; int ii; wxMenu* sel_unit_menu = new wxMenu; int ii;
for( ii = 0; ii < libComponent->GetPartCount(); ii++ ) for( ii = 0; ii < libComponent->GetPartCount(); ii++ )
{ {
wxString num_unit; wxString num_unit;
...@@ -289,36 +291,37 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component ) ...@@ -289,36 +291,37 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
num_unit.Printf( _( "Unit %d %c" ), ii + 1, num_unit.Printf( _( "Unit %d %c" ), ii + 1,
"?ABCDEFGHIJKLMNOPQRSTUVWXYZ"[ ii + 1 ] ); "?ABCDEFGHIJKLMNOPQRSTUVWXYZ"[ ii + 1 ] );
wxMenuItem * item = sel_unit_menu->Append( ID_POPUP_SCH_SELECT_UNIT1 + ii, wxMenuItem * item = sel_unit_menu->Append( ID_POPUP_SCH_SELECT_UNIT1 + ii,
num_unit, wxEmptyString, num_unit, wxEmptyString,
wxITEM_CHECK ); wxITEM_CHECK );
if( unit == ii + 1 ) if( unit == ii + 1 )
item->Check(true); 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 ); _( "Unit" ), component_select_unit_xpm );
} }
if( !Component->GetFlags() ) 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,
libedit_xpm ); _( "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 ); _( "Edit Component" ), edit_component_xpm );
if( !Component->GetFlags() ) if( !Component->GetFlags() )
{ {
msg = AddHotkeyName( _( "Copy Component" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Copy Component" ), s_Schematic_Hokeys_Descr,
HK_COPY_COMPONENT_OR_LABEL ); 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 ); 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() ) 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,31 +334,31 @@ void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel ) ...@@ -331,31 +334,31 @@ void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel )
{ {
msg = AddHotkeyName( _( "Move Global Label" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Move Global Label" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM ); 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, msg = AddHotkeyName( _( "Drag Global Label" ), s_Schematic_Hokeys_Descr,
HK_DRAG ); 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, msg = AddHotkeyName( _( "Copy Global Label" ), s_Schematic_Hokeys_Descr,
HK_COPY_COMPONENT_OR_LABEL ); 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 ); 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 ); 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 ); 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 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 ); _( "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 ); _( "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 ); _( "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 ); _( "Change Type" ), gl_change_xpm );
} }
...@@ -368,30 +371,30 @@ void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel ) ...@@ -368,30 +371,30 @@ void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel )
{ {
msg = AddHotkeyName( _( "Move Hierarchical Label" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Move Hierarchical Label" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM ); 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 Hierarchical Label" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Drag Hierarchical Label" ), s_Schematic_Hokeys_Descr, HK_DRAG );
HK_DRAG ); AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, move_text_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, move_text_xpm );
msg = AddHotkeyName( _( "Copy Hierarchical Label" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Copy Hierarchical Label" ), s_Schematic_Hokeys_Descr,
HK_COPY_COMPONENT_OR_LABEL ); 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 ); 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 ); 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 ); 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 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 ); _( "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 ); _( "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 ); _( "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 ); _( "Change Type" ), gl_change_xpm );
} }
...@@ -404,30 +407,30 @@ void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label ) ...@@ -404,30 +407,30 @@ void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label )
{ {
msg = AddHotkeyName( _( "Move Label" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Move Label" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM ); 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 Label" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Drag Label" ), s_Schematic_Hokeys_Descr, HK_DRAG );
HK_DRAG ); AddMenuItem( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, move_text_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST, msg, move_text_xpm );
msg = AddHotkeyName( _( "Copy Label" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Copy Label" ), s_Schematic_Hokeys_Descr,
HK_COPY_COMPONENT_OR_LABEL ); 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 ); 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 ); 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 ); 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 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 ); _( "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 ); _( "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 ); _( "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 ); _( "Change Type" ), gl_change_xpm );
} }
...@@ -440,32 +443,32 @@ void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text ) ...@@ -440,32 +443,32 @@ void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text )
{ {
msg = AddHotkeyName( _( "Move Text" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Move Text" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM ); 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, msg = AddHotkeyName( _( "Copy Text" ), s_Schematic_Hokeys_Descr,
HK_COPY_COMPONENT_OR_LABEL ); 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 ); 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 ); 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 ); 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), /* add menu change type text (to label, glabel, text),
* but only if this is a single line text * but only if this is a single line text
*/ */
if( Text->m_Text.Find( wxT( "\n" ) ) == wxNOT_FOUND ) 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 ); _( "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 ); _( "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 ); _( "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 ); _( "Change Type" ), gl_change_xpm );
} }
} }
...@@ -476,22 +479,22 @@ void SCH_EDIT_FRAME::addJunctionMenuEntries( wxMenu* aMenu, SCH_JUNCTION* aJunct ...@@ -476,22 +479,22 @@ void SCH_EDIT_FRAME::addJunctionMenuEntries( wxMenu* aMenu, SCH_JUNCTION* aJunct
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
msg = AddHotkeyName( _( "Delete Junction" ), s_Schematic_Hokeys_Descr, HK_DELETE ); 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( !aJunction->IsNew() )
{ {
if( m_collectedItems.IsDraggableJunction() ) 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 ) ) 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 ) ) if( screen->GetWireOrBus( aJunction->m_Pos ) )
{ {
ADD_MENUITEM( aMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete Node" ), delete_node_xpm ); AddMenuItem( 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_CONNECTION, _( "Delete Connection" ),
delete_connection_xpm ); delete_connection_xpm );
} }
} }
...@@ -505,34 +508,34 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame ) ...@@ -505,34 +508,34 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame )
if( is_new ) 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; return;
} }
msg = AddHotkeyName( _( "Drag Wire" ), s_Schematic_Hokeys_Descr, HK_DRAG ); 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(); PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Delete Wire" ), s_Schematic_Hokeys_Descr, HK_DELETE ); msg = AddHotkeyName( _( "Delete Wire" ), s_Schematic_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_xpm ); AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete Node" ), delete_node_xpm ); AddMenuItem( 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_CONNECTION, _( "Delete Connection" ),
delete_connection_xpm ); delete_connection_xpm );
SCH_LINE* line = screen->GetWireOrBus( screen->GetCrossHairPosition() ); SCH_LINE* line = screen->GetWireOrBus( screen->GetCrossHairPosition() );
if( line && !line->IsEndPoint( 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(); PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Add Junction" ), s_Schematic_Hokeys_Descr, HK_ADD_JUNCTION ); 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 ); 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. // Add global label command only if the cursor is over one end of the wire.
if( ( pos == Wire->m_Start ) || ( pos == Wire->m_End ) ) 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 ) ...@@ -544,24 +547,24 @@ void AddMenusForBus( wxMenu* PopMenu, SCH_LINE* Bus, SCH_EDIT_FRAME* frame )
if( is_new ) 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; return;
} }
msg = AddHotkeyName( _( "Delete Bus" ), s_Schematic_Hokeys_Descr, HK_DELETE ); 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(); PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Add Junction" ), s_Schematic_Hokeys_Descr, HK_ADD_JUNCTION ); 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 ); 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. // Add global label command only if the cursor is over one end of the bus.
if( ( pos == Bus->m_Start ) || ( pos == Bus->m_End ) ) 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 ) ...@@ -571,37 +574,38 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet )
if( !Sheet->GetFlags() ) 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(); PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Move Sheet" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Move Sheet" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM ); 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 ); 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() ) 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 else
{ {
msg = AddHotkeyName( _( "Edit Sheet" ), s_Schematic_Hokeys_Descr, HK_EDIT ); 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 ); resize_sheet_xpm );
PopMenu->AppendSeparator(); 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 ); import_hierarchical_label_xpm );
if( Sheet->HasUndefinedPins() ) // Sheet has pin labels, and can be cleaned 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 ); options_pinsheet_xpm );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Delete Sheet" ), s_Schematic_Hokeys_Descr, HK_DELETE ); 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 ) ...@@ -614,13 +618,13 @@ void AddMenusForSheetPin( wxMenu* PopMenu, SCH_SHEET_PIN* PinSheet )
{ {
msg = AddHotkeyName( _( "Move Sheet Pin" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Move Sheet Pin" ), s_Schematic_Hokeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM ); 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() ) 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,34 +632,33 @@ void AddMenusForBlock( wxMenu* PopMenu, SCH_EDIT_FRAME* frame ) ...@@ -628,34 +632,33 @@ void AddMenusForBlock( wxMenu* PopMenu, SCH_EDIT_FRAME* frame )
{ {
wxString msg; 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(); PopMenu->AppendSeparator();
if( frame->GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE ) if( frame->GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE )
ADD_MENUITEM( PopMenu, ID_POPUP_ZOOM_BLOCK, _( "Window Zoom" ), AddMenuItem( PopMenu, ID_POPUP_ZOOM_BLOCK, _( "Window Zoom" ), zoom_area_xpm );
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 // After a block move (that is also a block selection) one can reselect
// a block function. // a block function.
if( frame->GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE ) if( frame->GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE )
{ {
ADD_MENUITEM( PopMenu, wxID_COPY, _( "Save Block" ), copy_button_xpm ); AddMenuItem( PopMenu, wxID_COPY, _( "Save Block" ), copy_button_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), copyblock_xpm ); AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), copyblock_xpm );
msg = AddHotkeyName( _( "Drag Block" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Drag Block" ), s_Schematic_Hokeys_Descr,
HK_MOVEBLOCK_TO_DRAGBLOCK ); HK_MOVEBLOCK_TO_DRAGBLOCK );
ADD_MENUITEM( PopMenu, ID_POPUP_DRAG_BLOCK, msg, move_xpm ); AddMenuItem( PopMenu, ID_POPUP_DRAG_BLOCK, msg, move_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), delete_xpm ); AddMenuItem( PopMenu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), delete_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_MIRROR_Y_BLOCK, _( "Mirror Block ||" ), mirror_h_xpm ); AddMenuItem( PopMenu, ID_POPUP_MIRROR_Y_BLOCK, _( "Mirror Block ||" ), mirror_h_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_MIRROR_X_BLOCK, _( "Mirror Block --" ), mirror_v_xpm ); AddMenuItem( 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_ROTATE_BLOCK, _( "Rotate Block ccw" ), rotate_ccw_xpm );
#if 0 #if 0
#ifdef __WINDOWS__ #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 ); _( "Copy to Clipboard" ), copy_button_xpm );
#endif #endif
#endif #endif
} }
...@@ -664,6 +667,6 @@ void AddMenusForBlock( wxMenu* PopMenu, SCH_EDIT_FRAME* frame ) ...@@ -664,6 +667,6 @@ void AddMenusForBlock( wxMenu* PopMenu, SCH_EDIT_FRAME* frame )
void AddMenusForMarkers( wxMenu* aPopMenu, SCH_MARKER* aMarker, SCH_EDIT_FRAME* aFrame ) void AddMenusForMarkers( wxMenu* aPopMenu, SCH_MARKER* aMarker, SCH_EDIT_FRAME* aFrame )
{ {
ADD_MENUITEM( aPopMenu, ID_POPUP_SCH_DELETE, _( "Delete Marker" ), delete_xpm ); AddMenuItem( 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_GETINFO_MARKER, _( "Marker Error Info" ), info_xpm );
} }
...@@ -151,7 +151,7 @@ public: ...@@ -151,7 +151,7 @@ public:
* checks for \a aName in the the template field name list. * checks for \a aName in the the template field name list.
* *
* @param aName A wxString object containing the field name to search for. * @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; bool HasFieldName( const wxString& aName ) const;
}; };
......
...@@ -19,6 +19,8 @@ class GERBVIEW_FRAME; ...@@ -19,6 +19,8 @@ class GERBVIEW_FRAME;
//class BOARD; //class BOARD;
class GERBER_IMAGE; class GERBER_IMAGE;
class Ki_PageDescr;
// Type of photoplotter action: // Type of photoplotter action:
#define GERB_ACTIVE_DRAW 1 // Activate light (lower pen) #define GERB_ACTIVE_DRAW 1 // Activate light (lower pen)
......
...@@ -5,10 +5,8 @@ ...@@ -5,10 +5,8 @@
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h"
#include "gerbview.h" #include "gerbview.h"
#include "bitmaps.h"
#include "gerbview_id.h" #include "gerbview_id.h"
#include "hotkeys.h" #include "hotkeys.h"
...@@ -26,6 +24,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -26,6 +24,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
// Delete all existing menus so they can be rebuilt. // Delete all existing menus so they can be rebuilt.
// This allows language changes of the menu text on the fly. // This allows language changes of the menu text on the fly.
menuBar->Freeze(); menuBar->Freeze();
while( menuBar->GetMenuCount() ) while( menuBar->GetMenuCount() )
delete menuBar->Remove( 0 ); delete menuBar->Remove( 0 );
...@@ -35,113 +34,117 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -35,113 +34,117 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
wxMenu* fileMenu = new wxMenu; wxMenu* fileMenu = new wxMenu;
// Load // Load
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
wxID_FILE, wxID_FILE,
_( "Load &Gerber File" ), _( "Load &Gerber File" ),
_( "Load a new Gerber file on the current layer. Previous data will be deleted" ), _( "Load a new Gerber file on the current layer. Previous data will be deleted" ),
gerber_file_xpm ); gerber_file_xpm );
// Excellon // Excellon
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_GERBVIEW_LOAD_DRILL_FILE, ID_GERBVIEW_LOAD_DRILL_FILE,
_( "Load &EXCELLON Drill File" ), _( "Load &EXCELLON Drill File" ),
_( "Load excellon drill file" ), _( "Load excellon drill file" ),
gerbview_drill_file_xpm ); gerbview_drill_file_xpm );
// Dcodes // Dcodes
ADD_MENUITEM_WITH_HELP( fileMenu, ID_GERBVIEW_LOAD_DCODE_FILE, AddMenuItem( fileMenu, ID_GERBVIEW_LOAD_DCODE_FILE,
_( "Load &DCodes" ), _( "Load &DCodes" ),
_( "Load D-Codes definition file" ), _( "Load D-Codes definition file" ),
gerber_open_dcode_file_xpm ); gerber_open_dcode_file_xpm );
// Recent gerber files // Recent gerber files
static wxMenu* openRecentGbrMenu; static wxMenu* openRecentGbrMenu;
// Add this menu to list menu managed by m_fileHistory // Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history // (the file history will be updated when adding/removing files in history
if( openRecentGbrMenu ) if( openRecentGbrMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentGbrMenu ); wxGetApp().m_fileHistory.RemoveMenu( openRecentGbrMenu );
openRecentGbrMenu = new wxMenu(); openRecentGbrMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentGbrMenu ); wxGetApp().m_fileHistory.UseMenu( openRecentGbrMenu );
wxGetApp().m_fileHistory.AddFilesToMenu(); wxGetApp().m_fileHistory.AddFilesToMenu();
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentGbrMenu, AddMenuItem( fileMenu, openRecentGbrMenu,
wxID_ANY, wxID_ANY,
_( "Open &Recent Gerber File" ), _( "Open &Recent Gerber File" ),
_( "Open a recent opened Gerber file" ), _( "Open a recent opened Gerber file" ),
gerber_recent_files_xpm ); gerber_recent_files_xpm );
// Recent drill files // Recent drill files
static wxMenu* openRecentDrlMenu; static wxMenu* openRecentDrlMenu;
if( openRecentDrlMenu ) if( openRecentDrlMenu )
m_drillFileHistory.RemoveMenu( openRecentDrlMenu ); m_drillFileHistory.RemoveMenu( openRecentDrlMenu );
openRecentDrlMenu = new wxMenu(); openRecentDrlMenu = new wxMenu();
m_drillFileHistory.UseMenu( openRecentDrlMenu ); m_drillFileHistory.UseMenu( openRecentDrlMenu );
m_drillFileHistory.AddFilesToMenu( ); m_drillFileHistory.AddFilesToMenu( );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentDrlMenu, AddMenuItem( fileMenu, openRecentDrlMenu,
wxID_ANY, wxID_ANY,
_( "Open Recent &Drill File" ), _( "Open Recent &Drill File" ),
_( "Open a recent opened drill file" ), _( "Open a recent opened drill file" ),
open_project_xpm ); open_project_xpm );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Clear all // Clear all
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_GERBVIEW_ERASE_ALL, ID_GERBVIEW_ERASE_ALL,
_( "&Clear All" ), _( "&Clear All" ),
_( "Clear all layers. All data will be deleted" ), _( "Clear all layers. All data will be deleted" ),
gerbview_clear_layers_xpm ); gerbview_clear_layers_xpm );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Export to pcbnew // Export to pcbnew
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_GERBVIEW_EXPORT_TO_PCBNEW, ID_GERBVIEW_EXPORT_TO_PCBNEW,
_( "Export to &Pcbnew" ), _( "Export to &Pcbnew" ),
_( "Export data in pcbnew format" ), _( "Export data in pcbnew format" ),
export_xpm ); export_xpm );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Print // Print
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
wxID_PRINT, wxID_PRINT,
_( "P&rint" ), _( "P&rint" ),
_( "Print gerber" ), _( "Print gerber" ),
print_button_xpm ); print_button_xpm );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Exit // Exit
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
wxID_EXIT, wxID_EXIT,
_( "E&xit" ), _( "E&xit" ),
_( "Quit Gerbview" ), _( "Quit Gerbview" ),
exit_xpm ); exit_xpm );
// Menu for configuration and preferences // Menu for configuration and preferences
wxMenu* configMenu = new wxMenu; wxMenu* configMenu = new wxMenu;
// Hide layer manager // Hide layer manager
ADD_MENUITEM_WITH_HELP( configMenu, AddMenuItem( configMenu,
ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG, ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
_( "Hide &Layers Manager" ), _( "Hide &Layers Manager" ),
_( "Show/hide the layers manager toolbar" ), _( "Show/hide the layers manager toolbar" ),
layers_manager_xpm ); layers_manager_xpm );
// Options (Preferences on WXMAC) // Options (Preferences on WXMAC)
#ifdef __WXMAC__ #ifdef __WXMAC__
configMenu->Append(wxID_PREFERENCES); configMenu->Append(wxID_PREFERENCES);
#else #else
ADD_MENUITEM_WITH_HELP( configMenu, AddMenuItem( configMenu,
wxID_PREFERENCES, wxID_PREFERENCES,
_( "&Options" ), _( "&Options" ),
_( "Set options to draw items" ), _( "Set options to draw items" ),
preference_xpm ); preference_xpm );
#endif // __WXMAC__ #endif // __WXMAC__
...@@ -155,38 +158,38 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -155,38 +158,38 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
wxMenu* miscellaneousMenu = new wxMenu; wxMenu* miscellaneousMenu = new wxMenu;
// List dcodes // List dcodes
ADD_MENUITEM_WITH_HELP( miscellaneousMenu, AddMenuItem( miscellaneousMenu,
ID_GERBVIEW_SHOW_LIST_DCODES, ID_GERBVIEW_SHOW_LIST_DCODES,
_( "&List DCodes" ), _( "&List DCodes" ),
_( "List and edit D-codes" ), _( "List and edit D-codes" ),
show_dcodenumber_xpm ); show_dcodenumber_xpm );
// Show source // Show source
ADD_MENUITEM_WITH_HELP( miscellaneousMenu, AddMenuItem( miscellaneousMenu,
ID_GERBVIEW_SHOW_SOURCE, ID_GERBVIEW_SHOW_SOURCE,
_( "&Show Source" ), _( "&Show Source" ),
_( "Show source file for the current layer" ), _( "Show source file for the current layer" ),
tools_xpm ); tools_xpm );
// Separator // Separator
miscellaneousMenu->AppendSeparator(); miscellaneousMenu->AppendSeparator();
// Clear layer // Clear layer
ADD_MENUITEM_WITH_HELP( miscellaneousMenu, AddMenuItem( miscellaneousMenu,
ID_GERBVIEW_GLOBAL_DELETE, ID_GERBVIEW_GLOBAL_DELETE,
_( "&Clear Layer" ), _( "&Clear Layer" ),
_( "Clear current layer" ), _( "Clear current layer" ),
general_deletions_xpm ); general_deletions_xpm );
// Separator // Separator
miscellaneousMenu->AppendSeparator(); miscellaneousMenu->AppendSeparator();
// Text editor // Text editor
ADD_MENUITEM_WITH_HELP( miscellaneousMenu, AddMenuItem( miscellaneousMenu,
ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR, ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR,
_( "&Text Editor" ), _( "&Text Editor" ),
_( "Select your preferred text editor" ), _( "Select your preferred text editor" ),
editor_xpm ); editor_xpm );
// Menu Help // Menu Help
wxMenu* helpMenu = new wxMenu; wxMenu* helpMenu = new wxMenu;
...@@ -195,18 +198,18 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -195,18 +198,18 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
AddHelpVersionInfoMenuEntry( helpMenu ); AddHelpVersionInfoMenuEntry( helpMenu );
// Contents // Contents
ADD_MENUITEM_WITH_HELP( helpMenu, AddMenuItem( helpMenu,
wxID_HELP, wxID_HELP,
_( "&Contents" ), _( "&Contents" ),
_( "Open the Gerbview handbook" ), _( "Open the Gerbview handbook" ),
help_xpm ); help_xpm );
// About gerbview // About gerbview
ADD_MENUITEM_WITH_HELP( helpMenu, AddMenuItem( helpMenu,
wxID_ABOUT, wxID_ABOUT,
_( "&About GerbView" ), _( "&About GerbView" ),
_( "About gerbview gerber and drill viewer" ), _( "About gerbview gerber and drill viewer" ),
online_help_xpm ); online_help_xpm );
// Append menus to the menubar // Append menus to the menubar
menuBar->Append( fileMenu, _( "&File" ) ); menuBar->Append( fileMenu, _( "&File" ) );
......
...@@ -3,10 +3,8 @@ ...@@ -3,10 +3,8 @@
/********************/ /********************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "bitmaps.h"
#include "gerbview.h" #include "gerbview.h"
...@@ -34,11 +32,11 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -34,11 +32,11 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
if( GetToolId() != ID_NO_TOOL_SELECTED ) if( GetToolId() != ID_NO_TOOL_SELECTED )
{ {
if( DrawStruct && DrawStruct->m_Flags ) if( DrawStruct && DrawStruct->m_Flags )
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel" ), cancel_xpm ); _( "Cancel" ), cancel_xpm );
else else
ADD_MENUITEM( PopMenu, ID_POPUP_CLOSE_CURRENT_TOOL, AddMenuItem( PopMenu, ID_POPUP_CLOSE_CURRENT_TOOL,
_( "End Tool" ), cancel_tool_xpm ); _( "End Tool" ), cancel_tool_xpm );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
} }
...@@ -48,17 +46,20 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -48,17 +46,20 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{ {
if( BlockActive ) if( BlockActive )
{ {
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel Block" ), cancel_xpm ); _( "Cancel Block" ), cancel_xpm );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_PLACE_BLOCK, AddMenuItem( PopMenu, ID_POPUP_PLACE_BLOCK,
_( "Place Block" ), apply_xpm ); _( "Place Block" ), apply_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_DELETE_BLOCK, AddMenuItem( PopMenu, ID_POPUP_DELETE_BLOCK,
_( "Delete Block (ctrl + drag mouse)" ), delete_xpm ); _( "Delete Block (ctrl + drag mouse)" ), delete_xpm );
} }
else else
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, {
_( "Cancel" ), cancel_xpm ); AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel" ), cancel_xpm );
}
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
} }
} }
......
...@@ -224,7 +224,7 @@ public: WinEDA_App(); ...@@ -224,7 +224,7 @@ public: WinEDA_App();
/** /**
* Function GetHelpFile * Function GetHelpFile
* get the help file path. * get the help file path.
* <p? * <p>
* Return the Kicad help file with path. The base paths defined in * Return the Kicad help file with path. The base paths defined in
* m_searchPaths are tested for a valid file. The path returned can * m_searchPaths are tested for a valid file. The path returned can
* be relative depending on the paths added to m_searchPaths. See the * be relative depending on the paths added to m_searchPaths. See the
...@@ -233,8 +233,8 @@ public: WinEDA_App(); ...@@ -233,8 +233,8 @@ public: WinEDA_App();
* version of the help file is made. * version of the help file is made.
* wxEmptyString is returned if help file not found. * wxEmptyString is returned if help file not found.
* Help file is searched in directories in this order: * Help file is searched in directories in this order:
* help/<canonical name> like help/en_GB * help/\<canonical name\> like help/en_GB
* help/<short name> like help/en * help/\<short name\> like help/en
* help/en * help/en
* </p> * </p>
*/ */
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
#define DEFAULT_HOTKEY_FILENAME_EXT wxT( "key" ) #define DEFAULT_HOTKEY_FILENAME_EXT wxT( "key" )
class EDA_DRAW_FRAME;
/* Class to handle hotkey commnands. hotkeys have a default value /* 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) * 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 #ifndef MACROS_H
#define MACROS_H #define MACROS_H
#include <wx/wx.h> #include <wx/wx.h>
#include "bitmaps.h"
/** /**
* Macro TO_UTF8 * Macro TO_UTF8
* converts a wxString to a UTF8 encoded C string for all wxWidgets build modes. * converts a wxString to a UTF8 encoded C string for all wxWidgets build modes.
...@@ -26,8 +24,10 @@ ...@@ -26,8 +24,10 @@
static inline wxString FROM_UTF8( const char* cstring ) static inline wxString FROM_UTF8( const char* cstring )
{ {
wxString line = wxString::FromUTF8( cstring ); wxString line = wxString::FromUTF8( cstring );
if( line.IsEmpty() ) // happens when cstring is not a valid UTF8 sequence if( line.IsEmpty() ) // happens when cstring is not a valid UTF8 sequence
line = wxConvCurrent->cMB2WC( cstring ); // try to use locale conversion line = wxConvCurrent->cMB2WC( cstring ); // try to use locale conversion
return line; return line;
} }
...@@ -78,33 +78,39 @@ static inline const wxChar* GetChars( const wxString& s ) ...@@ -78,33 +78,39 @@ static inline const wxChar* GetChars( const wxString& s )
#define RAD2DEG( Rad ) ( (Rad) * 180.0 / M_PI ) #define RAD2DEG( Rad ) ( (Rad) * 180.0 / M_PI )
// Normalize angle to be in the -360.0 .. 360.0: // Normalize angle to be in the -360.0 .. 360.0:
#define NORMALIZE_ANGLE_360( Angle ) { while( Angle < -3600 ) \ #define NORMALIZE_ANGLE_360( Angle ) { \
Angle += 3600;\ while( Angle < -3600 ) \
while( Angle > 3600 ) \ Angle += 3600; \
Angle -= 3600;} while( Angle > 3600 ) \
Angle -= 3600; }
/* Normalize angle to be in the 0.0 .. 360.0 range: */ /* Normalize angle to be in the 0.0 .. 360.0 range: */
#define NORMALIZE_ANGLE_POS( Angle ) { while( Angle < 0 ) \ #define NORMALIZE_ANGLE_POS( Angle ) { \
Angle += 3600;\ while( Angle < 0 ) \
while( Angle >= 3600 ) \ Angle += 3600; \
Angle -= 3600;} while( Angle >= 3600 ) \
Angle -= 3600; }
#define NEGATE_AND_NORMALIZE_ANGLE_POS( Angle ) \
{ Angle = -Angle; while( Angle < 0 ) \ #define NEGATE_AND_NORMALIZE_ANGLE_POS( Angle ) { \
Angle += 3600;while( Angle >= 3600 ) \ Angle = -Angle; \
Angle -= 3600;} while( Angle < 0 ) \
Angle += 3600; \
while( Angle >= 3600 ) \
Angle -= 3600; }
/* Normalize angle to be in the -90.0 .. 90.0 range */ /* Normalize angle to be in the -90.0 .. 90.0 range */
#define NORMALIZE_ANGLE_90( Angle ) { while( Angle < -900 ) \ #define NORMALIZE_ANGLE_90( Angle ) { \
Angle += 1800;\ while( Angle < -900 ) \
while( Angle > 900 ) \ Angle += 1800; \
Angle -= 1800;} while( Angle > 900 ) \
Angle -= 1800; }
/* Normalize angle to be in the -180.0 .. 180.0 range */ /* Normalize angle to be in the -180.0 .. 180.0 range */
#define NORMALIZE_ANGLE_180( Angle ) { while( Angle <= -1800 ) \ #define NORMALIZE_ANGLE_180( Angle ) { \
Angle += 3600;\ while( Angle <= -1800 ) \
while( Angle > 1800 ) \ Angle += 3600; \
Angle -= 3600;} while( Angle > 1800 ) \
Angle -= 3600; }
/*****************************/ /*****************************/
/* macro to exchange 2 items */ /* macro to exchange 2 items */
...@@ -140,92 +146,4 @@ BOOST_TYPEOF_REGISTER_TYPE( BOARD_ITEM* ) ...@@ -140,92 +146,4 @@ BOOST_TYPEOF_REGISTER_TYPE( BOARD_ITEM* )
(b) = __temp__; } (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 */ #endif /* ifdef MACRO_H */
/****************/ /**
/* wxstruct.h */ * @file wxstruct.h
/****************/ * @brief Base window classes and related definitions.
*/
#ifndef WXSTRUCT_H #ifndef WXSTRUCT_H
#define WXSTRUCT_H #define WXSTRUCT_H
...@@ -16,10 +17,11 @@ ...@@ -16,10 +17,11 @@
#include <wx/aui/aui.h> #include <wx/aui/aui.h>
#include <wx/docview.h> #include <wx/docview.h>
#include "bitmaps.h"
#include "colors.h" #include "colors.h"
#include "common.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 #ifndef SAFE_DELETE
#define SAFE_DELETE( p ) delete (p); (p) = NULL; #define SAFE_DELETE( p ) delete (p); (p) = NULL;
#endif #endif
...@@ -28,7 +30,7 @@ ...@@ -28,7 +30,7 @@
#define EESCHEMA_INTERNAL_UNIT 1000 #define EESCHEMA_INTERNAL_UNIT 1000
#endif #endif
// Option for dialog boxes // Option for dialog boxes
#define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT | MAYBE_RESIZE_BORDER #define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT | MAYBE_RESIZE_BORDER
#define KICAD_DEFAULT_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS #define KICAD_DEFAULT_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS
...@@ -74,16 +76,11 @@ enum id_toolbar { ...@@ -74,16 +76,11 @@ enum id_toolbar {
}; };
/***********************************************/ /**
/* Classes for basic main frames used in kicad */ * Class EDA_BASE_FRAME
/***********************************************/ * is the base frame for deriving all Kicad main window classes. This class is not
* intended to be used directly.
*/
/******************************************************************/
/* Basic frame for kicad, eeschema, pcbnew and gerbview. */
/* not directly used: the real frames are derived from this class */
/******************************************************************/
class EDA_BASE_FRAME : public wxFrame class EDA_BASE_FRAME : public wxFrame
{ {
public: public:
...@@ -95,33 +92,34 @@ public: ...@@ -95,33 +92,34 @@ public:
EDA_TOOLBAR* m_HToolBar; // Standard horizontal Toolbar EDA_TOOLBAR* m_HToolBar; // Standard horizontal Toolbar
bool m_FrameIsActive; bool m_FrameIsActive;
wxString m_FrameName; // name used for writing and reading setup wxString m_FrameName; // name used for writing and reading setup
// It is "SchematicFrame", "PcbFrame" .... // It is "SchematicFrame", "PcbFrame" ....
wxString m_AboutTitle; // Name of program displayed in About. wxString m_AboutTitle; // Name of program displayed in About.
wxAuiManager m_auimgr; wxAuiManager m_auimgr;
public: public:
EDA_BASE_FRAME( wxWindow* father, int idtype, EDA_BASE_FRAME( wxWindow* father, int idtype, const wxString& title,
const wxString& title,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~EDA_BASE_FRAME(); ~EDA_BASE_FRAME();
void GetKicadHelp( wxCommandEvent& event ); void GetKicadHelp( wxCommandEvent& event );
void GetKicadAbout( wxCommandEvent& event ); 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 CopyVersionInfoToClipboard( wxCommandEvent& event );
void PrintMsg( const wxString& text );
void PrintMsg( const wxString& text );
/** /**
* Append the copy version information to clipboard help menu entry to \a aMenu. * Append the copy version information to clipboard help menu entry to \a aMenu.
* *
* @param aMenu - The menu to append. * @param aMenu - The menu to append.
*/ */
void AddHelpVersionInfoMenuEntry( wxMenu* aMenu ); void AddHelpVersionInfoMenuEntry( wxMenu* aMenu );
virtual void LoadSettings(); virtual void LoadSettings();
virtual void SaveSettings(); virtual void SaveSettings();
...@@ -139,9 +137,9 @@ public: ...@@ -139,9 +137,9 @@ public:
/** /**
* Function ReadHotkeyConfig * Function ReadHotkeyConfig
* Read configuration data and fill the current hotkey list with hotkeys * 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 ); int ReadHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aDescList );
/** /**
* Function WriteHotkeyConfig * Function WriteHotkeyConfig
...@@ -149,37 +147,37 @@ public: ...@@ -149,37 +147,37 @@ public:
* It is stored using the standard wxConfig mechanism or a file. * It is stored using the standard wxConfig mechanism or a file.
* *
* @param aDescList = pointer to the current hotkey list. * @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) * if NULL, use the standard wxConfig mechanism (default)
* the output format is: shortcut "key" "function" * the output format is: shortcut "key" "function"
* lines starting with # are comments * lines starting with # are comments
*/ */
int WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aDescList, int WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aDescList,
wxString * aFullFileName = NULL); wxString* aFullFileName = NULL);
/** /**
* Function ReadHotkeyConfigFile * Function ReadHotkeyConfigFile
* Read an old configuration file (&ltfile&gt.key) and fill the current hotkey list * Read an old configuration file (&ltfile&gt.key) and fill the current hotkey list
* with hotkeys * with hotkeys
* @param aFilename = file name to read. * @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, int ReadHotkeyConfigFile( const wxString& aFilename,
struct Ki_HotkeyInfoSectionDescriptor* aDescList ); struct Ki_HotkeyInfoSectionDescriptor* aDescList );
/** /**
* Function ImportHotkeyConfigFromFile * Function ImportHotkeyConfigFromFile
* Prompt the user for an old hotkey file to read, and read it. * 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 ); void ImportHotkeyConfigFromFile( struct Ki_HotkeyInfoSectionDescriptor* aDescList );
/** /**
* Function ExportHotkeyConfigToFile * Function ExportHotkeyConfigToFile
* Prompt the user for an old hotkey file to read, and read it. * 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 ); void ExportHotkeyConfigToFile( struct Ki_HotkeyInfoSectionDescriptor* aDescList );
/** /**
* Function SetLanguage * Function SetLanguage
...@@ -200,8 +198,8 @@ public: ...@@ -200,8 +198,8 @@ public:
* history is used * history is used
* @return a wxString containing the selected filename * @return a wxString containing the selected filename
*/ */
wxString GetFileFromHistory( int cmdId, const wxString& type, wxString GetFileFromHistory( int cmdId, const wxString& type,
wxFileHistory* aFileHistory = NULL); wxFileHistory* aFileHistory = NULL );
/** /**
* Function UpdateFileHistory * Function UpdateFileHistory
...@@ -212,10 +210,9 @@ public: ...@@ -212,10 +210,9 @@ public:
* @param aFileHistory The wxFileHistory in use. * @param aFileHistory The wxFileHistory in use.
* If NULL, the main application file history is used. * If NULL, the main application file history is used.
*/ */
void UpdateFileHistory( const wxString& FullFileName, void UpdateFileHistory( const wxString& FullFileName, wxFileHistory * aFileHistory = NULL );
wxFileHistory * aFileHistory = NULL );
void DisplayActivity( int PerCent, const wxString& Text ); void DisplayActivity( int PerCent, const wxString& Text );
/** /**
* Function ReCreateMenuBar * Function ReCreateMenuBar
...@@ -240,13 +237,14 @@ public: ...@@ -240,13 +237,14 @@ 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 class EDA_DRAW_FRAME : public EDA_BASE_FRAME
{ {
int m_toolId; ///< Id of active button on the vertical toolbar. int m_toolId; ///< Id of active button on the vertical toolbar.
public: public:
EDA_DRAW_PANEL* DrawPanel; // Draw area EDA_DRAW_PANEL* DrawPanel; // Draw area
...@@ -273,7 +271,7 @@ public: ...@@ -273,7 +271,7 @@ public:
// for PCBnew and Gerbview // for PCBnew and Gerbview
bool m_Draw_Axis; // TRUE to show X and Y axis 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_Draw_Sheet_Ref; // TRUE to show frame references
bool m_Print_Sheet_Ref; // TRUE to print frame references bool m_Print_Sheet_Ref; // TRUE to print frame references
...@@ -283,7 +281,7 @@ public: ...@@ -283,7 +281,7 @@ public:
* coordinates for drill, gerber * coordinates for drill, gerber
* and component position files * 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: protected:
Ki_HotkeyInfoSectionDescriptor * m_HotkeysZoomAndGridList; Ki_HotkeyInfoSectionDescriptor * m_HotkeysZoomAndGridList;
...@@ -311,8 +309,7 @@ protected: ...@@ -311,8 +309,7 @@ protected:
virtual void unitsChangeRefresh(); virtual void unitsChangeRefresh();
public: public:
EDA_DRAW_FRAME( wxWindow* father, int idtype, EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& title,
const wxString& title,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
...@@ -327,10 +324,10 @@ public: ...@@ -327,10 +324,10 @@ public:
*/ */
virtual BASE_SCREEN* GetScreen() const { return m_currentScreen; } virtual BASE_SCREEN* GetScreen() const { return m_currentScreen; }
void OnMenuOpen( wxMenuEvent& event ); void OnMenuOpen( wxMenuEvent& event );
void OnMouseEvent( wxMouseEvent& event ); void OnMouseEvent( wxMouseEvent& event );
virtual void OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, virtual void OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
EDA_ITEM* aItem = NULL ); EDA_ITEM* aItem = NULL );
/** /**
* Function AddMenuZoomAndGrid (virtual) * Function AddMenuZoomAndGrid (virtual)
...@@ -338,22 +335,22 @@ public: ...@@ -338,22 +335,22 @@ public:
* uses zoom hotkeys info base to add hotkeys info to menu commands * uses zoom hotkeys info base to add hotkeys info to menu commands
* @param aMasterMenu = the menu to populate. * @param aMasterMenu = the menu to populate.
*/ */
virtual void AddMenuZoomAndGrid( wxMenu* aMasterMenu ); virtual void AddMenuZoomAndGrid( wxMenu* aMasterMenu );
void EraseMsgBox(); void EraseMsgBox();
void Process_PageSettings( wxCommandEvent& event ); void Process_PageSettings( wxCommandEvent& event );
/** /**
* Function SetLanguage * Function SetLanguage
* called on a language menu selection * called on a language menu selection
* when using a derived function, do not forget to call this one * when using a derived function, do not forget to call this one
*/ */
virtual void SetLanguage( wxCommandEvent& event ); virtual void SetLanguage( wxCommandEvent& event );
virtual void ReCreateHToolbar() = 0; virtual void ReCreateHToolbar() = 0;
virtual void ReCreateVToolbar() = 0; virtual void ReCreateVToolbar() = 0;
virtual void ReCreateMenuBar(); virtual void ReCreateMenuBar();
virtual void ReCreateAuxiliaryToolbar(); virtual void ReCreateAuxiliaryToolbar();
/** /**
* Function SetToolID * Function SetToolID
...@@ -379,7 +376,7 @@ public: ...@@ -379,7 +376,7 @@ public:
* Function IsGridVisible() , virtual * Function IsGridVisible() , virtual
* @return true if the grid must be shown * @return true if the grid must be shown
*/ */
virtual bool IsGridVisible() virtual bool IsGridVisible()
{ {
return m_DrawGrid; return m_DrawGrid;
} }
...@@ -389,7 +386,7 @@ public: ...@@ -389,7 +386,7 @@ public:
* It may be overloaded by derived classes * It may be overloaded by derived classes
* @param aVisible = true if the grid must be shown * @param aVisible = true if the grid must be shown
*/ */
virtual void SetGridVisibility( bool aVisible ) virtual void SetGridVisibility( bool aVisible )
{ {
m_DrawGrid = aVisible; m_DrawGrid = aVisible;
} }
...@@ -398,7 +395,7 @@ public: ...@@ -398,7 +395,7 @@ public:
* Function GetGridColor() , virtual * Function GetGridColor() , virtual
* @return the color of the grid * @return the color of the grid
*/ */
virtual int GetGridColor() virtual int GetGridColor()
{ {
return m_GridColor; return m_GridColor;
} }
...@@ -407,7 +404,7 @@ public: ...@@ -407,7 +404,7 @@ public:
* Function SetGridColor() , virtual * Function SetGridColor() , virtual
* @param aColor = the new color of the grid * @param aColor = the new color of the grid
*/ */
virtual void SetGridColor( int aColor ) virtual void SetGridColor( int aColor )
{ {
m_GridColor = aColor; m_GridColor = aColor;
} }
...@@ -415,7 +412,7 @@ public: ...@@ -415,7 +412,7 @@ public:
/** /**
* Function GetGridPosition * Function GetGridPosition
* returns the nearest grid position to \a aPosition if a screen is defined and snap to * 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. * @see m_snapToGrid and m_BaseScreen members.
* @param aPosition The position to test. * @param aPosition The position to test.
* @return The wxPoint of the appropriate cursor position. * @return The wxPoint of the appropriate cursor position.
...@@ -432,8 +429,8 @@ public: ...@@ -432,8 +429,8 @@ public:
* @param event - Command event passed by selecting grid size from the * @param event - Command event passed by selecting grid size from the
* grid size combobox on the toolbar. * grid size combobox on the toolbar.
*/ */
virtual void OnSelectGrid( wxCommandEvent& event ); virtual void OnSelectGrid( wxCommandEvent& event );
virtual void OnSelectZoom( wxCommandEvent& event ); virtual void OnSelectZoom( wxCommandEvent& event );
// Command event handlers shared by all applications derived from EDA_DRAW_FRAME. // Command event handlers shared by all applications derived from EDA_DRAW_FRAME.
void OnToggleGridState( wxCommandEvent& aEvent ); void OnToggleGridState( wxCommandEvent& aEvent );
...@@ -457,15 +454,15 @@ public: ...@@ -457,15 +454,15 @@ public:
*</p> *</p>
* @param aDC A device context. * @param aDC A device context.
* @param aPosition The current cursor position in logical (drawing) units. * @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 ) { } virtual void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 ) { }
virtual void OnSize( wxSizeEvent& event ); virtual void OnSize( wxSizeEvent& event );
void OnEraseBackground( wxEraseEvent& SizeEvent ); void OnEraseBackground( wxEraseEvent& SizeEvent );
virtual void OnZoom( wxCommandEvent& event ); virtual void OnZoom( wxCommandEvent& event );
void OnGrid( int grid_type ); void OnGrid( int grid_type );
/** /**
* Function RedrawScreen * Function RedrawScreen
...@@ -474,21 +471,21 @@ public: ...@@ -474,21 +471,21 @@ public:
* @param aCenterPoint The position in logical units to center the scroll bars. * @param aCenterPoint The position in logical units to center the scroll bars.
* @param aWarpPointer Moves the mouse cursor to \a aCenterPoint if true. * @param aWarpPointer Moves the mouse cursor to \a aCenterPoint if true.
*/ */
void RedrawScreen( const wxPoint& aCenterPoint, bool aWarpPointer ); void RedrawScreen( const wxPoint& aCenterPoint, bool aWarpPointer );
void Zoom_Automatique( bool aWarpPointer ); void Zoom_Automatique( bool aWarpPointer );
/* Set the zoom level to show the area Rect */ /* Set the zoom level to show the area Rect */
void Window_Zoom( EDA_RECT& Rect ); void Window_Zoom( EDA_RECT& Rect );
/* Return the zoom level which displays the full page on screen */ /* Return the zoom level which displays the full page on screen */
virtual double BestZoom() = 0; virtual double BestZoom() = 0;
/* Return the current zoom level */ /* Return the current zoom level */
double GetZoom( void ); double GetZoom( void );
void TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_width ); void TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_width );
void PlotWorkSheet( PLOTTER *plotter, BASE_SCREEN* screen ); void PlotWorkSheet( PLOTTER *plotter, BASE_SCREEN* screen );
/** /**
* Function GetXYSheetReferences * Function GetXYSheetReferences
...@@ -498,15 +495,15 @@ public: ...@@ -498,15 +495,15 @@ public:
* @return a wxString containing the message locator like A3 or B6 * @return a wxString containing the message locator like A3 or B6
* (or ?? if out of page limits) * (or ?? if out of page limits)
*/ */
wxString GetXYSheetReferences( BASE_SCREEN* aScreen, const wxPoint& aPosition ); wxString GetXYSheetReferences( BASE_SCREEN* aScreen, const wxPoint& aPosition );
void DisplayToolMsg( const wxString& msg ); void DisplayToolMsg( const wxString& msg );
virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0; virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0;
virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0; virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0; virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
virtual void ToolOnRightClick( wxCommandEvent& event ); virtual void ToolOnRightClick( wxCommandEvent& event );
void AdjustScrollBars( const wxPoint& aCenterPosition ); void AdjustScrollBars( const wxPoint& aCenterPosition );
/** /**
* Function OnActivate (virtual) * Function OnActivate (virtual)
...@@ -514,7 +511,7 @@ public: ...@@ -514,7 +511,7 @@ public:
* In derived classes with a overriding OnActivate function, * In derived classes with a overriding OnActivate function,
* do not forget to call this EDA_DRAW_FRAME::OnActivate( event ) basic function. * do not forget to call this EDA_DRAW_FRAME::OnActivate( event ) basic function.
*/ */
virtual void OnActivate( wxActivateEvent& event ); virtual void OnActivate( wxActivateEvent& event );
/** /**
* Function UpdateStatusBar * Function UpdateStatusBar
...@@ -529,13 +526,13 @@ public: ...@@ -529,13 +526,13 @@ public:
* On a MAC, be careful about calling this function when there is an * On a MAC, be careful about calling this function when there is an
* existing wxDC in existence on a sibling window. * existing wxDC in existence on a sibling window.
*/ */
virtual void UpdateStatusBar(); virtual void UpdateStatusBar();
void DisplayUnitsMsg(); void DisplayUnitsMsg();
/* Handlers for block commands */ /* Handlers for block commands */
virtual void InitBlockPasteInfos(); virtual void InitBlockPasteInfos();
virtual bool HandleBlockBegin( wxDC* DC, int cmd_type,const wxPoint& startpos ); virtual bool HandleBlockBegin( wxDC* DC, int cmd_type,const wxPoint& startpos );
/** /**
* Function ReturnBlockCommand * Function ReturnBlockCommand
...@@ -545,7 +542,7 @@ public: ...@@ -545,7 +542,7 @@ public:
* @param aKey = the key modifiers (Alt, Shift ...) * @param aKey = the key modifiers (Alt, Shift ...)
* @return the block command id (BLOCK_MOVE, BLOCK_COPY...) * @return the block command id (BLOCK_MOVE, BLOCK_COPY...)
*/ */
virtual int ReturnBlockCommand( int aKey ); virtual int ReturnBlockCommand( int aKey );
/** /**
* Function HandleBlockPlace( ) * Function HandleBlockPlace( )
...@@ -568,14 +565,14 @@ public: ...@@ -568,14 +565,14 @@ public:
*/ */
virtual bool HandleBlockEnd( wxDC* DC ); virtual bool HandleBlockEnd( wxDC* DC );
void CopyToClipboard( wxCommandEvent& event ); void CopyToClipboard( wxCommandEvent& event );
/* interprocess communication */ /* interprocess communication */
void OnSockRequest( wxSocketEvent& evt ); void OnSockRequest( wxSocketEvent& evt );
void OnSockRequestServer( wxSocketEvent& evt ); void OnSockRequestServer( wxSocketEvent& evt );
virtual void LoadSettings(); virtual void LoadSettings();
virtual void SaveSettings(); virtual void SaveSettings();
/** /**
* Append a message to the message panel. * Append a message to the message panel.
...@@ -597,7 +594,8 @@ public: ...@@ -597,7 +594,8 @@ public:
*/ */
void ClearMsgPanel( void ); void ClearMsgPanel( void );
/** Virtual function PrintPage /**
* Function PrintPage
* used to print a page * used to print a page
* Print the page pointed by current screen, set by the calling print function * Print the page pointed by current screen, set by the calling print function
* @param aDC = wxDC given by the calling print function * @param aDC = wxDC given by the calling print function
...@@ -622,17 +620,11 @@ public: ...@@ -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 * Struct EDA_MSG_ITEM
* is used privately by EDA_MSG_PANEL as the item type of its vector. * is used privately by EDA_MSG_PANEL as the item type for displaying messages.
* These items are the pairs of text strings shown in the MsgPanel.
*/ */
struct MsgItem struct EDA_MSG_ITEM
{ {
int m_X; int m_X;
int m_UpperY; int m_UpperY;
...@@ -644,12 +636,12 @@ struct MsgItem ...@@ -644,12 +636,12 @@ struct MsgItem
/** /**
* Function operator= * Function operator=
* overload the assignment operator so that the wxStrings get copied * 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. * 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_X = rv.m_X;
m_UpperY = rv.m_UpperY; m_UpperY = rv.m_UpperY;
m_LowerY = rv.m_LowerY; m_LowerY = rv.m_LowerY;
m_UpperText = rv.m_UpperText; // overloaded operator=() m_UpperText = rv.m_UpperText; // overloaded operator=()
...@@ -661,15 +653,18 @@ struct MsgItem ...@@ -661,15 +653,18 @@ struct MsgItem
}; };
/**
* class EDA_MSG_PANEL
* is a panel to display various information messages.
*/
class EDA_MSG_PANEL : public wxPanel class EDA_MSG_PANEL : public wxPanel
{ {
protected: protected:
std::vector<MsgItem> m_Items; std::vector<EDA_MSG_ITEM> m_Items;
int m_last_x; ///< the last used x coordinate int m_last_x; ///< the last used x coordinate
wxSize m_fontSize; wxSize m_fontSize;
void showItem( wxDC& dc, const MsgItem& aItem ); void showItem( wxDC& dc, const EDA_MSG_ITEM& aItem );
void erase( wxDC* DC ); void erase( wxDC* DC );
...@@ -735,10 +730,10 @@ public: ...@@ -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 class EDA_TOOLBAR : public wxAuiToolBar
{ {
public: public:
...@@ -770,8 +765,150 @@ public: ...@@ -770,8 +765,150 @@ public:
* Function GetDimension * Function GetDimension
* @return the dimension of this toolbar (Height if horizontal, Width if vertical. * @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 */ #endif /* WXSTRUCT_H */
...@@ -4,10 +4,8 @@ ...@@ -4,10 +4,8 @@
*/ */
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h"
#include "kicad.h" #include "kicad.h"
#include "macros.h"
#include "bitmaps.h"
/* Menubar and toolbar event table */ /* Menubar and toolbar event table */
BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME ) BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME )
...@@ -74,6 +72,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() ...@@ -74,6 +72,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Delete all existing menus so they can be rebuilt. // Delete all existing menus so they can be rebuilt.
// This allows language changes of the menu text on the fly. // This allows language changes of the menu text on the fly.
menuBar->Freeze(); menuBar->Freeze();
while( menuBar->GetMenuCount() ) while( menuBar->GetMenuCount() )
delete menuBar->Remove( 0 ); delete menuBar->Remove( 0 );
...@@ -83,91 +82,93 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() ...@@ -83,91 +82,93 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
wxMenu* fileMenu = new wxMenu; wxMenu* fileMenu = new wxMenu;
// Open // Open
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_LOAD_PROJECT, ID_LOAD_PROJECT,
_( "&Open\tCtrl+O" ), _( "&Open\tCtrl+O" ),
_( "Open an existing project" ), _( "Open an existing project" ),
open_project_xpm ); open_project_xpm );
// Open Recent submenu // Open Recent submenu
static wxMenu* openRecentMenu; static wxMenu* openRecentMenu;
// Add this menu to list menu managed by m_fileHistory // Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history // (the file history will be updated when adding/removing files in history
if( openRecentMenu ) if( openRecentMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu ); wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu );
openRecentMenu = new wxMenu(); openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentMenu ); wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu( ); wxGetApp().m_fileHistory.AddFilesToMenu( );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentMenu, AddMenuItem( fileMenu, openRecentMenu,
wxID_ANY, wxID_ANY,
_( "Open &Recent" ), _( "Open &Recent" ),
_( "Open a recent opened schematic project" ), _( "Open a recent opened schematic project" ),
open_project_xpm ); open_project_xpm );
// New // New
ADD_MENUITEM_WITH_HELP( fileMenu, ID_NEW_PROJECT, AddMenuItem( fileMenu, ID_NEW_PROJECT,
_( "&New\tCtrl+N" ), _( "&New\tCtrl+N" ),
_( "Start a new project" ), _( "Start a new project" ),
new_project_xpm ); new_project_xpm );
// Save // Save
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_SAVE_PROJECT, ID_SAVE_PROJECT,
_( "&Save\tCtrl+S" ), _( "&Save\tCtrl+S" ),
_( "Save current project" ), _( "Save current project" ),
save_project_xpm ); save_project_xpm );
// Archive // Archive
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_SAVE_AND_ZIP_FILES, ID_SAVE_AND_ZIP_FILES,
_( "&Archive" ), _( "&Archive" ),
_( "Archive project files in zip archive" ), _( "Archive project files in zip archive" ),
zip_xpm ); zip_xpm );
// Unarchive // Unarchive
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
ID_READ_ZIP_ARCHIVE, ID_READ_ZIP_ARCHIVE,
_( "&Unarchive" ), _( "&Unarchive" ),
_( "Unarchive project files from zip file" ), _( "Unarchive project files from zip file" ),
unzip_xpm ); unzip_xpm );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Quit // Quit
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
wxID_EXIT, wxID_EXIT,
_( "&Quit" ), _( "&Quit" ),
_( "Quit KiCad" ), _( "Quit KiCad" ),
exit_xpm ); exit_xpm );
// Menu Browse: // Menu Browse:
wxMenu* browseMenu = new wxMenu(); wxMenu* browseMenu = new wxMenu();
// Text editor // Text editor
ADD_MENUITEM_WITH_HELP( browseMenu, AddMenuItem( browseMenu,
ID_TO_EDITOR, ID_TO_EDITOR,
_( "Text E&ditor" ), _( "Text E&ditor" ),
_( "Launch preferred text editor" ), _( "Launch preferred text editor" ),
editor_xpm ); editor_xpm );
// View file // View file
ADD_MENUITEM_WITH_HELP( browseMenu, AddMenuItem( browseMenu,
ID_BROWSE_AN_SELECT_FILE, ID_BROWSE_AN_SELECT_FILE,
_( "&View File" ), _( "&View File" ),
_( "View, read or edit file with a text editor" ), _( "View, read or edit file with a text editor" ),
browse_files_xpm ); browse_files_xpm );
// Menu Preferences: // Menu Preferences:
wxMenu* preferencesMenu = new wxMenu; wxMenu* preferencesMenu = new wxMenu;
// Text editor // Text editor
ADD_MENUITEM_WITH_HELP( preferencesMenu, AddMenuItem( preferencesMenu,
ID_SELECT_PREFERED_EDITOR, ID_SELECT_PREFERED_EDITOR,
_( "&Text Editor" ), _( "&Text Editor" ),
_( "Select your preferred text editor" ), _( "Select your preferred text editor" ),
editor_xpm ); editor_xpm );
// PDF Viewer submenu:System browser or user defined checkbox // PDF Viewer submenu:System browser or user defined checkbox
wxMenu* SubMenuPdfBrowserChoice = new wxMenu; wxMenu* SubMenuPdfBrowserChoice = new wxMenu;
...@@ -200,18 +201,18 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() ...@@ -200,18 +201,18 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
!wxGetApp().m_PdfBrowserIsDefault ); !wxGetApp().m_PdfBrowserIsDefault );
// Append PDF Viewer submenu to preferences // Append PDF Viewer submenu to preferences
ADD_MENUITEM_WITH_HELP( SubMenuPdfBrowserChoice, AddMenuItem( SubMenuPdfBrowserChoice,
ID_SELECT_PREFERED_PDF_BROWSER_NAME, ID_SELECT_PREFERED_PDF_BROWSER_NAME,
_( "PDF Viewer" ), _( "PDF Viewer" ),
_( "Select your favourite PDF viewer used to browse datasheets" ), _( "Select your favourite PDF viewer used to browse datasheets" ),
datasheet_xpm ); datasheet_xpm );
// PDF viewer submenu // PDF viewer submenu
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( preferencesMenu, AddMenuItem( preferencesMenu,
SubMenuPdfBrowserChoice, -1, SubMenuPdfBrowserChoice, -1,
_( "PDF Viewer" ), _( "PDF Viewer" ),
_( "PDF viewer preferences" ), _( "PDF viewer preferences" ),
datasheet_xpm ); datasheet_xpm );
// Language submenu // Language submenu
preferencesMenu->AppendSeparator(); preferencesMenu->AppendSeparator();
...@@ -224,26 +225,26 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() ...@@ -224,26 +225,26 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu ); AddHelpVersionInfoMenuEntry( helpMenu );
// Contents // Contents
ADD_MENUITEM_WITH_HELP( helpMenu, AddMenuItem( helpMenu,
wxID_HELP, wxID_HELP,
_( "&Contents" ), _( "&Contents" ),
_( "Open the Kicad handbook" ), _( "Open the Kicad handbook" ),
online_help_xpm ); online_help_xpm );
ADD_MENUITEM_WITH_HELP( helpMenu, AddMenuItem( helpMenu,
wxID_INDEX, wxID_INDEX,
_( "&Getting Started in KiCad" ), _( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ), _( "Open the \"Getting Started in KiCad\" guide for beginners" ),
help_xpm ); help_xpm );
// Separator // Separator
helpMenu->AppendSeparator(); helpMenu->AppendSeparator();
// About // About
ADD_MENUITEM_WITH_HELP( helpMenu, AddMenuItem( helpMenu,
wxID_ABOUT, wxID_ABOUT,
_( "&About KiCad" ), _( "&About KiCad" ),
_( "About kicad project manager" ), _( "About kicad project manager" ),
info_xpm ); info_xpm );
// Create the menubar and append all submenus // Create the menubar and append all submenus
menuBar->Append( fileMenu, _( "&File" ) ); menuBar->Append( fileMenu, _( "&File" ) );
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
/****************/ /****************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
...@@ -176,16 +175,16 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode ) ...@@ -176,16 +175,16 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
wxMenu itemMenu; wxMenu itemMenu;
/* Give a title to the selection menu. This is also a cancel menu item */ /* 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__ #ifdef __WINDOWS__
wxFont bold_font(*wxNORMAL_FONT); wxFont bold_font( *wxNORMAL_FONT );
bold_font.SetWeight(wxFONTWEIGHT_BOLD); bold_font.SetWeight( wxFONTWEIGHT_BOLD );
bold_font.SetStyle( wxFONTSTYLE_ITALIC); bold_font.SetStyle( wxFONTSTYLE_ITALIC );
item_title->SetFont(bold_font); item_title->SetFont( bold_font );
#endif #endif
itemMenu.Append(item_title); itemMenu.Append( item_title );
itemMenu.AppendSeparator(); itemMenu.AppendSeparator();
int limit = MIN( MAX_ITEMS_IN_PICKER, m_Collector->GetCount() ); int limit = MIN( MAX_ITEMS_IN_PICKER, m_Collector->GetCount() );
...@@ -199,7 +198,7 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode ) ...@@ -199,7 +198,7 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
BITMAP_DEF xpm = item->GetMenuImage(); 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 /* @todo: rather than assignment to true, these should be increment and decrement
......
...@@ -188,12 +188,14 @@ private: ...@@ -188,12 +188,14 @@ private:
* Function BuildHolesList * Function BuildHolesList
* Create the list of holes and tools for a given board * Create the list of holes and tools for a given board
* The list is sorted by increasing drill values * 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 aPcb : the given board
* @param aHoleListBuffer : the std::vector<HOLE_INFO> to fill with pcb holes info * @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 aToolListBuffer : the std::vector<DRILL_TOOL> to fill with tools to use
* @param aFirstLayer = first layer to consider. if < 0 aFirstLayer is ignored * @param aFirstLayer = first layer to consider. if < 0 aFirstLayer is ignored
* @param aLastLayer = last layer to consider. if < 0 aLastLayer is ignored * @param aLastLayer = last layer to consider. if < 0 aLastLayer is ignored
* @param aExcludeThroughHoles Exclude through holes if true.
* @param aGenerateNPTH_list : * @param aGenerateNPTH_list :
* true to create NPTH only list (with no plated holes) * true to create NPTH only list (with no plated holes)
* false to created plated holes list (with no NPTH ) * false to created plated holes list (with no NPTH )
......
...@@ -3,13 +3,11 @@ ...@@ -3,13 +3,11 @@
* @brief (Re)Create the main menubar for the module editor * @brief (Re)Create the main menubar for the module editor
*/ */
#include "fctsys.h" #include "fctsys.h"
#include "common.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "module_editor_frame.h" #include "module_editor_frame.h"
#include "bitmaps.h"
#include "protos.h" #include "protos.h"
#include "pcbnew_id.h" #include "pcbnew_id.h"
...@@ -71,10 +69,10 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() ...@@ -71,10 +69,10 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
openSubmenu->Append( item ); openSubmenu->Append( item );
/* Append openSubmenu to fileMenu */ /* Append openSubmenu to fileMenu */
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openSubmenu, -1, AddMenuItem( fileMenu, openSubmenu, -1,
_( "&Load Module" ), _( "&Load Module" ),
_( "Load a footprint module" ), _( "Load a footprint module" ),
open_document_xpm ); open_document_xpm );
// Save module // Save module
item = new wxMenuItem( fileMenu, item = new wxMenuItem( fileMenu,
...@@ -188,11 +186,11 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() ...@@ -188,11 +186,11 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
dimensions_Submenu->Append( item ); dimensions_Submenu->Append( item );
// Append dimensions_Submenu to editMenu // Append dimensions_Submenu to editMenu
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( editMenu, AddMenuItem( editMenu,
dimensions_Submenu, -1, dimensions_Submenu, -1,
_( "&Dimensions" ), _( "&Dimensions" ),
_( "Edit dimensions preferences" ), _( "Edit dimensions preferences" ),
add_dimension_xpm ); add_dimension_xpm );
// View menu // View menu
wxMenu* viewMenu = new wxMenu; wxMenu* viewMenu = new wxMenu;
...@@ -302,23 +300,23 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() ...@@ -302,23 +300,23 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu ); AddHelpVersionInfoMenuEntry( helpMenu );
// Contents // Contents
ADD_MENUITEM_WITH_HELP( helpMenu, AddMenuItem( helpMenu,
wxID_HELP, wxID_HELP,
_( "&Contents" ), _( "&Contents" ),
_( "Open the PCBNew handbook" ), _( "Open the PCBNew handbook" ),
online_help_xpm ); online_help_xpm );
ADD_MENUITEM_WITH_HELP( helpMenu, AddMenuItem( helpMenu,
wxID_INDEX, wxID_INDEX,
_( "&Getting Started in KiCad" ), _( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ), _( "Open the \"Getting Started in KiCad\" guide for beginners" ),
help_xpm ); help_xpm );
// About PCBNew // About PCBNew
helpMenu->AppendSeparator(); helpMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( helpMenu, wxID_ABOUT, AddMenuItem( helpMenu, wxID_ABOUT,
_( "&About PCBNew" ), _( "&About PCBNew" ),
_( "About PCBNew PCB designer" ), _( "About PCBNew PCB designer" ),
info_xpm ); info_xpm );
// Append menus to the menubar // Append menus to the menubar
menuBar->Append( fileMenu, _( "&File" ) ); menuBar->Append( fileMenu, _( "&File" ) );
......
...@@ -4,14 +4,11 @@ ...@@ -4,14 +4,11 @@
*/ */
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "bitmaps.h"
#include "protos.h" #include "protos.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "pcbnew_id.h" #include "pcbnew_id.h"
#include "macros.h"
#include "help_common_strings.h" #include "help_common_strings.h"
...@@ -30,6 +27,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -30,6 +27,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// Delete all existing menus so they can be rebuilt. // Delete all existing menus so they can be rebuilt.
// This allows language changes of the menu text on the fly. // This allows language changes of the menu text on the fly.
menuBar->Freeze(); menuBar->Freeze();
while( menuBar->GetMenuCount() ) while( menuBar->GetMenuCount() )
delete menuBar->Remove(0); delete menuBar->Remove(0);
...@@ -54,17 +52,19 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -54,17 +52,19 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// Load Recent submenu // Load Recent submenu
static wxMenu* openRecentMenu; static wxMenu* openRecentMenu;
// Add this menu to list menu managed by m_fileHistory // Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history // (the file history will be updated when adding/removing files in history
if( openRecentMenu ) if( openRecentMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu ); wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu );
openRecentMenu = new wxMenu(); openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentMenu ); wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu(); wxGetApp().m_fileHistory.AddFilesToMenu();
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu, AddMenuItem( filesMenu, openRecentMenu,
-1, _( "Open &Recent" ), -1, _( "Open &Recent" ),
_( "Open a recent opened board" ), _( "Open a recent opened board" ),
open_project_xpm ); open_project_xpm );
// PCBNew Board // PCBNew Board
...@@ -136,10 +136,10 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -136,10 +136,10 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
fabricationOutputsMenu->Append( item ); fabricationOutputsMenu->Append( item );
// Fabrications Outputs submenu append // Fabrications Outputs submenu append
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, fabricationOutputsMenu, AddMenuItem( filesMenu, fabricationOutputsMenu,
-1, _( "Fabrication Outputs" ), -1, _( "Fabrication Outputs" ),
_( "Generate files for fabrication" ), _( "Generate files for fabrication" ),
fabrication_xpm ); fabrication_xpm );
...@@ -153,9 +153,9 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -153,9 +153,9 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
SET_BITMAP( import_xpm ); // @todo need better bitmap SET_BITMAP( import_xpm ); // @todo need better bitmap
submenuImport->Append( item ); submenuImport->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuImport, AddMenuItem( filesMenu, submenuImport,
ID_GEN_IMPORT_FILE, _( "Import" ), ID_GEN_IMPORT_FILE, _( "Import" ),
_( "Import files" ), import_xpm ); _( "Import files" ), import_xpm );
...@@ -189,9 +189,9 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -189,9 +189,9 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
SET_BITMAP( three_d_xpm ); SET_BITMAP( three_d_xpm );
submenuexport->Append( item ); submenuexport->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuexport, AddMenuItem( filesMenu, submenuexport,
ID_GEN_EXPORT_FILE, _( "&Export" ), ID_GEN_EXPORT_FILE, _( "&Export" ),
_( "Export board" ), export_xpm ); _( "Export board" ), export_xpm );
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
...@@ -240,11 +240,11 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -240,11 +240,11 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
SET_BITMAP( library_xpm ); SET_BITMAP( library_xpm );
submenuarchive->Append( item ); submenuarchive->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuarchive, AddMenuItem( filesMenu, submenuarchive,
ID_MENU_ARCHIVE_MODULES, ID_MENU_ARCHIVE_MODULES,
_( "Archive Footprints" ), _( "Archive Footprints" ),
_( "Archive or add footprints in a library file" ), _( "Archive or add footprints in a library file" ),
library_xpm ); library_xpm );
/* Quit */ /* Quit */
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
...@@ -337,36 +337,29 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -337,36 +337,29 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
* for Zoom in and Zoom out sub menus * for Zoom in and Zoom out sub menus
*/ */
// Zoom In // Zoom In
text = AddHotkeyName( _( "Zoom In" ), g_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Zoom In" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_IN, false );
HK_ZOOM_IN, false ); item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, wxITEM_NORMAL );
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text,
HELP_ZOOM_IN, wxITEM_NORMAL );
SET_BITMAP( zoom_in_xpm ); SET_BITMAP( zoom_in_xpm );
viewMenu->Append( item ); viewMenu->Append( item );
// Zoom Out // Zoom Out
text = AddHotkeyName( _( "Zoom Out" ), g_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Zoom Out" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_OUT, false );
HK_ZOOM_OUT, false ); item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, wxITEM_NORMAL );
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text,
HELP_ZOOM_OUT, wxITEM_NORMAL );
SET_BITMAP( zoom_out_xpm ); SET_BITMAP( zoom_out_xpm );
viewMenu->Append( item ); viewMenu->Append( item );
// Fit on Screen // Fit on Screen
text = AddHotkeyName( _( "Fit on Screen" ), g_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Fit on Screen" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_AUTO );
HK_ZOOM_AUTO );
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text, item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, wxITEM_NORMAL );
HELP_ZOOM_FIT, wxITEM_NORMAL );
SET_BITMAP( zoom_fit_in_page_xpm ); SET_BITMAP( zoom_fit_in_page_xpm );
viewMenu->Append( item ); viewMenu->Append( item );
viewMenu->AppendSeparator(); viewMenu->AppendSeparator();
// Redraw // Redraw
text = AddHotkeyName( _( "Redraw" ), g_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Redraw" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_REDRAW );
HK_ZOOM_REDRAW );
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text, item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text,
HELP_ZOOM_REDRAW, HELP_ZOOM_REDRAW,
...@@ -403,8 +396,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -403,8 +396,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
placeMenu->Append( item ); placeMenu->Append( item );
// Track // Track
text = AddHotkeyName( _( "Track" ), g_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Track" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ADD_NEW_TRACK, false );
HK_ADD_NEW_TRACK, false );
item = new wxMenuItem( placeMenu, ID_TRACK_BUTT, text, item = new wxMenuItem( placeMenu, ID_TRACK_BUTT, text,
_( "Add tracks and vias" ), wxITEM_NORMAL ); _( "Add tracks and vias" ), wxITEM_NORMAL );
...@@ -449,8 +441,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -449,8 +441,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// Dimension // Dimension
item = new wxMenuItem( placeMenu, ID_PCB_DIMENSION_BUTT, item = new wxMenuItem( placeMenu, ID_PCB_DIMENSION_BUTT,
_( "Dimension" ), _( "Dimension" ),
_( "Add dimension" ) ); _( "Add dimension" ) );
SET_BITMAP( add_dimension_xpm ); SET_BITMAP( add_dimension_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
...@@ -464,8 +456,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -464,8 +456,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// Drill & Place Offset // Drill & Place Offset
item = new wxMenuItem( placeMenu, ID_PCB_PLACE_OFFSET_COORD_BUTT, item = new wxMenuItem( placeMenu, ID_PCB_PLACE_OFFSET_COORD_BUTT,
_( "Drill and Place Offset" ), _( "Drill and Place Offset" ),
_( "Place the origin point for drill and place files" )); _( "Place the origin point for drill and place files" ));
SET_BITMAP( pcb_offset_xpm ); SET_BITMAP( pcb_offset_xpm );
placeMenu->Append( item ); placeMenu->Append( item );
...@@ -556,10 +548,10 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -556,10 +548,10 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
dimensionsMenu->Append( item ); dimensionsMenu->Append( item );
// Append dimension menu to config menu // Append dimension menu to config menu
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( configmenu, dimensionsMenu, AddMenuItem( configmenu, dimensionsMenu,
-1, _( "Di&mensions" ), -1, _( "Di&mensions" ),
_( "Global dimensions preferences" ), _( "Global dimensions preferences" ),
add_dimension_xpm ); add_dimension_xpm );
// Language submenu // Language submenu
wxGetApp().AddMenuLanguageList( configmenu ); wxGetApp().AddMenuLanguageList( configmenu );
...@@ -634,7 +626,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -634,7 +626,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
SET_BITMAP( copper_layers_setup_xpm ); SET_BITMAP( copper_layers_setup_xpm );
designRulesMenu->Append( item ); designRulesMenu->Append( item );
/** /**
* Help menu * Help menu
*/ */
...@@ -643,23 +634,23 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -643,23 +634,23 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu ); AddHelpVersionInfoMenuEntry( helpMenu );
// Contents // Contents
ADD_MENUITEM_WITH_HELP( helpMenu, AddMenuItem( helpMenu,
wxID_HELP, wxID_HELP,
_( "&Contents" ), _( "&Contents" ),
_( "Open the PCBNew handbook" ), _( "Open the PCBNew handbook" ),
online_help_xpm ); online_help_xpm );
ADD_MENUITEM_WITH_HELP( helpMenu, AddMenuItem( helpMenu,
wxID_INDEX, wxID_INDEX,
_( "&Getting Started in KiCad" ), _( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ), _( "Open the \"Getting Started in KiCad\" guide for beginners" ),
help_xpm ); help_xpm );
// About // About
helpMenu->AppendSeparator(); helpMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( helpMenu, wxID_ABOUT, AddMenuItem( helpMenu, wxID_ABOUT,
_( "&About PCBNew" ), _( "&About PCBNew" ),
_( "About PCBnew printed circuit board designer" ), _( "About PCBnew printed circuit board designer" ),
info_xpm ); info_xpm );
/** /**
* Append all menus to the menuBar * Append all menus to the menuBar
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "bitmaps.h"
#include "pcbnew_id.h" #include "pcbnew_id.h"
#include "trigo.h" #include "trigo.h"
...@@ -100,10 +99,10 @@ BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode ) ...@@ -100,10 +99,10 @@ BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode )
text = item->GetSelectMenuText(); text = item->GetSelectMenuText();
xpm = item->GetMenuImage(); xpm = item->GetMenuImage();
ADD_MENUITEM( &itemMenu, AddMenuItem( &itemMenu,
ID_POPUP_PCB_ITEM_SELECTION_START + ii, ID_POPUP_PCB_ITEM_SELECTION_START + ii,
text, text,
xpm ); xpm );
} }
// this menu's handler is void // this menu's handler is void
...@@ -735,6 +734,7 @@ void FOOTPRINT_EDIT_FRAME::Transform( MODULE* module, int transform ) ...@@ -735,6 +734,7 @@ void FOOTPRINT_EDIT_FRAME::Transform( MODULE* module, int transform )
edgemod->m_Start0 = edgemod->m_Start; edgemod->m_Start0 = edgemod->m_Start;
edgemod->m_End0 = edgemod->m_End; edgemod->m_End0 = edgemod->m_End;
} }
if( PtStruct->Type() == TYPE_TEXTE_MODULE ) if( PtStruct->Type() == TYPE_TEXTE_MODULE )
{ {
textmod = (TEXTE_MODULE*) PtStruct; textmod = (TEXTE_MODULE*) PtStruct;
...@@ -775,6 +775,7 @@ void FOOTPRINT_EDIT_FRAME::Transform( MODULE* module, int transform ) ...@@ -775,6 +775,7 @@ void FOOTPRINT_EDIT_FRAME::Transform( MODULE* module, int transform )
/* Reverse mirror of footprints. */ /* Reverse mirror of footprints. */
PtStruct = module->m_Drawings; PtStruct = module->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() ) for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
{ {
switch( PtStruct->Type() ) switch( PtStruct->Type() )
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
/************************/ /************************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
...@@ -13,7 +12,6 @@ ...@@ -13,7 +12,6 @@
#include "module_editor_frame.h" #include "module_editor_frame.h"
#include "dialog_edit_module_for_Modedit.h" #include "dialog_edit_module_for_Modedit.h"
#include "bitmaps.h"
#include "protos.h" #include "protos.h"
#include "pcbnew_id.h" #include "pcbnew_id.h"
...@@ -199,9 +197,9 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen ...@@ -199,9 +197,9 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
if( GetToolId() != ID_NO_TOOL_SELECTED ) if( GetToolId() != ID_NO_TOOL_SELECTED )
{ {
if( item && item->m_Flags ) 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 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(); PopMenu->AppendSeparator();
} }
...@@ -211,31 +209,31 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen ...@@ -211,31 +209,31 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
{ {
if( blockActive ) // Put block commands in list 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 ); _( "Cancel Block" ), cancel_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_ZOOM_BLOCK, AddMenuItem( PopMenu, ID_POPUP_ZOOM_BLOCK,
_( "Zoom Block (drag middle mouse)" ), _( "Zoom Block (drag middle mouse)" ),
zoom_area_xpm ); zoom_area_xpm );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_PLACE_BLOCK, AddMenuItem( PopMenu, ID_POPUP_PLACE_BLOCK,
_( "Place Block" ), apply_xpm ); _( "Place Block" ), apply_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_COPY_BLOCK, AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK,
_( "Copy Block (shift + drag mouse)" ), _( "Copy Block (shift + drag mouse)" ),
copyblock_xpm ); copyblock_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_MIRROR_X_BLOCK, AddMenuItem( PopMenu, ID_POPUP_MIRROR_X_BLOCK,
_( "Mirror Block (alt + drag mouse)" ), _( "Mirror Block (alt + drag mouse)" ),
mirror_h_xpm ); mirror_h_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_ROTATE_BLOCK, AddMenuItem( PopMenu, ID_POPUP_ROTATE_BLOCK,
_( "Rotate Block (ctrl + drag mouse)" ), _( "Rotate Block (ctrl + drag mouse)" ),
rotate_ccw_xpm ); rotate_ccw_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_DELETE_BLOCK, AddMenuItem( PopMenu, ID_POPUP_DELETE_BLOCK,
_( "Delete Block (shift+ctrl + drag mouse)" ), _( "Delete Block (shift+ctrl + drag mouse)" ),
delete_xpm ); delete_xpm );
} }
else else
{ {
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel" ), cancel_xpm ); _( "Cancel" ), cancel_xpm );
} }
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
...@@ -252,13 +250,13 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen ...@@ -252,13 +250,13 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
case TYPE_MODULE: case TYPE_MODULE:
{ {
wxMenu* transform_choice = new wxMenu; 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 ); 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 ); msg = AddHotkeyName( _( "Edit Module" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_MODULE, msg, edit_module_xpm ); AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_MODULE, msg, edit_module_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, transform_choice, ID_MODEDIT_TRANSFORM_MODULE, AddMenuItem( PopMenu, transform_choice, ID_MODEDIT_TRANSFORM_MODULE,
_( "Transform Module" ), edit_xpm ); _( "Transform Module" ), edit_xpm );
break; break;
} }
...@@ -266,23 +264,23 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen ...@@ -266,23 +264,23 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
if( !flags ) if( !flags )
{ {
msg = AddHotkeyName( _("Move Pad" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM ); 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 ); msg = AddHotkeyName( _("Edit Pad" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_PAD, msg, options_pad_xpm ); AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_PAD, msg, options_pad_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_IMPORT_PAD_SETTINGS, AddMenuItem( PopMenu, ID_POPUP_PCB_IMPORT_PAD_SETTINGS,
_( "New Pad Settings" ), options_new_pad_xpm ); _( "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 ); _( "Export Pad Settings" ), export_options_pad_xpm );
msg = AddHotkeyName( _("Delete Pad" ), g_Module_Editor_Hokeys_Descr, HK_DELETE ); 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 ) if( !flags )
{ {
PopMenu->AppendSeparator(); 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 ); _( "Global Pad Settings" ), global_options_pad_xpm );
} }
break; break;
...@@ -292,24 +290,24 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen ...@@ -292,24 +290,24 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
{ {
msg = AddHotkeyName( _("Move Text Mod." ), g_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _("Move Text Mod." ), g_Module_Editor_Hokeys_Descr,
HK_MOVE_ITEM ); 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, msg = AddHotkeyName( _("Rotate Text Mod." ), g_Module_Editor_Hokeys_Descr,
HK_ROTATE_ITEM ); 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 ) if( !flags )
{ {
msg = AddHotkeyName( _("Edit Text Mod." ), g_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _("Edit Text Mod." ), g_Module_Editor_Hokeys_Descr,
HK_EDIT_ITEM ); 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 ) if( ( (TEXTE_MODULE*) item )->m_Type == TEXT_is_DIVERS )
{ {
msg = AddHotkeyName( _("Delete Text Mod." ), g_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _("Delete Text Mod." ), g_Module_Editor_Hokeys_Descr,
HK_DELETE ); 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; break;
...@@ -317,29 +315,29 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen ...@@ -317,29 +315,29 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
case TYPE_EDGE_MODULE: case TYPE_EDGE_MODULE:
{ {
if( (flags & IS_NEW) ) 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 ) if( !flags )
{ {
msg = AddHotkeyName( _("Move edge" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM ); 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 ) 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; wxMenu* edit_mnu = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( PopMenu, edit_mnu, ID_POPUP_PCB_EDIT_EDGE, _( "Edit" ), AddMenuItem( PopMenu, edit_mnu, ID_POPUP_PCB_EDIT_EDGE, _( "Edit" ), edit_xpm );
edit_xpm ); AddMenuItem( edit_mnu, ID_POPUP_PCB_EDIT_WIDTH_CURRENT_EDGE,
ADD_MENUITEM( edit_mnu, ID_POPUP_PCB_EDIT_WIDTH_CURRENT_EDGE, _( "Edit Width (Current)" ), width_segment_xpm );
_( "Edit Width (Current)" ), width_segment_xpm ); AddMenuItem( edit_mnu, ID_POPUP_PCB_EDIT_WIDTH_ALL_EDGE,
ADD_MENUITEM( edit_mnu, ID_POPUP_PCB_EDIT_WIDTH_ALL_EDGE, _( "Edit Width (All)" ), width_segment_xpm );
_( "Edit Width (All)" ), width_segment_xpm ); AddMenuItem( edit_mnu, ID_POPUP_PCB_EDIT_LAYER_CURRENT_EDGE,
ADD_MENUITEM( edit_mnu, ID_POPUP_PCB_EDIT_LAYER_CURRENT_EDGE, _( "Edit Layer (Current)" ), select_layer_pair_xpm );
_( "Edit Layer (Current)" ), select_layer_pair_xpm ); AddMenuItem( edit_mnu, ID_POPUP_PCB_EDIT_LAYER_ALL_EDGE,
ADD_MENUITEM( edit_mnu, ID_POPUP_PCB_EDIT_LAYER_ALL_EDGE, _( "Edit Layer (All)" ), select_layer_pair_xpm );
_( "Edit Layer (All)" ), select_layer_pair_xpm );
msg = AddHotkeyName( _("Delete edge" ), g_Module_Editor_Hokeys_Descr, HK_DELETE ); 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; append_set_width = TRUE;
} }
break; break;
...@@ -377,7 +375,7 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen ...@@ -377,7 +375,7 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
|| ( GetToolId() == ID_PCB_CIRCLE_BUTT ) || ( GetToolId() == ID_PCB_CIRCLE_BUTT )
|| ( GetToolId() == ID_PCB_ARC_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(); PopMenu->AppendSeparator();
} }
...@@ -441,6 +439,7 @@ void FOOTPRINT_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -441,6 +439,7 @@ void FOOTPRINT_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
SetCurItem( NULL ); SetCurItem( NULL );
DrawPanel->Refresh(); DrawPanel->Refresh();
} }
break; break;
} }
......
...@@ -30,7 +30,7 @@ public: ...@@ -30,7 +30,7 @@ public:
/** /**
* Function RedrawActiveWindoow * 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 ); void RedrawActiveWindow( wxDC* DC, bool EraseBg );
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "macros.h"
#include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
...@@ -17,8 +15,6 @@ ...@@ -17,8 +15,6 @@
#include "hotkeys.h" #include "hotkeys.h"
#include "collectors.h" #include "collectors.h"
/* Bitmaps */
#include "bitmaps.h"
static wxMenu* Append_Track_Width_List( BOARD* aBoard ); static wxMenu* Append_Track_Width_List( BOARD* aBoard );
...@@ -36,7 +32,6 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -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 DrawPanel->m_CanStartBlock = -1; // Avoid to start a block coomand when clicking on menu
// If a command or a block is in progress: // If a command or a block is in progress:
// Put the Cancel command (if needed) and the End command // Put the Cancel command (if needed) and the End command
...@@ -53,12 +48,12 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -53,12 +48,12 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{ {
if( item && item->m_Flags ) 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 else
{ {
ADD_MENUITEM( aPopMenu, ID_POPUP_CLOSE_CURRENT_TOOL, AddMenuItem( aPopMenu, ID_POPUP_CLOSE_CURRENT_TOOL,
_( "End Tool" ), cancel_tool_xpm ); _( "End Tool" ), cancel_tool_xpm );
} }
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
...@@ -67,8 +62,8 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -67,8 +62,8 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{ {
if( item && item->m_Flags ) if( item && item->m_Flags )
{ {
ADD_MENUITEM( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, AddMenuItem( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel" ), cancel_xpm ); _( "Cancel" ), cancel_xpm );
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
} }
} }
...@@ -106,6 +101,7 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -106,6 +101,7 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
} }
item = GetCurItem(); item = GetCurItem();
if( item ) if( item )
flags = item->m_Flags; flags = item->m_Flags;
else else
...@@ -126,15 +122,15 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -126,15 +122,15 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{ {
msg = AddHotkeyName( _("Lock Module" ), g_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( _("Lock Module" ), g_Board_Editor_Hokeys_Descr,
HK_LOCK_UNLOCK_FOOTPRINT ); 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 ); locked_xpm );
} }
else else
{ {
msg = AddHotkeyName( _( "Unlock Module" ), g_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( _( "Unlock Module" ), g_Board_Editor_Hokeys_Descr,
HK_LOCK_UNLOCK_FOOTPRINT ); 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 ); unlocked_xpm );
} }
if( !flags ) if( !flags )
...@@ -160,41 +156,45 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -160,41 +156,45 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
case TYPE_DRAWSEGMENT: // Some graphic items on technical layers case TYPE_DRAWSEGMENT: // Some graphic items on technical layers
if( (flags & IS_NEW) ) 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 ); _( "End Drawing" ), apply_xpm );
} }
if( !flags ) if( !flags )
{ {
msg = AddHotkeyName( _( "Move Drawing" ), g_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( _( "Move Drawing" ), g_Board_Editor_Hokeys_Descr,
HK_MOVE_ITEM ); HK_MOVE_ITEM );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_MOVE_DRAWING_REQUEST, AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_DRAWING_REQUEST,
msg, move_xpm ); msg, move_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_DRAWING, _( "Edit Drawing" ), edit_xpm ); AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_DRAWING, _( "Edit Drawing" ), edit_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_DRAWING, _( AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_DRAWING,
"Delete Drawing" ), delete_xpm ); _( "Delete Drawing" ), delete_xpm );
if( item->GetLayer() > LAST_COPPER_LAYER ) 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 ); _( "Delete All Drawing on Layer" ), delete_body_xpm );
} }
break; break;
case TYPE_ZONE: // Item used to fill a zone 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 ); _( "Delete Zone Filling" ), delete_xpm );
break; break;
case TYPE_ZONE_CONTAINER: // Item used to handle a zone area (outlines, holes ...) case TYPE_ZONE_CONTAINER: // Item used to handle a zone area (outlines, holes ...)
if( flags & IS_NEW ) 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 ); _( "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 ); _( "Delete Last Corner" ), delete_xpm );
} }
else else
{
createPopUpMenuForZones( (ZONE_CONTAINER*) item, aPopMenu ); createPopUpMenuForZones( (ZONE_CONTAINER*) item, aPopMenu );
}
break; break;
case TYPE_TEXTE: case TYPE_TEXTE:
...@@ -216,10 +216,11 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -216,10 +216,11 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{ {
msg = AddHotkeyName( _( "Edit Dimension" ), g_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( _( "Edit Dimension" ), g_Board_Editor_Hokeys_Descr,
HK_EDIT_ITEM ); HK_EDIT_ITEM );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_DIMENSION, msg, edit_xpm ); AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_DIMENSION, msg, edit_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_DIMENSION, AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_DIMENSION,
_( "Delete Dimension" ), delete_xpm ); _( "Delete Dimension" ), delete_xpm );
} }
break; break;
case TYPE_MIRE: case TYPE_MIRE:
...@@ -227,35 +228,35 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -227,35 +228,35 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{ {
msg = AddHotkeyName( _( "Move Target" ), g_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( _( "Move Target" ), g_Board_Editor_Hokeys_Descr,
HK_MOVE_ITEM ); 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, msg = AddHotkeyName( _( "Edit Target" ), g_Board_Editor_Hokeys_Descr,
HK_EDIT_ITEM ); HK_EDIT_ITEM );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_MIRE, msg, edit_xpm ); AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_MIRE, msg, edit_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MIRE, AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_MIRE,
_( "Delete Target" ), delete_xpm ); _( "Delete Target" ), delete_xpm );
} }
break; break;
case TYPE_EDGE_MODULE: case TYPE_EDGE_MODULE:
case TYPE_SCREEN: case TYPE_SCREEN:
case TYPE_NOT_INIT: case TYPE_NOT_INIT:
case TYPE_PCB: case TYPE_PCB:
msg.Printf( msg.Printf( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unexpected DrawType %d" ),
wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unexpected DrawType %d" ), item->Type() );
item->Type() );
DisplayError( this, msg ); DisplayError( this, msg );
SetCurItem( NULL ); SetCurItem( NULL );
break; break;
default: default:
msg.Printf( msg.Printf( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unknown DrawType %d" ),
wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unknown DrawType %d" ), item->Type() );
item->Type() );
DisplayError( this, msg ); DisplayError( this, msg );
// Attempt to clear error (but should no occurs ) // Attempt to clear error (but should no occurs )
if( item->Type() >= MAX_STRUCT_TYPE_ID ) if( item->Type() >= MAX_STRUCT_TYPE_ID )
SetCurItem( NULL ); SetCurItem( NULL );
break; break;
} }
...@@ -266,8 +267,8 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -266,8 +267,8 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{ {
msg = AddHotkeyName( _( "Get and Move Footprint" ), msg = AddHotkeyName( _( "Get and Move Footprint" ),
g_Board_Editor_Hokeys_Descr, HK_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 ); msg, move_module_xpm );
} }
/* Display context sensitive comands: */ /* Display context sensitive comands: */
...@@ -277,27 +278,27 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -277,27 +278,27 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
if( GetBoard()->m_ZoneDescriptorList.size() > 0 ) if( GetBoard()->m_ZoneDescriptorList.size() > 0 )
{ {
aPopMenu->AppendSeparator(); 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 ); _( "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 ); _( "Remove Filled Areas in All Zones" ), fill_zone_xpm );
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
} }
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_LAYER, AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_LAYER,
_( "Select Working Layer" ), select_w_layer_xpm ); _( "Select Working Layer" ), select_w_layer_xpm );
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
break; break;
case ID_TRACK_BUTT: case ID_TRACK_BUTT:
if ( ! locate_track ) // This menu is already added when a track is located if ( ! locate_track ) // This menu is already added when a track is located
ADD_MENUITEM_WITH_SUBMENU( aPopMenu, Append_Track_Width_List( GetBoard() ), AddMenuItem( aPopMenu, Append_Track_Width_List( GetBoard() ),
ID_POPUP_PCB_SELECT_WIDTH, ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ), width_track_xpm );
_( "Select Track Width" ), width_track_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_CU_LAYER, AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_CU_LAYER,
_( "Select Working Layer" ), select_w_layer_xpm ); _( "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 ); _( "Select Layer Pair for Vias" ), select_layer_pair_xpm );
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
break; break;
...@@ -306,14 +307,14 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -306,14 +307,14 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
case ID_PCB_ADD_TEXT_BUTT: case ID_PCB_ADD_TEXT_BUTT:
case ID_PCB_ADD_LINE_BUTT: case ID_PCB_ADD_LINE_BUTT:
case ID_PCB_DIMENSION_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 ); _( "Select Working Layer" ), select_w_layer_xpm );
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
break; break;
case ID_PCB_MODULE_BUTT: 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 ); _( "Footprint Documentation" ), book_xpm );
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
break; break;
...@@ -321,23 +322,23 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -321,23 +322,23 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_MODE_MODULE ) if( m_HTOOL_current_state == ID_TOOLBARH_PCB_MODE_MODULE )
{ {
wxMenu* commands = new wxMenu; 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 ); _( "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 ); _( "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 ); _( "Lock All Modules" ), locked_xpm );
commands->AppendSeparator(); commands->AppendSeparator();
ADD_MENUITEM( commands, ID_POPUP_PCB_AUTOMOVE_ALL_MODULES, AddMenuItem( commands, ID_POPUP_PCB_AUTOMOVE_ALL_MODULES,
_( "Move All Modules" ), move_xpm ); _( "Move All Modules" ), move_xpm );
commands->Append( ID_POPUP_PCB_AUTOMOVE_NEW_MODULES, _( "Move New Modules" ) ); commands->Append( ID_POPUP_PCB_AUTOMOVE_NEW_MODULES, _( "Move New Modules" ) );
commands->AppendSeparator(); commands->AppendSeparator();
commands->Append( ID_POPUP_PCB_AUTOPLACE_ALL_MODULES, _( "Autoplace All Modules" ) ); commands->Append( ID_POPUP_PCB_AUTOPLACE_ALL_MODULES, _( "Autoplace All Modules" ) );
commands->Append( ID_POPUP_PCB_AUTOPLACE_NEW_MODULES, _( "Autoplace New Modules" ) ); commands->Append( ID_POPUP_PCB_AUTOPLACE_NEW_MODULES, _( "Autoplace New Modules" ) );
commands->Append( ID_POPUP_PCB_AUTOPLACE_NEXT_MODULE, _( "Autoplace Next Module" ) ); commands->Append( ID_POPUP_PCB_AUTOPLACE_NEXT_MODULE, _( "Autoplace Next Module" ) );
commands->AppendSeparator(); 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 ); _( "Orient All Modules" ), rotate_module_pos_xpm );
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
} }
...@@ -345,8 +346,8 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -345,8 +346,8 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{ {
wxMenu* commands = new wxMenu; wxMenu* commands = new wxMenu;
aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_COMMANDS, _( "Autoroute" ), commands ); 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 ); _( "Select Layer Pair" ), select_layer_pair_xpm );
commands->AppendSeparator(); commands->AppendSeparator();
commands->Append( ID_POPUP_PCB_AUTOROUTE_ALL_MODULES, _( "Autoroute All Modules" ) ); commands->Append( ID_POPUP_PCB_AUTOROUTE_ALL_MODULES, _( "Autoroute All Modules" ) );
commands->AppendSeparator(); commands->AppendSeparator();
...@@ -355,11 +356,12 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -355,11 +356,12 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
} }
if( locate_track ) 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" ), ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ),
width_track_xpm ); width_track_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_LAYER,
_( "Select Working Layer" ), select_w_layer_xpm ); AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_LAYER,
_( "Select Working Layer" ), select_w_layer_xpm );
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
break; break;
} }
...@@ -373,14 +375,14 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -373,14 +375,14 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
*/ */
void PCB_EDIT_FRAME::createPopUpBlockMenu( wxMenu* menu ) void PCB_EDIT_FRAME::createPopUpBlockMenu( wxMenu* menu )
{ {
ADD_MENUITEM( menu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ), cancel_xpm ); AddMenuItem( 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_ZOOM_BLOCK, _( "Zoom Block" ), zoom_area_xpm );
menu->AppendSeparator(); menu->AppendSeparator();
ADD_MENUITEM( menu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), apply_xpm ); AddMenuItem( menu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), apply_xpm );
ADD_MENUITEM( menu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), copyblock_xpm ); AddMenuItem( menu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), copyblock_xpm );
ADD_MENUITEM( menu, ID_POPUP_FLIP_BLOCK, _( "Flip Block" ), invert_module_xpm ); AddMenuItem( menu, ID_POPUP_FLIP_BLOCK, _( "Flip Block" ), invert_module_xpm );
ADD_MENUITEM( menu, ID_POPUP_ROTATE_BLOCK, _( "Rotate Block" ), rotate_ccw_xpm ); AddMenuItem( 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_DELETE_BLOCK, _( "Delete Block" ), delete_xpm );
} }
...@@ -402,35 +404,35 @@ void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) ...@@ -402,35 +404,35 @@ void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
{ {
if( Track->Type() == TYPE_VIA ) 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 else
{ {
if( Track->IsPointOnEnds( cursorPosition, -1 ) != 0 ) if( Track->IsPointOnEnds( cursorPosition, -1 ) != 0 )
{ {
msg = AddHotkeyName( _( "Move Node" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); 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 ); msg, move_xpm );
} }
else else
{ {
msg = AddHotkeyName( _( "Drag Segments, Keep Slope" ), g_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( _( "Drag Segments, Keep Slope" ), g_Board_Editor_Hokeys_Descr,
HK_DRAG_TRACK_KEEP_SLOPE ); 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, drag_segment_withslope_xpm );
msg = AddHotkeyName( _( "Drag Segment" ), g_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( _( "Drag Segment" ), g_Board_Editor_Hokeys_Descr,
HK_DRAG_ITEM ); 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 ); 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 ); _( "Break Track" ), break_line_xpm );
} }
} }
} }
else if( flags & IS_DRAGGED ) // Drag via or node in progress 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 ); _( "Place Node" ), apply_xpm );
return; return;
} }
else // Edition in progress else // Edition in progress
...@@ -438,8 +440,9 @@ void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) ...@@ -438,8 +440,9 @@ void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
if( flags & IS_NEW ) if( flags & IS_NEW )
{ {
msg = AddHotkeyName( _( "End Track" ), g_Board_Editor_Hokeys_Descr, HK_END_TRACK ); 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 ); msg = AddHotkeyName( _( "Place Via" ), g_Board_Editor_Hokeys_Descr, HK_ADD_VIA );
PopMenu->Append( ID_POPUP_PCB_PLACE_VIA, msg ); PopMenu->Append( ID_POPUP_PCB_PLACE_VIA, msg );
...@@ -463,55 +466,52 @@ void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) ...@@ -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, msg = AddHotkeyName( _( "Change Via Size and Drill" ), g_Board_Editor_Hokeys_Descr,
HK_EDIT_ITEM ); 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 else
{ {
msg = AddHotkeyName( _( "Change Segment Width" ), g_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( _( "Change Segment Width" ), g_Board_Editor_Hokeys_Descr,
HK_EDIT_ITEM ); 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 );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TRACK, AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TRACK,
_( "Change Track Width" ), width_track_xpm ); _( "Change Track Width" ), width_track_xpm );
} }
} }
// Allows switching to an other track/via size when routing // Allows switching to an other track/via size when routing
ADD_MENUITEM_WITH_SUBMENU( PopMenu, Append_Track_Width_List( GetBoard() ), AddMenuItem( PopMenu, Append_Track_Width_List( GetBoard() ), ID_POPUP_PCB_SELECT_WIDTH,
ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ), width_track_xpm );
_( "Select Track Width" ), width_track_xpm );
// Delete control: // Delete control:
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
wxMenu* track_mnu = new wxMenu; wxMenu* track_mnu = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu, ID_POPUP_PCB_DELETE_TRACK_MNU, AddMenuItem( PopMenu, track_mnu, ID_POPUP_PCB_DELETE_TRACK_MNU, _( "Delete" ), delete_xpm );
_( "Delete" ), delete_xpm );
msg = AddHotkeyName( Track->Type()==TYPE_VIA ? msg = AddHotkeyName( Track->Type()==TYPE_VIA ?
_( "Delete Via" ) : _( "Delete Segment" ), _( "Delete Via" ) : _( "Delete Segment" ),
g_Board_Editor_Hokeys_Descr, HK_BACK_SPACE ); 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 ) if( !flags )
{ {
msg = AddHotkeyName( _( "Delete Track" ), g_Board_Editor_Hokeys_Descr, HK_DELETE ); msg = AddHotkeyName( _( "Delete Track" ), g_Board_Editor_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACK, msg, delete_track_xpm ); AddMenuItem( 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_TRACKNET, _( "Delete Net" ), delete_net_xpm );
} }
// Add global edition command // Add global edition command
if( !flags ) if( !flags )
{ {
PopMenu->AppendSeparator(); 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 ); _( "Global Tracks and Vias Edition" ), width_track_via_xpm );
} }
// Add lock/unlock flags menu: // Add lock/unlock flags menu:
track_mnu = new wxMenu; track_mnu = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu, AddMenuItem( PopMenu, track_mnu, ID_POPUP_PCB_SETFLAGS_TRACK_MNU, _( "Set Flags" ), flag_xpm );
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_ON_TRACKSEG, _( "Locked: Yes" ), wxEmptyString, true );
track_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, _( "Locked: No" ), wxEmptyString, true ); track_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, _( "Locked: No" ), wxEmptyString, true );
...@@ -539,72 +539,73 @@ void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* ...@@ -539,72 +539,73 @@ void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu*
if( edge_zone->m_Flags == IS_DRAGGED ) 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 ); _( "Place Edge Outline" ), apply_xpm );
} }
else if( edge_zone->m_Flags ) else if( edge_zone->m_Flags )
{ {
if( (edge_zone->m_Flags & IN_EDIT ) ) 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 ); _( "Place Corner" ), apply_xpm );
else else
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_OUTLINES, AddMenuItem( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_OUTLINES,
_( "Place Zone" ), apply_xpm ); _( "Place Zone" ), apply_xpm );
} }
else else
{ {
wxMenu* zones_menu = new wxMenu(); wxMenu* zones_menu = new wxMenu();
ADD_MENUITEM_WITH_SUBMENU( aPopMenu, zones_menu, AddMenuItem( aPopMenu, zones_menu, -1, _( "Zones" ), add_zone_xpm );
-1, _( "Zones" ), add_zone_xpm );
if( edge_zone->HitTestForCorner( GetScreen()->RefPos( true ) ) ) 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 ); _( "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 ); _( "Delete Corner" ), delete_xpm );
} }
else if( edge_zone->HitTestForEdge( GetScreen()->RefPos( true ) ) ) 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 ); _( "Create Corner" ), add_corner_xpm );
msg = AddHotkeyName( _( "Drag Outline Segment" ), g_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( _( "Drag Outline Segment" ), g_Board_Editor_Hokeys_Descr,
HK_DRAG_ITEM ); 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 ); msg, drag_outline_segment_xpm );
} }
zones_menu->AppendSeparator(); 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 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 ); _( "Add Cutout Area" ), add_zone_cutout_xpm );
zones_menu->AppendSeparator(); 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 ) 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 ); _( "Remove Filled Areas in Zone" ), fill_zone_xpm );
} }
msg = AddHotkeyName( _( "Move Zone" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); 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 ); 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 ); msg, edit_xpm );
zones_menu->AppendSeparator(); zones_menu->AppendSeparator();
if( edge_zone->m_CornerSelection >= 0 && if( edge_zone->m_CornerSelection >= 0 &&
edge_zone->m_Poly->IsCutoutContour( edge_zone->m_CornerSelection ) ) 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 ); _( "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 ); _( "Delete Zone Outline" ), delete_xpm );
} }
} }
...@@ -620,34 +621,34 @@ void PCB_EDIT_FRAME::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu ...@@ -620,34 +621,34 @@ void PCB_EDIT_FRAME::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu
sub_menu_footprint = new wxMenu; sub_menu_footprint = new wxMenu;
msg = aModule->GetSelectMenuText(); 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 ) if( !flags )
{ {
msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); 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, move_module_xpm );
msg = AddHotkeyName( _( "Drag" ), g_Board_Editor_Hokeys_Descr, HK_DRAG_ITEM ); 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, drag_module_xpm );
} }
msg = AddHotkeyName( _( "Rotate +" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM ); 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 ); 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 ); _( "Rotate -" ), rotate_module_neg_xpm );
msg = AddHotkeyName( _( "Flip" ), g_Board_Editor_Hokeys_Descr, HK_FLIP_FOOTPRINT ); 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 ); msg, invert_module_xpm );
if( !flags ) if( !flags )
{ {
msg = AddHotkeyName( _( "Edit" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); 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(); 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 ); _( "Delete Module" ), delete_module_xpm );
} }
} }
...@@ -663,32 +664,32 @@ void PCB_EDIT_FRAME::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* me ...@@ -663,32 +664,32 @@ void PCB_EDIT_FRAME::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* me
sub_menu_Fp_text = new wxMenu; 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 ) if( !flags )
{ {
msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); 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, move_field_xpm );
} }
msg = AddHotkeyName( _( "Rotate" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM ); 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 ); msg, rotate_field_xpm );
if( !flags ) if( !flags )
{ {
msg = AddHotkeyName( _( "Edit" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); 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 ); 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 ); _( "Reset Size" ), reset_text_xpm );
} }
// Graphic texts can be deleted only if are not currently edited. // Graphic texts can be deleted only if are not currently edited.
if( !flags && FpText->m_Type == TEXT_is_DIVERS ) 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 ); _( "Delete" ), delete_xpm );
} }
if( !flags ) if( !flags )
...@@ -722,30 +723,30 @@ void PCB_EDIT_FRAME::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu ) ...@@ -722,30 +723,30 @@ void PCB_EDIT_FRAME::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu )
wxString msg = Pad->GetSelectMenuText(); wxString msg = Pad->GetSelectMenuText();
sub_menu_Pad = new wxMenu; 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 ); AddMenuItem( 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_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(); 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" ), _( "Copy Current Settings to this Pad" ),
wxEmptyString, wxEmptyString,
options_new_pad_xpm ); 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" ), _( "Copy this Pad Settings to Current Settings" ),
wxEmptyString, wxEmptyString,
export_options_pad_xpm ); 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" ), _( "Global Pads Edition" ),
_( "Copy this pad settings to all pads in this footprint (or similar footprints)" ), _( "Copy this pad settings to all pads in this footprint (or similar footprints)" ),
global_options_pad_xpm ); global_options_pad_xpm );
sub_menu_Pad->AppendSeparator(); 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 ) if( m_HTOOL_current_state == ID_TOOLBARH_PCB_MODE_TRACKS )
{ {
...@@ -773,30 +774,30 @@ void PCB_EDIT_FRAME::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu ) ...@@ -773,30 +774,30 @@ void PCB_EDIT_FRAME::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu )
sub_menu_Text = new wxMenu; 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 ) if( !flags )
{ {
msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); 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, move_text_xpm );
} }
msg = AddHotkeyName( _( "Rotate" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM ); 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 ); 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 ); AddMenuItem( 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_RESET_TEXT_SIZE,
_( "Reset Size" ), reset_text_xpm ); _( "Reset Size" ), reset_text_xpm );
sub_menu_Text->AppendSeparator(); 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 ) void PCB_EDIT_FRAME::createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu )
{ {
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MARKER, _( "Delete Marker" ), delete_xpm ); AddMenuItem( 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_GETINFO_MARKER, _( "Marker Error Info" ), info_xpm );
} }
...@@ -851,11 +852,14 @@ static wxMenu* Append_Track_Width_List( BOARD* aBoard ) ...@@ -851,11 +852,14 @@ static wxMenu* Append_Track_Width_List( BOARD* aBoard )
PCB_INTERNAL_UNIT, true ); PCB_INTERNAL_UNIT, true );
if( aBoard->m_ViasDimensionsList[ii].m_Drill <= 0 ) if( aBoard->m_ViasDimensionsList[ii].m_Drill <= 0 )
{
msg.Printf( _( "Via %s" ), GetChars( value ) ); msg.Printf( _( "Via %s" ), GetChars( value ) );
}
else else
{ {
msg.Printf( _( "Via %s; (drl %s)" ), GetChars( value ), GetChars( drill ) ); msg.Printf( _( "Via %s; (drl %s)" ), GetChars( value ), GetChars( drill ) );
} }
if( ii == 0 ) if( ii == 0 )
msg << _( " (use NetClass)" ); msg << _( " (use NetClass)" );
......
...@@ -224,8 +224,9 @@ void Calcule_Coord_Extremite_45( const wxPoint& aPosition, int ox, int oy, int* ...@@ -224,8 +224,9 @@ void Calcule_Coord_Extremite_45( const wxPoint& aPosition, int ox, int oy, int*
* interesting segments * interesting segments
* @param aTrackLen = a pointer to an integer where to return the lenght of the * @param aTrackLen = a pointer to an integer where to return the lenght of the
* track * track
* @param aLengthDie = a pointer to an integer where to return the extra lengths inside integrated circuits * @param aLengthDie = a pointer to an integer where to return the extra lengths inside
* from the pads connected to this track to the die (if any) * integrated circuits from the pads connected to this track to the
* die (if any)
* @param aReorder = true for reorder the interesting segments (useful for * @param aReorder = true for reorder the interesting segments (useful for
* track edition/deletion) in this case the flag BUSY is * track edition/deletion) in this case the flag BUSY is
* set (the user is responsible of flag clearing). False * set (the user is responsible of flag clearing). False
......
...@@ -28,30 +28,6 @@ static void Marque_Chaine_segments( BOARD* Pcb, ...@@ -28,30 +28,6 @@ static void Marque_Chaine_segments( BOARD* Pcb,
TRACK_PTRS* aList ); 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* Marque_Une_Piste( BOARD* aPcb,
TRACK* aStartSegm, TRACK* aStartSegm,
int* aSegmCount, 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