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.
......
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.
This diff is collapsed.
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)
......
This diff is collapsed.
...@@ -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 */
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,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() )
......
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