From 4a8bf70db8fc32a06f3454e4e7b44a53f1f0a854 Mon Sep 17 00:00:00 2001 From: dickelbeck Date: Thu, 6 Sep 2007 04:34:03 +0000 Subject: [PATCH] tweaks --- include/macros.h | 6 +- include/pcbstruct.h | 16 +++- include/wxstruct.h | 16 +++- pcbnew/collectors.cpp | 53 ++++------- pcbnew/collectors.h | 7 ++ pcbnew/edit.cpp | 4 + pcbnew/onrightclick.cpp | 195 ++++++++++++++++++++-------------------- pcbnew/pcbframe.cpp | 3 +- 8 files changed, 154 insertions(+), 146 deletions(-) diff --git a/include/macros.h b/include/macros.h index a6018b1ee7..9bce439245 100644 --- a/include/macros.h +++ b/include/macros.h @@ -11,12 +11,12 @@ #define CONV_FROM_UTF8(utf8string) (utf8string) #endif -/* violation of C++ standard, cannot use MIN() and MAX() +/* violation of C++ standard, cannot use min() and max(), i.e. in lowercase #ifndef min -#define MIN(x, y) ((x) > (y) ? (y) : (x)) +#define min(x, y) ((x) > (y) ? (y) : (x)) #endif #ifndef max -#define MAX(x, y) ((x) > (y) ? (x) : (y)) +#define max(x, y) ((x) > (y) ? (x) : (y)) #endif */ diff --git a/include/pcbstruct.h b/include/pcbstruct.h index 47cef6345b..097f78d1a1 100644 --- a/include/pcbstruct.h +++ b/include/pcbstruct.h @@ -325,11 +325,19 @@ public: public: PCB_SCREEN( int idscreen ); ~PCB_SCREEN(); + PCB_SCREEN* Next() { return (PCB_SCREEN*) Pnext; } - void Init(); - void SetNextZoom(); - void SetPreviousZoom(); - void SetLastZoom(); + void Init(); + void SetNextZoom(); + void SetPreviousZoom(); + void SetLastZoom(); + + /** + * Function GetCurItem + * returns the currently selected BOARD_ITEM, overriding BASE_SCREEN::GetCurItem(). + * @return BOARD_ITEM* - the one selected, or NULL. + */ + BOARD_ITEM* GetCurItem() const { return (BOARD_ITEM*) BASE_SCREEN::GetCurItem(); } }; /***************************/ diff --git a/include/wxstruct.h b/include/wxstruct.h index 7e2e973050..a9784c2683 100644 --- a/include/wxstruct.h +++ b/include/wxstruct.h @@ -210,8 +210,8 @@ public: BASE_SCREEN* m_CurrentScreen; // SCREEN en cours int m_CurrentCursorShape; // shape for cursor (0 = default cursor) - int m_ID_current_state; // Id du bouton actif du tool bar vertical - int m_HTOOL_current_state; // Id du bouton actif du tool bar horizontal + int m_ID_current_state; ///< Id of active button on the vertical toolbar + int m_HTOOL_current_state; ///< Id of active button on horizontal toolbar int m_InternalUnits; // nombre d'unites internes pour 1 pouce // = 1000 pour schema, = 10000 pour PCB @@ -394,6 +394,7 @@ public: bool Clear_Pcb( wxDC* DC, bool query ); BOARD_ITEM* PcbGeneralLocateAndDisplay(); BOARD_ITEM* Locate( int typeloc, int LayerSearch ); + #if defined(DEBUG) /** @@ -562,7 +563,16 @@ public: void PrepareLayerIndicator(); void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); - void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); + + /** + * Function OnRightClick + * populates a popup menu with the choices appropriate for the current context. + * The caller will add the ZOOM menu choices afterwards. + * @param aMousePos The current mouse position + * @param aPopMenu The menu to add to. + */ + void OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ); + void OnSelectOptionToolbar( wxCommandEvent& event ); void ToolOnRightClick( wxCommandEvent& event ); diff --git a/pcbnew/collectors.cpp b/pcbnew/collectors.cpp index ac62fa8785..3a321a7564 100644 --- a/pcbnew/collectors.cpp +++ b/pcbnew/collectors.cpp @@ -47,6 +47,19 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = { }; +const KICAD_T GENERAL_COLLECTOR::PrimaryItems[] = { + TYPETEXTE, + TYPEDRAWSEGMENT, + TYPECOTATION, + TYPEVIA, + TYPETRACK, +// TYPEPAD, TYPEPAD and TYPETEXTEMODULE are handled in a subsearch +// TYPETEXTEMODULE, + TYPEMODULE, + EOT +}; + + /** * Function Inspect * is the examining function within the INSPECTOR which is passed to the @@ -223,42 +236,8 @@ exit: } -// see collectors.h -/* -void GENERAL_COLLECTOR::Collect( BOARD* board, const wxPoint& refPos, - int aPreferredLayer, int aLayerMask ) -{ - Empty(); // empty the collection, primary criteria list - Empty2nd(); // empty the collection, secondary criteria list - - SetPreferredLayer( aPreferredLayer ); - SetLayerMask( aLayerMask ); - - // remember refPos, pass to Inspect() - SetRefPos( refPos ); - -#if defined(DEBUG) - std::cout << '\n'; -#endif - - // visit the board with the INSPECTOR (me). - board->Visit( this, // INSPECTOR* inspector - NULL, // const void* testData, not used here - m_ScanTypes); - - SetTimeNow(); // when snapshot was taken - - // append 2nd list onto end of the first "list" - for( unsigned i=0; iVisit( this, // INSPECTOR* inspector NULL, // const void* testData, not used here m_ScanTypes); diff --git a/pcbnew/collectors.h b/pcbnew/collectors.h index c31a4264b0..7a6b9438af 100644 --- a/pcbnew/collectors.h +++ b/pcbnew/collectors.h @@ -192,6 +192,13 @@ public: static const KICAD_T AllBoardItems[]; + /** + * A scan list for all primary board items, omitting items which are subsidiary to + * a MODULE, such as D_PAD and TEXTEMODULE. + */ + static const KICAD_T PrimaryItems[]; + + /** * Constructor GENERALCOLLECTOR */ diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 7ca2a7aabc..ed1dd4a11f 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -351,6 +351,10 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) DrawPanel->CursorOff( &dc ); DrawPanel->PrepareGraphicContext( &dc ); + +#if defined(DEBUG) + std::cout << "GetString=" << event.GetString().mb_str() << '\n'; +#endif wxGetMousePosition( &pos.x, &pos.y ); diff --git a/pcbnew/onrightclick.cpp b/pcbnew/onrightclick.cpp index 967b44dfca..be9e9946e8 100644 --- a/pcbnew/onrightclick.cpp +++ b/pcbnew/onrightclick.cpp @@ -121,67 +121,63 @@ static wxMenu* Append_Track_Width_List() } -/****************************************************************************/ -void WinEDA_PcbFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) -/****************************************************************************/ - -/* Create the PopUp menu (click on right mouse button) - * de la souris. - * The ZOOM menu is added to this menu - */ +/******************************************************************************/ +void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) +/******************************************************************************/ { - EDA_BaseStruct* DrawStruct = m_CurrentScreen->GetCurItem(); wxString msg; int flags = 0; bool locate_track = FALSE; bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE); wxClientDC dc( DrawPanel ); + BOARD_ITEM* item = GetScreen()->GetCurItem(); + DrawPanel->CursorOff( &dc ); DrawPanel->m_CanStartBlock = -1; // Ne pas engager un debut de bloc sur validation menu // Simple localisation des elements si possible - if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) ) + if( item == NULL || item->m_Flags == 0 ) { if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOPLACE ) { - DrawStruct = Locate_Prefered_Module( m_Pcb, CURSEUR_OFF_GRILLE | VISIBLE_ONLY ); - if( DrawStruct ) - ( (MODULE*) DrawStruct )->Display_Infos( this ); + item = Locate_Prefered_Module( m_Pcb, CURSEUR_OFF_GRILLE | VISIBLE_ONLY ); + if( item ) + item->Display_Infos( this ); else - DrawStruct = PcbGeneralLocateAndDisplay(); + item = PcbGeneralLocateAndDisplay(); } else - DrawStruct = PcbGeneralLocateAndDisplay(); + item = PcbGeneralLocateAndDisplay(); } // If command in progress: Put the Cancel command (if needed) and End command if( m_ID_current_state ) { - if( DrawStruct && DrawStruct->m_Flags ) + if( item && item->m_Flags ) { - ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, + ADD_MENUITEM( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm ); } else { - ADD_MENUITEM( PopMenu, ID_POPUP_CLOSE_CURRENT_TOOL, + ADD_MENUITEM( aPopMenu, ID_POPUP_CLOSE_CURRENT_TOOL, _( "End Tool" ), cancel_tool_xpm ); } - PopMenu->AppendSeparator(); + aPopMenu->AppendSeparator(); } else { - if( (DrawStruct && DrawStruct->m_Flags) || BlockActive ) + if( (item && item->m_Flags) || BlockActive ) { if( BlockActive ) - CreatePopUpBlockMenu( PopMenu ); + CreatePopUpBlockMenu( aPopMenu ); else { - ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, + ADD_MENUITEM( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm ); } - PopMenu->AppendSeparator(); + aPopMenu->AppendSeparator(); } } @@ -191,65 +187,65 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) return; } - m_CurrentScreen->SetCurItem( DrawStruct ); + m_CurrentScreen->SetCurItem( item ); - if( DrawStruct ) - flags = DrawStruct->m_Flags; + if( item ) + flags = item->m_Flags; else flags = 0; if( !flags ) { - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST, _( "Get and Move Footprint" ), Move_Module_xpm ); } - if( DrawStruct ) + if( item ) { - switch( DrawStruct->Type() ) + switch( item->Type() ) { case TYPEMODULE: if( !flags ) - CreatePopUpMenuForFootprints( (MODULE*) DrawStruct, PopMenu, TRUE ); + CreatePopUpMenuForFootprints( (MODULE*) item, aPopMenu, TRUE ); else - CreatePopUpMenuForFootprints( (MODULE*) DrawStruct, PopMenu, FALSE ); + CreatePopUpMenuForFootprints( (MODULE*) item, aPopMenu, FALSE ); if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOPLACE ) { - PopMenu->AppendSeparator(); - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, _( "Lock Module" ), + aPopMenu->AppendSeparator(); + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, _( "Lock Module" ), Locked_xpm ); - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_AUTOPLACE_FREE_MODULE, _( "Unlock Module" ), + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FREE_MODULE, _( "Unlock Module" ), Unlocked_xpm ); if( !flags ) - PopMenu->Append( ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE, + aPopMenu->Append( ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE, _( "Auto place Module" ) ); } if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOROUTE ) { if( !flags ) - PopMenu->Append( ID_POPUP_PCB_AUTOROUTE_MODULE, _( "Autoroute" ) ); + aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_MODULE, _( "Autoroute" ) ); } break; case TYPEPAD: if( !flags ) { - MODULE* Module = (MODULE*) DrawStruct->m_Parent; - if( Module ) + MODULE* module = (MODULE*) item->m_Parent; + if( module ) { - CreatePopUpMenuForFootprints( Module, PopMenu, TRUE ); - PopMenu->AppendSeparator(); + CreatePopUpMenuForFootprints( module, aPopMenu, TRUE ); + aPopMenu->AppendSeparator(); } } - CreatePopUpMenuForPads( (D_PAD*) DrawStruct, PopMenu ); + CreatePopUpMenuForPads( (D_PAD*) item, aPopMenu ); if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOROUTE ) { if( !flags ) { - PopMenu->Append( ID_POPUP_PCB_AUTOROUTE_PAD, _( "Autoroute Pad" ) ); - PopMenu->Append( ID_POPUP_PCB_AUTOROUTE_NET, _( "Autoroute Net" ) ); + aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_PAD, _( "Autoroute Pad" ) ); + aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_NET, _( "Autoroute Net" ) ); } } break; @@ -257,83 +253,83 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) case TYPETEXTEMODULE: if( !flags ) { - MODULE* Module = (MODULE*) DrawStruct->m_Parent; - if( Module ) + MODULE* module = (MODULE*) item->m_Parent; + if( module ) { - CreatePopUpMenuForFootprints( Module, PopMenu, TRUE ); - PopMenu->AppendSeparator(); + CreatePopUpMenuForFootprints( module, aPopMenu, TRUE ); + aPopMenu->AppendSeparator(); } } - CreatePopUpMenuForFpTexts( (TEXTE_MODULE*) DrawStruct, PopMenu ); + CreatePopUpMenuForFpTexts( (TEXTE_MODULE*) item, aPopMenu ); break; case TYPEDRAWSEGMENT: if( !flags ) { - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_DRAWING_REQUEST, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_MOVE_DRAWING_REQUEST, _( "Move Drawing" ), move_xpm ); } if( flags & IS_NEW ) { - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_STOP_CURRENT_DRAWING, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_STOP_CURRENT_DRAWING, _( "End Drawing" ), apply_xpm ); } - PopMenu->Append( ID_POPUP_PCB_EDIT_DRAWING, _( "Edit Drawing" ) ); - PopMenu->Append( ID_POPUP_PCB_DELETE_DRAWING, _( "Delete Drawing" ) ); + aPopMenu->Append( ID_POPUP_PCB_EDIT_DRAWING, _( "Edit Drawing" ) ); + aPopMenu->Append( ID_POPUP_PCB_DELETE_DRAWING, _( "Delete Drawing" ) ); break; case TYPEEDGEZONE: if( flags & IS_NEW ) { - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE, _( "End edge zone" ), apply_xpm ); } - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DELETE_EDGE_ZONE, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_EDGE_ZONE, _( "Delete edge zone" ), delete_xpm ); break; case TYPETEXTE: - CreatePopUpMenuForTexts( (TEXTE_PCB*) DrawStruct, PopMenu ); + CreatePopUpMenuForTexts( (TEXTE_PCB*) item, aPopMenu ); break; case TYPETRACK: case TYPEVIA: locate_track = TRUE; - CreatePopupMenuForTracks( (TRACK*) DrawStruct, GetScreen()->m_Curseur, - PopMenu ); + CreatePopupMenuForTracks( (TRACK*) item, GetScreen()->m_Curseur, + aPopMenu ); break; case TYPEZONE: - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_ZONE, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_ZONE, _( "Edit Zone" ), edit_xpm ); - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DELETE_ZONE, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_ZONE, _( "Delete Zone" ), delete_xpm ); break; case TYPEMARQUEUR: - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DELETE_MARKER, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MARKER, _( "Delete Marker" ), delete_xpm ); break; case TYPECOTATION: if( !flags ) { - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_COTATION, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_COTATION, _( "Edit Cotation" ), edit_xpm ); } - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DELETE_COTATION, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_COTATION, _( "Delete Cotation" ), delete_xpm ); break; case TYPEMIRE: if( !flags ) { - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_MIRE_REQUEST, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_MOVE_MIRE_REQUEST, _( "Move Mire" ), move_xpm ); } - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_MIRE, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_MIRE, _( "Edit Mire" ), edit_xpm ); - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DELETE_MIRE, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MIRE, _( "Delete Mire" ), delete_xpm ); break; @@ -344,19 +340,19 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) case PCB_EQUIPOT_STRUCT_TYPE: msg.Printf( wxT( "WinEDA_PcbFrame::OnRightClick() Error: illegal DrawType %d" ), - DrawStruct->Type() ); + item->Type() ); DisplayError( this, msg ); break; default: msg.Printf( wxT( "WinEDA_PcbFrame::OnRightClick() Error: unknown DrawType %d" ), - DrawStruct->Type() ); + item->Type() ); DisplayError( this, msg ); break; } - PopMenu->AppendSeparator(); + aPopMenu->AppendSeparator(); } /* Traitement des fonctions specifiques */ @@ -365,39 +361,39 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) case ID_PCB_ZONES_BUTT: { bool add_separator = FALSE; - PopMenu->Append( ID_POPUP_PCB_FILL_ZONE, _( "Fill zone" ) ); + aPopMenu->Append( ID_POPUP_PCB_FILL_ZONE, _( "Fill zone" ) ); - if( DrawStruct - && ( (DrawStruct->Type() == TYPEPAD) - || (DrawStruct->Type() == TYPETRACK) - || (DrawStruct->Type() == TYPEVIA) ) ) + if( item + && ( (item->Type() == TYPEPAD) + || (item->Type() == TYPETRACK) + || (item->Type() == TYPEVIA) ) ) { add_separator = TRUE; - PopMenu->Append( ID_POPUP_PCB_SELECT_NET_ZONE, _( "Select Net" ) ); + aPopMenu->Append( ID_POPUP_PCB_SELECT_NET_ZONE, _( "Select Net" ) ); } if( m_Pcb->m_CurrentLimitZone ) { add_separator = TRUE; - PopMenu->Append( ID_POPUP_PCB_DELETE_ZONE_LIMIT, _( "Delete Zone Limit" ) ); + aPopMenu->Append( ID_POPUP_PCB_DELETE_ZONE_LIMIT, _( "Delete Zone Limit" ) ); } if( add_separator ) - PopMenu->AppendSeparator(); - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_SELECT_LAYER, + aPopMenu->AppendSeparator(); + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_LAYER, _( "Select Working Layer" ), Select_W_Layer_xpm ); - PopMenu->AppendSeparator(); + aPopMenu->AppendSeparator(); } break; case ID_TRACK_BUTT: { - ADD_MENUITEM_WITH_SUBMENU( PopMenu, Append_Track_Width_List(), + ADD_MENUITEM_WITH_SUBMENU( aPopMenu, Append_Track_Width_List(), ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ), width_track_xpm ); - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_SELECT_CU_LAYER, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_CU_LAYER, _( "Select Working Layer" ), Select_W_Layer_xpm ); - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_SELECT_LAYER_PAIR, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_LAYER_PAIR, _( "Select layer pair for vias" ), select_layer_pair_xpm ); - PopMenu->AppendSeparator(); + aPopMenu->AppendSeparator(); } break; @@ -406,28 +402,28 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) case ID_TEXT_COMMENT_BUTT: case ID_LINE_COMMENT_BUTT: case ID_PCB_COTATION_BUTT: - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_SELECT_NO_CU_LAYER, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_NO_CU_LAYER, _( "Select Working Layer" ), Select_W_Layer_xpm ); - PopMenu->AppendSeparator(); + aPopMenu->AppendSeparator(); break; case ID_COMPONENT_BUTT: - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DISPLAY_FOOTPRINT_DOC, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DISPLAY_FOOTPRINT_DOC, _( "Footprint documentation" ), book_xpm ); - PopMenu->AppendSeparator(); + aPopMenu->AppendSeparator(); break; case 0: if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOPLACE ) { wxMenu* commands = new wxMenu; - ADD_MENUITEM_WITH_SUBMENU( PopMenu, commands, + ADD_MENUITEM_WITH_SUBMENU( aPopMenu, commands, ID_POPUP_PCB_AUTOPLACE_COMMANDS, _( "Glob Move and Place" ), move_xpm ); ADD_MENUITEM( commands, ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES, - _( "Free All Modules" ), Unlocked_xpm ); + _( "Unlock All Modules" ), Unlocked_xpm ); ADD_MENUITEM( commands, ID_POPUP_PCB_AUTOPLACE_FIXE_ALL_MODULES, - _( "Fixe All Modules" ), Locked_xpm ); + _( "Lock All Modules" ), Locked_xpm ); commands->AppendSeparator(); ADD_MENUITEM( commands, ID_POPUP_PCB_AUTOMOVE_ALL_MODULES, _( "Move All Modules" ), move_xpm ); @@ -439,12 +435,13 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) commands->AppendSeparator(); ADD_MENUITEM( commands, ID_POPUP_PCB_REORIENT_ALL_MODULES, _( "Orient All Modules" ), rotate_module_pos_xpm ); - PopMenu->AppendSeparator(); + aPopMenu->AppendSeparator(); } + if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOROUTE ) { wxMenu* commands = new wxMenu; - PopMenu->Append( ID_POPUP_PCB_AUTOROUTE_COMMANDS, _( "Global Autoroute" ), commands ); + aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_COMMANDS, _( "Global Autoroute" ), commands ); ADD_MENUITEM( commands, ID_POPUP_PCB_SELECT_LAYER_PAIR, _( "Select layer pair" ), select_layer_pair_xpm ); commands->AppendSeparator(); @@ -459,16 +456,16 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) commands->Append( ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER_DATA, _( "Read Global AutoRouter Data" ) ); } - PopMenu->AppendSeparator(); + aPopMenu->AppendSeparator(); } if( locate_track ) - ADD_MENUITEM_WITH_SUBMENU( PopMenu, Append_Track_Width_List(), + ADD_MENUITEM_WITH_SUBMENU( aPopMenu, Append_Track_Width_List(), ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ), width_track_xpm ); - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_SELECT_LAYER, + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_LAYER, _( "Select Working Layer" ), Select_W_Layer_xpm ); - PopMenu->AppendSeparator(); + aPopMenu->AppendSeparator(); break; } @@ -631,7 +628,7 @@ void CreatePopupMenuForTracks( TRACK* Track, wxPoint CursorPosition, /*********************************************************************************/ -void CreatePopUpMenuForFootprints( MODULE* Module, wxMenu* menu, bool full_menu ) +void CreatePopUpMenuForFootprints( MODULE* aModule, wxMenu* menu, bool full_menu ) /*********************************************************************************/ /* Create the wxMenuitem list for footprint editing @@ -639,10 +636,10 @@ void CreatePopUpMenuForFootprints( MODULE* Module, wxMenu* menu, bool full_menu { wxMenu* sub_menu_footprint; wxString msg; - int flags = Module->m_Flags; + int flags = aModule->m_Flags; msg = _( "Footprint" ); - msg << wxT( " " ) << Module->m_Reference->m_Text; + msg << wxT( " " ) << aModule->GetReference(); sub_menu_footprint = new wxMenu; @@ -741,6 +738,7 @@ void CreatePopUpMenuForPads( D_PAD* Pad, wxMenu* menu ) } ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_EDIT_PAD, _( "Edit Pad" ), options_pad_xpm ); sub_menu_Pad->AppendSeparator(); + ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_IMPORT_PAD_SETTINGS, _( "New Pad Settings" ), options_new_pad_xpm ); ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_EXPORT_PAD_SETTINGS, @@ -751,6 +749,7 @@ void CreatePopUpMenuForPads( D_PAD* Pad, wxMenu* menu ) ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS, _( "Global Pad Settings" ), global_options_pad_xpm ); sub_menu_Pad->AppendSeparator(); + ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_DELETE_PAD, _( "delete" ), Delete_Pad_xpm ); } diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 1b5f41cfec..2f5049e48e 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -18,7 +18,8 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, wxFrame ) - COMMON_EVENTS_DRAWFRAME EVT_SOCKET( ID_EDA_SOCKET_EVENT_SERV, WinEDA_PcbFrame::OnSockRequestServer ) + COMMON_EVENTS_DRAWFRAME + EVT_SOCKET( ID_EDA_SOCKET_EVENT_SERV, WinEDA_PcbFrame::OnSockRequestServer ) EVT_SOCKET( ID_EDA_SOCKET_EVENT, WinEDA_PcbFrame::OnSockRequest ) EVT_KICAD_CHOICEBOX( ID_ON_ZOOM_SELECT, WinEDA_PcbFrame::OnSelectZoom )