diff --git a/bitmaps/erc.xpm b/bitmaps/erc.xpm index 8ba471453f..713623586e 100644 --- a/bitmaps/erc.xpm +++ b/bitmaps/erc.xpm @@ -1,8 +1,4 @@ /* XPM */ -#ifndef XPMMAIN -extern const char *erc_xpm[]; - -#else const char *erc_xpm[] = { "16 16 100 2", " c None", @@ -121,4 +117,3 @@ const char *erc_xpm[] = { " . . . . #.$.. . ", " . . %.&.. ", " . . "}; -#endif diff --git a/bitmaps/palette.xpm b/bitmaps/palette.xpm index c1730ed6dd..33c9c436ed 100644 --- a/bitmaps/palette.xpm +++ b/bitmaps/palette.xpm @@ -1,8 +1,4 @@ /* XPM */ -#ifndef XPMMAIN -extern const char *palette_xpm[]; - -#else const char * palette_xpm[] = { "16 15 14 1", " c #c0c0c0", @@ -34,5 +30,4 @@ const char * palette_xpm[] = { " .oXo---Xo. ", " *#.oXXoXo.. ", " *# ...... "} -#endif ; diff --git a/bitmaps/tools.xpm b/bitmaps/tools.xpm index 589dd85649..58cc1004ac 100644 --- a/bitmaps/tools.xpm +++ b/bitmaps/tools.xpm @@ -1,8 +1,4 @@ /* XPM */ -#ifndef XPMMAIN -extern const char *tools_xpm[]; - -#else const char *tools_xpm[] = { /* columns rows colors const chars-per-pixel */ "16 16 5 1", @@ -27,5 +23,3 @@ const char *tools_xpm[] = { ".+++++++++++++. ", "............... ", " "}; -#endif - diff --git a/include/boost/polygon/gtl.hpp b/include/boost/polygon/gtl.hpp new file mode 100644 index 0000000000..ac56252712 --- /dev/null +++ b/include/boost/polygon/gtl.hpp @@ -0,0 +1,27 @@ +/* + Copyright 2008 Intel Corporation + + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ +#ifndef GTL_GTL_HPP +#define GTL_GTL_HPP + +#ifdef __ICC +#pragma warning (disable:1125) +#endif + +#ifdef WIN32 +#pragma warning( disable: 4996 ) +#pragma warning( disable: 4800 ) +#endif + +#define BOOST_POLYGON_NO_DEPS +#include "polygon.hpp" +namespace gtl = boost::polygon; +using namespace boost::polygon::operators; +#if __ICC +#pragma warning (default:1125) +#endif +#endif diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index bcd9916a1a..e609821901 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -663,6 +663,14 @@ public: // Board handling void RemoveStruct( BOARD_ITEM* Item, wxDC* DC ); + /** Function OnEditItemRequest + * Install the corresponding dialog editor for the given item + * @param DC = the current device context + * @param aItem = a pointer to the BOARD_ITEM to edit + */ + void OnEditItemRequest( wxDC* DC, BOARD_ITEM* aItem ); + + // Highlight functions: int Select_High_Light( wxDC* DC ); void High_Light( wxDC* DC ); @@ -922,8 +930,7 @@ public: void StartMove_Mire( MIREPCB* MirePcb, wxDC* DC ); void Place_Mire( MIREPCB* MirePcb, wxDC* DC ); void InstallMireOptionsFrame( MIREPCB* MirePcb, - wxDC* DC, - const wxPoint& pos ); + wxDC* DC ); // Graphic segments type DRAWSEGMENT handling: DRAWSEGMENT* Begin_DrawSegment( DRAWSEGMENT* Segment, int shape, wxDC* DC ); @@ -933,8 +940,7 @@ public: // Dimension handling: void Install_Edit_Dimension( DIMENSION* Dimension, - wxDC* DC, - const wxPoint& pos ); + wxDC* DC ); DIMENSION* Begin_Dimension( DIMENSION* Dimension, wxDC* DC ); void Delete_Dimension( DIMENSION* Dimension, wxDC* DC ); @@ -1051,194 +1057,4 @@ public: }; -/*********************************************************/ -/* class WinEDA_ModuleEditFrame: public WinEDA_DrawFrame */ -/* Class for the footprint editor */ -/*********************************************************/ - -class WinEDA_ModuleEditFrame : public WinEDA_BasePcbFrame -{ -public: - MODULE* CurrentModule; - wxString m_CurrentLib; - -public: - WinEDA_ModuleEditFrame( wxWindow* father, - const wxString& title, - const wxPoint& pos, const wxSize& size, - long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); - - ~WinEDA_ModuleEditFrame(); - - void InstallOptionsFrame( const wxPoint& pos ); - - void OnCloseWindow( wxCloseEvent& Event ); - void CloseModuleEditor( wxCommandEvent& Event ); - - void Process_Special_Functions( wxCommandEvent& event ); - void RedrawActiveWindow( wxDC* DC, bool EraseBg ); - void ReCreateHToolbar(); - void ReCreateVToolbar(); - void ReCreateOptToolbar(); - void ReCreateAuxiliaryToolbar(); - void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); - void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); - bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); - void SetToolbars(); - void ReCreateMenuBar(); - void ToolOnRightClick( wxCommandEvent& event ); - void OnSelectOptionToolbar( wxCommandEvent& event ); - void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ); - void Show3D_Frame( wxCommandEvent& event ); - void GeneralControle( wxDC* DC, wxPoint Mouse ); - - /** function LoadModuleFromBoard - * called from the main toolbar - * to load a footprint from board mainly to edit it - */ - void LoadModuleFromBoard( wxCommandEvent& event ); - - /** Virtual Function OnModify() - * Must be called after a footprint change - * in order to set the "modify" flag of the current screen - * and prepare, if needed the refresh of the 3D frame showing the footprint - * do not forget to call the basic OnModify function to update auxiliary info - */ - virtual void OnModify( ); - - /** function ToPrinter - * Install the print dialog - */ - void ToPrinter( wxCommandEvent& event ); - - /** Virtual function PrintPage - * used to print a page - * Print the page pointed by ActiveScreen, set by the calling print function - * @param aDC = wxDC given by the calling print function - * @param aPrint_Sheet_Ref = true to print page references - * @param aPrintMask = not used here - * @param aPrintMirrorMode = not used here (Set when printing in mirror mode) - * @param aData = a pointer on an auxiliary data (NULL if not used) - */ - virtual void PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, - int aPrintMask, bool aPrintMirrorMode, - void * aData = NULL); - - // BOARD handling - - /** function Clear_Pcb() - * delete all and reinitialize the current board - * @param aQuery = true to prompt user for confirmation, false to - * initialize silently - */ - bool Clear_Pcb( bool aQuery ); - - /* handlers for block commands */ - int ReturnBlockCommand( int key ); - virtual void HandleBlockPlace( wxDC* DC ); - virtual int HandleBlockEnd( wxDC* DC ); - - BOARD_ITEM* ModeditLocateAndDisplay( int aHotKeyCode = 0 ); - - /* Undo and redo functions */ -public: - - /** Function SaveCopyInUndoList. - * Creates a new entry in undo list of commands. - * add a picker to handle aItemToCopy - * @param aItem = the board item modified by the command to undo - * @param aTypeCommand = command type (see enum UndoRedoOpType) - * @param aTransformPoint = the reference point of the transformation, for - * commands like move - */ - virtual void SaveCopyInUndoList( BOARD_ITEM* aItem, - UndoRedoOpType aTypeCommand, - const wxPoint& aTransformPoint = - wxPoint( 0, 0 ) ); - - /** Function SaveCopyInUndoList (overloaded). - * Creates a new entry in undo list of commands. - * add a list of pickers to handle a list of items - * @param aItemsList = the list of items modified by the command to undo - * @param aTypeCommand = command type (see enum UndoRedoOpType) - * @param aTransformPoint = the reference point of the transformation, for - * commands like move - */ - virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, - UndoRedoOpType aTypeCommand, - const wxPoint& aTransformPoint = - wxPoint( 0, 0 ) ); - -private: - void GetComponentFromUndoList( wxCommandEvent& event ); - void GetComponentFromRedoList( wxCommandEvent& event ); - -public: - - // Footprint edition - void Place_Ancre( MODULE* module ); - void RemoveStruct( EDA_BaseStruct* Item ); - void Transform( MODULE* module, int transform ); - - // importing / exporting Footprint - void Export_Module( MODULE* ptmod, bool createlib ); - /** - * Function Import_Module - * Read a file containing only one footprint. - * Used to import (after exporting) a footprint - * Exported files have the standard ext .emp - * This is the same format as .mod files but restricted to only one footprint - * The import function can also read gpcb footprint file, in Newlib format - * (One footprint per file, Newlib files have no special ext.) - * @param DC = Current Device Context (can be NULL) - */ - MODULE* Import_Module( ); - - - /** function Load_Module_From_BOARD - * load in Modedit a footfrint from the main board - * @param Module = the module to load. If NULL, a module reference will we asked to user - * @return true if a module isloaded, false otherwise. - */ - bool Load_Module_From_BOARD( MODULE* Module ); - - /** Function Select_1_Module_From_BOARD - * Display the list of modules currently existing on the BOARD - * @return a pointer to a module if this module is selected or NULL otherwise - * @param aPcb = the board from modules can be loaded - */ - MODULE* Select_1_Module_From_BOARD( BOARD* aPcb ); - - // functions to edit footprint edges - - /** Function Edit_Edge_Width - * changes the width of module perimeter lines, EDGE_MODULEs. - * param ModuleSegmentWidth (global) = new width - * @param aEdge = edge to edit, or NULL. If aEdge == NULL change - * the width of all footprint's edges - */ - void Edit_Edge_Width( EDGE_MODULE* aEdge ); - void Edit_Edge_Layer( EDGE_MODULE* Edge ); - void Delete_Edge_Module( EDGE_MODULE* Edge ); - EDGE_MODULE* Begin_Edge_Module( EDGE_MODULE* Edge, wxDC* DC, int type_edge ); - void End_Edge_Module( EDGE_MODULE* Edge ); - /** function Enter_Edge_Width - * Edition of the edge items width - * Ask for a new width. - * Change the width of EDGE_MODULE Edge if aEdge != NULL - * @param aEdge = edge to edit, or NULL - * @output ModuleSegmentWidth (global) = new width - */ - void Enter_Edge_Width( EDGE_MODULE* aEdge ); - void Start_Move_EdgeMod( EDGE_MODULE* drawitem, wxDC* DC ); - void Place_EdgeMod( EDGE_MODULE* drawitem ); - - // handlers for libraries: - void Delete_Module_In_Library( const wxString& libname ); - int Create_Librairie( const wxString& LibName ); - void Select_Active_Library(); - - DECLARE_EVENT_TABLE() -}; - #endif /* WXPCB_STRUCT_H */ diff --git a/pcbnew/block_module_editor.cpp b/pcbnew/block_module_editor.cpp index 7586cec52d..c389eb090f 100644 --- a/pcbnew/block_module_editor.cpp +++ b/pcbnew/block_module_editor.cpp @@ -13,6 +13,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "autorout.h" #include "pcbplot.h" #include "trigo.h" diff --git a/pcbnew/dialog_edit_module_for_Modedit.cpp b/pcbnew/dialog_edit_module_for_Modedit.cpp index 8fdefb908c..11e6af1550 100644 --- a/pcbnew/dialog_edit_module_for_Modedit.cpp +++ b/pcbnew/dialog_edit_module_for_Modedit.cpp @@ -13,6 +13,7 @@ #include "3d_struct.h" #include "3d_viewer.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "dialog_edit_module_for_Modedit.h" /**************************************************************************************/ diff --git a/pcbnew/dialog_graphic_items_options.cpp b/pcbnew/dialog_graphic_items_options.cpp index 158b6e1cd9..9d89aca496 100644 --- a/pcbnew/dialog_graphic_items_options.cpp +++ b/pcbnew/dialog_graphic_items_options.cpp @@ -8,6 +8,7 @@ #include "common.h" #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "pcbnew_id.h" diff --git a/pcbnew/dialog_print_for_modedit.cpp b/pcbnew/dialog_print_for_modedit.cpp index 4dee1258cd..ae0d1619e6 100644 --- a/pcbnew/dialog_print_for_modedit.cpp +++ b/pcbnew/dialog_print_for_modedit.cpp @@ -12,6 +12,7 @@ #include "confirm.h" #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "pcbplot.h" #include "dialog_print_for_modedit_base.h" diff --git a/pcbnew/dimension.cpp b/pcbnew/dimension.cpp index 764f314c01..b565895c7b 100644 --- a/pcbnew/dimension.cpp +++ b/pcbnew/dimension.cpp @@ -11,19 +11,19 @@ #include "class_board_design_settings.h" #include "drawtxt.h" -/* Routines Locales */ +/* Loca functions */ static void Exit_EditDimension( WinEDA_DrawPanel* Panel, wxDC* DC ); static void Montre_Position_New_Dimension( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); -/* Variables "locales" : */ -static int status_dimension; /* = 0 : pas de dimension en cours - * = 1 : debut place, fin a placer - * = 2 : fin placee, texte a ajuster */ +/* Local variables : */ +static int status_dimension; /* Used in cimension creation: + * = 0 : initial value: no dimension in progress + * = 1 : First point created + * = 2 : Secont point created, the text must be placed */ /* - * Les routines generent une dimension de la forme - * - cote usuelle: - * + * A dimension has this shape: + * It has 2 reference points, and a text * | | * | dist | * |<---------->| @@ -53,7 +53,7 @@ public: // Constructor and destructor DIMENSION_EDITOR_DIALOG( WinEDA_PcbFrame* parent, - DIMENSION* Dimension, wxDC* DC, const wxPoint& pos ); + DIMENSION* Dimension, wxDC* DC ); ~DIMENSION_EDITOR_DIALOG() { } @@ -73,10 +73,9 @@ END_EVENT_TABLE() DIMENSION_EDITOR_DIALOG::DIMENSION_EDITOR_DIALOG( WinEDA_PcbFrame* parent, - DIMENSION* Dimension, wxDC* DC, - const wxPoint& framepos ) : - wxDialog( parent, -1, _( "Dimension properties" ), framepos, wxSize( 340, 270 ), - DIALOG_STYLE ) + DIMENSION* Dimension, wxDC* DC + ) : + wxDialog( parent, -1, _( "Dimension properties" ) ) { wxButton* Button; @@ -350,14 +349,13 @@ static void Montre_Position_New_Dimension( WinEDA_DrawPanel* panel, wxDC* DC, bo /***************************************************************/ -void WinEDA_PcbFrame::Install_Edit_Dimension( DIMENSION* Dimension, - wxDC* DC, const wxPoint& pos ) +void WinEDA_PcbFrame::Install_Edit_Dimension( DIMENSION* Dimension, wxDC* DC ) /***************************************************************/ { if( Dimension == NULL ) return; - DIMENSION_EDITOR_DIALOG* frame = new DIMENSION_EDITOR_DIALOG( this, Dimension, DC, pos ); + DIMENSION_EDITOR_DIALOG* frame = new DIMENSION_EDITOR_DIALOG( this, Dimension, DC ); frame->ShowModal(); frame->Destroy(); } diff --git a/pcbnew/edgemod.cpp b/pcbnew/edgemod.cpp index 4e2ddecc6f..79d1980670 100644 --- a/pcbnew/edgemod.cpp +++ b/pcbnew/edgemod.cpp @@ -16,6 +16,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" static void ShowEdgeModule( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 9b5970fffd..8f4b99b1be 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -12,6 +12,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "class_board_design_settings.h" #include "autorout.h" #include "protos.h" @@ -807,7 +808,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) break; case ID_POPUP_PCB_EDIT_MIRE: - InstallMireOptionsFrame( (MIREPCB*) GetCurItem(), &dc, pos ); + InstallMireOptionsFrame( (MIREPCB*) GetCurItem(), &dc ); DrawPanel->MouseToCursorSchema(); break; @@ -824,7 +825,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) break; case ID_POPUP_PCB_EDIT_DIMENSION: - Install_Edit_Dimension( (DIMENSION*) GetCurItem(), &dc, pos ); + Install_Edit_Dimension( (DIMENSION*) GetCurItem(), &dc ); DrawPanel->MouseToCursorSchema(); break; diff --git a/pcbnew/editmod.cpp b/pcbnew/editmod.cpp index 7a9a9ca767..e57bdeb734 100644 --- a/pcbnew/editmod.cpp +++ b/pcbnew/editmod.cpp @@ -9,6 +9,7 @@ #include "confirm.h" #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "trigo.h" #include "3d_viewer.h" diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index 7f96e4ec77..2c9a0b4d2c 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -6,6 +6,7 @@ #include "common.h" #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "pcbnew_id.h" #include "class_drawpanel.h" #include "confirm.h" @@ -72,13 +73,14 @@ static Ki_HotkeyInfo HkSwitchTrackPosture( wxT( "Switch Track Posture" ), static Ki_HotkeyInfo HkAddMicroVia( wxT( "Add MicroVia" ), HK_ADD_MICROVIA, 'V' + GR_KB_CTRL ); static Ki_HotkeyInfo HkEndTrack( wxT( "End Track" ), HK_END_TRACK, WXK_END ); +static Ki_HotkeyInfo HkEditBoardItem( wxT( "Edit Item" ), HK_EDIT_ITEM, 'E' ); static Ki_HotkeyInfo HkFlipFootprint( wxT( "Flip Footprint" ), HK_FLIP_FOOTPRINT, 'F' ); static Ki_HotkeyInfo HkRotateFootprint( wxT( "Rotate Footprint" ), HK_ROTATE_FOOTPRINT, 'R' ); -static Ki_HotkeyInfo HkMoveFootprint( wxT( "Move Footprint" ), HK_MOVE_FOOTPRINT, +static Ki_HotkeyInfo HkMoveFootprint( wxT( "Move Footprint" ), HK_MOVE_FOOTPRINT_OR_TRACK, 'M' ); -static Ki_HotkeyInfo HkDragFootprint( wxT( "Drag Footprint" ), HK_DRAG_FOOTPRINT, +static Ki_HotkeyInfo HkDragFootprint( wxT( "Drag Footprint" ), HK_DRAG_FOOTPRINT_OR_TRACK, 'G' ); static Ki_HotkeyInfo HkGetAndMoveFootprint( wxT( "Get and Move Footprint" ), HK_GET_AND_MOVE_FOOTPRINT, 'T' ); @@ -163,8 +165,8 @@ Ki_HotkeyInfo* s_board_edit_Hotkey_List[] = &HkEndTrack, &HkMoveFootprint, &HkFlipFootprint, &HkRotateFootprint, &HkDragFootprint, &HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, &HkSavefile, - &HkLoadfile, &HkFindItem, &HkSwitch2CopperLayer, - &HkSwitch2InnerLayer1, + &HkLoadfile, &HkFindItem, &HkEditBoardItem, + &HkSwitch2CopperLayer, &HkSwitch2InnerLayer1, &HkSwitch2InnerLayer2, &HkSwitch2InnerLayer3, &HkSwitch2InnerLayer4, &HkSwitch2InnerLayer5, &HkSwitch2InnerLayer6, &HkSwitch2ComponentLayer, &HkSwitch2NextCopperLayer, &HkSwitch2PreviousCopperLayer,&HkAddModule, @@ -540,6 +542,17 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct } break; + case HK_EDIT_ITEM: // Edit board item + if( ItemFree ) + { + BOARD_ITEM * item = PcbGeneralLocateAndDisplay(); + if ( item == NULL ) + break; + //An item is found, and some can be edited: + OnEditItemRequest( DC, item ); + } + break; + // Footprint edition: case HK_LOCK_UNLOCK_FOOTPRINT: // toggle module "MODULE_is_LOCKED" status: // get any module, locked or not locked and toggle its locked status @@ -556,11 +569,11 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct } break; - case HK_DRAG_FOOTPRINT: // Start move (and drag) module - case HK_MOVE_FOOTPRINT: // Start move module + case HK_DRAG_FOOTPRINT_OR_TRACK: // Start move (and drag) module or track segment + case HK_MOVE_FOOTPRINT_OR_TRACK: // Start move module or track segment if( PopupOn ) break; - + // Fall through on hot key case HK_ROTATE_FOOTPRINT: // Rotation case HK_FLIP_FOOTPRINT: // move to other side int exit = 0; @@ -575,7 +588,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct || DrawStruct->Type() == TYPE_VIA) ) switch( HK_Descr->m_Idcommand ) { - case HK_DRAG_FOOTPRINT: // Start move (and drag) module + case HK_DRAG_FOOTPRINT_OR_TRACK: // Start drag track segment DrawPanel->MouseToCursorSchema(); //Start_DragTrackSegmentAndKeepSlope( (TRACK*) DrawStruct,DC ); @@ -584,7 +597,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct break; // fall through - case HK_MOVE_FOOTPRINT: // Start move module + case HK_MOVE_FOOTPRINT_OR_TRACK: // Start move track segment DrawPanel->MouseToCursorSchema(); Start_MoveOneNodeOrSegment( (TRACK*) DrawStruct, DC, ID_POPUP_PCB_MOVE_TRACK_NODE ); @@ -646,7 +659,6 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct { // Send the module via socket to EESCHEMA's search facility. SendMessageToEESCHEMA( module ); - SetCurItem( module ); } @@ -664,11 +676,11 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct Change_Side_Module( module, DC ); break; - case HK_DRAG_FOOTPRINT: // Start move (and drag) module + case HK_DRAG_FOOTPRINT_OR_TRACK: // Start move (and drag) module g_Drag_Pistes_On = TRUE; // fall through - case HK_MOVE_FOOTPRINT: // Start move module + case HK_MOVE_FOOTPRINT_OR_TRACK: // Start move module GetScreen()->m_Curseur = module->m_Pos; DrawPanel->MouseToCursorSchema(); StartMove_Module( module, DC ); diff --git a/pcbnew/hotkeys.h b/pcbnew/hotkeys.h index e3d172d420..3fe33f8243 100644 --- a/pcbnew/hotkeys.h +++ b/pcbnew/hotkeys.h @@ -14,8 +14,8 @@ enum hotkey_id_commnand { HK_DELETE = HK_COMMON_END, HK_BACK_SPACE, HK_ROTATE_FOOTPRINT, - HK_MOVE_FOOTPRINT, - HK_DRAG_FOOTPRINT, + HK_MOVE_FOOTPRINT_OR_TRACK, + HK_DRAG_FOOTPRINT_OR_TRACK, HK_FLIP_FOOTPRINT, HK_GET_AND_MOVE_FOOTPRINT, HK_LOCK_UNLOCK_FOOTPRINT, @@ -28,6 +28,7 @@ enum hotkey_id_commnand { HK_SWITCH_UNITS, HK_SWITCH_TRACK_DISPLAY_MODE, HK_FIND_ITEM, + HK_EDIT_ITEM, HK_SWITCH_LAYER_TO_COPPER, HK_SWITCH_LAYER_TO_COMPONENT, HK_SWITCH_LAYER_TO_NEXT, diff --git a/pcbnew/initpcb.cpp b/pcbnew/initpcb.cpp index 55b190d672..8138dc9303 100644 --- a/pcbnew/initpcb.cpp +++ b/pcbnew/initpcb.cpp @@ -9,6 +9,7 @@ #include "confirm.h" #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "class_board_design_settings.h" #include "protos.h" diff --git a/pcbnew/librairi.cpp b/pcbnew/librairi.cpp index d82ddc6b97..59eff5a689 100644 --- a/pcbnew/librairi.cpp +++ b/pcbnew/librairi.cpp @@ -11,6 +11,7 @@ #include "gestfich.h" #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "protos.h" /* diff --git a/pcbnew/loadcmp.cpp b/pcbnew/loadcmp.cpp index b0362addb4..e6a0fe1734 100644 --- a/pcbnew/loadcmp.cpp +++ b/pcbnew/loadcmp.cpp @@ -15,6 +15,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "protos.h" class ModList diff --git a/pcbnew/menubar_modedit.cpp b/pcbnew/menubar_modedit.cpp index 425b6bdf6a..82192d2067 100644 --- a/pcbnew/menubar_modedit.cpp +++ b/pcbnew/menubar_modedit.cpp @@ -7,6 +7,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "bitmaps.h" #include "protos.h" diff --git a/pcbnew/mirepcb.cpp b/pcbnew/mirepcb.cpp index b80cecc513..b6ff2cfbae 100644 --- a/pcbnew/mirepcb.cpp +++ b/pcbnew/mirepcb.cpp @@ -28,10 +28,10 @@ static MIREPCB s_TargetCopy( NULL ); /* Used to store "old" values of the */ /************************************/ -/* class WinEDA_MirePropertiesFrame */ +/* class TARGET_PROPERTIES_DIALOG_EDITOR */ /************************************/ -class WinEDA_MirePropertiesFrame : public wxDialog +class TARGET_PROPERTIES_DIALOG_EDITOR : public wxDialog { private: @@ -42,11 +42,10 @@ private: WinEDA_ValueCtrl* m_MireSizeCtrl; wxRadioBox* m_MireShape; -public: WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, +public: TARGET_PROPERTIES_DIALOG_EDITOR( WinEDA_PcbFrame* parent, MIREPCB* Mire, - wxDC* DC, - const wxPoint& pos ); - ~WinEDA_MirePropertiesFrame() { } + wxDC* DC ); + ~TARGET_PROPERTIES_DIALOG_EDITOR() { } private: void OnOkClick( wxCommandEvent& event ); @@ -55,29 +54,26 @@ private: DECLARE_EVENT_TABLE() }; -BEGIN_EVENT_TABLE( WinEDA_MirePropertiesFrame, wxDialog ) - EVT_BUTTON( wxID_OK, WinEDA_MirePropertiesFrame::OnOkClick ) - EVT_BUTTON( wxID_CANCEL, WinEDA_MirePropertiesFrame::OnCancelClick ) +BEGIN_EVENT_TABLE( TARGET_PROPERTIES_DIALOG_EDITOR, wxDialog ) + EVT_BUTTON( wxID_OK, TARGET_PROPERTIES_DIALOG_EDITOR::OnOkClick ) + EVT_BUTTON( wxID_CANCEL, TARGET_PROPERTIES_DIALOG_EDITOR::OnCancelClick ) END_EVENT_TABLE() -void WinEDA_PcbFrame::InstallMireOptionsFrame( MIREPCB* MirePcb, - wxDC* DC, const wxPoint& pos ) +void WinEDA_PcbFrame::InstallMireOptionsFrame( MIREPCB* MirePcb, wxDC* DC ) { - WinEDA_MirePropertiesFrame* frame = - new WinEDA_MirePropertiesFrame( this, MirePcb, DC, pos ); + TARGET_PROPERTIES_DIALOG_EDITOR* frame = + new TARGET_PROPERTIES_DIALOG_EDITOR( this, MirePcb, DC ); frame->ShowModal(); frame->Destroy(); } -WinEDA_MirePropertiesFrame::WinEDA_MirePropertiesFrame( +TARGET_PROPERTIES_DIALOG_EDITOR::TARGET_PROPERTIES_DIALOG_EDITOR( WinEDA_PcbFrame* parent, - MIREPCB* Mire, wxDC* DC, - const wxPoint& framepos ) : - wxDialog( parent, -1, _( "Target Properties" ), framepos, wxSize( 270, 210 ), - DIALOG_STYLE ) + MIREPCB* Mire, wxDC* DC ) : + wxDialog( parent, wxID_ANY, _( "Target Properties" ) ) { wxString number; wxButton* Button; @@ -128,7 +124,7 @@ WinEDA_MirePropertiesFrame::WinEDA_MirePropertiesFrame( } -void WinEDA_MirePropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED( +void TARGET_PROPERTIES_DIALOG_EDITOR::OnCancelClick( wxCommandEvent& WXUNUSED( event ) ) { EndModal( -1 ); @@ -137,7 +133,7 @@ void WinEDA_MirePropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED( /* Updates the different parameters for the component being edited */ -void WinEDA_MirePropertiesFrame::OnOkClick( wxCommandEvent& event ) +void TARGET_PROPERTIES_DIALOG_EDITOR::OnOkClick( wxCommandEvent& event ) { m_MirePcb->Draw( m_Parent->DrawPanel, m_DC, GR_XOR ); diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index ae42dab119..bb79bcca5a 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -15,6 +15,7 @@ #include "3d_viewer.h" #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "protos.h" #include "kicad_device_context.h" diff --git a/pcbnew/modedit_onclick.cpp b/pcbnew/modedit_onclick.cpp index 4829554d20..f6e8dcf48d 100644 --- a/pcbnew/modedit_onclick.cpp +++ b/pcbnew/modedit_onclick.cpp @@ -10,6 +10,7 @@ #include "3d_viewer.h" #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "dialog_edit_module_for_Modedit.h" #include "bitmaps.h" diff --git a/pcbnew/modedit_undo_redo.cpp b/pcbnew/modedit_undo_redo.cpp index 20f6526dcc..3c7c41c03d 100644 --- a/pcbnew/modedit_undo_redo.cpp +++ b/pcbnew/modedit_undo_redo.cpp @@ -8,6 +8,7 @@ #include "common.h" #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "protos.h" diff --git a/pcbnew/modeditoptions.cpp b/pcbnew/modeditoptions.cpp index f3cb37e0c5..6a5fa0ddac 100644 --- a/pcbnew/modeditoptions.cpp +++ b/pcbnew/modeditoptions.cpp @@ -9,6 +9,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "pcbnew_id.h" diff --git a/pcbnew/module_editor_frame.h b/pcbnew/module_editor_frame.h new file mode 100644 index 0000000000..860e2ccb65 --- /dev/null +++ b/pcbnew/module_editor_frame.h @@ -0,0 +1,197 @@ + +/*********************************************************/ +/* class WinEDA_ModuleEditFrame: public WinEDA_DrawFrame */ +/* Class for the footprint editor */ +/*********************************************************/ + +#ifndef _MODULE_EDITOR_FRAME_H_ +#define _MODULE_EDITOR_FRAME_H_ + + +class WinEDA_ModuleEditFrame : public WinEDA_BasePcbFrame +{ +public: + MODULE* CurrentModule; + wxString m_CurrentLib; + +public: + WinEDA_ModuleEditFrame( wxWindow* father, + const wxString& title, + const wxPoint& pos, const wxSize& size, + long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); + + ~WinEDA_ModuleEditFrame(); + + void InstallOptionsFrame( const wxPoint& pos ); + + void OnCloseWindow( wxCloseEvent& Event ); + void CloseModuleEditor( wxCommandEvent& Event ); + + void Process_Special_Functions( wxCommandEvent& event ); + void RedrawActiveWindow( wxDC* DC, bool EraseBg ); + void ReCreateHToolbar(); + void ReCreateVToolbar(); + void ReCreateOptToolbar(); + void ReCreateAuxiliaryToolbar(); + void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); + void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); + bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); + void SetToolbars(); + void ReCreateMenuBar(); + void ToolOnRightClick( wxCommandEvent& event ); + void OnSelectOptionToolbar( wxCommandEvent& event ); + void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ); + void Show3D_Frame( wxCommandEvent& event ); + void GeneralControle( wxDC* DC, wxPoint Mouse ); + + /** function LoadModuleFromBoard + * called from the main toolbar + * to load a footprint from board mainly to edit it + */ + void LoadModuleFromBoard( wxCommandEvent& event ); + + /** Virtual Function OnModify() + * Must be called after a footprint change + * in order to set the "modify" flag of the current screen + * and prepare, if needed the refresh of the 3D frame showing the footprint + * do not forget to call the basic OnModify function to update auxiliary info + */ + virtual void OnModify( ); + + /** function ToPrinter + * Install the print dialog + */ + void ToPrinter( wxCommandEvent& event ); + + /** Virtual function PrintPage + * used to print a page + * Print the page pointed by ActiveScreen, set by the calling print function + * @param aDC = wxDC given by the calling print function + * @param aPrint_Sheet_Ref = true to print page references + * @param aPrintMask = not used here + * @param aPrintMirrorMode = not used here (Set when printing in mirror mode) + * @param aData = a pointer on an auxiliary data (NULL if not used) + */ + virtual void PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, + int aPrintMask, bool aPrintMirrorMode, + void * aData = NULL); + + // BOARD handling + + /** function Clear_Pcb() + * delete all and reinitialize the current board + * @param aQuery = true to prompt user for confirmation, false to + * initialize silently + */ + bool Clear_Pcb( bool aQuery ); + + /* handlers for block commands */ + int ReturnBlockCommand( int key ); + virtual void HandleBlockPlace( wxDC* DC ); + virtual int HandleBlockEnd( wxDC* DC ); + + BOARD_ITEM* ModeditLocateAndDisplay( int aHotKeyCode = 0 ); + + /* Undo and redo functions */ +public: + + /** Function SaveCopyInUndoList. + * Creates a new entry in undo list of commands. + * add a picker to handle aItemToCopy + * @param aItem = the board item modified by the command to undo + * @param aTypeCommand = command type (see enum UndoRedoOpType) + * @param aTransformPoint = the reference point of the transformation, for + * commands like move + */ + virtual void SaveCopyInUndoList( BOARD_ITEM* aItem, + UndoRedoOpType aTypeCommand, + const wxPoint& aTransformPoint = + wxPoint( 0, 0 ) ); + + /** Function SaveCopyInUndoList (overloaded). + * Creates a new entry in undo list of commands. + * add a list of pickers to handle a list of items + * @param aItemsList = the list of items modified by the command to undo + * @param aTypeCommand = command type (see enum UndoRedoOpType) + * @param aTransformPoint = the reference point of the transformation, for + * commands like move + */ + virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, + UndoRedoOpType aTypeCommand, + const wxPoint& aTransformPoint = + wxPoint( 0, 0 ) ); + +private: + void GetComponentFromUndoList( wxCommandEvent& event ); + void GetComponentFromRedoList( wxCommandEvent& event ); + +public: + + // Footprint edition + void Place_Ancre( MODULE* module ); + void RemoveStruct( EDA_BaseStruct* Item ); + void Transform( MODULE* module, int transform ); + + // importing / exporting Footprint + void Export_Module( MODULE* ptmod, bool createlib ); + /** + * Function Import_Module + * Read a file containing only one footprint. + * Used to import (after exporting) a footprint + * Exported files have the standard ext .emp + * This is the same format as .mod files but restricted to only one footprint + * The import function can also read gpcb footprint file, in Newlib format + * (One footprint per file, Newlib files have no special ext.) + * @param DC = Current Device Context (can be NULL) + */ + MODULE* Import_Module( ); + + + /** function Load_Module_From_BOARD + * load in Modedit a footfrint from the main board + * @param Module = the module to load. If NULL, a module reference will we asked to user + * @return true if a module isloaded, false otherwise. + */ + bool Load_Module_From_BOARD( MODULE* Module ); + + /** Function Select_1_Module_From_BOARD + * Display the list of modules currently existing on the BOARD + * @return a pointer to a module if this module is selected or NULL otherwise + * @param aPcb = the board from modules can be loaded + */ + MODULE* Select_1_Module_From_BOARD( BOARD* aPcb ); + + // functions to edit footprint edges + + /** Function Edit_Edge_Width + * changes the width of module perimeter lines, EDGE_MODULEs. + * param ModuleSegmentWidth (global) = new width + * @param aEdge = edge to edit, or NULL. If aEdge == NULL change + * the width of all footprint's edges + */ + void Edit_Edge_Width( EDGE_MODULE* aEdge ); + void Edit_Edge_Layer( EDGE_MODULE* Edge ); + void Delete_Edge_Module( EDGE_MODULE* Edge ); + EDGE_MODULE* Begin_Edge_Module( EDGE_MODULE* Edge, wxDC* DC, int type_edge ); + void End_Edge_Module( EDGE_MODULE* Edge ); + /** function Enter_Edge_Width + * Edition of the edge items width + * Ask for a new width. + * Change the width of EDGE_MODULE Edge if aEdge != NULL + * @param aEdge = edge to edit, or NULL + * @output ModuleSegmentWidth (global) = new width + */ + void Enter_Edge_Width( EDGE_MODULE* aEdge ); + void Start_Move_EdgeMod( EDGE_MODULE* drawitem, wxDC* DC ); + void Place_EdgeMod( EDGE_MODULE* drawitem ); + + // handlers for libraries: + void Delete_Module_In_Library( const wxString& libname ); + int Create_Librairie( const wxString& LibName ); + void Select_Active_Library(); + + DECLARE_EVENT_TABLE() +}; + +#endif // #define _MODULE_EDITOR_FRAME_H_ + diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp index 14428dbd1a..0933ea1335 100644 --- a/pcbnew/moduleframe.cpp +++ b/pcbnew/moduleframe.cpp @@ -9,6 +9,7 @@ #include "confirm.h" #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "bitmaps.h" #include "protos.h" #include "pcbnew_id.h" diff --git a/pcbnew/onleftclick.cpp b/pcbnew/onleftclick.cpp index e3bdd78be9..9f32038fb5 100644 --- a/pcbnew/onleftclick.cpp +++ b/pcbnew/onleftclick.cpp @@ -389,15 +389,11 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) } -/********************************************************************************/ -void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) -/********************************************************************************/ - /* handle the double click on the mouse left button */ +void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) { BOARD_ITEM* DrawStruct = GetCurItem(); - wxPoint pos = GetPosition(); switch( m_ID_current_state ) { @@ -431,43 +427,23 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) break; case TYPE_TEXTE: - InstallTextPCBOptionsFrame( (TEXTE_PCB*) DrawStruct, DC ); - DrawPanel->MouseToCursorSchema(); - break; - case TYPE_PAD: - InstallPadOptionsFrame( (D_PAD*) DrawStruct ); - DrawPanel->MouseToCursorSchema(); - break; - case TYPE_MODULE: - InstallModuleOptionsFrame( (MODULE*) DrawStruct, DC ); - DrawPanel->MouseToCursorSchema(); - break; - case TYPE_MIRE: - InstallMireOptionsFrame( (MIREPCB*) DrawStruct, DC, pos ); - DrawPanel->MouseToCursorSchema(); - break; - case TYPE_DIMENSION: - Install_Edit_Dimension( (DIMENSION*) DrawStruct, DC, pos ); - DrawPanel->MouseToCursorSchema(); - break; - case TYPE_TEXTE_MODULE: - InstallTextModOptionsFrame( (TEXTE_MODULE*) DrawStruct, DC ); + OnEditItemRequest( DC, DrawStruct ); DrawPanel->MouseToCursorSchema(); break; case TYPE_DRAWSEGMENT: - InstallGraphicItemPropertiesDialog( (DRAWSEGMENT*) DrawStruct, DC ); + OnEditItemRequest( DC, DrawStruct ); break; case TYPE_ZONE_CONTAINER: if( DrawStruct->m_Flags ) break; - Edit_Zone_Params( DC, (ZONE_CONTAINER*) DrawStruct ); + OnEditItemRequest( DC, DrawStruct ); break; default: @@ -512,3 +488,57 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) break; } } + + + +/** Function OnEditItemRequest + * Install the corresponding dialog editor for the given item + * @param DC = the current device context + * @param aItem = a pointer to the BOARD_ITEM to edit + */ +void WinEDA_PcbFrame::OnEditItemRequest( wxDC* DC, BOARD_ITEM* aItem ) +{ + switch( aItem->Type() ) + { + case TYPE_TRACK: + case TYPE_VIA: + Edit_TrackSegm_Width( DC, (TRACK*) aItem ); + break; + + case TYPE_TEXTE: + InstallTextPCBOptionsFrame( (TEXTE_PCB*) aItem, DC ); + break; + + case TYPE_PAD: + InstallPadOptionsFrame( (D_PAD*) aItem ); + break; + + case TYPE_MODULE: + InstallModuleOptionsFrame( (MODULE*) aItem, DC ); + break; + + case TYPE_MIRE: + InstallMireOptionsFrame( (MIREPCB*) aItem, DC ); + break; + + case TYPE_DIMENSION: + Install_Edit_Dimension( (DIMENSION*) aItem, DC ); + break; + + case TYPE_TEXTE_MODULE: + InstallTextModOptionsFrame( (TEXTE_MODULE*) aItem, DC ); + break; + + case TYPE_DRAWSEGMENT: + InstallGraphicItemPropertiesDialog( (DRAWSEGMENT*) aItem, DC ); + break; + + case TYPE_ZONE_CONTAINER: + Edit_Zone_Params( DC, (ZONE_CONTAINER*) aItem ); + break; + + default: + break; + } +} + diff --git a/pcbnew/onrightclick.cpp b/pcbnew/onrightclick.cpp index 0afc53e7e7..bde060f003 100644 --- a/pcbnew/onrightclick.cpp +++ b/pcbnew/onrightclick.cpp @@ -214,8 +214,9 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) case TYPE_DIMENSION: if( !flags ) { + msg = AddHotkeyName( _( "Edit Dimension" ), s_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_DIMENSION, - _( "Edit Dimension" ), edit_xpm ); + msg, edit_xpm ); ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_DIMENSION, _( "Delete Dimension" ), delete_xpm ); } @@ -226,8 +227,9 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) { ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_MOVE_MIRE_REQUEST, _( "Move Target" ), move_xpm ); + msg = AddHotkeyName( _( "Edit Target" ), s_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_MIRE, - _( "Edit Target" ), edit_xpm ); + msg, edit_xpm ); ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MIRE, _( "Delete Target" ), delete_xpm ); } @@ -471,8 +473,9 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) } else { - ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, _( - "Change Segment Width" ), width_segment_xpm ); + msg = AddHotkeyName( _( "Change Segment Width" ), s_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); + ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, + msg, width_segment_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TRACK, _( "Change Track Width" ), width_track_xpm ); } @@ -543,6 +546,8 @@ void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu /* Create the wxMenuitem list for zone outlines editing and zone filling */ { + wxString msg; + if( edge_zone->m_Flags == IS_DRAGGED ) { ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_DRAGGED_ZONE_OUTLINE_SEGMENT, @@ -599,8 +604,9 @@ void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu ADD_MENUITEM( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES, _( "Move Zone" ), move_xpm ); + msg = AddHotkeyName( _( "Edit Zone Params" ), s_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); ADD_MENUITEM( zones_menu, ID_POPUP_PCB_EDIT_ZONE_PARAMS, - _( "Edit Zone Params" ), edit_xpm ); + msg, edit_xpm ); zones_menu->AppendSeparator(); if( index >= 0 && edge_zone->m_Poly->IsCutoutContour( edge_zone->m_CornerSelection ) ) @@ -630,10 +636,10 @@ void WinEDA_PcbFrame::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* men ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_footprint, -1, msg, module_xpm ); if( !flags ) { - msg = AddHotkeyName( _( "Move" ), s_Board_Editor_Hokeys_Descr, HK_MOVE_FOOTPRINT ); + msg = AddHotkeyName( _( "Move" ), s_Board_Editor_Hokeys_Descr, HK_MOVE_FOOTPRINT_OR_TRACK ); ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_MOVE_MODULE_REQUEST, msg, move_module_xpm ); - msg = AddHotkeyName( _( "Drag" ), s_Board_Editor_Hokeys_Descr, HK_DRAG_FOOTPRINT ); + msg = AddHotkeyName( _( "Drag" ), s_Board_Editor_Hokeys_Descr, HK_DRAG_FOOTPRINT_OR_TRACK ); ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_DRAG_MODULE_REQUEST, msg, drag_module_xpm ); } @@ -648,8 +654,9 @@ void WinEDA_PcbFrame::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* men if( !flags ) { + msg = AddHotkeyName( _( "Edit" ), s_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE, - _( "Edit" ), edit_module_xpm ); + msg, edit_module_xpm ); sub_menu_footprint->AppendSeparator(); ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_DELETE_MODULE, _( "Delete Module" ), delete_module_xpm ); @@ -680,8 +687,11 @@ void WinEDA_PcbFrame::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* m ADD_MENUITEM( sub_menu_Fp_text, ID_POPUP_PCB_ROTATE_TEXTMODULE, _( "Rotate" ), rotate_field_xpm ); if( !flags ) + { + msg = AddHotkeyName( _( "Edit" ), s_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); ADD_MENUITEM( sub_menu_Fp_text, ID_POPUP_PCB_EDIT_TEXTMODULE, - _( "Edit" ), edit_text_xpm ); + msg, edit_text_xpm ); + } if( !flags && FpText->m_Type == TEXT_is_DIVERS ) // Graphic texts can be deleted only if are not currently edited { @@ -729,7 +739,8 @@ void WinEDA_PcbFrame::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu ) ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_DRAG_PAD_REQUEST, _( "Drag" ), drag_pad_xpm ); - ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_EDIT_PAD, _( "Edit Pad" ), options_pad_xpm ); + msg = AddHotkeyName( _( "Edit Pad" ), s_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); + ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_EDIT_PAD, msg, options_pad_xpm ); sub_menu_Pad->AppendSeparator(); ADD_MENUITEM_WITH_HELP( sub_menu_Pad, ID_POPUP_PCB_IMPORT_PAD_SETTINGS, @@ -785,8 +796,9 @@ void WinEDA_PcbFrame::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu ) } ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_ROTATE_TEXTEPCB, _( "Rotate" ), rotate_pos_xpm ); + msg = AddHotkeyName( _( "Edit" ), s_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_EDIT_TEXTEPCB, - _( "Edit" ), edit_text_xpm ); + msg, edit_text_xpm ); sub_menu_Text->AppendSeparator(); ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_DELETE_TEXTEPCB, diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 2a9e295c5f..16493ca265 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -48,6 +48,7 @@ #include "class_pcb_layer_widget.h" #include "hotkeys.h" #include "pcbnew_config.h" +#include "module_editor_frame.h" extern int g_DrawDefaultLineThickness; diff --git a/pcbnew/print_board_functions.cpp b/pcbnew/print_board_functions.cpp index 10e02c7e04..b4eb01eba8 100644 --- a/pcbnew/print_board_functions.cpp +++ b/pcbnew/print_board_functions.cpp @@ -8,6 +8,7 @@ #include "class_drawpanel.h" #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "class_board_design_settings.h" #include "pcbplot.h" #include "printout_controler.h" diff --git a/pcbnew/tool_modedit.cpp b/pcbnew/tool_modedit.cpp index 33dda707f2..8c7fbda220 100644 --- a/pcbnew/tool_modedit.cpp +++ b/pcbnew/tool_modedit.cpp @@ -7,6 +7,7 @@ #include "common.h" #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "protos.h" diff --git a/pcbnew/tool_onrightclick.cpp b/pcbnew/tool_onrightclick.cpp index d4b8030e8c..0097d0ccb6 100644 --- a/pcbnew/tool_onrightclick.cpp +++ b/pcbnew/tool_onrightclick.cpp @@ -7,6 +7,7 @@ #include "confirm.h" #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "dialog_design_rules.h" #include "pcbnew_id.h" diff --git a/pcbnew/tracepcb.cpp b/pcbnew/tracepcb.cpp index 6337b3377e..8b32bb647f 100644 --- a/pcbnew/tracepcb.cpp +++ b/pcbnew/tracepcb.cpp @@ -15,6 +15,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" +#include "module_editor_frame.h" #include "pcbplot.h" #include "protos.h"