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

Add menu item function fixes and other minor improvements.

* Rename all ADD_MENUITEM_* functions to AddMenuItem and move them to
  wxstruct.h since they are used by the Kicad main frame classes.
* Move SET_BITMAP and SETBITMAPS definitions to wxstruct.h.
* Fix a bug in SET_BITMAPS that prevented enabling menu item images on
  OSX.
* Rename MsgItem to EDA_MSG_ITEM.
* Remove redundant includes from modified files.
* Doxygen and coding style policy fixes.
parent fd486a11
......@@ -3,8 +3,6 @@
/********************/
#include "fctsys.h"
#include "macros.h"
#include "bitmaps.h"
#include "3d_viewer.h"
......@@ -136,30 +134,30 @@ void EDA_3D_FRAME::ReCreateMenuBar()
wxMenu* referencesMenu = new wxMenu;
menuBar->Append( referencesMenu, _( "&Preferences" ) );
ADD_MENUITEM( referencesMenu, ID_MENU3D_BGCOLOR_SELECTION,
AddMenuItem( referencesMenu, ID_MENU3D_BGCOLOR_SELECTION,
_( "Choose background color" ), KiBitmap( palette_xpm ) );
ADD_MENUITEM( referencesMenu, ID_MENU3D_AXIS_ONOFF,
AddMenuItem( referencesMenu, ID_MENU3D_AXIS_ONOFF,
_( "3D Axis On/Off" ), KiBitmap( axis3d_front_xpm ) );
if( full_options )
{
ADD_MENUITEM( referencesMenu, ID_MENU3D_MODULE_ONOFF,
AddMenuItem( referencesMenu, ID_MENU3D_MODULE_ONOFF,
_( "3D Footprints Shapes On/Off" ), KiBitmap( shape_3d_xpm ) );
ADD_MENUITEM( referencesMenu, ID_MENU3D_ZONE_ONOFF,
AddMenuItem( referencesMenu, ID_MENU3D_ZONE_ONOFF,
_( "Zone Filling On/Off" ), KiBitmap( add_zone_xpm ) );
ADD_MENUITEM( referencesMenu, ID_MENU3D_COMMENTS_ONOFF,
AddMenuItem( referencesMenu, ID_MENU3D_COMMENTS_ONOFF,
_( "Comments Layer On/Off" ), KiBitmap( edit_sheet_xpm ) );
ADD_MENUITEM( referencesMenu, ID_MENU3D_DRAWINGS_ONOFF,
AddMenuItem( referencesMenu, ID_MENU3D_DRAWINGS_ONOFF,
_( "Drawings Layer On/Off" ), KiBitmap( add_polygon_xpm ) );
ADD_MENUITEM( referencesMenu, ID_MENU3D_ECO1_ONOFF,
AddMenuItem( referencesMenu, ID_MENU3D_ECO1_ONOFF,
_( "Eco1 Layer On/Off" ), KiBitmap( tools_xpm ) );
ADD_MENUITEM( referencesMenu, ID_MENU3D_ECO2_ONOFF,
AddMenuItem( referencesMenu, ID_MENU3D_ECO2_ONOFF,
_( "Eco2 Layer On/Off" ), KiBitmap( tools_xpm ) );
}
......
......@@ -12,14 +12,13 @@
#include "build_version.h"
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "online_help.h"
#include "id.h"
#include "confirm.h"
#include "eda_doc.h"
#include "wxstruct.h"
#include "macros.h"
#include "bitmaps.h"
/*
* Class constructor for EDA_BASE_FRAME general options
......@@ -364,7 +363,7 @@ void EDA_BASE_FRAME::AddHelpVersionInfoMenuEntry( wxMenu* aMenu )
wxASSERT( aMenu != NULL );
// Copy version string to clipboard for bug report purposes.
ADD_MENUITEM_WITH_HELP( aMenu, ID_HELP_COPY_VERSION_STRING,
AddMenuItem( aMenu, ID_HELP_COPY_VERSION_STRING,
_( "Copy &Version Information" ),
_( "Copy the version string to clipboard to send with bug reports" ),
KiBitmap( copy_button_xpm ) );
......
/***************/
/* edaappl.cpp */
/***************/
/***
* @file edaapl.cpp
*
......@@ -21,15 +17,14 @@
#include <wx/tokenzr.h>
#include "appl_wxstruct.h"
#include "common.h"
#include "wxstruct.h"
#include "macros.h"
#include "param_config.h"
#include "worksheet.h"
#include "id.h"
#include "build_version.h"
#include "hotkeys_basic.h"
#include "macros.h"
#include "online_help.h"
#include "bitmaps.h"
#include "gestfich.h"
......@@ -242,15 +237,12 @@ static struct LANGUAGE_DESCR s_Language_List[] =
};
/**
* WinEDA_App Constructor
*/
WinEDA_App::WinEDA_App()
{
m_Checker = NULL;
m_HtmlCtrl = NULL;
m_EDA_Config = NULL;
m_Env_Defined = FALSE;
m_Env_Defined = false;
m_LanguageId = wxLANGUAGE_DEFAULT;
m_PdfBrowserIsDefault = true;
m_Locale = NULL;
......@@ -259,9 +251,6 @@ WinEDA_App::WinEDA_App()
}
/**
* WinEDA_App Destructor
*/
WinEDA_App::~WinEDA_App()
{
SaveSettings();
......@@ -269,11 +258,15 @@ WinEDA_App::~WinEDA_App()
/* delete user datas */
if( m_ProjectConfig )
delete m_ProjectConfig;
if( m_EDA_CommonConfig )
delete m_EDA_CommonConfig;
delete m_EDA_Config;
if( m_Checker )
delete m_Checker;
delete m_Locale;
}
......@@ -848,7 +841,7 @@ void WinEDA_App::AddMenuLanguageList( wxMenu* MasterMenu )
menu->Append( item );
}
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( MasterMenu, menu,
AddMenuItem( MasterMenu, menu,
ID_LANGUAGE_CHOICE,
_( "Language" ),
_( "Select application language (only for testing!)" ),
......
......@@ -7,15 +7,13 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "hotkeys_basic.h"
#include "macros.h"
#include "bitmaps.h"
#include "id.h"
#include "confirm.h"
#include "kicad_string.h"
#include "gestfich.h"
#include "wxstruct.h"
#include "macros.h"
#include "dialog_hotkeys_editor.h"
#include <wx/apptrait.h>
......@@ -133,8 +131,10 @@ wxString ReturnKeyNameFromKeyCode( int aKeycode, bool* aIsFound )
if( (aKeycode & GR_KB_CTRL) != 0 )
modifier << MODIFIER_CTRL;
if( (aKeycode & GR_KB_ALT) != 0 )
modifier << MODIFIER_ALT;
if( (aKeycode & GR_KB_SHIFT) != 0 )
modifier << MODIFIER_SHIFT;
......@@ -143,7 +143,7 @@ wxString ReturnKeyNameFromKeyCode( int aKeycode, bool* aIsFound )
if( (aKeycode > ' ') && (aKeycode < 0x7F ) )
{
found = true;
keyname.Append((wxChar)aKeycode);
keyname.Append( (wxChar)aKeycode );
}
else
{
......@@ -165,6 +165,7 @@ wxString ReturnKeyNameFromKeyCode( int aKeycode, bool* aIsFound )
if( aIsFound )
*aIsFound = found;
fullkeyname = modifier + keyname;
return fullkeyname;
}
......@@ -195,6 +196,7 @@ wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList,
else
msg << wxT( " <" ) << keyname << wxT( ">" );
}
return msg;
}
......@@ -223,12 +225,14 @@ wxString AddHotkeyName( const wxString& aText,
{
List = aDescList->m_HK_InfoList;
keyname = ReturnKeyNameFromCommandId( List, aCommandId );
if( !keyname.IsEmpty() )
{
if( aIsShortCut )
msg << wxT( "\t" ) << keyname;
else
msg << wxT( " <" ) << keyname << wxT( ">" );
break;
}
}
......@@ -252,6 +256,7 @@ wxString ReturnKeyNameFromCommandId( Ki_HotkeyInfo** aList, int aCommandId )
for( ; *aList != NULL; aList++ )
{
Ki_HotkeyInfo* hk_decr = *aList;
if( hk_decr->m_Idcommand == aCommandId )
{
keyname = ReturnKeyNameFromKeyCode( hk_decr->m_KeyCode );
......@@ -285,7 +290,6 @@ int ReturnKeyCodeFromKeyName( const wxString& keyname )
modifier |= GR_KB_CTRL;
key.Remove( 0, 5 );
}
else if( key.StartsWith( MODIFIER_ALT ) )
{
modifier |= GR_KB_ALT;
......@@ -297,8 +301,10 @@ int ReturnKeyCodeFromKeyName( const wxString& keyname )
key.Remove( 0, 6 );
}
else
{
break;
}
}
if( (key.length() == 1) && (key[0] > ' ') && (key[0] < 0x7F) )
{
......@@ -338,6 +344,7 @@ void DisplayHotkeyList( EDA_DRAW_FRAME* aFrame,
for( ; aDescList->m_HK_InfoList != NULL; aDescList++ )
{
List = aDescList->m_HK_InfoList;
for( ; *List != NULL; List++ )
{
Ki_HotkeyInfo* hk_decr = *List;
......@@ -392,6 +399,7 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aD
/* Print the current hotkey list */
Ki_HotkeyInfo** List;
for( ; aDescList->m_HK_InfoList != NULL; aDescList++ )
{
if( aDescList->m_Comment )
......@@ -400,10 +408,12 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aD
msg += wxString( aDescList->m_Comment );
msg += wxT( "\n" );
}
msg += *aDescList->m_SectionTag;
msg += wxT( "\n" );
List = aDescList->m_HK_InfoList;
for( ; *List != NULL; List++ )
{
Ki_HotkeyInfo* hk_decr = *List;
......@@ -421,8 +431,11 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aD
if( aFullFileName )
{
FILE* file = wxFopen( *aFullFileName, wxT( "wt" ) );
if( file )
{
fputs( TO_UTF8( msg ), file );
}
else
{
msg.Printf( wxT( "Unable to write file %s" ), GetChars( *aFullFileName ) );
......@@ -504,8 +517,7 @@ int EDA_BASE_FRAME::ReadHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor* aDe
* lines starting by # are ignored (comments)
* lines like [xxx] are tags (example: [common] or [libedit] which identify sections
*/
void ParseHotkeyConfig(
const wxString& data,
void ParseHotkeyConfig( const wxString& data,
struct Ki_HotkeyInfoSectionDescriptor* aDescList )
{
/* Read the config */
......@@ -525,6 +537,7 @@ void ParseHotkeyConfig(
{
CurrentHotkeyList = 0;
Ki_HotkeyInfoSectionDescriptor* DList = aDescList;
for( ; DList->m_HK_InfoList; DList++ )
{
if( *DList->m_SectionTag == line_type )
......@@ -536,10 +549,13 @@ void ParseHotkeyConfig(
continue;
}
if( line_type == wxT( "$Endlist" ) )
break;
if( line_type != wxT( "shortcut" ) )
continue;
if( CurrentHotkeyList == NULL )
continue;
......@@ -559,6 +575,7 @@ void ParseHotkeyConfig(
if( hk_decr->m_InfoMsg == fctname )
{
int code = ReturnKeyCodeFromKeyName( keyname );
if( code )
hk_decr->m_KeyCode = code;
......@@ -635,14 +652,14 @@ void AddHotkeyConfigMenu( wxMenu* aMenu )
wxMenu* HotkeySubmenu = new wxMenu();
/* List existing hotkey menu*/
ADD_MENUITEM_WITH_HELP( HotkeySubmenu,
AddMenuItem( HotkeySubmenu,
ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
_( "List Current Keys" ),
_( "Displays the current hotkeys list and corresponding commands" ),
KiBitmap( info_xpm ) );
/* Call hotkeys editor*/
ADD_MENUITEM_WITH_HELP( HotkeySubmenu, ID_PREFERENCES_HOTKEY_SHOW_EDITOR,
AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_SHOW_EDITOR,
_( "Edit Hotkeys" ),
_( "Call the hotkeys editor" ),
KiBitmap( editor_xpm ) );
......@@ -650,21 +667,20 @@ void AddHotkeyConfigMenu( wxMenu* aMenu )
HotkeySubmenu->AppendSeparator();
/* create hotkey file to export current hotkeys config */
ADD_MENUITEM_WITH_HELP( HotkeySubmenu, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG,
AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG,
_( "Export Hotkeys Config" ),
_( "Create a hotkey configuration file to export the current hotkey config" ),
KiBitmap( save_setup_xpm ) );
/* Reload hotkey file */
ADD_MENUITEM_WITH_HELP( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG,
AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG,
_( "Import Hotkeys Config" ),
_( "Load an existing hotkey configuration file" ),
KiBitmap( reload_xpm ) );
/* Append HotkeySubmenu to menu */
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( aMenu, HotkeySubmenu,
AddMenuItem( aMenu, HotkeySubmenu,
ID_PREFERENCES_HOTKEY_SUBMENU, _( "Hotkeys" ),
_( "Hotkeys configuration and preferences" ),
KiBitmap( hotkeys_xpm ) );
}
......@@ -97,7 +97,7 @@ void EDA_MSG_PANEL::AppendMessage( const wxString& textUpper,
text = ( textUpper.Len() > textLower.Len() ) ? textUpper : textLower;
text.Append( ' ', pad );
MsgItem item;
EDA_MSG_ITEM item;
/* Don't put the first message a window client position 0. Offset by
* one 'W' character width. */
......@@ -133,7 +133,7 @@ void EDA_MSG_PANEL::SetMessage( int aXPosition, const wxString& aUpperText,
else
pos.x = m_last_x;
MsgItem item;
EDA_MSG_ITEM item;
item.m_X = pos.x;
......@@ -174,7 +174,7 @@ void EDA_MSG_PANEL::SetMessage( int aXPosition, const wxString& aUpperText,
}
void EDA_MSG_PANEL::showItem( wxDC& dc, const MsgItem& aItem )
void EDA_MSG_PANEL::showItem( wxDC& dc, const EDA_MSG_ITEM& aItem )
{
int color = aItem.m_Color;
......@@ -205,6 +205,7 @@ void EDA_MSG_PANEL::EraseMsgBox()
Refresh();
}
void EDA_MSG_PANEL::erase( wxDC* DC )
{
wxPen pen;
......
......@@ -7,9 +7,7 @@
*/
#include "fctsys.h"
#include "common.h"
#include "macros.h"
#include "bitmaps.h"
#include "id.h"
#include "class_drawpanel.h"
#include "class_base_screen.h"
......@@ -154,19 +152,19 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
BASE_SCREEN * screen = DrawPanel->GetScreen();
msg = AddHotkeyName( _( "Center" ), m_HotkeysZoomAndGridList, HK_ZOOM_CENTER );
ADD_MENUITEM( MasterMenu, ID_POPUP_ZOOM_CENTER, msg, KiBitmap( zoom_center_on_screen_xpm ) );
AddMenuItem( MasterMenu, ID_POPUP_ZOOM_CENTER, msg, KiBitmap( zoom_center_on_screen_xpm ) );
msg = AddHotkeyName( _( "Zoom in" ), m_HotkeysZoomAndGridList, HK_ZOOM_IN );
ADD_MENUITEM( MasterMenu, ID_POPUP_ZOOM_IN, msg, KiBitmap( zoom_in_xpm ) );
AddMenuItem( MasterMenu, ID_POPUP_ZOOM_IN, msg, KiBitmap( zoom_in_xpm ) );
msg = AddHotkeyName( _( "Zoom out" ), m_HotkeysZoomAndGridList, HK_ZOOM_OUT );
ADD_MENUITEM( MasterMenu, ID_POPUP_ZOOM_OUT, msg, KiBitmap( zoom_out_xpm ) );
AddMenuItem( MasterMenu, ID_POPUP_ZOOM_OUT, msg, KiBitmap( zoom_out_xpm ) );
msg = AddHotkeyName( _( "Redraw view" ), m_HotkeysZoomAndGridList, HK_ZOOM_REDRAW );
ADD_MENUITEM( MasterMenu, ID_ZOOM_REDRAW, msg, KiBitmap( zoom_redraw_xpm ) );
AddMenuItem( MasterMenu, ID_ZOOM_REDRAW, msg, KiBitmap( zoom_redraw_xpm ) );
msg = AddHotkeyName( _( "Zoom auto" ), m_HotkeysZoomAndGridList, HK_ZOOM_AUTO );
ADD_MENUITEM( MasterMenu, ID_ZOOM_PAGE, msg, KiBitmap( zoom_fit_in_page_xpm ) );
AddMenuItem( MasterMenu, ID_ZOOM_PAGE, msg, KiBitmap( zoom_fit_in_page_xpm ) );
wxMenu* zoom_choice = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( MasterMenu, zoom_choice,
AddMenuItem( MasterMenu, zoom_choice,
ID_POPUP_ZOOM_SELECT, _( "Zoom select" ),
KiBitmap( zoom_selection_xpm ) );
......@@ -190,7 +188,7 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
if( screen->GetGridCount() )
{
wxMenu* gridMenu = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( MasterMenu, gridMenu, ID_POPUP_GRID_SELECT,
AddMenuItem( MasterMenu, gridMenu, ID_POPUP_GRID_SELECT,
_( "Grid Select" ), KiBitmap( grid_select_xpm ) );
GRID_TYPE tmp;
......@@ -234,5 +232,5 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
}
MasterMenu->AppendSeparator();
ADD_MENUITEM( MasterMenu, ID_POPUP_CANCEL, _( "Close" ), KiBitmap( cancel_xpm ) );
AddMenuItem( MasterMenu, ID_POPUP_CANCEL, _( "Close" ), KiBitmap( cancel_xpm ) );
}
......@@ -4,7 +4,6 @@
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "confirm.h"
#include "gestfich.h"
......@@ -12,7 +11,6 @@
#include "cvpcb_mainframe.h"
#include "cvpcb_id.h"
#include "bitmaps.h"
/**
* @brief (Re)Create the menubar for the cvpcb mainframe
......@@ -39,7 +37,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
wxMenu* filesMenu = new wxMenu;
// Open
ADD_MENUITEM_WITH_HELP( filesMenu,
AddMenuItem( filesMenu,
ID_LOAD_PROJECT,
_( "&Open" ),
_( "Open a net list file" ),
......@@ -56,7 +54,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu();
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu, -1,
AddMenuItem( filesMenu, openRecentMenu, -1,
_( "Open &Recent" ),
_( "Open a recent opened netlist document" ),
open_project_xpm );
......@@ -65,14 +63,14 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
filesMenu->AppendSeparator();
// Save
ADD_MENUITEM_WITH_HELP( filesMenu,
AddMenuItem( filesMenu,
wxID_SAVE,
_( "&Save\tCtrl+S" ),
_( "Save net list and footprint list files" ),
save_xpm );
// Save as
ADD_MENUITEM_WITH_HELP( filesMenu,
AddMenuItem( filesMenu,
wxID_SAVEAS,
_( "Save &As..." ),
_( "Save new net list and footprint list files" ),
......@@ -82,7 +80,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
filesMenu->AppendSeparator();
// Quit
ADD_MENUITEM_WITH_HELP( filesMenu,
AddMenuItem( filesMenu,
wxID_EXIT,
_( "&Quit" ),
_( "Quit CvPcb" ),
......@@ -92,7 +90,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
wxMenu* preferencesMenu = new wxMenu;
// Options (Preferences on WXMAC)
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
wxID_PREFERENCES,
#ifdef __WXMAC__
_( "&Preferences..." ),
......@@ -115,11 +113,11 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
// Separator
preferencesMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( preferencesMenu, ID_SAVE_PROJECT,
AddMenuItem( preferencesMenu, ID_SAVE_PROJECT,
_( "&Save Project File" ),
_( "Save changes to the project configuration file" ),
save_setup_xpm );
ADD_MENUITEM_WITH_HELP( preferencesMenu, ID_SAVE_PROJECT_AS,
AddMenuItem( preferencesMenu, ID_SAVE_PROJECT_AS,
_( "&Save Project File As" ),
_( "Save changes to the project configuration to a new file" ),
save_setup_xpm );
......@@ -131,12 +129,12 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu, wxID_HELP, _( "&Contents" ),
AddMenuItem( helpMenu, wxID_HELP, _( "&Contents" ),
_( "Open the CvPcb handbook" ),
online_help_xpm );
// About
ADD_MENUITEM_WITH_HELP( helpMenu, wxID_ABOUT,
AddMenuItem( helpMenu, wxID_ABOUT,
_( "&About CvPcb" ),
_( "About CvPcb schematic to pcb converter" ),
info_xpm );
......
......@@ -4,7 +4,6 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h"
#include "eda_dde.h"
#include "wxEeschemaStruct.h"
......@@ -144,7 +143,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF
{
wxString text = m_collectedItems[i]->GetSelectMenuText();
BITMAP_DEF xpm = m_collectedItems[i]->GetMenuImage();
ADD_MENUITEM( &selectMenu, ID_SELECT_ITEM_START + i, text, xpm );
AddMenuItem( &selectMenu, ID_SELECT_ITEM_START + i, text, xpm );
}
// Set to NULL in case user aborts the clarification context menu.
......
This diff is collapsed.
......@@ -6,12 +6,9 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "macros.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "eda_doc.h"
#include "bitmaps.h"
#include "gr_basic.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
......@@ -745,11 +742,14 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM:
if( m_drawItem == NULL )
break;
DrawPanel->CrossHairOff( &dc );
if( m_drawItem->Type() == LIB_FIELD_T )
{
EditField( &dc, (LIB_FIELD*) m_drawItem );
}
DrawPanel->MoveCursorToCrossHair();
DrawPanel->CrossHairOn( &dc );
break;
......@@ -759,6 +759,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM:
if( ( m_drawItem == NULL ) || ( m_drawItem->Type() != LIB_PIN_T ) )
break;
SaveCopyInUndoList( m_component );
GlobalSetPins( &dc, (LIB_PIN*) m_drawItem, id );
DrawPanel->MoveCursorToCrossHair();
......@@ -1130,7 +1131,7 @@ LIB_ITEM* LIB_EDIT_FRAME::locateItem( const wxPoint& aPosition, const KICAD_T aF
{
wxString text = m_collectedItems[i]->GetSelectMenuText();
BITMAP_DEF xpm = m_collectedItems[i]->GetMenuImage();
ADD_MENUITEM( &selectMenu, ID_SELECT_ITEM_START + i, text, xpm );
AddMenuItem( &selectMenu, ID_SELECT_ITEM_START + i, text, xpm );
}
// Set to NULL in case user aborts the clarification context menu.
......
......@@ -318,7 +318,7 @@ private:
*
* @param aLibEntry A pointer to the LIB_ALIAS object to load.
* @param aLibrary A pointer to the CMP_LIBRARY object to load \a aLibEntry from.
* @returns True if a copy of \a aLibEntry was successfully loaded from \aLibrary.
* @return True if a copy of \a aLibEntry was successfully loaded from \a aLibrary.
*/
bool LoadOneLibraryPartAux( LIB_ALIAS* aLibEntry, CMP_LIBRARY* aLibrary );
......
This diff is collapsed.
......@@ -3,9 +3,7 @@
* @brief (Re)Create the main menubar for the component editor frame (LibEdit)
*/
#include "fctsys.h"
#include "common.h"
#include "appl_wxstruct.h"
#include "bitmaps.h"
#include "general.h"
#include "libeditframe.h"
......@@ -29,6 +27,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// Delete all existing menus so they can be rebuilt.
// This allows language changes of the menu text on the fly.
menuBar->Freeze();
while( menuBar->GetMenuCount() )
delete menuBar->Remove( 0 );
......@@ -38,14 +37,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
wxMenu* fileMenu = new wxMenu;
// Save current library
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_LIBEDIT_SAVE_CURRENT_LIB,
_( "&Save Current Library\tCtrl+S" ),
_( "Save the current active library" ),
save_xpm );
// Save current library as...
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_LIBEDIT_SAVE_CURRENT_LIB_AS,
_( "Save Current Library &as" ),
_( "Save current active library as..." ),
......@@ -55,14 +54,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
fileMenu->AppendSeparator();
// Export as png file
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_LIBEDIT_GEN_PNG_FILE,
_( "&Create PNG File from Screen" ),
_( "Create a PNG file from the component displayed on screen" ),
plot_xpm );
// Export as SVG file
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_LIBEDIT_GEN_SVG_FILE,
_( "&Create SVG File" ),
_( "Create a SVG file from the current loaded component" ),
......@@ -72,7 +71,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
fileMenu->AppendSeparator();
// Quit
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
wxID_EXIT,
_( "&Quit" ),
_( "Quit Library Editor" ),
......@@ -84,7 +83,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// Undo
text = AddHotkeyName( _( "Undo" ), s_Libedit_Hokeys_Descr, HK_UNDO );
ADD_MENUITEM_WITH_HELP( editMenu,
AddMenuItem( editMenu,
wxID_UNDO,
text,
_( "Undo last edition" ),
......@@ -92,7 +91,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// Redo
text = AddHotkeyName( _( "Redo" ), s_Libedit_Hokeys_Descr, HK_REDO );
ADD_MENUITEM_WITH_HELP( editMenu,
AddMenuItem( editMenu,
wxID_REDO,
text,
_( "Redo the last undo command" ),
......@@ -102,7 +101,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
editMenu->AppendSeparator();
// Delete
ADD_MENUITEM_WITH_HELP( editMenu,
AddMenuItem( editMenu,
ID_LIBEDIT_DELETE_ITEM_BUTT,
_( "Delete" ),
HELP_DELETE_ITEMS,
......@@ -126,67 +125,63 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// Zoom in
text = _( "Zoom In" );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN,
zoom_in_xpm );
AddMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, zoom_in_xpm );
// Zoom out
text = _( "Zoom Out" );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT,
zoom_out_xpm );
AddMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, zoom_out_xpm );
// Fit on screen
text = AddHotkeyName( _( "Fit on Screen" ), s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT,
zoom_fit_in_page_xpm );
AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, zoom_fit_in_page_xpm );
// Separator
viewMenu->AppendSeparator();
// Redraw
text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW,
zoom_redraw_xpm );
AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, zoom_redraw_xpm );
// Menu Place:
wxMenu* placeMenu = new wxMenu;
// Pin
ADD_MENUITEM_WITH_HELP( placeMenu,
AddMenuItem( placeMenu,
ID_LIBEDIT_PIN_BUTT,
_( "&Pin" ),
HELP_ADD_PIN,
pin_xpm );
// Graphic text
ADD_MENUITEM_WITH_HELP( placeMenu,
AddMenuItem( placeMenu,
ID_LIBEDIT_BODY_TEXT_BUTT,
_( "Graphic text" ),
HELP_ADD_BODYTEXT,
add_text_xpm );
// Graphic rectangle
ADD_MENUITEM_WITH_HELP( placeMenu,
AddMenuItem( placeMenu,
ID_LIBEDIT_BODY_RECT_BUTT,
_( "Rectangle" ),
HELP_ADD_BODYRECT,
add_rectangle_xpm );
// Graphic Circle
ADD_MENUITEM_WITH_HELP( placeMenu,
AddMenuItem( placeMenu,
ID_LIBEDIT_BODY_CIRCLE_BUTT,
_( "Circle" ),
HELP_ADD_BODYCIRCLE,
add_circle_xpm );
// Graphic Arc
ADD_MENUITEM_WITH_HELP( placeMenu,
AddMenuItem( placeMenu,
ID_LIBEDIT_BODY_ARC_BUTT,
_( "Arc" ),
HELP_ADD_BODYARC,
add_arc_xpm );
// Graphic Line or Polygon
ADD_MENUITEM_WITH_HELP( placeMenu,
AddMenuItem( placeMenu,
ID_LIBEDIT_BODY_LINE_BUTT,
_( "Line or Polygon" ),
HELP_ADD_BODYPOLYGON,
......@@ -196,14 +191,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
wxMenu* preferencesMenu = new wxMenu;
// Library
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
ID_CONFIG_REQ,
_( "&Library" ),
_( "Library preferences" ),
library_xpm );
// Colors
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
ID_COLORS_SETUP,
_( "&Colors" ),
_( "Color preferences" ),
......@@ -219,14 +214,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
preferencesMenu->AppendSeparator();
// Save preferences
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
ID_CONFIG_SAVE,
_( "&Save preferences" ),
_( "Save application preferences" ),
save_setup_xpm );
// Read preferences
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
ID_CONFIG_READ,
_( "&Read preferences" ),
_( "Read application preferences" ),
......@@ -239,12 +234,12 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_HELP,
_( "&Contents" ),
_( "Open the eeschema manual" ),
online_help_xpm );
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
......@@ -252,7 +247,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// About EESchema
helpMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_ABOUT,
_( "&About EESchema" ),
_( "About EESchema schematic designer" ),
......
This diff is collapsed.
......@@ -151,7 +151,7 @@ public:
* checks for \a aName in the the template field name list.
*
* @param aName A wxString object containing the field name to search for.
* @param True if \a aName is found in the list.
* @return True if \a aName is found in the list.
*/
bool HasFieldName( const wxString& aName ) const;
};
......
......@@ -19,6 +19,8 @@ class GERBVIEW_FRAME;
//class BOARD;
class GERBER_IMAGE;
class Ki_PageDescr;
// Type of photoplotter action:
#define GERB_ACTIVE_DRAW 1 // Activate light (lower pen)
......
......@@ -5,10 +5,8 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "gerbview.h"
#include "bitmaps.h"
#include "gerbview_id.h"
#include "hotkeys.h"
......@@ -26,6 +24,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
// Delete all existing menus so they can be rebuilt.
// This allows language changes of the menu text on the fly.
menuBar->Freeze();
while( menuBar->GetMenuCount() )
delete menuBar->Remove( 0 );
......@@ -35,35 +34,37 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
wxMenu* fileMenu = new wxMenu;
// Load
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
wxID_FILE,
_( "Load &Gerber File" ),
_( "Load a new Gerber file on the current layer. Previous data will be deleted" ),
gerber_file_xpm );
// Excellon
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_GERBVIEW_LOAD_DRILL_FILE,
_( "Load &EXCELLON Drill File" ),
_( "Load excellon drill file" ),
gerbview_drill_file_xpm );
// Dcodes
ADD_MENUITEM_WITH_HELP( fileMenu, ID_GERBVIEW_LOAD_DCODE_FILE,
AddMenuItem( fileMenu, ID_GERBVIEW_LOAD_DCODE_FILE,
_( "Load &DCodes" ),
_( "Load D-Codes definition file" ),
gerber_open_dcode_file_xpm );
// Recent gerber files
static wxMenu* openRecentGbrMenu;
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if( openRecentGbrMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentGbrMenu );
openRecentGbrMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentGbrMenu );
wxGetApp().m_fileHistory.AddFilesToMenu();
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentGbrMenu,
AddMenuItem( fileMenu, openRecentGbrMenu,
wxID_ANY,
_( "Open &Recent Gerber File" ),
_( "Open a recent opened Gerber file" ),
......@@ -71,12 +72,14 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
// Recent drill files
static wxMenu* openRecentDrlMenu;
if( openRecentDrlMenu )
m_drillFileHistory.RemoveMenu( openRecentDrlMenu );
openRecentDrlMenu = new wxMenu();
m_drillFileHistory.UseMenu( openRecentDrlMenu );
m_drillFileHistory.AddFilesToMenu( );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentDrlMenu,
AddMenuItem( fileMenu, openRecentDrlMenu,
wxID_ANY,
_( "Open Recent &Drill File" ),
_( "Open a recent opened drill file" ),
......@@ -86,7 +89,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
fileMenu->AppendSeparator();
// Clear all
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_GERBVIEW_ERASE_ALL,
_( "&Clear All" ),
_( "Clear all layers. All data will be deleted" ),
......@@ -96,7 +99,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
fileMenu->AppendSeparator();
// Export to pcbnew
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_GERBVIEW_EXPORT_TO_PCBNEW,
_( "Export to &Pcbnew" ),
_( "Export data in pcbnew format" ),
......@@ -106,7 +109,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
fileMenu->AppendSeparator();
// Print
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
wxID_PRINT,
_( "P&rint" ),
_( "Print gerber" ),
......@@ -116,7 +119,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
fileMenu->AppendSeparator();
// Exit
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
wxID_EXIT,
_( "E&xit" ),
_( "Quit Gerbview" ),
......@@ -126,7 +129,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
wxMenu* configMenu = new wxMenu;
// Hide layer manager
ADD_MENUITEM_WITH_HELP( configMenu,
AddMenuItem( configMenu,
ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
_( "Hide &Layers Manager" ),
_( "Show/hide the layers manager toolbar" ),
......@@ -137,7 +140,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
#ifdef __WXMAC__
configMenu->Append(wxID_PREFERENCES);
#else
ADD_MENUITEM_WITH_HELP( configMenu,
AddMenuItem( configMenu,
wxID_PREFERENCES,
_( "&Options" ),
_( "Set options to draw items" ),
......@@ -155,14 +158,14 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
wxMenu* miscellaneousMenu = new wxMenu;
// List dcodes
ADD_MENUITEM_WITH_HELP( miscellaneousMenu,
AddMenuItem( miscellaneousMenu,
ID_GERBVIEW_SHOW_LIST_DCODES,
_( "&List DCodes" ),
_( "List and edit D-codes" ),
show_dcodenumber_xpm );
// Show source
ADD_MENUITEM_WITH_HELP( miscellaneousMenu,
AddMenuItem( miscellaneousMenu,
ID_GERBVIEW_SHOW_SOURCE,
_( "&Show Source" ),
_( "Show source file for the current layer" ),
......@@ -172,7 +175,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
miscellaneousMenu->AppendSeparator();
// Clear layer
ADD_MENUITEM_WITH_HELP( miscellaneousMenu,
AddMenuItem( miscellaneousMenu,
ID_GERBVIEW_GLOBAL_DELETE,
_( "&Clear Layer" ),
_( "Clear current layer" ),
......@@ -182,7 +185,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
miscellaneousMenu->AppendSeparator();
// Text editor
ADD_MENUITEM_WITH_HELP( miscellaneousMenu,
AddMenuItem( miscellaneousMenu,
ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR,
_( "&Text Editor" ),
_( "Select your preferred text editor" ),
......@@ -195,14 +198,14 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_HELP,
_( "&Contents" ),
_( "Open the Gerbview handbook" ),
help_xpm );
// About gerbview
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_ABOUT,
_( "&About GerbView" ),
_( "About gerbview gerber and drill viewer" ),
......
......@@ -3,10 +3,8 @@
/********************/
#include "fctsys.h"
#include "common.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "bitmaps.h"
#include "gerbview.h"
......@@ -34,10 +32,10 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
if( GetToolId() != ID_NO_TOOL_SELECTED )
{
if( DrawStruct && DrawStruct->m_Flags )
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel" ), cancel_xpm );
else
ADD_MENUITEM( PopMenu, ID_POPUP_CLOSE_CURRENT_TOOL,
AddMenuItem( PopMenu, ID_POPUP_CLOSE_CURRENT_TOOL,
_( "End Tool" ), cancel_tool_xpm );
PopMenu->AppendSeparator();
......@@ -48,17 +46,20 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
if( BlockActive )
{
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel Block" ), cancel_xpm );
PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_PLACE_BLOCK,
AddMenuItem( PopMenu, ID_POPUP_PLACE_BLOCK,
_( "Place Block" ), apply_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_DELETE_BLOCK,
AddMenuItem( PopMenu, ID_POPUP_DELETE_BLOCK,
_( "Delete Block (ctrl + drag mouse)" ), delete_xpm );
}
else
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
{
AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel" ), cancel_xpm );
}
PopMenu->AppendSeparator();
}
}
......
......@@ -224,7 +224,7 @@ public: WinEDA_App();
/**
* Function GetHelpFile
* get the help file path.
* <p?
* <p>
* Return the Kicad help file with path. The base paths defined in
* m_searchPaths are tested for a valid file. The path returned can
* be relative depending on the paths added to m_searchPaths. See the
......@@ -233,8 +233,8 @@ public: WinEDA_App();
* version of the help file is made.
* wxEmptyString is returned if help file not found.
* Help file is searched in directories in this order:
* help/<canonical name> like help/en_GB
* help/<short name> like help/en
* help/\<canonical name\> like help/en_GB
* help/\<short name\> like help/en
* help/en
* </p>
*/
......
......@@ -11,6 +11,9 @@
#define DEFAULT_HOTKEY_FILENAME_EXT wxT( "key" )
class EDA_DRAW_FRAME;
/* Class to handle hotkey commnands. hotkeys have a default value
* This class allows the real key code changed by user(from a key code list file)
*/
......
/**************************************/
/* Useful macros and inline functions */
/**************************************/
/**
* @file macros.h
* @brief This file contains miscellaneous helper definitions and functions.
*/
#ifndef MACROS_H
#define MACROS_H
#include <wx/wx.h>
#include "bitmaps.h"
/**
* Macro TO_UTF8
* converts a wxString to a UTF8 encoded C string for all wxWidgets build modes.
......@@ -26,8 +24,10 @@
static inline wxString FROM_UTF8( const char* cstring )
{
wxString line = wxString::FromUTF8( cstring );
if( line.IsEmpty() ) // happens when cstring is not a valid UTF8 sequence
line = wxConvCurrent->cMB2WC( cstring ); // try to use locale conversion
return line;
}
......@@ -78,33 +78,39 @@ static inline const wxChar* GetChars( const wxString& s )
#define RAD2DEG( Rad ) ( (Rad) * 180.0 / M_PI )
// Normalize angle to be in the -360.0 .. 360.0:
#define NORMALIZE_ANGLE_360( Angle ) { while( Angle < -3600 ) \
Angle += 3600;\
#define NORMALIZE_ANGLE_360( Angle ) { \
while( Angle < -3600 ) \
Angle += 3600; \
while( Angle > 3600 ) \
Angle -= 3600;}
Angle -= 3600; }
/* Normalize angle to be in the 0.0 .. 360.0 range: */
#define NORMALIZE_ANGLE_POS( Angle ) { while( Angle < 0 ) \
Angle += 3600;\
#define NORMALIZE_ANGLE_POS( Angle ) { \
while( Angle < 0 ) \
Angle += 3600; \
while( Angle >= 3600 ) \
Angle -= 3600;}
Angle -= 3600; }
#define NEGATE_AND_NORMALIZE_ANGLE_POS( Angle ) \
{ Angle = -Angle; while( Angle < 0 ) \
Angle += 3600;while( Angle >= 3600 ) \
Angle -= 3600;}
#define NEGATE_AND_NORMALIZE_ANGLE_POS( Angle ) { \
Angle = -Angle; \
while( Angle < 0 ) \
Angle += 3600; \
while( Angle >= 3600 ) \
Angle -= 3600; }
/* Normalize angle to be in the -90.0 .. 90.0 range */
#define NORMALIZE_ANGLE_90( Angle ) { while( Angle < -900 ) \
Angle += 1800;\
#define NORMALIZE_ANGLE_90( Angle ) { \
while( Angle < -900 ) \
Angle += 1800; \
while( Angle > 900 ) \
Angle -= 1800;}
Angle -= 1800; }
/* Normalize angle to be in the -180.0 .. 180.0 range */
#define NORMALIZE_ANGLE_180( Angle ) { while( Angle <= -1800 ) \
Angle += 3600;\
#define NORMALIZE_ANGLE_180( Angle ) { \
while( Angle <= -1800 ) \
Angle += 3600; \
while( Angle > 1800 ) \
Angle -= 3600;}
Angle -= 3600; }
/*****************************/
/* macro to exchange 2 items */
......@@ -140,92 +146,4 @@ BOOST_TYPEOF_REGISTER_TYPE( BOARD_ITEM* )
(b) = __temp__; }
/*****************************************************/
/* inline functions to insert menuitems with a icon: */
/*****************************************************/
static inline void ADD_MENUITEM( wxMenu* menu,
int id,
const wxString& text,
const wxBitmap& icon )
{
wxMenuItem* l_item;
l_item = new wxMenuItem( menu, id, text );
#if defined( USE_IMAGES_IN_MENUS )
l_item->SetBitmap( icon );
#endif
menu->Append( l_item );
}
static inline void ADD_MENUITEM_WITH_HELP( wxMenu* menu,
int id,
const wxString& text,
const wxString& help,
const wxBitmap& icon )
{
wxMenuItem* l_item;
l_item = new wxMenuItem( menu, id, text, help );
#if defined( USE_IMAGES_IN_MENUS )
l_item->SetBitmap( icon );
#endif
menu->Append( l_item );
}
static inline void ADD_MENUITEM_WITH_SUBMENU( wxMenu* menu,
wxMenu* submenu,
int id,
const wxString& text,
const wxBitmap& icon )
{
wxMenuItem* l_item;
l_item = new wxMenuItem( menu, id, text );
l_item->SetSubMenu( submenu );
#if defined( USE_IMAGES_IN_MENUS )
l_item->SetBitmap( icon );
#endif
menu->Append( l_item );
};
static inline void ADD_MENUITEM_WITH_HELP_AND_SUBMENU( wxMenu* menu,
wxMenu* submenu,
int id,
const wxString& text,
const wxString& help,
const wxBitmap& icon )
{
wxMenuItem* l_item;
l_item = new wxMenuItem( menu, id, text, help );
l_item->SetSubMenu( submenu );
#if defined( USE_IMAGES_IN_MENUS )
l_item->SetBitmap( icon );
#endif
menu->Append( l_item );
};
// macro to add a bitmap list to check menus (do not use with normal menus)
#if defined( USE_IMAGES_IN_MENUS ) && defined( __WINDOWS__ )
# define SETBITMAPS( icon ) item->SetBitmaps( KiBitmap( apply_xpm ), KiBitmap( icon ) )
#else
# define SETBITMAPS( icon )
#endif
// macro to add a bitmap menus (do not use with check menus)
#if !defined( USE_IMAGES_IN_MENUS ) || defined( __WXMAC__ )
# define SET_BITMAP( icon )
#else
# define SET_BITMAP( icon ) item->SetBitmap( (icon) )
#endif
#endif /* ifdef MACRO_H */
This diff is collapsed.
......@@ -4,10 +4,8 @@
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "kicad.h"
#include "macros.h"
#include "bitmaps.h"
/* Menubar and toolbar event table */
BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME )
......@@ -74,6 +72,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Delete all existing menus so they can be rebuilt.
// This allows language changes of the menu text on the fly.
menuBar->Freeze();
while( menuBar->GetMenuCount() )
delete menuBar->Remove( 0 );
......@@ -83,7 +82,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
wxMenu* fileMenu = new wxMenu;
// Open
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_LOAD_PROJECT,
_( "&Open\tCtrl+O" ),
_( "Open an existing project" ),
......@@ -91,27 +90,29 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Open Recent submenu
static wxMenu* openRecentMenu;
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if( openRecentMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu );
openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu( );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentMenu,
AddMenuItem( fileMenu, openRecentMenu,
wxID_ANY,
_( "Open &Recent" ),
_( "Open a recent opened schematic project" ),
open_project_xpm );
// New
ADD_MENUITEM_WITH_HELP( fileMenu, ID_NEW_PROJECT,
AddMenuItem( fileMenu, ID_NEW_PROJECT,
_( "&New\tCtrl+N" ),
_( "Start a new project" ),
new_project_xpm );
// Save
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_SAVE_PROJECT,
_( "&Save\tCtrl+S" ),
_( "Save current project" ),
......@@ -119,14 +120,14 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Archive
fileMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_SAVE_AND_ZIP_FILES,
_( "&Archive" ),
_( "Archive project files in zip archive" ),
zip_xpm );
// Unarchive
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
ID_READ_ZIP_ARCHIVE,
_( "&Unarchive" ),
_( "Unarchive project files from zip file" ),
......@@ -136,7 +137,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
fileMenu->AppendSeparator();
// Quit
ADD_MENUITEM_WITH_HELP( fileMenu,
AddMenuItem( fileMenu,
wxID_EXIT,
_( "&Quit" ),
_( "Quit KiCad" ),
......@@ -146,14 +147,14 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
wxMenu* browseMenu = new wxMenu();
// Text editor
ADD_MENUITEM_WITH_HELP( browseMenu,
AddMenuItem( browseMenu,
ID_TO_EDITOR,
_( "Text E&ditor" ),
_( "Launch preferred text editor" ),
editor_xpm );
// View file
ADD_MENUITEM_WITH_HELP( browseMenu,
AddMenuItem( browseMenu,
ID_BROWSE_AN_SELECT_FILE,
_( "&View File" ),
_( "View, read or edit file with a text editor" ),
......@@ -163,7 +164,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
wxMenu* preferencesMenu = new wxMenu;
// Text editor
ADD_MENUITEM_WITH_HELP( preferencesMenu,
AddMenuItem( preferencesMenu,
ID_SELECT_PREFERED_EDITOR,
_( "&Text Editor" ),
_( "Select your preferred text editor" ),
......@@ -200,14 +201,14 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
!wxGetApp().m_PdfBrowserIsDefault );
// Append PDF Viewer submenu to preferences
ADD_MENUITEM_WITH_HELP( SubMenuPdfBrowserChoice,
AddMenuItem( SubMenuPdfBrowserChoice,
ID_SELECT_PREFERED_PDF_BROWSER_NAME,
_( "PDF Viewer" ),
_( "Select your favourite PDF viewer used to browse datasheets" ),
datasheet_xpm );
// PDF viewer submenu
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( preferencesMenu,
AddMenuItem( preferencesMenu,
SubMenuPdfBrowserChoice, -1,
_( "PDF Viewer" ),
_( "PDF viewer preferences" ),
......@@ -224,12 +225,12 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_HELP,
_( "&Contents" ),
_( "Open the Kicad handbook" ),
online_help_xpm );
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
......@@ -239,7 +240,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
helpMenu->AppendSeparator();
// About
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_ABOUT,
_( "&About KiCad" ),
_( "About kicad project manager" ),
......
......@@ -3,7 +3,6 @@
/****************/
#include "fctsys.h"
#include "common.h"
#include "class_drawpanel.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
......@@ -176,16 +175,16 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
wxMenu itemMenu;
/* Give a title to the selection menu. This is also a cancel menu item */
wxMenuItem * item_title = new wxMenuItem(&itemMenu, -1, _( "Selection Clarification" ) );
wxMenuItem * item_title = new wxMenuItem( &itemMenu, -1, _( "Selection Clarification" ) );
#ifdef __WINDOWS__
wxFont bold_font(*wxNORMAL_FONT);
bold_font.SetWeight(wxFONTWEIGHT_BOLD);
bold_font.SetStyle( wxFONTSTYLE_ITALIC);
item_title->SetFont(bold_font);
wxFont bold_font( *wxNORMAL_FONT );
bold_font.SetWeight( wxFONTWEIGHT_BOLD );
bold_font.SetStyle( wxFONTSTYLE_ITALIC );
item_title->SetFont( bold_font );
#endif
itemMenu.Append(item_title);
itemMenu.Append( item_title );
itemMenu.AppendSeparator();
int limit = MIN( MAX_ITEMS_IN_PICKER, m_Collector->GetCount() );
......@@ -199,7 +198,7 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
BITMAP_DEF xpm = item->GetMenuImage();
ADD_MENUITEM( &itemMenu, ID_POPUP_PCB_ITEM_SELECTION_START + i, text, xpm );
AddMenuItem( &itemMenu, ID_POPUP_PCB_ITEM_SELECTION_START + i, text, xpm );
}
/* @todo: rather than assignment to true, these should be increment and decrement
......
......@@ -188,12 +188,14 @@ private:
* Function BuildHolesList
* Create the list of holes and tools for a given board
* The list is sorted by increasing drill values
* Only holes from aFirstLayer to aLastLayer copper layers are listed (for vias, because pad holes are always through holes)
* Only holes from aFirstLayer to aLastLayer copper layers are listed (for vias, because
* pad holes are always through holes)
* @param aPcb : the given board
* @param aHoleListBuffer : the std::vector<HOLE_INFO> to fill with pcb holes info
* @param aToolListBuffer : the std::vector<DRILL_TOOL> to fill with tools to use
* @param aFirstLayer = first layer to consider. if < 0 aFirstLayer is ignored
* @param aLastLayer = last layer to consider. if < 0 aLastLayer is ignored
* @param aExcludeThroughHoles Exclude through holes if true.
* @param aGenerateNPTH_list :
* true to create NPTH only list (with no plated holes)
* false to created plated holes list (with no NPTH )
......
......@@ -3,13 +3,11 @@
* @brief (Re)Create the main menubar for the module editor
*/
#include "fctsys.h"
#include "common.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "module_editor_frame.h"
#include "bitmaps.h"
#include "protos.h"
#include "pcbnew_id.h"
......@@ -71,7 +69,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
openSubmenu->Append( item );
/* Append openSubmenu to fileMenu */
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openSubmenu, -1,
AddMenuItem( fileMenu, openSubmenu, -1,
_( "&Load Module" ),
_( "Load a footprint module" ),
open_document_xpm );
......@@ -188,7 +186,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
dimensions_Submenu->Append( item );
// Append dimensions_Submenu to editMenu
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( editMenu,
AddMenuItem( editMenu,
dimensions_Submenu, -1,
_( "&Dimensions" ),
_( "Edit dimensions preferences" ),
......@@ -302,12 +300,12 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_HELP,
_( "&Contents" ),
_( "Open the PCBNew handbook" ),
online_help_xpm );
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
......@@ -315,7 +313,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// About PCBNew
helpMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( helpMenu, wxID_ABOUT,
AddMenuItem( helpMenu, wxID_ABOUT,
_( "&About PCBNew" ),
_( "About PCBNew PCB designer" ),
info_xpm );
......
......@@ -4,14 +4,11 @@
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "bitmaps.h"
#include "protos.h"
#include "hotkeys.h"
#include "pcbnew_id.h"
#include "macros.h"
#include "help_common_strings.h"
......@@ -30,6 +27,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// Delete all existing menus so they can be rebuilt.
// This allows language changes of the menu text on the fly.
menuBar->Freeze();
while( menuBar->GetMenuCount() )
delete menuBar->Remove(0);
......@@ -54,14 +52,16 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// Load Recent submenu
static wxMenu* openRecentMenu;
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if( openRecentMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu );
openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu();
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
AddMenuItem( filesMenu, openRecentMenu,
-1, _( "Open &Recent" ),
_( "Open a recent opened board" ),
open_project_xpm );
......@@ -136,7 +136,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
fabricationOutputsMenu->Append( item );
// Fabrications Outputs submenu append
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, fabricationOutputsMenu,
AddMenuItem( filesMenu, fabricationOutputsMenu,
-1, _( "Fabrication Outputs" ),
_( "Generate files for fabrication" ),
fabrication_xpm );
......@@ -153,7 +153,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
SET_BITMAP( import_xpm ); // @todo need better bitmap
submenuImport->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuImport,
AddMenuItem( filesMenu, submenuImport,
ID_GEN_IMPORT_FILE, _( "Import" ),
_( "Import files" ), import_xpm );
......@@ -189,7 +189,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
SET_BITMAP( three_d_xpm );
submenuexport->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuexport,
AddMenuItem( filesMenu, submenuexport,
ID_GEN_EXPORT_FILE, _( "&Export" ),
_( "Export board" ), export_xpm );
......@@ -240,7 +240,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
SET_BITMAP( library_xpm );
submenuarchive->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuarchive,
AddMenuItem( filesMenu, submenuarchive,
ID_MENU_ARCHIVE_MODULES,
_( "Archive Footprints" ),
_( "Archive or add footprints in a library file" ),
......@@ -337,36 +337,29 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
* for Zoom in and Zoom out sub menus
*/
// Zoom In
text = AddHotkeyName( _( "Zoom In" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_IN, false );
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text,
HELP_ZOOM_IN, wxITEM_NORMAL );
text = AddHotkeyName( _( "Zoom In" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_IN, false );
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, wxITEM_NORMAL );
SET_BITMAP( zoom_in_xpm );
viewMenu->Append( item );
// Zoom Out
text = AddHotkeyName( _( "Zoom Out" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_OUT, false );
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text,
HELP_ZOOM_OUT, wxITEM_NORMAL );
text = AddHotkeyName( _( "Zoom Out" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_OUT, false );
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, wxITEM_NORMAL );
SET_BITMAP( zoom_out_xpm );
viewMenu->Append( item );
// Fit on Screen
text = AddHotkeyName( _( "Fit on Screen" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_AUTO );
text = AddHotkeyName( _( "Fit on Screen" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_AUTO );
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text,
HELP_ZOOM_FIT, wxITEM_NORMAL );
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, wxITEM_NORMAL );
SET_BITMAP( zoom_fit_in_page_xpm );
viewMenu->Append( item );
viewMenu->AppendSeparator();
// Redraw
text = AddHotkeyName( _( "Redraw" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_REDRAW );
text = AddHotkeyName( _( "Redraw" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_REDRAW );
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text,
HELP_ZOOM_REDRAW,
......@@ -403,8 +396,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
placeMenu->Append( item );
// Track
text = AddHotkeyName( _( "Track" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ADD_NEW_TRACK, false );
text = AddHotkeyName( _( "Track" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ADD_NEW_TRACK, false );
item = new wxMenuItem( placeMenu, ID_TRACK_BUTT, text,
_( "Add tracks and vias" ), wxITEM_NORMAL );
......@@ -556,7 +548,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
dimensionsMenu->Append( item );
// Append dimension menu to config menu
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( configmenu, dimensionsMenu,
AddMenuItem( configmenu, dimensionsMenu,
-1, _( "Di&mensions" ),
_( "Global dimensions preferences" ),
add_dimension_xpm );
......@@ -634,7 +626,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
SET_BITMAP( copper_layers_setup_xpm );
designRulesMenu->Append( item );
/**
* Help menu
*/
......@@ -643,12 +634,12 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_HELP,
_( "&Contents" ),
_( "Open the PCBNew handbook" ),
online_help_xpm );
ADD_MENUITEM_WITH_HELP( helpMenu,
AddMenuItem( helpMenu,
wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
......@@ -656,7 +647,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// About
helpMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( helpMenu, wxID_ABOUT,
AddMenuItem( helpMenu, wxID_ABOUT,
_( "&About PCBNew" ),
_( "About PCBnew printed circuit board designer" ),
info_xpm );
......
......@@ -8,7 +8,6 @@
#include "confirm.h"
#include "gestfich.h"
#include "appl_wxstruct.h"
#include "bitmaps.h"
#include "pcbnew_id.h"
#include "trigo.h"
......@@ -100,7 +99,7 @@ BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode )
text = item->GetSelectMenuText();
xpm = item->GetMenuImage();
ADD_MENUITEM( &itemMenu,
AddMenuItem( &itemMenu,
ID_POPUP_PCB_ITEM_SELECTION_START + ii,
text,
xpm );
......@@ -735,6 +734,7 @@ void FOOTPRINT_EDIT_FRAME::Transform( MODULE* module, int transform )
edgemod->m_Start0 = edgemod->m_Start;
edgemod->m_End0 = edgemod->m_End;
}
if( PtStruct->Type() == TYPE_TEXTE_MODULE )
{
textmod = (TEXTE_MODULE*) PtStruct;
......@@ -775,6 +775,7 @@ void FOOTPRINT_EDIT_FRAME::Transform( MODULE* module, int transform )
/* Reverse mirror of footprints. */
PtStruct = module->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
{
switch( PtStruct->Type() )
......
This diff is collapsed.
......@@ -30,7 +30,7 @@ public:
/**
* Function RedrawActiveWindoow
* daws the footprint editor BOARD, and others elements : axis, grid ..
* daws the footprint editor BOARD, and others elements such as axis and grid.
*/
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
......
This diff is collapsed.
......@@ -224,8 +224,9 @@ void Calcule_Coord_Extremite_45( const wxPoint& aPosition, int ox, int oy, int*
* interesting segments
* @param aTrackLen = a pointer to an integer where to return the lenght of the
* track
* @param aLengthDie = a pointer to an integer where to return the extra lengths inside integrated circuits
* from the pads connected to this track to the die (if any)
* @param aLengthDie = a pointer to an integer where to return the extra lengths inside
* integrated circuits from the pads connected to this track to the
* die (if any)
* @param aReorder = true for reorder the interesting segments (useful for
* track edition/deletion) in this case the flag BUSY is
* set (the user is responsible of flag clearing). False
......
......@@ -28,30 +28,6 @@ static void Marque_Chaine_segments( BOARD* Pcb,
TRACK_PTRS* aList );
/**
* Function Marque_Une_Piste
* marks a chain of track segments, connected to aTrackList.
* Each segment is marked by setting the BUSY bit into m_Flags. Electrical
* continuity is detected by walking each segment, and finally the segments
* are rearranged into a contiguous chain within the given list.
* @param aPcb = the board to analyze
* @param aStartSegm - The first interesting segment within a list of track
* segment of aPcb
* @param aSegmCount = a pointer to an integer where to return the number of
* interesting segments
* @param aTrackLen = a pointer to an integer where to return the length of the
* track on board
* @param aLengthDie = a pointer to an integer where to return the extra lengths inside integrated circuits
* from the pads connected to this track to the die (if any)
* @param aReorder = bool:
* true for reorder the interesting segments (useful for track
*edition/deletion)
* in this case the flag BUSY is set (the user is responsible of flag
*clearing)
* false for no reorder : useful when we want just calculate the track length
* in this case, flags are reset
* @return TRACK* the first in the chain of interesting segments.
*/
TRACK* Marque_Une_Piste( BOARD* aPcb,
TRACK* aStartSegm,
int* aSegmCount,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment