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"
...@@ -136,30 +134,30 @@ void EDA_3D_FRAME::ReCreateMenuBar() ...@@ -136,30 +134,30 @@ 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 ) );
} }
......
...@@ -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,7 +363,7 @@ void EDA_BASE_FRAME::AddHelpVersionInfoMenuEntry( wxMenu* aMenu ) ...@@ -364,7 +363,7 @@ 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,7 +841,7 @@ void WinEDA_App::AddMenuLanguageList( wxMenu* MasterMenu ) ...@@ -848,7 +841,7 @@ 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!)" ),
......
...@@ -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,8 +301,10 @@ int ReturnKeyCodeFromKeyName( const wxString& keyname ) ...@@ -297,8 +301,10 @@ 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,8 +517,7 @@ int EDA_BASE_FRAME::ReadHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aDe ...@@ -504,8 +517,7 @@ 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 */
...@@ -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,14 +652,14 @@ void AddHotkeyConfigMenu( wxMenu* aMenu ) ...@@ -635,14 +652,14 @@ 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 ) );
...@@ -650,21 +667,20 @@ void AddHotkeyConfigMenu( wxMenu* aMenu ) ...@@ -650,21 +667,20 @@ void AddHotkeyConfigMenu( wxMenu* aMenu )
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,19 +152,19 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu ) ...@@ -154,19 +152,19 @@ 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 ) );
...@@ -190,7 +188,7 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu ) ...@@ -190,7 +188,7 @@ 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;
...@@ -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,7 +37,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar() ...@@ -39,7 +37,7 @@ 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" ),
...@@ -56,7 +54,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar() ...@@ -56,7 +54,7 @@ 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 );
...@@ -65,14 +63,14 @@ void CVPCB_MAINFRAME::ReCreateMenuBar() ...@@ -65,14 +63,14 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
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" ),
...@@ -82,7 +80,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar() ...@@ -82,7 +80,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
// Quit // Quit
ADD_MENUITEM_WITH_HELP( filesMenu, AddMenuItem( filesMenu,
wxID_EXIT, wxID_EXIT,
_( "&Quit" ), _( "&Quit" ),
_( "Quit CvPcb" ), _( "Quit CvPcb" ),
...@@ -92,7 +90,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar() ...@@ -92,7 +90,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
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..." ),
...@@ -115,11 +113,11 @@ void CVPCB_MAINFRAME::ReCreateMenuBar() ...@@ -115,11 +113,11 @@ 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 );
...@@ -131,12 +129,12 @@ void CVPCB_MAINFRAME::ReCreateMenuBar() ...@@ -131,12 +129,12 @@ 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 );
......
...@@ -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.
......
This diff is collapsed.
...@@ -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 );
......
This diff is collapsed.
...@@ -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,14 +37,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -38,14 +37,14 @@ 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..." ),
...@@ -55,14 +54,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -55,14 +54,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
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" ),
...@@ -72,7 +71,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -72,7 +71,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
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" ),
...@@ -84,7 +83,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -84,7 +83,7 @@ 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" ),
...@@ -92,7 +91,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -92,7 +91,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// 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" ),
...@@ -102,7 +101,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -102,7 +101,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
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,
...@@ -126,67 +125,63 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -126,67 +125,63 @@ 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,
...@@ -196,14 +191,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -196,14 +191,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
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" ),
...@@ -219,14 +214,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -219,14 +214,14 @@ 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" ),
...@@ -239,12 +234,12 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -239,12 +234,12 @@ 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" ),
...@@ -252,7 +247,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -252,7 +247,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// 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" ),
......
This diff is collapsed.
...@@ -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,35 +34,37 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -35,35 +34,37 @@ 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" ),
...@@ -71,12 +72,14 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -71,12 +72,14 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
// 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" ),
...@@ -86,7 +89,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -86,7 +89,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
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" ),
...@@ -96,7 +99,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -96,7 +99,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
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" ),
...@@ -106,7 +109,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -106,7 +109,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
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" ),
...@@ -116,7 +119,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -116,7 +119,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
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" ),
...@@ -126,7 +129,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -126,7 +129,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
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" ),
...@@ -137,7 +140,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -137,7 +140,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
#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" ),
...@@ -155,14 +158,14 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -155,14 +158,14 @@ 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" ),
...@@ -172,7 +175,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -172,7 +175,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
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" ),
...@@ -182,7 +185,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -182,7 +185,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
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" ),
...@@ -195,14 +198,14 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -195,14 +198,14 @@ 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" ),
......
...@@ -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,10 +32,10 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -34,10 +32,10 @@ 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, {
AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel" ), cancel_xpm ); _( "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 ) \
Angle += 3600; \
while( Angle > 3600 ) \ while( Angle > 3600 ) \
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 ) \
Angle += 3600; \
while( Angle >= 3600 ) \ while( Angle >= 3600 ) \
Angle -= 3600;} Angle -= 3600; }
#define NEGATE_AND_NORMALIZE_ANGLE_POS( Angle ) \ #define NEGATE_AND_NORMALIZE_ANGLE_POS( Angle ) { \
{ Angle = -Angle; while( Angle < 0 ) \ Angle = -Angle; \
Angle += 3600;while( Angle >= 3600 ) \ while( Angle < 0 ) \
Angle -= 3600;} 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 ) \
Angle += 1800; \
while( Angle > 900 ) \ while( Angle > 900 ) \
Angle -= 1800;} 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 ) \
Angle += 3600; \
while( Angle > 1800 ) \ while( Angle > 1800 ) \
Angle -= 3600;} 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 */
This diff is collapsed.
...@@ -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,7 +82,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() ...@@ -83,7 +82,7 @@ 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" ),
...@@ -91,27 +90,29 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() ...@@ -91,27 +90,29 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// 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" ),
...@@ -119,14 +120,14 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() ...@@ -119,14 +120,14 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// 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" ),
...@@ -136,7 +137,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() ...@@ -136,7 +137,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Quit // Quit
ADD_MENUITEM_WITH_HELP( fileMenu, AddMenuItem( fileMenu,
wxID_EXIT, wxID_EXIT,
_( "&Quit" ), _( "&Quit" ),
_( "Quit KiCad" ), _( "Quit KiCad" ),
...@@ -146,14 +147,14 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() ...@@ -146,14 +147,14 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
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" ),
...@@ -163,7 +164,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() ...@@ -163,7 +164,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
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" ),
...@@ -200,14 +201,14 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() ...@@ -200,14 +201,14 @@ 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" ),
...@@ -224,12 +225,12 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() ...@@ -224,12 +225,12 @@ 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" ),
...@@ -239,7 +240,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() ...@@ -239,7 +240,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
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" ),
......
...@@ -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,7 +69,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() ...@@ -71,7 +69,7 @@ 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 );
...@@ -188,7 +186,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() ...@@ -188,7 +186,7 @@ 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" ),
...@@ -302,12 +300,12 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() ...@@ -302,12 +300,12 @@ 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" ),
...@@ -315,7 +313,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() ...@@ -315,7 +313,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// 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 );
......
...@@ -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,14 +52,16 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -54,14 +52,16 @@ 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 );
...@@ -136,7 +136,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -136,7 +136,7 @@ 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,7 +153,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -153,7 +153,7 @@ 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,7 +189,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -189,7 +189,7 @@ 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 );
...@@ -240,7 +240,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -240,7 +240,7 @@ 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" ),
...@@ -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 );
...@@ -556,7 +548,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -556,7 +548,7 @@ 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 );
...@@ -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,12 +634,12 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -643,12 +634,12 @@ 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" ),
...@@ -656,7 +647,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -656,7 +647,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// 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 );
......
...@@ -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,7 +99,7 @@ BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode ) ...@@ -100,7 +99,7 @@ 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 );
...@@ -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() )
......
This diff is collapsed.
...@@ -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 );
......
This diff is collapsed.
...@@ -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