From 43d6c685b5bcf28055bc590b80165926e497f1bf Mon Sep 17 00:00:00 2001 From: stambaughw Date: Tue, 22 Sep 2009 12:27:57 +0000 Subject: [PATCH] Command ID refactoring and other minor improvements. * Split out application specific command IDs to prevent unnecessary rebuilding. * Eliminate duplicate menu and tool bar command IDs. * Split component library editor and viewer definitions to separate header files. * More component library and document file merge code. * A bunch of minor string readability and consistency fixes. --- 3d-viewer/3d_canvas.cpp | 18 - 3d-viewer/3d_frame.cpp | 1 - 3d-viewer/3d_toolbar.cpp | 3 - 3d-viewer/3d_viewer.h | 56 + common/pcbcommon.cpp | 2 + cvpcb/class_components_listbox.cpp | 5 +- cvpcb/class_footprints_listbox.cpp | 1 - cvpcb/cvframe.cpp | 1 - cvpcb/cvpcb.cpp | 1 - cvpcb/cvstruct.h | 47 +- cvpcb/displayframe.cpp | 1 - cvpcb/init.cpp | 1 - cvpcb/listboxes.cpp | 1 - cvpcb/menucfg.cpp | 2 - cvpcb/setvisu.cpp | 1 - cvpcb/tool_cvpcb.cpp | 1 - eeschema/block_libedit.cpp | 61 +- eeschema/busentry.cpp | 2 +- eeschema/class_libentry_fields.cpp | 31 + eeschema/class_libentry_fields.h | 2 + eeschema/class_library.cpp | 6 +- eeschema/class_pin.cpp | 5 +- eeschema/class_sch_screen.cpp | 2 +- eeschema/class_text-label.cpp | 2 +- eeschema/controle.cpp | 4 +- eeschema/cross-probing.cpp | 2 +- eeschema/dialog_edit_component_in_lib.cpp | 29 +- .../dialog_edit_libentry_fields_in_lib.cpp | 31 +- eeschema/dialog_eeschema_config.cpp | 5 +- eeschema/dialog_options.cpp | 2 +- eeschema/edit_component_in_lib.cpp | 177 ++- eeschema/edit_graphic_bodyitem_text.cpp | 4 +- eeschema/eeconfig.cpp | 2 +- eeschema/eelayer.cpp | 2 +- eeschema/eeschema.cpp | 1 - eeschema/eeschema_id.h | 196 ++++ eeschema/files-io.cpp | 2 +- eeschema/getpart.cpp | 1 + eeschema/hotkeys.cpp | 10 +- eeschema/lib_export.cpp | 9 +- eeschema/libcmp.h | 10 +- eeschema/libedit.cpp | 118 +- eeschema/libedit_onleftclick.cpp | 63 +- eeschema/libedit_onrightclick.cpp | 380 +++--- eeschema/libedit_undo_redo.cpp | 19 +- eeschema/libeditfrm.h | 160 +++ eeschema/libfield.cpp | 69 +- eeschema/libframe.cpp | 118 +- eeschema/libviewfrm.h | 71 ++ eeschema/menubar.cpp | 2 +- eeschema/onleftclick.cpp | 2 +- eeschema/onrightclick.cpp | 2 +- eeschema/pinedit-dialog.h | 10 +- eeschema/pinedit.cpp | 121 +- eeschema/schedit.cpp | 2 +- eeschema/schframe.cpp | 6 +- eeschema/symbdraw.cpp | 25 +- eeschema/symbedit.cpp | 39 +- eeschema/tool_lib.cpp | 13 +- eeschema/tool_sch.cpp | 2 +- eeschema/tool_viewlib.cpp | 3 +- eeschema/viewlib_frame.cpp | 6 +- eeschema/viewlibs.cpp | 3 +- gerbview/controle.cpp | 5 - gerbview/edit.cpp | 3 +- gerbview/files.cpp | 7 +- gerbview/gerberframe.cpp | 11 +- gerbview/gerbview_config.cpp | 2 +- gerbview/hotkeys.cpp | 3 +- gerbview/onrightclick.cpp | 1 - gerbview/options.cpp | 6 +- gerbview/pcbplot.cpp | 1 - gerbview/tool_gerber.cpp | 13 +- gerbview/wxGerberFrame.h | 92 +- include/id.h | 1016 ++++------------- include/pcbcommon.h | 1 + include/wxEeschemaStruct.h | 506 +++----- include/wxPcbStruct.h | 4 +- kicad/buildmnu.cpp | 1 - kicad/commandframe.cpp | 11 +- kicad/files-io.cpp | 1 - kicad/kicad.h | 71 +- kicad/mainframe.cpp | 3 +- kicad/preferences.cpp | 1 - kicad/prjconfig.cpp | 1 - kicad/treeprj_datas.cpp | 5 +- kicad/treeprj_frame.cpp | 4 +- pcbnew/automove.cpp | 2 +- pcbnew/basepcbframe.cpp | 2 +- pcbnew/class_board_item.cpp | 2 +- pcbnew/class_pad.cpp | 2 +- pcbnew/class_pad_draw_functions.cpp | 2 +- pcbnew/classpcb.cpp | 2 +- pcbnew/controle.cpp | 2 +- pcbnew/cross-probing.cpp | 2 +- pcbnew/dialog_copper_layers_setup.cpp | 2 +- pcbnew/dialog_design_rules.cpp | 2 +- pcbnew/dialog_display_options.cpp | 2 +- pcbnew/dialog_general_options.cpp | 2 +- pcbnew/dialog_graphic_items_options.cpp | 2 +- pcbnew/edit.cpp | 10 +- pcbnew/files.cpp | 68 +- pcbnew/find.cpp | 2 +- pcbnew/hotkeys.cpp | 2 +- pcbnew/ioascii.cpp | 2 +- pcbnew/menubarmodedit.cpp | 2 +- pcbnew/menubarpcb.cpp | 12 +- pcbnew/modedit.cpp | 10 +- pcbnew/modedit_onclick.cpp | 10 +- pcbnew/modeditoptions.cpp | 2 +- pcbnew/moduleframe.cpp | 20 +- pcbnew/move_or_drag_track.cpp | 2 +- pcbnew/muwave_command.cpp | 2 +- pcbnew/onleftclick.cpp | 8 +- pcbnew/onrightclick.cpp | 6 +- pcbnew/pcbcfg.cpp | 2 +- pcbnew/pcbframe.cpp | 22 +- pcbnew/pcbnew_id.h | 289 +++++ pcbnew/pcbplot.cpp | 2 +- pcbnew/set_grid.cpp | 2 +- pcbnew/tool_modedit.cpp | 10 +- pcbnew/tool_onrightclick.cpp | 10 +- pcbnew/tool_pcb.cpp | 6 +- pcbnew/via_edit.cpp | 2 +- pcbnew/zones_by_polygon.cpp | 2 +- 125 files changed, 2169 insertions(+), 2105 deletions(-) create mode 100644 eeschema/eeschema_id.h create mode 100644 eeschema/libeditfrm.h create mode 100644 eeschema/libviewfrm.h create mode 100644 pcbnew/pcbnew_id.h diff --git a/3d-viewer/3d_canvas.cpp b/3d-viewer/3d_canvas.cpp index 71e797a0d3..3420fc4810 100644 --- a/3d-viewer/3d_canvas.cpp +++ b/3d-viewer/3d_canvas.cpp @@ -21,7 +21,6 @@ #include "wx/dataobj.h" #include "wx/clipbrd.h" -#include "id.h" #include "gestfich.h" #include "3d_viewer.h" @@ -30,23 +29,6 @@ /* Tool and button Bitmaps */ #include "bitmaps.h" -enum onrclick_id { - ID_POPUP_3D_VIEW_START = 2000, - ID_POPUP_ZOOMIN, - ID_POPUP_ZOOMOUT, - ID_POPUP_VIEW_XPOS, - ID_POPUP_VIEW_XNEG, - ID_POPUP_VIEW_YPOS, - ID_POPUP_VIEW_YNEG, - ID_POPUP_VIEW_ZPOS, - ID_POPUP_VIEW_ZNEG, - ID_POPUP_MOVE3D_LEFT, - ID_POPUP_MOVE3D_RIGHT, - ID_POPUP_MOVE3D_UP, - ID_POPUP_MOVE3D_DOWN, - ID_POPUP_3D_VIEW_END -}; - /* * Pcb3D_GLCanvas implementation diff --git a/3d-viewer/3d_frame.cpp b/3d-viewer/3d_frame.cpp index 840e6bea8c..1add311005 100644 --- a/3d-viewer/3d_frame.cpp +++ b/3d-viewer/3d_frame.cpp @@ -18,7 +18,6 @@ #endif #include "bitmaps.h" -#include "id.h" #include "3d_viewer.h" #include "trackball.h" diff --git a/3d-viewer/3d_toolbar.cpp b/3d-viewer/3d_toolbar.cpp index e8c03bf301..beba8758df 100644 --- a/3d-viewer/3d_toolbar.cpp +++ b/3d-viewer/3d_toolbar.cpp @@ -4,11 +4,8 @@ #include "fctsys.h" #include "macros.h" - #include "bitmaps.h" -#include "id.h" - #include "3d_viewer.h" diff --git a/3d-viewer/3d_viewer.h b/3d-viewer/3d_viewer.h index 14be22c88b..590afdeb36 100644 --- a/3d-viewer/3d_viewer.h +++ b/3d-viewer/3d_viewer.h @@ -23,12 +23,68 @@ #include "pcbstruct.h" #include "3d_struct.h" +#include "id.h" + #define KICAD_DEFAULT_3D_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE|wxWANTS_CHARS #define LIB3D_PATH wxT("packages3d") +/** + * Command IDs for the 3D viewer. + * + * Please add IDs that are unique to the 3D viewer here and not in the global + * id.h file. This will prevent the entire project from being rebuilt when + * adding new commands to the 3D viewer. + */ +enum id_3dview_frm +{ + ID_START_COMMAND_3D = ID_END_LIST, + ID_ROTATE3D_X_NEG, + ID_ROTATE3D_X_POS, + ID_ROTATE3D_Y_NEG, + ID_ROTATE3D_Y_POS, + ID_ROTATE3D_Z_NEG, + ID_ROTATE3D_Z_POS, + ID_RELOAD3D_BOARD, + ID_TOOL_SCREENCOPY_TOCLIBBOARD, + ID_MOVE3D_LEFT, + ID_MOVE3D_RIGHT, + ID_MOVE3D_UP, + ID_MOVE3D_DOWN, + ID_MENU3D_BGCOLOR_SELECTION, + ID_MENU3D_AXIS_ONOFF, + ID_MENU3D_MODULE_ONOFF, + ID_MENU3D_UNUSED, + ID_MENU3D_ZONE_ONOFF, + ID_MENU3D_DRAWINGS_ONOFF, + ID_MENU3D_COMMENTS_ONOFF, + ID_MENU3D_ECO1_ONOFF, + ID_MENU3D_ECO2_ONOFF, + ID_END_COMMAND_3D, + + ID_MENU_SCREENCOPY_PNG, + ID_MENU_SCREENCOPY_JPEG, + ID_MENU_SCREENCOPY_TOCLIBBOARD, + + ID_POPUP_3D_VIEW_START, + ID_POPUP_ZOOMIN, + ID_POPUP_ZOOMOUT, + ID_POPUP_VIEW_XPOS, + ID_POPUP_VIEW_XNEG, + ID_POPUP_VIEW_YPOS, + ID_POPUP_VIEW_YNEG, + ID_POPUP_VIEW_ZPOS, + ID_POPUP_VIEW_ZNEG, + ID_POPUP_MOVE3D_LEFT, + ID_POPUP_MOVE3D_RIGHT, + ID_POPUP_MOVE3D_UP, + ID_POPUP_MOVE3D_DOWN, + ID_POPUP_3D_VIEW_END +}; + + class Pcb3D_GLCanvas; class WinEDA3D_DrawFrame; class Info_3D_Visu; diff --git a/common/pcbcommon.cpp b/common/pcbcommon.cpp index 49ecf1757c..a96d9c182d 100644 --- a/common/pcbcommon.cpp +++ b/common/pcbcommon.cpp @@ -81,6 +81,8 @@ const wxString ModuleFileExtension( wxT( "mod" ) ); const wxString ModuleFileWildcard( _( "Kicad footprint library files (*.mod)|*.mod" ) ); +const wxString PcbFileWildcard( + _( "Printed circuit board files (*.brd)|*.brd" ) ); int g_CurrentVersionPCB = 1; diff --git a/cvpcb/class_components_listbox.cpp b/cvpcb/class_components_listbox.cpp index 7ddd0dc747..8fe260c507 100644 --- a/cvpcb/class_components_listbox.cpp +++ b/cvpcb/class_components_listbox.cpp @@ -5,7 +5,6 @@ #include "fctsys.h" #include "wxstruct.h" #include "common.h" -#include "id.h" #include "cvpcb.h" #include "protos.h" @@ -33,8 +32,8 @@ COMPONENTS_LISTBOX::~COMPONENTS_LISTBOX() */ BEGIN_EVENT_TABLE( COMPONENTS_LISTBOX, ITEMS_LISTBOX_BASE ) -EVT_SIZE( ITEMS_LISTBOX_BASE::OnSize ) -EVT_CHAR( COMPONENTS_LISTBOX::OnChar ) + EVT_SIZE( ITEMS_LISTBOX_BASE::OnSize ) + EVT_CHAR( COMPONENTS_LISTBOX::OnChar ) END_EVENT_TABLE() diff --git a/cvpcb/class_footprints_listbox.cpp b/cvpcb/class_footprints_listbox.cpp index de26a0f211..98f051dd3d 100644 --- a/cvpcb/class_footprints_listbox.cpp +++ b/cvpcb/class_footprints_listbox.cpp @@ -5,7 +5,6 @@ #include "fctsys.h" #include "wxstruct.h" #include "common.h" -#include "id.h" #include "cvpcb.h" #include "protos.h" diff --git a/cvpcb/cvframe.cpp b/cvpcb/cvframe.cpp index bc94dabbe7..696b20d020 100644 --- a/cvpcb/cvframe.cpp +++ b/cvpcb/cvframe.cpp @@ -8,7 +8,6 @@ #include "confirm.h" #include "eda_doc.h" #include "gestfich.h" -#include "id.h" #include "param_config.h" #include "bitmaps.h" diff --git a/cvpcb/cvpcb.cpp b/cvpcb/cvpcb.cpp index d216dd98d1..6840d744b0 100644 --- a/cvpcb/cvpcb.cpp +++ b/cvpcb/cvpcb.cpp @@ -8,7 +8,6 @@ #include "common.h" #include "confirm.h" #include "gestfich.h" -#include "id.h" #include "cvpcb.h" #include "zones.h" diff --git a/cvpcb/cvstruct.h b/cvpcb/cvstruct.h index 4ede753650..d2de7b0a80 100644 --- a/cvpcb/cvstruct.h +++ b/cvpcb/cvstruct.h @@ -17,10 +17,40 @@ class COMPONENTS_LISTBOX; class WinEDA_DisplayFrame; -/******************************************************/ -/* classe derivee pour la Fenetre principale de cvpcb */ -/******************************************************/ +#include "id.h" + +/** + * Command IDs for the component library viewer. + * + * Please add IDs that are unique to the component library viewer here and + * not in the global id.h file. This will prevent the entire project from + * being rebuilt when adding new commands to the component library viewer. + */ +enum id_cvpcb_frm +{ + ID_CVPCB_QUIT = ID_END_LIST, + ID_CVPCB_READ_INPUT_NETLIST, + ID_CVPCB_SAVEQUITCVPCB, + ID_CVPCB_CREATE_CONFIGWINDOW, + ID_CVPCB_CREATE_SCREENCMP, + ID_CVPCB_GOTO_FIRSTNA, + ID_CVPCB_GOTO_PREVIOUSNA, + ID_CVPCB_DEL_ASSOCIATIONS, + ID_CVPCB_AUTO_ASSOCIE, + ID_CVPCB_COMPONENT_LIST, + ID_CVPCB_FOOTPRINT_LIST, + ID_CVPCB_CREATE_STUFF_FILE, + ID_CVPCB_SHOW3D_FRAME, + ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, + ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, + ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE +}; + + +/** + * The CVPcb application main window. + */ class WinEDA_CvpcbFrame : public WinEDA_BasicFrame { public: @@ -227,9 +257,9 @@ public: * currently: do nothing in cvpcb. * but but be defined because it is a pure virtual in WinEDA_BasePcbFrame */ - virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy, - UndoRedoOpType aTypeCommand = UR_UNSPECIFIED, - const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) + virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy, + UndoRedoOpType aTypeCommand = UR_UNSPECIFIED, + const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) { } @@ -241,8 +271,9 @@ public: * @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 ) ) + virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, + UndoRedoOpType aTypeCommand, + const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) { // currently: do nothing in cvpcb. } diff --git a/cvpcb/displayframe.cpp b/cvpcb/displayframe.cpp index adf125c017..720816ace7 100644 --- a/cvpcb/displayframe.cpp +++ b/cvpcb/displayframe.cpp @@ -6,7 +6,6 @@ #include "appl_wxstruct.h" #include "common.h" #include "class_drawpanel.h" -#include "id.h" #include "confirm.h" #include "macros.h" diff --git a/cvpcb/init.cpp b/cvpcb/init.cpp index e45e1f37b9..e470d4ef10 100644 --- a/cvpcb/init.cpp +++ b/cvpcb/init.cpp @@ -8,7 +8,6 @@ #include "confirm.h" #include "gr_basic.h" #include "gestfich.h" -#include "id.h" #include "appl_wxstruct.h" #include "cvpcb.h" diff --git a/cvpcb/listboxes.cpp b/cvpcb/listboxes.cpp index f9fdd5dcc4..164e2d7d68 100644 --- a/cvpcb/listboxes.cpp +++ b/cvpcb/listboxes.cpp @@ -5,7 +5,6 @@ #include "fctsys.h" #include "wxstruct.h" #include "common.h" -#include "id.h" #include "cvpcb.h" #include "protos.h" diff --git a/cvpcb/menucfg.cpp b/cvpcb/menucfg.cpp index 14f39413e8..fdf92d2b6c 100644 --- a/cvpcb/menucfg.cpp +++ b/cvpcb/menucfg.cpp @@ -13,8 +13,6 @@ #include "bitmaps.h" -#include "id.h" - /*******************************************/ void WinEDA_CvpcbFrame::ReCreateMenuBar() diff --git a/cvpcb/setvisu.cpp b/cvpcb/setvisu.cpp index a32cc07d22..18cb25342e 100644 --- a/cvpcb/setvisu.cpp +++ b/cvpcb/setvisu.cpp @@ -5,7 +5,6 @@ #include "fctsys.h" #include "common.h" #include "class_drawpanel.h" -#include "id.h" #include "bitmaps.h" #include "cvpcb.h" diff --git a/cvpcb/tool_cvpcb.cpp b/cvpcb/tool_cvpcb.cpp index 9657886571..94390df396 100644 --- a/cvpcb/tool_cvpcb.cpp +++ b/cvpcb/tool_cvpcb.cpp @@ -5,7 +5,6 @@ #include "fctsys.h" #include "appl_wxstruct.h" #include "common.h" -#include "id.h" #include "trigo.h" #include "bitmaps.h" diff --git a/eeschema/block_libedit.cpp b/eeschema/block_libedit.cpp index 290f2f7c1a..a1609aa8ec 100644 --- a/eeschema/block_libedit.cpp +++ b/eeschema/block_libedit.cpp @@ -14,6 +14,7 @@ #include "libcmp.h" #include "general.h" #include "protos.h" +#include "libeditfrm.h" static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, @@ -183,7 +184,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) case BLOCK_DRAG: /* Drag */ case BLOCK_MOVE: /* Move */ case BLOCK_COPY: /* Copy */ - ItemsCount = MarkItemsInBloc( CurrentLibEntry, + ItemsCount = MarkItemsInBloc( m_currentComponent, GetScreen()->m_BlockLocate ); if( ItemsCount ) { @@ -206,11 +207,11 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) break; case BLOCK_DELETE: /* Delete */ - ItemsCount = MarkItemsInBloc( CurrentLibEntry, + ItemsCount = MarkItemsInBloc( m_currentComponent, GetScreen()->m_BlockLocate ); if( ItemsCount ) - SaveCopyInUndoList( CurrentLibEntry ); - DeleteMarkedItems( CurrentLibEntry ); + SaveCopyInUndoList( m_currentComponent ); + DeleteMarkedItems( m_currentComponent ); break; case BLOCK_SAVE: /* Save */ @@ -222,11 +223,11 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) case BLOCK_MIRROR_Y: - ItemsCount = MarkItemsInBloc( CurrentLibEntry, + ItemsCount = MarkItemsInBloc( m_currentComponent, GetScreen()->m_BlockLocate ); if( ItemsCount ) - SaveCopyInUndoList( CurrentLibEntry ); - MirrorMarkedItems( CurrentLibEntry, + SaveCopyInUndoList( m_currentComponent ); + MirrorMarkedItems( m_currentComponent, GetScreen()->m_BlockLocate.Centre() ); break; @@ -245,7 +246,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) { if( GetScreen()->m_BlockLocate.m_Command != BLOCK_SELECT_ITEMS_ONLY ) { - ClearMarkItems( CurrentLibEntry ); + ClearMarkItems( m_currentComponent ); } GetScreen()->m_BlockLocate.m_Flags = 0; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; @@ -291,16 +292,16 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC ) case BLOCK_MOVE: /* Move */ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ GetScreen()->m_BlockLocate.ClearItemsList(); - SaveCopyInUndoList( CurrentLibEntry ); - MoveMarkedItems( CurrentLibEntry, + SaveCopyInUndoList( m_currentComponent ); + MoveMarkedItems( m_currentComponent, GetScreen()->m_BlockLocate.m_MoveVector ); DrawPanel->Refresh( TRUE ); break; case BLOCK_COPY: /* Copy */ GetScreen()->m_BlockLocate.ClearItemsList(); - SaveCopyInUndoList( CurrentLibEntry ); - CopyMarkedItems( CurrentLibEntry, + SaveCopyInUndoList( m_currentComponent ); + CopyMarkedItems( m_currentComponent, GetScreen()->m_BlockLocate.m_MoveVector ); break; @@ -309,8 +310,8 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC ) break; case BLOCK_MIRROR_Y: /* Invert by popup menu, from block move */ - SaveCopyInUndoList( CurrentLibEntry ); - MirrorMarkedItems( CurrentLibEntry, + SaveCopyInUndoList( m_currentComponent ); + MirrorMarkedItems( m_currentComponent, GetScreen()->m_BlockLocate.Centre() ); break; @@ -342,8 +343,7 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC ) * Retrace le contour du block de recherche de structures * L'ensemble du block suit le curseur */ -static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, - bool erase ) +void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) { BLOCK_SELECTOR* PtBlock; BASE_SCREEN* screen = panel->GetScreen(); @@ -351,19 +351,22 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, PtBlock = &screen->m_BlockLocate; - /* Effacement ancien cadre */ + WinEDA_LibeditFrame* parent = ( WinEDA_LibeditFrame* ) panel->GetParent(); + wxASSERT( parent != NULL ); + + LIB_COMPONENT* component = parent->GetCurrentComponent(); + + if( component == NULL ) + return; + if( erase ) { PtBlock->Draw( panel, DC, PtBlock->m_MoveVector, g_XorMode, PtBlock->m_Color ); - if( CurrentLibEntry ) - { - CurrentLibEntry->Draw( panel, DC, PtBlock->m_MoveVector, - CurrentUnit, CurrentConvert, g_XorMode, - -1, DefaultTransformMatrix, true, false, - true ); - } + component->Draw( panel, DC, PtBlock->m_MoveVector, CurrentUnit, + CurrentConvert, g_XorMode, -1, DefaultTransformMatrix, + true, false, true ); } /* Redessin nouvel affichage */ @@ -376,13 +379,9 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, PtBlock->Draw( panel, DC, PtBlock->m_MoveVector, g_XorMode, PtBlock->m_Color ); - if( CurrentLibEntry ) - { - CurrentLibEntry->Draw( panel, DC, PtBlock->m_MoveVector, - CurrentUnit, CurrentConvert, g_XorMode, - -1, DefaultTransformMatrix, true, false, - true ); - } + component->Draw( panel, DC, PtBlock->m_MoveVector, CurrentUnit, + CurrentConvert, g_XorMode, -1, DefaultTransformMatrix, + true, false, true ); } diff --git a/eeschema/busentry.cpp b/eeschema/busentry.cpp index 29af2e3fe5..749b13102c 100644 --- a/eeschema/busentry.cpp +++ b/eeschema/busentry.cpp @@ -6,7 +6,7 @@ #include "gr_basic.h" #include "common.h" #include "class_drawpanel.h" -#include "id.h" +#include "eeschema_id.h" #include "confirm.h" #include "program.h" diff --git a/eeschema/class_libentry_fields.cpp b/eeschema/class_libentry_fields.cpp index d2868fd883..1d27be291a 100644 --- a/eeschema/class_libentry_fields.cpp +++ b/eeschema/class_libentry_fields.cpp @@ -416,6 +416,37 @@ bool LibDrawField::DoTestInside( EDA_Rect& rect ) } +/* + * If the field is the reference, return reference like schematic, + * i.e U -> U? or U?A or the field text for others + * + * @fixme This should be handled by the field object. + */ +wxString LibDrawField::GetFullText( void ) +{ + if( m_FieldId != REFERENCE ) + return m_Text; + + wxString text = m_Text; + + if( GetParent()->m_UnitCount > 1 ) + { +#if defined(KICAD_GOST) + text.Printf( wxT( "%s?.%c" ), + m_Text.GetData(), CurrentUnit + '1' - 1 ); +#else + + text.Printf( wxT( "%s?%c" ), + m_Text.GetData(), CurrentUnit + 'A' - 1 ); +#endif + } + else + text << wxT( "?" ); + + return text; +} + + /** * Function ReturnDefaultFieldName * Return the default field name from its index (REFERENCE, VALUE ..) diff --git a/eeschema/class_libentry_fields.h b/eeschema/class_libentry_fields.h index 5b0d473064..2b778cc8b0 100644 --- a/eeschema/class_libentry_fields.h +++ b/eeschema/class_libentry_fields.h @@ -103,6 +103,8 @@ public: m_Parent = field.m_Parent; } + wxString GetFullText( void ); + protected: virtual LibEDA_BaseStruct* DoGenCopy(); virtual bool DoCompare( const LibEDA_BaseStruct& other ) const; diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp index 122da6b247..89a2281b1c 100644 --- a/eeschema/class_library.cpp +++ b/eeschema/class_library.cpp @@ -514,8 +514,8 @@ information." ); { wxLogWarning( _( "The component library <%s> header version \ number is invalid.\n\nIn future versions of EESchema this library may not \ -load correctly.\nTo resolve this problem open the library in the library \ -editor and save it.\nIf this library is the project cache library, save \ +load correctly. To resolve this problem open the library in the library \ +editor and save it. If this library is the project cache library, save \ the current schematic." ), (const wxChar*) GetName() ); } @@ -636,7 +636,7 @@ bool CMP_LIBRARY::LoadDocs( wxString& errMsg ) if( f == NULL ) { - errMsg.Printf( _( "Could not open component document libray file\n<%s>." ), + errMsg.Printf( _( "Could not open component document libray file <%s>." ), (const wxChar*) fn.GetFullPath() ); return false; } diff --git a/eeschema/class_pin.cpp b/eeschema/class_pin.cpp index 80b5075334..d75b62c277 100644 --- a/eeschema/class_pin.cpp +++ b/eeschema/class_pin.cpp @@ -9,11 +9,14 @@ #include "common.h" #include "class_drawpanel.h" #include "drawtxt.h" +#include "plot_common.h" + #include "program.h" #include "libcmp.h" #include "general.h" -#include "plot_common.h" #include "protos.h" +#include "libeditfrm.h" + const wxChar* MsgPinElectricType[] = { diff --git a/eeschema/class_sch_screen.cpp b/eeschema/class_sch_screen.cpp index 6739188f23..c98d4ae672 100644 --- a/eeschema/class_sch_screen.cpp +++ b/eeschema/class_sch_screen.cpp @@ -2,7 +2,7 @@ #include "fctsys.h" #include "gr_basic.h" #include "common.h" -#include "id.h" +#include "eeschema_id.h" #include "class_drawpanel.h" #include "program.h" #include "libcmp.h" diff --git a/eeschema/class_text-label.cpp b/eeschema/class_text-label.cpp index 76d007d40f..24b5bf1bf0 100644 --- a/eeschema/class_text-label.cpp +++ b/eeschema/class_text-label.cpp @@ -6,7 +6,7 @@ #include "gr_basic.h" #include "common.h" #include "trigo.h" -#include "id.h" +#include "eeschema_id.h" #include "class_drawpanel.h" #include "drawtxt.h" diff --git a/eeschema/controle.cpp b/eeschema/controle.cpp index d9bf751ae5..e0fa855b02 100644 --- a/eeschema/controle.cpp +++ b/eeschema/controle.cpp @@ -7,12 +7,14 @@ #include "common.h" #include "class_drawpanel.h" #include "eda_dde.h" -#include "id.h" +#include "eeschema_id.h" #include "program.h" #include "libcmp.h" #include "general.h" #include "protos.h" +#include "libeditfrm.h" +#include "libviewfrm.h" #include "class_marker_sch.h" diff --git a/eeschema/cross-probing.cpp b/eeschema/cross-probing.cpp index e1a8a250b8..ae805393b0 100644 --- a/eeschema/cross-probing.cpp +++ b/eeschema/cross-probing.cpp @@ -11,7 +11,7 @@ #include "eda_dde.h" -#include "id.h" +#include "eeschema_id.h" #include "protos.h" diff --git a/eeschema/dialog_edit_component_in_lib.cpp b/eeschema/dialog_edit_component_in_lib.cpp index db86e8fc05..94f578a3ad 100644 --- a/eeschema/dialog_edit_component_in_lib.cpp +++ b/eeschema/dialog_edit_component_in_lib.cpp @@ -5,7 +5,6 @@ ///////////////////////////////////////////////////////////////////////////// #include "fctsys.h" -#include "appl_wxstruct.h" #include "common.h" #include "confirm.h" #include "gestfich.h" @@ -13,10 +12,11 @@ #include "program.h" #include "libcmp.h" #include "general.h" +#include "protos.h" +#include "libeditfrm.h" #include "dialog_edit_component_in_lib.h" -#include "protos.h" DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( WinEDA_LibeditFrame* aParent): DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE(aParent) @@ -45,7 +45,9 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::Init( ) SetFocus(); m_AliasLocation = -1; - if( CurrentLibEntry == NULL ) + LIB_COMPONENT* component = m_Parent->GetCurrentComponent(); + + if( component == NULL ) { SetTitle( _( "Library Component Properties" ) ); return; @@ -56,16 +58,15 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::Init( ) if( !CurrentAliasName.IsEmpty() ) { title += CurrentAliasName + _( " (alias of " ) + - wxString( CurrentLibEntry->m_Name.m_Text )+ wxT( ")" ); + component->GetName() + wxT( ")" ); } else { - title += CurrentLibEntry->m_Name.m_Text; + title += component->GetName(); CurrentAliasName.Empty(); } SetTitle( title ); - InitPanelDoc(); InitBasicPanel(); @@ -73,26 +74,18 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::Init( ) m_ButtonDeleteAllAlias->Enable( false ); /* Place list of alias names in listbox */ - if( CurrentLibEntry ) - { - m_PartAliasList->Append( CurrentLibEntry->m_AliasList ); - } + m_PartAliasList->Append( component->m_AliasList ); - if( ( CurrentLibEntry == NULL ) - || ( CurrentLibEntry->m_AliasList.GetCount() == 0 ) ) + if( component->m_AliasList.GetCount() == 0 ) { m_ButtonDeleteAllAlias->Enable( false ); m_ButtonDeleteOneAlias->Enable( false ); } /* Read the Footprint Filter list */ - if( CurrentLibEntry ) - { - m_FootprintFilterListBox->Append( CurrentLibEntry->m_FootprintList ); - } + m_FootprintFilterListBox->Append( component->m_FootprintList ); - if( ( CurrentLibEntry == NULL ) - || ( CurrentLibEntry->m_FootprintList.GetCount() == 0 ) ) + if( component->m_FootprintList.GetCount() == 0 ) { m_ButtonDeleteAllFootprintFilter->Enable( false ); m_ButtonDeleteOneFootprintFilter->Enable( false ); diff --git a/eeschema/dialog_edit_libentry_fields_in_lib.cpp b/eeschema/dialog_edit_libentry_fields_in_lib.cpp index f91afaec06..6508a2b20c 100644 --- a/eeschema/dialog_edit_libentry_fields_in_lib.cpp +++ b/eeschema/dialog_edit_libentry_fields_in_lib.cpp @@ -2,17 +2,18 @@ /* library editor: edition of fields of lib entries (components in libraries) */ /*******************************************************************************/ -#include "fctsys.h" - #include +#include "fctsys.h" #include "common.h" #include "confirm.h" +#include "class_drawpanel.h" + #include "program.h" #include "libcmp.h" #include "general.h" - #include "protos.h" +#include "libeditfrm.h" #include "dialog_edit_libentry_fields_in_lib_base.h" @@ -97,25 +98,25 @@ private: void reinitializeFieldsIdAndDefaultNames(); }; -/*****************************************************************/ -void WinEDA_LibeditFrame::InstallFieldsEditorDialog( void ) -/*****************************************************************/ + +void WinEDA_LibeditFrame::InstallFieldsEditorDialog( wxCommandEvent& event ) { - if( CurrentLibEntry == NULL ) + if( m_currentComponent == NULL ) return; - DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB* frame = - new DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB( this, CurrentLibEntry ); + DrawPanel->UnManageCursor( 0, wxCURSOR_ARROW ); - int abort = frame->ShowModal(); frame->Destroy(); + DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB dlg( this, m_currentComponent ); - if( ! abort ) - { - ReCreateHToolbar(); - Refresh(); - } + int abort = dlg.ShowModal(); + if( abort ) + return; + + UpdateAliasSelectList(); + UpdatePartSelectList(); DisplayLibInfos(); + Refresh(); } diff --git a/eeschema/dialog_eeschema_config.cpp b/eeschema/dialog_eeschema_config.cpp index a62bc4b7f2..e363d5b526 100644 --- a/eeschema/dialog_eeschema_config.cpp +++ b/eeschema/dialog_eeschema_config.cpp @@ -8,7 +8,6 @@ ///////////////////////////////////////////////////////////////////////////// #include "fctsys.h" -#include #include "appl_wxstruct.h" #include "common.h" #include "confirm.h" @@ -17,11 +16,11 @@ #include "program.h" #include "libcmp.h" #include "general.h" - #include "protos.h" #include "netlist.h" +#include "libviewfrm.h" -#include "id.h" +#include #include "dialog_eeschema_config_fbp.h" diff --git a/eeschema/dialog_options.cpp b/eeschema/dialog_options.cpp index ccdb48be40..58571d28e2 100644 --- a/eeschema/dialog_options.cpp +++ b/eeschema/dialog_options.cpp @@ -19,7 +19,7 @@ #include "fctsys.h" #include "gr_basic.h" #include "common.h" -#include "id.h" +#include "eeschema_id.h" #include "class_drawpanel.h" #include "confirm.h" diff --git a/eeschema/edit_component_in_lib.cpp b/eeschema/edit_component_in_lib.cpp index 746b15f5c6..559c965001 100644 --- a/eeschema/edit_component_in_lib.cpp +++ b/eeschema/edit_component_in_lib.cpp @@ -11,8 +11,8 @@ #include "program.h" #include "libcmp.h" #include "general.h" - #include "protos.h" +#include "libeditfrm.h" extern int CurrentUnit; @@ -38,7 +38,7 @@ void WinEDA_LibeditFrame::OnEditComponentProperties( wxCommandEvent& event ) void WinEDA_LibeditFrame::EditComponentProperties() { - wxASSERT( CurrentLibEntry != NULL && CurrentLib != NULL ); + wxASSERT( m_currentComponent != NULL && CurrentLib != NULL ); DIALOG_EDIT_COMPONENT_IN_LIBRARY dlg( this ); @@ -48,8 +48,9 @@ void WinEDA_LibeditFrame::EditComponentProperties() UpdateAliasSelectList(); UpdatePartSelectList(); DisplayLibInfos(); + DisplayCmpDoc(); GetScreen()->SetModify(); - SaveCopyInUndoList( CurrentLibEntry ); + SaveCopyInUndoList( m_currentComponent ); } @@ -57,13 +58,14 @@ void WinEDA_LibeditFrame::EditComponentProperties() void DIALOG_EDIT_COMPONENT_IN_LIBRARY::InitPanelDoc() { CMP_LIB_ENTRY* entry; + LIB_COMPONENT* component = m_Parent->GetCurrentComponent(); - if( CurrentLibEntry == NULL ) + if( component == NULL ) return; if( CurrentAliasName.IsEmpty() ) { - entry = CurrentLibEntry; + entry = component; } else { @@ -84,51 +86,31 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::InitPanelDoc() */ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::InitBasicPanel() { + LIB_COMPONENT* component = m_Parent->GetCurrentComponent(); + if( g_AsDeMorgan ) - m_AsConvertButt->SetValue( TRUE ); - if( CurrentLibEntry ) + m_AsConvertButt->SetValue( true ); + + /* Default values for a new component. */ + if( component == NULL ) { - if( CurrentLibEntry->m_DrawPinNum ) - m_ShowPinNumButt->SetValue( TRUE ); + m_ShowPinNumButt->SetValue( true ); + m_ShowPinNameButt->SetValue( true ); + m_PinsNameInsideButt->SetValue( true ); + m_SelNumberOfUnits->SetValue( 1 ); + m_SetSkew->SetValue( 40 ); + m_OptionPower->SetValue( false ); + m_OptionPartsLocked->SetValue( false ); + return; } - else - m_ShowPinNumButt->SetValue( TRUE ); - if( CurrentLibEntry ) - { - if( CurrentLibEntry->m_DrawPinName ) - m_ShowPinNameButt->SetValue( TRUE ); - } - else - m_ShowPinNameButt->SetValue( TRUE ); - - - if( CurrentLibEntry ) - { - if( CurrentLibEntry->m_TextInside ) - m_PinsNameInsideButt->SetValue( TRUE ); - } - else - m_PinsNameInsideButt->SetValue( TRUE ); - - int number, number_of_units; - if( CurrentLibEntry ) - number_of_units = CurrentLibEntry->m_UnitCount; - else - number_of_units = 1; - m_SelNumberOfUnits->SetValue( number_of_units ); - - if( CurrentLibEntry && CurrentLibEntry->m_TextInside ) - number = CurrentLibEntry->m_TextInside; - else - number = 40; - m_SetSkew->SetValue( number ); - - if( CurrentLibEntry && CurrentLibEntry->m_Options == ENTRY_POWER ) - m_OptionPower->SetValue( TRUE ); - - if( CurrentLibEntry && CurrentLibEntry->m_UnitSelectionLocked ) - m_OptionPartsLocked->SetValue( TRUE ); + m_ShowPinNumButt->SetValue( component->m_DrawPinNum ); + m_ShowPinNameButt->SetValue( component->m_DrawPinName ); + m_PinsNameInsideButt->SetValue( component->m_TextInside != 0 ); + m_SelNumberOfUnits->SetValue( component->m_UnitCount ); + m_SetSkew->SetValue( component->m_TextInside ); + m_OptionPower->SetValue( component->m_Options == ENTRY_POWER ); + m_OptionPartsLocked->SetValue( component->m_UnitSelectionLocked ); } @@ -139,10 +121,11 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnOkClick( wxCommandEvent& event ) size_t i; int index; CMP_LIB_ENTRY* entry; + LIB_COMPONENT* component = m_Parent->GetCurrentComponent(); if( CurrentAliasName.IsEmpty() ) { - entry = CurrentLibEntry; + entry = (CMP_LIB_ENTRY*) component; } else { @@ -152,9 +135,10 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnOkClick( wxCommandEvent& event ) if( entry == NULL ) { wxString msg; - msg.Printf( _( "Alias <%s> not found for component <%s> in library <%s>." ), + msg.Printf( _( "Alias <%s> not found for component <%s> in library \ +<%s>." ), (const wxChar*) CurrentAliasName, - (const wxChar*) CurrentLibEntry->GetName(), + (const wxChar*) component->GetName(), (const wxChar*) CurrentLib->GetName() ); wxMessageBox( msg, _( "Component Library Error" ), wxID_OK | wxICON_ERROR, this ); @@ -166,7 +150,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnOkClick( wxCommandEvent& event ) entry->m_DocFile = m_Docfile->GetValue(); } - if( m_PartAliasList->GetStrings() != CurrentLibEntry->m_AliasList ) + if( m_PartAliasList->GetStrings() != component->m_AliasList ) { LIB_ALIAS* alias; wxArrayString aliases = m_PartAliasList->GetStrings(); @@ -174,12 +158,12 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnOkClick( wxCommandEvent& event ) /* Add names not existing in the old alias list. */ for( i = 0; i < aliases.GetCount(); i++ ) { - index = CurrentLibEntry->m_AliasList.Index( aliases[ i ], false ); + index = component->m_AliasList.Index( aliases[ i ], false ); if( index != wxNOT_FOUND ) continue; - alias = new LIB_ALIAS( aliases[ i ], CurrentLibEntry ); + alias = new LIB_ALIAS( aliases[ i ], component ); if( !CurrentLib->AddAlias( alias ) ) { @@ -189,20 +173,20 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnOkClick( wxCommandEvent& event ) } /* Remove names and library alias entries not in the new alias list. */ - for( i = 0; CurrentLibEntry->m_AliasList.GetCount(); i++ ) + for( i = 0; component->m_AliasList.GetCount(); i++ ) { - index = aliases.Index( CurrentLibEntry->m_AliasList[ i ], false ); + index = aliases.Index( component->m_AliasList[ i ], false ); if( index == wxNOT_FOUND ) continue; CMP_LIB_ENTRY* alias = - CurrentLib->FindAlias( CurrentLibEntry->m_AliasList[ i ] ); + CurrentLib->FindAlias( component->m_AliasList[ i ] ); if( alias != NULL ) CurrentLib->RemoveEntry( alias ); } - CurrentLibEntry->m_AliasList = aliases; + component->m_AliasList = aliases; } index = m_SelNumberOfUnits->GetValue(); @@ -225,28 +209,28 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnOkClick( wxCommandEvent& event ) } } - CurrentLibEntry->m_DrawPinNum = m_ShowPinNumButt->GetValue() ? 1 : 0; - CurrentLibEntry->m_DrawPinName = m_ShowPinNameButt->GetValue() ? 1 : 0; + component->m_DrawPinNum = m_ShowPinNumButt->GetValue() ? 1 : 0; + component->m_DrawPinName = m_ShowPinNameButt->GetValue() ? 1 : 0; if( m_PinsNameInsideButt->GetValue() == FALSE ) - CurrentLibEntry->m_TextInside = 0; + component->m_TextInside = 0; else - CurrentLibEntry->m_TextInside = m_SetSkew->GetValue(); + component->m_TextInside = m_SetSkew->GetValue(); if( m_OptionPower->GetValue() == TRUE ) - CurrentLibEntry->m_Options = ENTRY_POWER; + component->m_Options = ENTRY_POWER; else - CurrentLibEntry->m_Options = ENTRY_NORMAL; + component->m_Options = ENTRY_NORMAL; /* Set the option "Units locked". * Obviously, cannot be TRUE if there is only one part */ - CurrentLibEntry->m_UnitSelectionLocked = m_OptionPartsLocked->GetValue(); - if( CurrentLibEntry->m_UnitCount <= 1 ) - CurrentLibEntry->m_UnitSelectionLocked = FALSE; + component->m_UnitSelectionLocked = m_OptionPartsLocked->GetValue(); + if( component->m_UnitCount <= 1 ) + component->m_UnitSelectionLocked = FALSE; /* Update the footprint filter list */ - CurrentLibEntry->m_FootprintList.Clear(); - CurrentLibEntry->m_FootprintList = m_FootprintFilterListBox->GetStrings(); + component->m_FootprintList.Clear(); + component->m_FootprintList = m_FootprintFilterListBox->GetStrings(); EndModal( wxID_OK ); } @@ -256,12 +240,14 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnOkClick( wxCommandEvent& event ) void DIALOG_EDIT_COMPONENT_IN_LIBRARY::CopyDocToAlias( wxCommandEvent& WXUNUSED (event) ) /******************************************************************************/ { - if( CurrentLibEntry == NULL || CurrentAliasName.IsEmpty() ) + LIB_COMPONENT* component = m_Parent->GetCurrentComponent(); + + if( component == NULL || CurrentAliasName.IsEmpty() ) return; - m_Doc->SetValue( CurrentLibEntry->m_Doc ); - m_Docfile->SetValue( CurrentLibEntry->m_DocFile ); - m_Keywords->SetValue( CurrentLibEntry->m_KeyWord ); + m_Doc->SetValue( component->m_Doc ); + m_Docfile->SetValue( component->m_DocFile ); + m_Keywords->SetValue( component->m_KeyWord ); } @@ -301,8 +287,9 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::AddAliasOfPart( wxCommandEvent& WXUNUSED { wxString Line; wxString aliasname; + LIB_COMPONENT* component = m_Parent->GetCurrentComponent(); - if( CurrentLibEntry == NULL ) + if( component == NULL ) return; if( Get_Message( _( "New alias:" ), _( "Component Alias" ), Line, this ) != 0 ) @@ -367,25 +354,26 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::ChangeNbUnitsPerPackage( int MaxUnit ) { int OldNumUnits, ii, FlagDel = -1; LibEDA_BaseStruct* DrawItem, * NextDrawItem; + LIB_COMPONENT* component = m_Parent->GetCurrentComponent(); - if( CurrentLibEntry == NULL ) + if( component == NULL ) return FALSE; /* Si pas de changement: termine */ - if( CurrentLibEntry->m_UnitCount == MaxUnit ) + if( component->m_UnitCount == MaxUnit ) return FALSE; - OldNumUnits = CurrentLibEntry->m_UnitCount; + OldNumUnits = component->m_UnitCount; if( OldNumUnits < 1 ) OldNumUnits = 1; - CurrentLibEntry->m_UnitCount = MaxUnit; + component->m_UnitCount = MaxUnit; /* Traitement des unites enlevees ou rajoutees */ - if( OldNumUnits > CurrentLibEntry->m_UnitCount ) + if( OldNumUnits > component->m_UnitCount ) { - DrawItem = CurrentLibEntry->m_Drawings; + DrawItem = component->m_Drawings; for( ; DrawItem != NULL; DrawItem = NextDrawItem ) { NextDrawItem = DrawItem->Next(); @@ -404,21 +392,21 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::ChangeNbUnitsPerPackage( int MaxUnit ) { FlagDel = 0; MaxUnit = OldNumUnits; - CurrentLibEntry->m_UnitCount = MaxUnit; + component->m_UnitCount = MaxUnit; return FALSE; } } - CurrentLibEntry->RemoveDrawItem( DrawItem ); + component->RemoveDrawItem( DrawItem ); } } return TRUE; } - if( OldNumUnits < CurrentLibEntry->m_UnitCount ) + if( OldNumUnits < component->m_UnitCount ) { - DrawItem = CurrentLibEntry->m_Drawings; + DrawItem = component->m_Drawings; for( ; DrawItem != NULL; DrawItem = DrawItem->Next() ) { /* Duplication des items pour autres elements */ @@ -427,8 +415,8 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::ChangeNbUnitsPerPackage( int MaxUnit ) for( ii = OldNumUnits + 1; ii <= MaxUnit; ii++ ) { NextDrawItem = DrawItem->GenCopy(); - NextDrawItem->SetNext( CurrentLibEntry->m_Drawings ); - CurrentLibEntry->m_Drawings = NextDrawItem; + NextDrawItem->SetNext( component->m_Drawings ); + component->m_Drawings = NextDrawItem; NextDrawItem->m_Unit = ii; } } @@ -448,12 +436,13 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::SetUnsetConvert() { int FlagDel = 0; LibEDA_BaseStruct* DrawItem = NULL, * NextDrawItem; + LIB_COMPONENT* component = m_Parent->GetCurrentComponent(); if( g_AsDeMorgan ) /* Representation convertie a creer */ { /* Traitement des elements a ajouter ( pins seulement ) */ - if( CurrentLibEntry ) - DrawItem = CurrentLibEntry->m_Drawings; + if( component ) + DrawItem = component->m_Drawings; for( ; DrawItem != NULL; DrawItem = DrawItem->Next() ) { /* Duplication des items pour autres elements */ @@ -474,8 +463,8 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::SetUnsetConvert() } } NextDrawItem = DrawItem->GenCopy(); - NextDrawItem->SetNext( CurrentLibEntry->m_Drawings ); - CurrentLibEntry->m_Drawings = NextDrawItem; + NextDrawItem->SetNext( component->m_Drawings ); + component->m_Drawings = NextDrawItem; NextDrawItem->m_Convert = 2; } } @@ -483,8 +472,8 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::SetUnsetConvert() else /* Representation convertie a supprimer */ { /* Traitement des elements � supprimer */ - if( CurrentLibEntry ) - DrawItem = CurrentLibEntry->m_Drawings; + if( component ) + DrawItem = component->m_Drawings; for( ; DrawItem != NULL; DrawItem = NextDrawItem ) { NextDrawItem = DrawItem->Next(); @@ -505,7 +494,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::SetUnsetConvert() } m_Parent->GetScreen()->SetModify(); - CurrentLibEntry->RemoveDrawItem( DrawItem ); + component->RemoveDrawItem( DrawItem ); } } } @@ -572,8 +561,9 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::AddFootprintFilter( wxCommandEvent& WXUNU */ { wxString Line; + LIB_COMPONENT* component = m_Parent->GetCurrentComponent(); - if( CurrentLibEntry == NULL ) + if( component == NULL ) return; if( Get_Message( _( "Add Footprint Filter" ), _( "Footprint Filter" ), @@ -606,11 +596,12 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::DeleteOneFootprintFilter( wxCommandEvent& WXUNUSED (event) ) /********************************************************/ { + LIB_COMPONENT* component = m_Parent->GetCurrentComponent(); int ii = m_FootprintFilterListBox->GetSelection(); m_FootprintFilterListBox->Delete( ii ); - if( !CurrentLibEntry || (m_FootprintFilterListBox->GetCount() == 0) ) + if( !component || (m_FootprintFilterListBox->GetCount() == 0) ) { m_ButtonDeleteAllFootprintFilter->Enable( FALSE ); m_ButtonDeleteOneFootprintFilter->Enable( FALSE ); diff --git a/eeschema/edit_graphic_bodyitem_text.cpp b/eeschema/edit_graphic_bodyitem_text.cpp index edc3cf7531..23ccfb0372 100644 --- a/eeschema/edit_graphic_bodyitem_text.cpp +++ b/eeschema/edit_graphic_bodyitem_text.cpp @@ -15,11 +15,11 @@ #include "program.h" #include "libcmp.h" #include "general.h" +#include "protos.h" +#include "libeditfrm.h" #include "dialog_bodygraphictext_properties_base.h" -#include "protos.h" - class Dialog_BodyGraphicText_Properties : public Dialog_BodyGraphicText_Properties_base { diff --git a/eeschema/eeconfig.cpp b/eeschema/eeconfig.cpp index 8cd257da28..21d47dd800 100644 --- a/eeschema/eeconfig.cpp +++ b/eeschema/eeconfig.cpp @@ -6,7 +6,7 @@ #include "appl_wxstruct.h" #include "gr_basic.h" #include "common.h" -#include "id.h" +#include "eeschema_id.h" #include "class_drawpanel.h" #include "confirm.h" #include "gestfich.h" diff --git a/eeschema/eelayer.cpp b/eeschema/eelayer.cpp index 39ed55245a..6c47fa9662 100644 --- a/eeschema/eelayer.cpp +++ b/eeschema/eelayer.cpp @@ -12,7 +12,7 @@ #include "fctsys.h" #include "gr_basic.h" #include "common.h" -#include "id.h" +#include "eeschema_id.h" #include "class_drawpanel.h" #include "program.h" diff --git a/eeschema/eeschema.cpp b/eeschema/eeschema.cpp index 1b34d0d9f8..deb737be7d 100644 --- a/eeschema/eeschema.cpp +++ b/eeschema/eeschema.cpp @@ -102,7 +102,6 @@ LibEDA_BaseStruct* LibItemToRepeat = NULL; /* pointer on a graphic item than * can be duplicated by the Ins key * (usually the last created item */ CMP_LIBRARY* CurrentLib = NULL; /* Current opened library */ -LIB_COMPONENT* CurrentLibEntry = NULL; /* Current component */ LibEDA_BaseStruct* CurrentDrawItem = NULL; /* current edited item */ // Current selected alias (for components which have aliases) diff --git a/eeschema/eeschema_id.h b/eeschema/eeschema_id.h new file mode 100644 index 0000000000..5445ce2dbd --- /dev/null +++ b/eeschema/eeschema_id.h @@ -0,0 +1,196 @@ +#ifndef __EESCHEMA_ID_H__ +#define __EESCHEMA_ID_H__ + + +#include "id.h" + +/** + * Command IDs for the schematic editor. + * + * Please add IDs that are unique to the schematic editor (EESchema) here and + * not in the global id.h file. This will prevent the entire project from + * being rebuilt when adding new command to EESchema. + */ + +enum id_eeschema_frm +{ + /* Schecmatic editor horizontal toolbar IDs */ + ID_SCHEMATIC_UNDO = ID_END_LIST, + ID_SCHEMATIC_REDO, + ID_HIERARCHY, + ID_TO_LIBVIEW, + ID_GET_ANNOTATE, + ID_GET_ERC, + ID_BACKANNO_ITEMS, + + /* Schematic editor veritcal toolbar IDs */ + ID_SCHEMATIC_VERTICAL_TOOLBAR_START, + ID_HIERARCHY_PUSH_POP_BUTT, + ID_PLACE_POWER_BUTT, + ID_BUS_BUTT, + ID_WIRE_BUTT, + ID_BUSTOBUS_ENTRY_BUTT, + ID_WIRETOBUS_ENTRY_BUTT, + ID_LABEL_BUTT, + ID_GLABEL_BUTT, + ID_HIERLABEL_BUTT, + ID_IMPORT_HLABEL_BUTT, + ID_SHEET_LABEL_BUTT, + ID_NOCONN_BUTT, + ID_JUNCTION_BUTT, + ID_SHEET_SYMBOL_BUTT, + ID_TEXT_COMMENT_BUTT, + ID_LINE_COMMENT_BUTT, + ID_SCHEMATIC_DELETE_ITEM_BUTT, + ID_SCHEMATIC_VERTICAL_TOOLBAR_END, + + /* Schematic editor context menu IDs. */ + ID_POPUP_START_RANGE, + ID_POPUP_SCH_DELETE, + ID_POPUP_SCH_BREAK_WIRE, + ID_POPUP_SCH_DELETE_CONNECTION, + ID_POPUP_SCH_MOVE_ITEM_REQUEST, + ID_POPUP_SCH_DELETE_NODE, + ID_POPUP_SCH_MOVE_CMP_REQUEST, + ID_POPUP_SCH_DELETE_CMP, + ID_POPUP_SCH_DRAG_CMP_REQUEST, + ID_POPUP_SCH_DRAG_WIRE_REQUEST, + ID_POPUP_SCH_UNUSED_2, + ID_POPUP_SCH_ENTRY_SELECT_SLASH, + ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH, + + ID_POPUP_SCH_EDIT_CMP, + ID_POPUP_SCH_MIROR_X_CMP, + ID_POPUP_SCH_MIROR_Y_CMP, + ID_POPUP_SCH_ROTATE_CMP_CLOCKWISE, + ID_POPUP_SCH_ROTATE_CMP_COUNTERCLOCKWISE, + ID_POPUP_SCH_ORIENT_NORMAL_CMP, + ID_POPUP_SCH_INIT_CMP, + + ID_POPUP_SCH_EDIT_TEXT, + ID_POPUP_SCH_ROTATE_TEXT, + ID_POPUP_SCH_SET_SHAPE_TEXT, + ID_POPUP_END_LINE, + ID_POPUP_SCH_END_SHEET, + ID_POPUP_SCH_EDIT_SHEET, + ID_POPUP_SCH_RESIZE_SHEET, + ID_POPUP_SCH_CLEANUP_SHEET, + ID_POPUP_SCH_EDIT_PINSHEET, + ID_POPUP_SCH_MOVE_PINSHEET, + ID_POPUP_IMPORT_GLABEL, + ID_POPUP_SCH_GENERIC_ORIENT_CMP, + ID_POPUP_SCH_GENERIC_EDIT_CMP, + ID_POPUP_SCH_EDIT_VALUE_CMP, + ID_POPUP_SCH_EDIT_REF_CMP, + ID_POPUP_SCH_EDIT_FOOTPRINT_CMP, + ID_POPUP_SCH_EDIT_CONVERT_CMP, + ID_POPUP_SCH_COPY_COMPONENT_CMP, + ID_POPUP_SCH_SELECT_UNIT_CMP, + ID_POPUP_SCH_SELECT_UNIT1, + ID_POPUP_SCH_SELECT_UNIT2, + ID_POPUP_SCH_SELECT_UNIT3, + ID_POPUP_SCH_SELECT_UNIT4, + ID_POPUP_SCH_SELECT_UNIT5, + ID_POPUP_SCH_SELECT_UNIT6, + ID_POPUP_SCH_SELECT_UNIT7, + ID_POPUP_SCH_SELECT_UNIT8, + ID_POPUP_SCH_SELECT_UNIT9, + ID_POPUP_SCH_SELECT_UNIT10, + ID_POPUP_SCH_SELECT_UNIT11, + ID_POPUP_SCH_SELECT_UNIT12, + ID_POPUP_SCH_SELECT_UNIT13, + ID_POPUP_SCH_SELECT_UNIT14, + ID_POPUP_SCH_SELECT_UNIT15, + ID_POPUP_SCH_SELECT_UNIT16, + ID_POPUP_SCH_SELECT_UNIT17, + ID_POPUP_SCH_SELECT_UNIT18, + ID_POPUP_SCH_SELECT_UNIT19, + ID_POPUP_SCH_SELECT_UNIT20, + ID_POPUP_SCH_SELECT_UNIT21, + ID_POPUP_SCH_SELECT_UNIT22, + ID_POPUP_SCH_SELECT_UNIT23, + ID_POPUP_SCH_SELECT_UNIT24, + ID_POPUP_SCH_SELECT_UNIT25, + ID_POPUP_SCH_SELECT_UNIT26, + ID_POPUP_SCH_ROTATE_FIELD, + ID_POPUP_SCH_EDIT_FIELD, + ID_POPUP_SCH_CHANGE_TYPE_TEXT, + ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL, + ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL, + ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT, + ID_POPUP_SCH_DISPLAYDOC_CMP, + ID_POPUP_SCH_ENTER_SHEET, + ID_POPUP_SCH_LEAVE_SHEET, + ID_POPUP_SCH_ADD_JUNCTION, + ID_POPUP_SCH_ADD_LABEL, + ID_POPUP_SCH_ADD_GLABEL, + ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL, + ID_POPUP_SCH_GETINFO_MARKER, + ID_POPUP_END_RANGE, + + /* Library editor horizontal toolbar IDs. */ + ID_LIBEDIT_SELECT_PART, + ID_LIBEDIT_SELECT_CURRENT_LIB, + ID_LIBEDIT_SAVE_CURRENT_LIB, + ID_LIBEDIT_SAVE_CURRENT_PART, + ID_LIBEDIT_NEW_PART, + ID_LIBEDIT_GET_FRAME_EDIT_PART, + ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, + ID_LIBEDIT_DELETE_PART, + ID_LIBEDIT_UNDO, + ID_LIBEDIT_REDO, + ID_DE_MORGAN_NORMAL_BUTT, + ID_DE_MORGAN_CONVERT_BUTT, + ID_LIBEDIT_EDIT_PIN_BY_PIN, + ID_LIBEDIT_VIEW_DOC, + ID_LIBEDIT_CHECK_PART, + + ID_LIBEDIT_SELECT_PART_NUMBER, + ID_LIBEDIT_SELECT_ALIAS, + + /* Library editor vertical toolbar IDs. */ + ID_LIBEDIT_PIN_BUTT, + ID_LIBEDIT_BODY_LINE_BUTT, + ID_LIBEDIT_BODY_ARC_BUTT, + ID_LIBEDIT_BODY_CIRCLE_BUTT, + ID_LIBEDIT_BODY_RECT_BUTT, + ID_LIBEDIT_BODY_TEXT_BUTT, + ID_LIBEDIT_DELETE_ITEM_BUTT, + ID_LIBEDIT_ANCHOR_ITEM_BUTT, + ID_LIBEDIT_IMPORT_BODY_BUTT, + ID_LIBEDIT_EXPORT_BODY_BUTT, + + /* Library editor context menu IDs */ + ID_POPUP_LIBEDIT_PIN_EDIT, + ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM, + ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM, + ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM, + ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM, + ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, + ID_POPUP_LIBEDIT_DELETE_ITEM, + ID_POPUP_LIBEDIT_END_CREATE_ITEM, + ID_POPUP_LIBEDIT_CANCEL_EDITING, + ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, + ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM, + ID_POPUP_LIBEDIT_FIELD_ROTATE_ITEM, + ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT, + ID_POPUP_LIBEDIT_ROTATE_GRAPHIC_TEXT, + + /* Library viewer horizontal toolbar IDs */ + ID_LIBVIEW_NEXT, + ID_LIBVIEW_PREVIOUS, + ID_LIBVIEW_SELECT_PART, + ID_LIBVIEW_SELECT_LIB, + ID_LIBVIEW_VIEWDOC, + ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, + ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, + ID_LIBVIEW_SELECT_PART_NUMBER, + ID_LIBVIEW_LIB_LIST, + ID_LIBVIEW_CMP_LIST, + ID_LIBVIEW_LIBWINDOW, + ID_LIBVIEW_CMPWINDOW, + ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC +}; + + +#endif /* __EESCHEMA_ID_H__ */ diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index a31b1e995d..4ea2a90001 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -12,7 +12,7 @@ #include "general.h" #include "protos.h" -#include "id.h" +#include "eeschema_id.h" /****************************************************************/ diff --git a/eeschema/getpart.cpp b/eeschema/getpart.cpp index 63271b2700..7a8fb7a518 100644 --- a/eeschema/getpart.cpp +++ b/eeschema/getpart.cpp @@ -15,6 +15,7 @@ #include "general.h" #include "protos.h" #include "class_library.h" +#include "libviewfrm.h" #include diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index 793b8c413c..12369f5f93 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -3,17 +3,15 @@ /***************/ #include "fctsys.h" - #include "common.h" +#include "eeschema_id.h" +#include "hotkeys.h" + #include "program.h" #include "libcmp.h" #include "general.h" - -#include "id.h" - -#include "hotkeys.h" - #include "protos.h" +#include "libeditfrm.h" /* How to add a new hotkey: * add a new id in the enum hotkey_id_commnand like MY_NEW_ID_FUNCTION (see diff --git a/eeschema/lib_export.cpp b/eeschema/lib_export.cpp index e3ed94f9dc..a0647ded36 100644 --- a/eeschema/lib_export.cpp +++ b/eeschema/lib_export.cpp @@ -13,12 +13,13 @@ #include "class_drawpanel.h" #include "confirm.h" #include "gestfich.h" -#include "id.h" +#include "eeschema_id.h" #include "program.h" #include "libcmp.h" #include "general.h" #include "protos.h" +#include "libeditfrm.h" #include @@ -95,13 +96,13 @@ void WinEDA_LibeditFrame::OnExportPart( wxCommandEvent& event ) CMP_LIBRARY* CurLibTmp; bool createLib = ( event.GetId() != ExportPartId ) ? false : true; - if( CurrentLibEntry == NULL ) + if( m_currentComponent == NULL ) { DisplayError( this, _( "There is no component selected to save." ) ); return; } - fn = CurrentLibEntry->GetName().Lower(); + fn = m_currentComponent->GetName().Lower(); fn.SetExt( CompLibFileExtension ); title = createLib ? _( "New Library" ) : _( "Export Component" ); @@ -132,7 +133,7 @@ void WinEDA_LibeditFrame::OnExportPart( wxCommandEvent& event ) { msg = fn.GetFullPath() + _( " - OK" ); DisplayInfoMessage( this, _( "This library will not be available \ -until it is loaded by EESchema.\nModify the EESchema library configuration \ +until it is loaded by EESchema.\n\nModify the EESchema library configuration \ if you want to include it as part of this project." ) ); } else diff --git a/eeschema/libcmp.h b/eeschema/libcmp.h index 5759b0d4f2..402cb18775 100644 --- a/eeschema/libcmp.h +++ b/eeschema/libcmp.h @@ -20,6 +20,15 @@ LIB_VERSION( LIB_VERSION_MAJOR, LIB_VERSION_MINOR) \ ) +/* + * Library versions 2.3 and lower use the old separate library (.lib) and + * document (.dcm) files. Component libraries after 2.3 merged the library + * and document files into a single library file. This macro checks if the + * library version supports the old format + */ +#define USE_OLD_DOC_FILE_FORMAT( major, minor ) \ + ( LIB_VERSION( major, minor ) < LIB_VERSION( 2, 3 ) + /* Must be the first line of component library document (.dcm) files. */ #define DOCFILE_IDENT "EESchema-DOCLIB Version 2.0" @@ -48,7 +57,6 @@ extern LibEDA_BaseStruct* LibItemToRepeat; /* pointer on a graphic item than * can be duplicated by the Ins key * (usually the last created item */ extern CMP_LIBRARY* CurrentLib; /* Current opened library */ -extern LIB_COMPONENT* CurrentLibEntry; /* Current component */ extern LibEDA_BaseStruct* CurrentDrawItem; /* current edited item */ extern wxString CurrentAliasName; diff --git a/eeschema/libedit.cpp b/eeschema/libedit.cpp index 690a89ec55..4ab64ba74d 100644 --- a/eeschema/libedit.cpp +++ b/eeschema/libedit.cpp @@ -13,12 +13,14 @@ #include "class_drawpanel.h" #include "confirm.h" #include "gestfich.h" +#include "eeschema_id.h" + #include "program.h" #include "libcmp.h" #include "general.h" #include "protos.h" +#include "libeditfrm.h" -#include "id.h" #include "dialog_create_component.h" @@ -64,30 +66,28 @@ bool WinEDA_LibeditFrame::LoadOneLibraryPart() wxString CmpName; CMP_LIB_ENTRY* LibEntry = NULL; - if( g_ScreenLib->IsModify() ) - { - if( !IsOK( this, _( "Current part not saved.\nContinue?" ) ) ) - return FALSE; - } + if( g_ScreenLib->IsModify() && !IsOK( this, _( "Current part not \ +saved.\n\nDiscard current changes?" ) ) ) + return false; if( CurrentLib == NULL ) // No current lib, ask user for the library to use { SelectActiveLibrary(); if( CurrentLib == NULL ) - return FALSE; + return false; } i = GetNameOfPartToLoad( this, CurrentLib, CmpName ); if( i == 0 ) - return FALSE; + return false; g_ScreenLib->ClrModify(); CurrentDrawItem = NULL; // Delete previous library component, if any - if( CurrentLibEntry ) + if( m_currentComponent ) { - SAFE_DELETE( CurrentLibEntry ); + SAFE_DELETE( m_currentComponent ); } /* Load the new library component */ @@ -108,9 +108,9 @@ library \"%s\"." ), if( !LoadOneLibraryPartAux( LibEntry, CurrentLib ) ) return false; - Zoom_Automatique( FALSE ); + Zoom_Automatique( false ); DrawPanel->Refresh(); - return TRUE; + return true; } @@ -119,7 +119,7 @@ library \"%s\"." ), * retourne * 0 si OK * 1 si err - * CurrentLibEntry pointe la copie ainsi creee + * m_currentComponent pointe la copie ainsi creee */ bool WinEDA_LibeditFrame::LoadOneLibraryPartAux( CMP_LIB_ENTRY* LibEntry, CMP_LIBRARY* Library ) @@ -158,12 +158,12 @@ bool WinEDA_LibeditFrame::LoadOneLibraryPartAux( CMP_LIB_ENTRY* LibEntry, component = (LIB_COMPONENT*) LibEntry; } - if( CurrentLibEntry ) - SAFE_DELETE( CurrentLibEntry ); + if( m_currentComponent ) + SAFE_DELETE( m_currentComponent ); - CurrentLibEntry = CopyLibEntryStruct( component ); + m_currentComponent = CopyLibEntryStruct( component ); - if( CurrentLibEntry == NULL ) + if( m_currentComponent == NULL ) { msg.Printf( _( "Could not create copy of part <%s> in library <%s>." ), (const wxChar*) LibEntry->GetName(), @@ -177,7 +177,7 @@ bool WinEDA_LibeditFrame::LoadOneLibraryPartAux( CMP_LIB_ENTRY* LibEntry, g_AsDeMorgan = 0; - if( LookForConvertPart( CurrentLibEntry ) > 1 ) + if( LookForConvertPart( m_currentComponent ) > 1 ) g_AsDeMorgan = 1; g_ScreenLib->ClrModify(); @@ -208,7 +208,7 @@ void WinEDA_LibeditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) DrawPanel->CursorOff( DC ); // erase cursor if( DrawPanel->ManageCurseur ) { - DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); + DrawPanel->ManageCurseur( DrawPanel, DC, false ); } if( EraseBg ) @@ -216,15 +216,15 @@ void WinEDA_LibeditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) DrawPanel->DrawBackGround( DC ); - if( CurrentLibEntry ) - CurrentLibEntry->Draw( DrawPanel, DC, wxPoint( 0, 0 ), CurrentUnit, - CurrentConvert, GR_DEFAULT_DRAWMODE ); + if( m_currentComponent ) + m_currentComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), CurrentUnit, + CurrentConvert, GR_DEFAULT_DRAWMODE ); DrawPanel->CursorOn( DC ); // redraw cursor if( DrawPanel->ManageCurseur ) { - DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); + DrawPanel->ManageCurseur( DrawPanel, DC, false ); } GetScreen()->ClrRefreshReq(); @@ -296,10 +296,10 @@ void WinEDA_LibeditFrame::DisplayCmpDoc() MsgPanel->EraseMsgBox(); - if( CurrentLib == NULL && CurrentLibEntry == NULL ) + if( CurrentLib == NULL || m_currentComponent == NULL ) return; - msg = CurrentLibEntry->GetName(); + msg = m_currentComponent->GetName(); MsgPanel->AppendMessage( _( "Part" ), msg, BLUE, 8 ); @@ -327,7 +327,7 @@ void WinEDA_LibeditFrame::DisplayCmpDoc() MsgPanel->AppendMessage( _( "Body" ), msg, GREEN, 8 ); - if( CurrentLibEntry->m_Options == ENTRY_POWER ) + if( m_currentComponent->m_Options == ENTRY_POWER ) msg = _( "Power Symbol" ); else msg = _( "Component" ); @@ -337,14 +337,14 @@ void WinEDA_LibeditFrame::DisplayCmpDoc() if( alias != NULL ) msg = alias->m_Doc; else - msg = CurrentLibEntry->m_Doc; + msg = m_currentComponent->m_Doc; MsgPanel->AppendMessage( _( "Description" ), msg, CYAN, 8 ); if( alias != NULL ) msg = alias->m_KeyWord; else - msg = CurrentLibEntry->m_KeyWord; + msg = m_currentComponent->m_KeyWord; MsgPanel->AppendMessage( _( "Key words" ), msg, DARKDARKGRAY ); } @@ -362,13 +362,16 @@ void WinEDA_LibeditFrame::DisplayCmpDoc() * Sinon le premier alias devient le composant de base, et les autres * alias deviennent dependants de celui ci. */ -void WinEDA_LibeditFrame::DeleteOnePart() +void WinEDA_LibeditFrame::DeleteOnePart( wxCommandEvent& event ) { wxString CmpName; CMP_LIB_ENTRY* LibEntry; wxArrayString ListNames; wxString msg; + DrawPanel->UnManageCursor( 0, wxCURSOR_ARROW ); + + LibItemToRepeat = NULL; CurrentDrawItem = NULL; if( CurrentLib == NULL ) @@ -419,9 +422,9 @@ void WinEDA_LibeditFrame::DeleteOnePart() if( !IsOK( this, msg ) ) return; - if( CurrentLibEntry == NULL - || ( CurrentLibEntry->GetName().CmpNoCase( LibEntry->GetName() ) != 0 - && !CurrentLibEntry->HasAlias( LibEntry->GetName() ) ) ) + if( m_currentComponent == NULL + || ( m_currentComponent->GetName().CmpNoCase( LibEntry->GetName() ) != 0 + && !m_currentComponent->HasAlias( LibEntry->GetName() ) ) ) { CurrentLib->RemoveEntry( LibEntry ); return; @@ -444,23 +447,24 @@ All changes will be lost. Discard changes?" ) ) ) * in the library will be shown. If the current component has * aliases, the updated component will be shown */ - if( CurrentLibEntry->GetName().CmpNoCase( LibEntry->GetName() ) == 0 ) + if( m_currentComponent->GetName().CmpNoCase( LibEntry->GetName() ) == 0 ) { - if( CurrentLibEntry->m_AliasList.IsEmpty() ) + if( m_currentComponent->m_AliasList.IsEmpty() ) { - nextEntry = CurrentLib->GetNextEntry( CurrentLibEntry->GetName() ); + nextEntry = + CurrentLib->GetNextEntry( m_currentComponent->GetName() ); if( nextEntry != NULL ) newCmpName = nextEntry->GetName(); } else { - newCmpName = CurrentLibEntry->m_AliasList[ 0 ]; + newCmpName = m_currentComponent->m_AliasList[ 0 ]; } } else { - newCmpName = CurrentLibEntry->GetName(); + newCmpName = m_currentComponent->GetName(); } CurrentLib->RemoveEntry( LibEntry ); @@ -482,18 +486,19 @@ All changes will be lost. Discard changes?" ) ) ) * * If an old component is currently in edit, it is deleted. */ -void WinEDA_LibeditFrame::CreateNewLibraryPart() +void WinEDA_LibeditFrame::CreateNewLibraryPart( wxCommandEvent& event ) { - wxString msg; + int diag; + wxString msg; LIB_COMPONENT* NewStruct; - int diag; - if( CurrentLibEntry && GetScreen()->IsModify() - && !IsOK( this, - _( "All changes to the current component will be lost!\n\n\ -Clear the current component from the screen?" ) ) ) + if( m_currentComponent && GetScreen()->IsModify() + && !IsOK( this, _( "All changes to the current component will be \ +lost!\n\nClear the current component from the screen?" ) ) ) return; + DrawPanel->UnManageCursor( 0, wxCURSOR_ARROW ); + CurrentDrawItem = NULL; WinEDA_CreateCmpDialog Dialogbox( this ); @@ -512,7 +517,8 @@ Clear the current component from the screen?" ) ) ) if( CurrentLib->FindEntry( msg ) ) { wxString msg; - msg.Printf( _( "Component \"%s\" exists in library \"%s\"." ), + msg.Printf( _( "Component \"%s\" already exists in \ +library \"%s\"." ), (const wxChar*) Dialogbox.ReturnCmpName(), (const wxChar*) CurrentLib->GetName() ); DisplayError( this, msg ); @@ -527,15 +533,21 @@ Clear the current component from the screen?" ) ) ) NewStruct->m_Prefix.m_Text.MakeUpper(); // Effacement ancien composant affich� - if( CurrentLibEntry ) + if( m_currentComponent ) { - SAFE_DELETE( CurrentLibEntry ); + SAFE_DELETE( m_currentComponent ); } - CurrentLibEntry = NewStruct; + m_currentComponent = NewStruct; CurrentUnit = 1; CurrentConvert = 1; DisplayLibInfos(); DisplayCmpDoc(); + UpdateAliasSelectList(); + UpdatePartSelectList(); + g_EditPinByPinIsOn = false; + LibItemToRepeat = NULL; + GetScreen()->ClearUndoRedoList(); + DrawPanel->Refresh(); } @@ -552,7 +564,7 @@ void WinEDA_LibeditFrame::SaveOnePartInMemory() LIB_COMPONENT* Component; wxString msg; - if( CurrentLibEntry == NULL ) + if( m_currentComponent == NULL ) { DisplayError( this, _( "No component to save." ) ); return; @@ -569,7 +581,7 @@ void WinEDA_LibeditFrame::SaveOnePartInMemory() g_ScreenLib->ClrModify(); - oldComponent = CurrentLib->FindComponent( CurrentLibEntry->GetName() ); + oldComponent = CurrentLib->FindComponent( m_currentComponent->GetName() ); if( oldComponent != NULL ) { @@ -579,13 +591,13 @@ void WinEDA_LibeditFrame::SaveOnePartInMemory() return; } - wxASSERT( CurrentLibEntry->Type == ROOT ); + wxASSERT( m_currentComponent->Type == ROOT ); if( oldComponent != NULL ) Component = CurrentLib->ReplaceComponent( oldComponent, - CurrentLibEntry ); + m_currentComponent ); else - Component = CurrentLib->AddComponent( CurrentLibEntry ); + Component = CurrentLib->AddComponent( m_currentComponent ); if( Component == NULL ) return; diff --git a/eeschema/libedit_onleftclick.cpp b/eeschema/libedit_onleftclick.cpp index 22514b1130..9fc48974b7 100644 --- a/eeschema/libedit_onleftclick.cpp +++ b/eeschema/libedit_onleftclick.cpp @@ -10,28 +10,27 @@ #include "common.h" #include "class_drawpanel.h" #include "confirm.h" +#include "eeschema_id.h" #include "program.h" #include "libcmp.h" #include "general.h" - #include "protos.h" - -#include "id.h" +#include "libeditfrm.h" void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) { LibEDA_BaseStruct* DrawEntry = CurrentDrawItem; - if( CurrentLibEntry == NULL ) // No component loaded ! + if( m_currentComponent == NULL ) // No component loaded ! return; if( m_ID_current_state == 0 ) { if( DrawEntry && DrawEntry->m_Flags ) { - SaveCopyInUndoList( CurrentLibEntry ); + SaveCopyInUndoList( m_currentComponent ); switch( DrawEntry->Type() ) { @@ -51,25 +50,27 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) } else { - DrawEntry = LocatePin( GetScreen()->m_MousePosition, CurrentLibEntry, - CurrentUnit, CurrentConvert ); + DrawEntry = LocatePin( GetScreen()->m_MousePosition, + m_currentComponent, CurrentUnit, + CurrentConvert ); if( DrawEntry == NULL ) { DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(), GetScreen()->m_MousePosition, - CurrentLibEntry, CurrentUnit, + m_currentComponent, CurrentUnit, CurrentConvert, LOCATE_ALL_DRAW_ITEM ); } if( DrawEntry == NULL ) - DrawEntry = LocatePin( GetScreen()->m_Curseur, CurrentLibEntry, - CurrentUnit, CurrentConvert ); + DrawEntry = LocatePin( GetScreen()->m_Curseur, + m_currentComponent, CurrentUnit, + CurrentConvert ); if( DrawEntry == NULL ) { DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(), GetScreen()->m_Curseur, - CurrentLibEntry, CurrentUnit, + m_currentComponent, CurrentUnit, CurrentConvert, LOCATE_ALL_DRAW_ITEM ); } @@ -96,7 +97,7 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) } else { - SaveCopyInUndoList( CurrentLibEntry ); + SaveCopyInUndoList( m_currentComponent ); PlacePin( DC ); } break; @@ -108,7 +109,7 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) case ID_LIBEDIT_BODY_TEXT_BUTT: if( CurrentDrawItem == NULL || CurrentDrawItem->m_Flags == 0 ) { - CurrentDrawItem = CreateGraphicItem( CurrentLibEntry, DC ); + CurrentDrawItem = CreateGraphicItem( m_currentComponent, DC ); } else if( CurrentDrawItem ) { @@ -116,48 +117,50 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) GraphicItemBeginDraw( DC ); else { - SaveCopyInUndoList( CurrentLibEntry ); + SaveCopyInUndoList( m_currentComponent ); EndDrawGraphicItem( DC ); } } break; case ID_LIBEDIT_DELETE_ITEM_BUTT: - DrawEntry = LocatePin( GetScreen()->m_MousePosition, CurrentLibEntry, - CurrentUnit, CurrentConvert ); + DrawEntry = LocatePin( GetScreen()->m_MousePosition, + m_currentComponent, CurrentUnit, + CurrentConvert ); if( DrawEntry == NULL ) { DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(), GetScreen()->m_MousePosition, - CurrentLibEntry, CurrentUnit, + m_currentComponent, CurrentUnit, CurrentConvert, LOCATE_ALL_DRAW_ITEM ); } if( DrawEntry == NULL ) - DrawEntry = LocatePin( GetScreen()->m_Curseur, CurrentLibEntry, - CurrentUnit, CurrentConvert ); + DrawEntry = LocatePin( GetScreen()->m_Curseur, + m_currentComponent, CurrentUnit, + CurrentConvert ); if( DrawEntry == NULL ) { DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(), GetScreen()->m_Curseur, - CurrentLibEntry, CurrentUnit, + m_currentComponent, CurrentUnit, CurrentConvert, LOCATE_ALL_DRAW_ITEM ); } if( DrawEntry == NULL ) DisplayCmpDoc(); - SaveCopyInUndoList( CurrentLibEntry ); + SaveCopyInUndoList( m_currentComponent ); if( DrawEntry->Type() == COMPONENT_PIN_DRAW_TYPE ) - DeletePin( DC, CurrentLibEntry, (LibDrawPin*) DrawEntry ); + DeletePin( DC, m_currentComponent, (LibDrawPin*) DrawEntry ); else - CurrentLibEntry->RemoveDrawItem( DrawEntry, DrawPanel, DC ); + m_currentComponent->RemoveDrawItem( DrawEntry, DrawPanel, DC ); DrawEntry = NULL; GetScreen()->SetModify(); break; case ID_LIBEDIT_ANCHOR_ITEM_BUTT: - SaveCopyInUndoList( CurrentLibEntry ); + SaveCopyInUndoList( m_currentComponent ); PlaceAncre(); SetToolID( 0, wxCURSOR_ARROW, wxEmptyString ); break; @@ -183,22 +186,22 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) wxPoint pos = GetPosition(); LibEDA_BaseStruct* DrawEntry = CurrentDrawItem; - if( CurrentLibEntry == NULL ) + if( m_currentComponent == NULL ) return; if( ( DrawEntry == NULL ) || ( DrawEntry->m_Flags == 0 ) ) { // We can locate an item - DrawEntry = LocatePin( GetScreen()->m_MousePosition, CurrentLibEntry, + DrawEntry = LocatePin( GetScreen()->m_MousePosition, m_currentComponent, CurrentUnit, CurrentConvert ); if( DrawEntry == NULL ) - DrawEntry = LocatePin( GetScreen()->m_Curseur, CurrentLibEntry, + DrawEntry = LocatePin( GetScreen()->m_Curseur, m_currentComponent, CurrentUnit, CurrentConvert ); if( DrawEntry == NULL ) { DrawEntry = CurrentDrawItem = LocateDrawItem( (SCH_SCREEN*) GetScreen(), GetScreen()->m_MousePosition, - CurrentLibEntry, CurrentUnit, + m_currentComponent, CurrentUnit, CurrentConvert, LOCATE_ALL_DRAW_ITEM ); } if( DrawEntry == NULL ) @@ -206,13 +209,13 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) DrawEntry = CurrentDrawItem = LocateDrawItem( (SCH_SCREEN*) GetScreen(), GetScreen()->m_Curseur, - CurrentLibEntry, CurrentUnit, + m_currentComponent, CurrentUnit, CurrentConvert, LOCATE_ALL_DRAW_ITEM ); } if( DrawEntry == NULL ) { DrawEntry = CurrentDrawItem = - (LibEDA_BaseStruct*) LocateField( CurrentLibEntry ); + (LibEDA_BaseStruct*) LocateField( m_currentComponent ); } if( DrawEntry == NULL ) { diff --git a/eeschema/libedit_onrightclick.cpp b/eeschema/libedit_onrightclick.cpp index 8dfd4c3e5e..f5c943b177 100644 --- a/eeschema/libedit_onrightclick.cpp +++ b/eeschema/libedit_onrightclick.cpp @@ -1,65 +1,69 @@ - /****************************/ - /* EESchema - libedit_onrightclick.cpp */ - /****************************/ +/****************************/ +/* EESchema - libedit_onrightclick.cpp */ +/****************************/ /* , In library editor, create the pop menu when clicking on mouse right button -*/ + */ #include "fctsys.h" #include "gr_basic.h" #include "common.h" #include "confirm.h" +#include "bitmaps.h" +#include "eeschema_id.h" +#include "hotkeys.h" + #include "program.h" #include "libcmp.h" #include "general.h" - -#include "bitmaps.h" #include "protos.h" +#include "libeditfrm.h" -#include "id.h" -#include "hotkeys.h" /* functions to add commands and submenus depending on the item */ -static void AddMenusForBlock(wxMenu * PopMenu, WinEDA_LibeditFrame * frame); -static void AddMenusForPin(wxMenu * PopMenu, LibDrawPin* Pin, WinEDA_LibeditFrame * frame); +static void AddMenusForBlock( wxMenu* PopMenu, WinEDA_LibeditFrame* frame ); +static void AddMenusForPin( wxMenu* PopMenu, LibDrawPin* Pin, + WinEDA_LibeditFrame* frame ); -/********************************************************************************/ -bool WinEDA_LibeditFrame::OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu) -/********************************************************************************/ +bool WinEDA_LibeditFrame::OnRightClick( const wxPoint& MousePos, + wxMenu* PopMenu ) { -LibEDA_BaseStruct* DrawEntry = LocateItemUsingCursor(); -bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE); + LibEDA_BaseStruct* DrawEntry = LocateItemUsingCursor(); + bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE); - if ( CurrentLibEntry == NULL ) return true; + if( m_currentComponent == NULL ) + return true; // If Command in progresss: put the menu "cancel" and "end tool" - if ( m_ID_current_state ) + if( m_ID_current_state ) { - if (DrawEntry && DrawEntry->m_Flags) + if( DrawEntry && DrawEntry->m_Flags ) { - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, - _("Cancel"), cancel_xpm); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, + _( "Cancel" ), cancel_xpm ); } else { - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, - _("End Tool"), cancel_tool_xpm); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, + _( "End Tool" ), cancel_tool_xpm ); } PopMenu->AppendSeparator(); } - else { - if ( (DrawEntry && DrawEntry->m_Flags) || BlockActive ) + if( (DrawEntry && DrawEntry->m_Flags) || BlockActive ) { - if ( BlockActive ) AddMenusForBlock( PopMenu, this); - else ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, _("Cancel"), cancel_xpm); + if( BlockActive ) + AddMenusForBlock( PopMenu, this ); + else + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, + _( "Cancel" ), cancel_xpm ); PopMenu->AppendSeparator(); } } - if ( DrawEntry ) + if( DrawEntry ) DrawEntry->DisplayInfo( this ); else return true; @@ -67,186 +71,222 @@ bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE); CurrentDrawItem = DrawEntry; wxString msg; - switch ( DrawEntry->Type() ) + switch( DrawEntry->Type() ) { - case COMPONENT_PIN_DRAW_TYPE: - AddMenusForPin(PopMenu, (LibDrawPin*)DrawEntry, this); - break; + case COMPONENT_PIN_DRAW_TYPE: + AddMenusForPin( PopMenu, (LibDrawPin*) DrawEntry, this ); + break; - case COMPONENT_ARC_DRAW_TYPE: - if( DrawEntry->m_Flags == 0 ) - { - msg = AddHotkeyName( _( "Move Arc " ), s_Libedit_Hokeys_Descr, HK_MOVE_PIN ); - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_arc_xpm); - } - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, - _("Arc Options"), options_arc_xpm ); - if( DrawEntry->m_Flags == 0 ) - { - msg = AddHotkeyName( _( "Delete Arc " ), s_Libedit_Hokeys_Descr, HK_DELETE_PIN ); - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_arc_xpm); - } - break; + case COMPONENT_ARC_DRAW_TYPE: + if( DrawEntry->m_Flags == 0 ) + { + msg = AddHotkeyName( _( "Move Arc " ), s_Libedit_Hokeys_Descr, + HK_MOVE_PIN ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, + msg, move_arc_xpm ); + } + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, + _( "Arc Options" ), options_arc_xpm ); + if( DrawEntry->m_Flags == 0 ) + { + msg = AddHotkeyName( _( "Delete Arc " ), s_Libedit_Hokeys_Descr, + HK_DELETE_PIN ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, + msg, delete_arc_xpm ); + } + break; - case COMPONENT_CIRCLE_DRAW_TYPE: - if( DrawEntry->m_Flags == 0 ) - { - msg = AddHotkeyName( _( "Move Circle " ), s_Libedit_Hokeys_Descr, HK_MOVE_PIN ); - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_circle_xpm); - } - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, - _("Circle Options"), options_circle_xpm); - if( DrawEntry->m_Flags == 0 ) - { - msg = AddHotkeyName( _( "Delete Circle " ), s_Libedit_Hokeys_Descr, HK_DELETE_PIN ); - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM,msg, delete_circle_xpm); - } - break; + case COMPONENT_CIRCLE_DRAW_TYPE: + if( DrawEntry->m_Flags == 0 ) + { + msg = AddHotkeyName( _( "Move Circle " ), s_Libedit_Hokeys_Descr, + HK_MOVE_PIN ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, + msg, move_circle_xpm ); + } + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, + _( "Circle Options" ), options_circle_xpm ); + if( DrawEntry->m_Flags == 0 ) + { + msg = AddHotkeyName( _( "Delete Circle " ), + s_Libedit_Hokeys_Descr, HK_DELETE_PIN ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, + msg, delete_circle_xpm ); + } + break; - case COMPONENT_RECT_DRAW_TYPE: - if( DrawEntry->m_Flags == 0 ) - { - msg = AddHotkeyName( _( "Move Rect " ), s_Libedit_Hokeys_Descr, HK_MOVE_PIN ); - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_rectangle_xpm); - } - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, - _("Rect Options"), options_rectangle_xpm); - if( DrawEntry->m_Flags == 0 ) - { - msg = AddHotkeyName( _( "Delete Rect " ), s_Libedit_Hokeys_Descr, HK_DELETE_PIN ); - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_rectangle_xpm); - } - break; + case COMPONENT_RECT_DRAW_TYPE: + if( DrawEntry->m_Flags == 0 ) + { + msg = AddHotkeyName( _( "Move Rect " ), s_Libedit_Hokeys_Descr, + HK_MOVE_PIN ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, + msg, move_rectangle_xpm ); + } + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, + _( "Rect Options" ), options_rectangle_xpm ); + if( DrawEntry->m_Flags == 0 ) + { + msg = AddHotkeyName( _( "Delete Rect " ), s_Libedit_Hokeys_Descr, + HK_DELETE_PIN ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, + msg, delete_rectangle_xpm ); + } + break; - case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE: - if( DrawEntry->m_Flags == 0 ) - { - msg = AddHotkeyName( _( "Move Text " ), s_Libedit_Hokeys_Descr, HK_MOVE_PIN ); - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_text_xpm); - } - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, - _("Text Editor"), edit_text_xpm); - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_ROTATE_GRAPHIC_TEXT, - _("Rotate Text"), edit_text_xpm); - if( DrawEntry->m_Flags == 0 ) - { - msg = AddHotkeyName( _( "Delete Text " ), s_Libedit_Hokeys_Descr, HK_DELETE_PIN ); - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_text_xpm); - } - break; + case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE: + if( DrawEntry->m_Flags == 0 ) + { + msg = AddHotkeyName( _( "Move Text " ), s_Libedit_Hokeys_Descr, + HK_MOVE_PIN ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, + msg, move_text_xpm ); + } + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, + _( "Text Editor" ), edit_text_xpm ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_ROTATE_GRAPHIC_TEXT, + _( "Rotate Text" ), edit_text_xpm ); + if( DrawEntry->m_Flags == 0 ) + { + msg = AddHotkeyName( _( "Delete Text " ), s_Libedit_Hokeys_Descr, + HK_DELETE_PIN ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, + msg, delete_text_xpm ); + } + break; - case COMPONENT_POLYLINE_DRAW_TYPE: - if( DrawEntry->m_Flags == 0 ) + case COMPONENT_POLYLINE_DRAW_TYPE: + if( DrawEntry->m_Flags == 0 ) + { + msg = AddHotkeyName( _( "Move Line " ), s_Libedit_Hokeys_Descr, + HK_MOVE_PIN ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, + msg, move_line_xpm ); + } + if( DrawEntry->m_Flags & IS_NEW ) + { + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_END_CREATE_ITEM, + _( "Line End" ), apply_xpm ); + } + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, + _( "Line Options" ), options_segment_xpm ); + if( DrawEntry->m_Flags == 0 ) + { + msg = AddHotkeyName( _( "Delete Line " ), s_Libedit_Hokeys_Descr, + HK_DELETE_PIN ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, + msg, delete_segment_xpm ); + } + else if( (DrawEntry->m_Flags & IS_NEW) ) + { + if( ( (LibDrawPolyline*) DrawEntry )->GetCornerCount() > 2 ) { - msg = AddHotkeyName( _( "Move Line " ), s_Libedit_Hokeys_Descr, HK_MOVE_PIN ); - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_line_xpm); + msg = AddHotkeyName( _( "Delete Segment " ), + s_Libedit_Hokeys_Descr, HK_DELETE_PIN ); + ADD_MENUITEM( PopMenu, + ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT, + msg, delete_segment_xpm ); } - if ( DrawEntry->m_Flags & IS_NEW ) - { - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_END_CREATE_ITEM, - _("Line End"), apply_xpm); - } - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, - _("Line Options"), options_segment_xpm); - if( DrawEntry->m_Flags == 0 ) - { - msg = AddHotkeyName( _( "Delete Line " ), s_Libedit_Hokeys_Descr, HK_DELETE_PIN ); - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_segment_xpm); - } - else if( (DrawEntry->m_Flags & IS_NEW) ) - { - if( ((LibDrawPolyline*)DrawEntry)->GetCornerCount() > 2 ) - { - msg = AddHotkeyName( _( "Delete Segment " ), s_Libedit_Hokeys_Descr, HK_DELETE_PIN ); - ADD_MENUITEM(PopMenu, - ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT, msg, delete_segment_xpm); - } - } - break; + } + break; - case COMPONENT_FIELD_DRAW_TYPE: - if( DrawEntry->m_Flags == 0 ) - { - msg = AddHotkeyName( _( "Move Field " ), s_Libedit_Hokeys_Descr, HK_MOVE_PIN ); - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, move_field_xpm); - } - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_FIELD_ROTATE_ITEM, - _("Field Rotate"), rotate_field_xpm); - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM, - _("Field Edit"), edit_text_xpm); - break; + case COMPONENT_FIELD_DRAW_TYPE: + if( DrawEntry->m_Flags == 0 ) + { + msg = AddHotkeyName( _( "Move Field " ), s_Libedit_Hokeys_Descr, + HK_MOVE_PIN ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, + msg, move_field_xpm ); + } + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_FIELD_ROTATE_ITEM, + _( "Field Rotate" ), rotate_field_xpm ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM, + _( "Field Edit" ), edit_text_xpm ); + break; - default: - wxString msg; - msg.Printf( - wxT("WinEDA_LibeditFrame::OnRightClick Error: unknown StructType %d"), - DrawEntry->Type()); - DisplayError(this, msg ); - CurrentDrawItem = NULL; - break; + default: + wxString msg; + msg.Printf( wxT( "WinEDA_LibeditFrame::OnRightClick Error: unknown \ +StructType %d" ), + DrawEntry->Type() ); + DisplayError( this, msg ); + CurrentDrawItem = NULL; + break; } + PopMenu->AppendSeparator(); return true; } -/**********************************************************************************/ -void AddMenusForPin(wxMenu * PopMenu, LibDrawPin* Pin, WinEDA_LibeditFrame * frame) -/**********************************************************************************/ + +void AddMenusForPin( wxMenu* PopMenu, + LibDrawPin* Pin, + WinEDA_LibeditFrame* frame ) { -bool selected = (Pin->m_Selected & IS_SELECTED) != 0; -bool not_in_move = (Pin->m_Flags == 0); + bool selected = (Pin->m_Selected & IS_SELECTED) != 0; + bool not_in_move = (Pin->m_Flags == 0); if( not_in_move ) - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, _("Move Pin"), move_xpm ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, + _( "Move Pin" ), move_xpm ); wxString msg; msg = AddHotkeyName( _( "Edit Pin " ), s_Libedit_Hokeys_Descr, HK_EDIT_PIN ); - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_PIN_EDIT, msg, edit_xpm ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_PIN_EDIT, msg, edit_xpm ); if( not_in_move ) { - msg = AddHotkeyName( _( "Delete Pin " ), s_Libedit_Hokeys_Descr, HK_DELETE_PIN ); - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, delete_pin_xpm ); + msg = AddHotkeyName( _( "Delete Pin " ), s_Libedit_Hokeys_Descr, + HK_DELETE_PIN ); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, + msg, delete_pin_xpm ); } - wxMenu * global_pin_change = new wxMenu; - ADD_MENUITEM_WITH_SUBMENU(PopMenu, global_pin_change, ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM, - _("Global"), pin_to_xpm); - ADD_MENUITEM(global_pin_change, ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM, - selected ? _("Pin Size to selected pins"): _("Pin Size to Others"), - pin_size_to_xpm); - ADD_MENUITEM(global_pin_change, ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM, - selected ? _("Pin Name Size to selected pin") : _("Pin Name Size to Others"), - pin_name_to_xpm); - ADD_MENUITEM(global_pin_change, ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM, - selected ?_("Pin Num Size to selected pin") : _("Pin Num Size to Others"), - pin_number_to_xpm); + wxMenu* global_pin_change = new wxMenu; + ADD_MENUITEM_WITH_SUBMENU( PopMenu, global_pin_change, + ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM, + _( "Global" ), pin_to_xpm ); + ADD_MENUITEM( global_pin_change, + ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM, + selected ? _( "Pin Size to selected pins" ) : + _( "Pin Size to Others" ), pin_size_to_xpm ); + ADD_MENUITEM( global_pin_change, + ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM, + selected ? _( "Pin Name Size to selected pin" ) : + _( "Pin Name Size to Others" ), pin_name_to_xpm ); + ADD_MENUITEM( global_pin_change, + ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM, + selected ? _( "Pin Num Size to selected pin" ) : + _( "Pin Num Size to Others" ), pin_number_to_xpm ); } -/**********************************************************************/ -void AddMenusForBlock(wxMenu * PopMenu, WinEDA_LibeditFrame * frame) -/**********************************************************************/ -/* Add menu commands for block -*/ +/* Add menu commands for block */ + +void AddMenusForBlock( wxMenu* PopMenu, WinEDA_LibeditFrame* frame ) { - ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, _("Cancel Block"), cancel_xpm); + ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, + _( "Cancel Block" ), cancel_xpm ); if( frame->GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE ) - ADD_MENUITEM(PopMenu, ID_POPUP_ZOOM_BLOCK, _("Zoom Block (drag middle mouse)"), zoom_selected_xpm); + ADD_MENUITEM( PopMenu, ID_POPUP_ZOOM_BLOCK, + _( "Zoom Block (drag middle mouse)" ), + zoom_selected_xpm ); PopMenu->AppendSeparator(); - ADD_MENUITEM(PopMenu, ID_POPUP_PLACE_BLOCK, _("Place Block"), apply_xpm ); + ADD_MENUITEM( PopMenu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), + apply_xpm ); if( frame->GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE ) { - ADD_MENUITEM(PopMenu, ID_POPUP_SELECT_ITEMS_BLOCK, _("Select Items"), green_xpm); - ADD_MENUITEM(PopMenu, ID_POPUP_COPY_BLOCK, - _("Copy Block"), copyblock_xpm); - ADD_MENUITEM(PopMenu, ID_POPUP_MIRROR_Y_BLOCK, _("Mirror Block ||"), mirror_H_xpm ); - ADD_MENUITEM(PopMenu, ID_POPUP_DELETE_BLOCK, - _("Delete Block"), delete_xpm ); + ADD_MENUITEM( PopMenu, ID_POPUP_SELECT_ITEMS_BLOCK, + _( "Select Items" ), green_xpm ); + ADD_MENUITEM( PopMenu, ID_POPUP_COPY_BLOCK, + _( "Copy Block" ), copyblock_xpm ); + ADD_MENUITEM( PopMenu, ID_POPUP_MIRROR_Y_BLOCK, + _( "Mirror Block ||" ), mirror_H_xpm ); + ADD_MENUITEM( PopMenu, ID_POPUP_DELETE_BLOCK, + _( "Delete Block" ), delete_xpm ); } } - diff --git a/eeschema/libedit_undo_redo.cpp b/eeschema/libedit_undo_redo.cpp index d9a6c243d9..c2d4ac3019 100644 --- a/eeschema/libedit_undo_redo.cpp +++ b/eeschema/libedit_undo_redo.cpp @@ -9,9 +9,8 @@ #include "program.h" #include "libcmp.h" #include "general.h" -//#include "id.h" - #include "protos.h" +#include "libeditfrm.h" /*************************************************************************/ @@ -55,16 +54,16 @@ void WinEDA_LibeditFrame::GetComponentFromRedoList(wxCommandEvent& event) return; PICKED_ITEMS_LIST* lastcmd = new PICKED_ITEMS_LIST(); - ITEM_PICKER wrapper(CurrentLibEntry, UR_LIBEDIT); + ITEM_PICKER wrapper(m_currentComponent, UR_LIBEDIT); lastcmd->PushItem(wrapper); GetScreen()->PushCommandToUndoList( lastcmd ); lastcmd = GetScreen()->PopCommandFromRedoList( ); wrapper = lastcmd->PopItem(); - CurrentLibEntry = (LIB_COMPONENT*) wrapper.m_PickedItem; - if( CurrentLibEntry ) - CurrentLibEntry->SetNext( NULL ); + m_currentComponent = (LIB_COMPONENT*) wrapper.m_PickedItem; + if( m_currentComponent ) + m_currentComponent->SetNext( NULL ); CurrentDrawItem = NULL; GetScreen()->SetModify(); DrawPanel->Refresh(); @@ -85,17 +84,17 @@ void WinEDA_LibeditFrame::GetComponentFromUndoList(wxCommandEvent& event) return; PICKED_ITEMS_LIST* lastcmd = new PICKED_ITEMS_LIST(); - ITEM_PICKER wrapper(CurrentLibEntry, UR_LIBEDIT); + ITEM_PICKER wrapper(m_currentComponent, UR_LIBEDIT); lastcmd->PushItem(wrapper); GetScreen()->PushCommandToRedoList( lastcmd ); lastcmd = GetScreen()->PopCommandFromUndoList( ); wrapper = lastcmd->PopItem(); - CurrentLibEntry = (LIB_COMPONENT*) wrapper.m_PickedItem; + m_currentComponent = (LIB_COMPONENT*) wrapper.m_PickedItem; - if( CurrentLibEntry ) - CurrentLibEntry->SetNext( NULL ); + if( m_currentComponent ) + m_currentComponent->SetNext( NULL ); CurrentDrawItem = NULL; GetScreen()->SetModify(); DrawPanel->Refresh(); diff --git a/eeschema/libeditfrm.h b/eeschema/libeditfrm.h new file mode 100644 index 0000000000..fb979ecb3d --- /dev/null +++ b/eeschema/libeditfrm.h @@ -0,0 +1,160 @@ +/*****************************/ +/* class WinEDA_LibeditFrame */ +/*****************************/ + +#ifndef __LIBEDITFRM_H__ +#define __LIBEDITFRM_H__ + +#include "wxstruct.h" + + +class SCH_SCREEN; +class CMP_LIBRARY; +class LIB_COMPONENT; +class LIB_ALIAS; + +/** + * The component library editor main window. + */ +class WinEDA_LibeditFrame : public WinEDA_DrawFrame +{ +public: + WinEDAChoiceBox* m_SelpartBox; + WinEDAChoiceBox* m_SelAliasBox; + +public: + WinEDA_LibeditFrame( wxWindow* father, + const wxString& title, + const wxPoint& pos, const wxSize& size, + long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); + + ~WinEDA_LibeditFrame(); + + void Process_Special_Functions( wxCommandEvent& event ); + void OnImportPart( wxCommandEvent& event ); + void OnExportPart( wxCommandEvent& event ); + void OnSelectAlias( wxCommandEvent& event ); + void OnSelectPart( wxCommandEvent& event ); + void DeleteOnePart( wxCommandEvent& event ); + void CreateNewLibraryPart( wxCommandEvent& event ); + void OnEditComponentProperties( wxCommandEvent& event ); + void InstallFieldsEditorDialog( wxCommandEvent& event ); + + void OnUpdateEditingPart( wxUpdateUIEvent& event ); + void OnUpdateNotEditingPart( wxUpdateUIEvent& event ); + void OnUpdateUndo( wxUpdateUIEvent& event ); + void OnUpdateRedo( wxUpdateUIEvent& event ); + void OnUpdateSaveCurrentLib( wxUpdateUIEvent& event ); + void OnUpdateViewDoc( wxUpdateUIEvent& event ); + void OnUpdatePinByPin( wxUpdateUIEvent& event ); + void OnUpdatePartNumber( wxUpdateUIEvent& event ); + void OnUpdateDeMorganNormal( wxUpdateUIEvent& event ); + void OnUpdateDeMorganConvert( wxUpdateUIEvent& event ); + void OnUpdateSelectAlias( wxUpdateUIEvent& event ); + + void UpdateAliasSelectList(); + void UpdatePartSelectList(); + void DisplayLibInfos(); + void RedrawActiveWindow( wxDC* DC, bool EraseBg ); + void OnCloseWindow( wxCloseEvent& Event ); + void ReCreateHToolbar(); + void ReCreateVToolbar(); + void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); + bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); + int BestZoom(); // Retourne le meilleur zoom + void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); + + SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); } + void OnHotKey( wxDC* DC, int hotkey, + EDA_BaseStruct* DrawStruct ); + + void GeneralControle( wxDC* DC, + wxPoint MousePositionInPixels ); + + void LoadSettings(); + void SaveSettings(); + + LIB_COMPONENT* GetCurrentComponent( void ) + { + return m_currentComponent; + } + +private: + + // General: + void SaveOnePartInMemory(); + void SelectActiveLibrary(); + bool LoadOneLibraryPart(); + void SaveActiveLibrary( wxCommandEvent& event ); + + bool LoadOneLibraryPartAux( CMP_LIB_ENTRY* LibEntry, + CMP_LIBRARY* Library ); + + void DisplayCmpDoc(); + void EditComponentProperties(); + + // General editing +public: + void SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, + int flag_type_command = 0 ); + +private: + void GetComponentFromUndoList(wxCommandEvent& event); + void GetComponentFromRedoList(wxCommandEvent& event); + + // Edition des Pins: + void CreatePin( wxDC* DC ); + void DeletePin( wxDC* DC, + LIB_COMPONENT* LibEntry, + LibDrawPin* Pin ); + void StartMovePin( wxDC* DC ); + + // Test des pins ( duplicates...) + bool TestPins( LIB_COMPONENT* LibEntry ); + + // Edition de l'ancre + void PlaceAncre(); + + // Edition des graphismes: + LibEDA_BaseStruct* CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC ); + void GraphicItemBeginDraw( wxDC* DC ); + void StartMoveDrawSymbol( wxDC* DC ); + void EndDrawGraphicItem( wxDC* DC ); + void LoadOneSymbol(); + void SaveOneSymbol(); + void EditGraphicSymbol( wxDC* DC, + LibEDA_BaseStruct* DrawItem ); + void EditSymbolText( wxDC* DC, LibEDA_BaseStruct* DrawItem ); + void RotateSymbolText( wxDC* DC ); + void DeleteDrawPoly( wxDC* DC ); + LibDrawField* LocateField( LIB_COMPONENT* LibEntry ); + LibEDA_BaseStruct* LocateItemUsingCursor(); + void RotateField( wxDC* DC, LibDrawField* Field ); + void PlaceField( wxDC* DC, LibDrawField* Field ); + void EditField( wxDC* DC, LibDrawField* Field ); + void StartMoveField( wxDC* DC, LibDrawField* field ); + +public: + /* Block commands: */ + int ReturnBlockCommand( int key ); + void HandleBlockPlace( wxDC* DC ); + int HandleBlockEnd( wxDC* DC ); + + void PlacePin( wxDC* DC ); + void InitEditOnePin(); + void GlobalSetPins( wxDC* DC, LibDrawPin* MasterPin, int id ); + + // Repetition automatique de placement de pins + void RepeatPinItem( wxDC* DC, LibDrawPin* Pin ); + +protected: + wxString m_ConfigPath; + wxString m_LastLibImportPath; + wxString m_LastLibExportPath; + + static LIB_COMPONENT* m_currentComponent; + + DECLARE_EVENT_TABLE() +}; + +#endif /* __LIBEDITFRM_H__ */ diff --git a/eeschema/libfield.cpp b/eeschema/libfield.cpp index b0c4e3a0d1..403addd32a 100644 --- a/eeschema/libfield.cpp +++ b/eeschema/libfield.cpp @@ -11,19 +11,13 @@ #include "program.h" #include "libcmp.h" #include "general.h" - #include "protos.h" +#include "libeditfrm.h" /* Routines locales */ static void ShowMoveField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); -/* - * if the field is the reference, return reference like schematic, - * i.e U -> U? or U?A or the field text for others - */ -static wxString ReturnFieldFullText( LibDrawField* aField ); - /* Variables locales */ extern int CurrentUnit; @@ -55,7 +49,7 @@ void WinEDA_LibeditFrame::StartMoveField( wxDC* DC, LibDrawField* field ) { wxPoint startPos; - if( ( CurrentLibEntry == NULL ) || ( field == NULL ) ) + if( ( m_currentComponent == NULL ) || ( field == NULL ) ) return; CurrentDrawItem = field; @@ -77,37 +71,6 @@ void WinEDA_LibeditFrame::StartMoveField( wxDC* DC, LibDrawField* field ) } -/* - * If the field is the reference, return reference like schematic, - * i.e U -> U? or U?A or the field text for others - * - * @fixme This should be handled by the field object. - */ -static wxString ReturnFieldFullText( LibDrawField* aField ) -{ - if( aField->m_FieldId != REFERENCE ) - return aField->m_Text; - - wxString text = aField->m_Text; - - if( CurrentLibEntry->m_UnitCount > 1 ) - { -#if defined(KICAD_GOST) - text.Printf( wxT( "%s?.%c" ), - aField->m_Text.GetData(), CurrentUnit + '1' - 1 ); -#else - - text.Printf( wxT( "%s?%c" ), - aField->m_Text.GetData(), CurrentUnit + 'A' - 1 ); -#endif - } - else - text << wxT( "?" ); - - return text; -} - - /*****************************************************************/ /* Routine d'affichage du texte 'Field' en cours de deplacement. */ /* Routine normalement attachee au curseur */ @@ -116,10 +79,10 @@ static void ShowMoveField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) { LibDrawField* Field = (LibDrawField*) CurrentDrawItem; - if( ( CurrentLibEntry == NULL ) || ( Field == NULL ) ) + if( Field == NULL ) return; - wxString text = ReturnFieldFullText( Field ); + wxString text = Field->GetFullText(); if( erase ) Field->Draw( panel, DC, wxPoint( 0, 0 ), -1, g_XorMode, &text, @@ -144,7 +107,7 @@ void WinEDA_LibeditFrame::PlaceField( wxDC* DC, LibDrawField* Field ) Field->m_Pos.y = -GetScreen()->m_Curseur.y; DrawPanel->CursorOff( DC ); - wxString fieldText = ReturnFieldFullText( Field ); + wxString fieldText = Field->GetFullText(); Field->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE, &fieldText, DefaultTransformMatrix ); @@ -196,13 +159,13 @@ void WinEDA_LibeditFrame::EditField( wxDC* DC, LibDrawField* Field ) wxString msg; /* Test for an existing name in the current components alias list. */ - if( CurrentLibEntry->m_AliasList.Index( Text, false ) != wxNOT_FOUND ) + if( Field->GetParent()->m_AliasList.Index( Text, false ) != wxNOT_FOUND ) { msg.Printf( _( "The field name <%s> is an existing alias of the \ component <%s>.\nPlease choose another name that does not conflict with any \ names in the alias list." ), (const wxChar*) Text, - (const wxChar*) CurrentLibEntry->GetName() ); + (const wxChar*) Field->GetParent()->GetName() ); DisplayError( this, msg ); return; } @@ -222,14 +185,14 @@ not conflict with any library entries." ), } } - wxString fieldText = ReturnFieldFullText( Field ); + wxString fieldText = Field->GetFullText(); Field->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, &fieldText, DefaultTransformMatrix ); if( !Text.IsEmpty() ) { - SaveCopyInUndoList( CurrentLibEntry ); + SaveCopyInUndoList( Field->GetParent() ); Field->m_Text = Text; } else @@ -237,7 +200,7 @@ not conflict with any library entries." ), DisplayError( this, _( "No new text: no change" ) ); } - fieldText = ReturnFieldFullText( Field ); + fieldText = Field->GetFullText(); int drawMode = g_XorMode; if( Field->m_Flags == 0 ) @@ -266,7 +229,7 @@ void WinEDA_LibeditFrame::RotateField( wxDC* DC, LibDrawField* Field ) DrawPanel->CursorOff( DC ); GRSetDrawMode( DC, g_XorMode ); - wxString fieldText = ReturnFieldFullText( Field ); + wxString fieldText = Field->GetFullText(); Field->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, &fieldText, DefaultTransformMatrix ); @@ -324,33 +287,33 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::LocateItemUsingCursor() { LibEDA_BaseStruct* DrawEntry = CurrentDrawItem; - if( CurrentLibEntry == NULL ) + if( m_currentComponent == NULL ) return NULL; if( ( DrawEntry == NULL ) || ( DrawEntry->m_Flags == 0 ) ) { - DrawEntry = LocatePin( GetScreen()->m_Curseur, CurrentLibEntry, + DrawEntry = LocatePin( GetScreen()->m_Curseur, m_currentComponent, CurrentUnit, CurrentConvert ); if( DrawEntry == NULL ) { DrawEntry = CurrentDrawItem = LocateDrawItem( (SCH_SCREEN*) GetScreen(), GetScreen()->m_MousePosition, - CurrentLibEntry, CurrentUnit, + m_currentComponent, CurrentUnit, CurrentConvert, LOCATE_ALL_DRAW_ITEM ); } if( DrawEntry == NULL ) { DrawEntry = CurrentDrawItem = LocateDrawItem( (SCH_SCREEN*) GetScreen(), - GetScreen()->m_Curseur, CurrentLibEntry, + GetScreen()->m_Curseur, m_currentComponent, CurrentUnit, CurrentConvert, LOCATE_ALL_DRAW_ITEM ); } if( DrawEntry == NULL ) { DrawEntry = CurrentDrawItem = - (LibEDA_BaseStruct*) LocateField( CurrentLibEntry ); + (LibEDA_BaseStruct*) LocateField( m_currentComponent ); } } diff --git a/eeschema/libframe.cpp b/eeschema/libframe.cpp index f1a3c0f00d..248ec76c9e 100644 --- a/eeschema/libframe.cpp +++ b/eeschema/libframe.cpp @@ -11,13 +11,15 @@ #include "class_drawpanel.h" #include "confirm.h" #include "eda_doc.h" + #include "program.h" #include "libcmp.h" #include "general.h" #include "bitmaps.h" #include "protos.h" -#include "id.h" +#include "eeschema_id.h" #include "class_library.h" +#include "libeditfrm.h" #include @@ -35,6 +37,9 @@ int ImportPartId = ::wxNewId(); int CreateNewLibAndSavePartId = ::wxNewId(); +LIB_COMPONENT* WinEDA_LibeditFrame::m_currentComponent = NULL; + + /*****************************/ /* class WinEDA_LibeditFrame */ /*****************************/ @@ -49,9 +54,9 @@ BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, WinEDA_DrawFrame ) EVT_TOOL( ID_LIBEDIT_SELECT_CURRENT_LIB, WinEDA_LibeditFrame::Process_Special_Functions ) EVT_TOOL( ID_LIBEDIT_DELETE_PART, - WinEDA_LibeditFrame::Process_Special_Functions ) + WinEDA_LibeditFrame::DeleteOnePart ) EVT_TOOL( ID_LIBEDIT_NEW_PART, - WinEDA_LibeditFrame::Process_Special_Functions ) + WinEDA_LibeditFrame::CreateNewLibraryPart ) EVT_TOOL( ID_LIBEDIT_SELECT_PART, WinEDA_LibeditFrame::Process_Special_Functions ) EVT_TOOL( ID_LIBEDIT_SAVE_CURRENT_PART, @@ -63,7 +68,7 @@ BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, WinEDA_DrawFrame ) EVT_TOOL( ID_LIBEDIT_GET_FRAME_EDIT_PART, WinEDA_LibeditFrame::OnEditComponentProperties ) EVT_TOOL( ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, - WinEDA_LibeditFrame::Process_Special_Functions ) + WinEDA_LibeditFrame::InstallFieldsEditorDialog ) EVT_TOOL( ID_LIBEDIT_CHECK_PART, WinEDA_LibeditFrame::Process_Special_Functions ) EVT_TOOL( ID_DE_MORGAN_NORMAL_BUTT, @@ -86,11 +91,12 @@ BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, WinEDA_DrawFrame ) /* Right vertical toolbar. */ EVT_TOOL( ID_NO_SELECT_BUTT, WinEDA_LibeditFrame::Process_Special_Functions ) - EVT_TOOL_RANGE( ID_LIBEDIT_START_V_TOOL, ID_LIBEDIT_END_V_TOOL, + EVT_TOOL_RANGE( ID_LIBEDIT_PIN_BUTT, ID_LIBEDIT_EXPORT_BODY_BUTT, WinEDA_LibeditFrame::Process_Special_Functions ) /* Context menu events and commands. */ - EVT_MENU_RANGE( ID_POPUP_START_RANGE, ID_POPUP_END_RANGE, + EVT_MENU_RANGE( ID_POPUP_LIBEDIT_PIN_EDIT, + ID_POPUP_LIBEDIT_ROTATE_GRAPHIC_TEXT, WinEDA_LibeditFrame::Process_Special_Functions ) EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE, @@ -246,10 +252,10 @@ int WinEDA_LibeditFrame::BestZoom() wxSize size; EDA_Rect BoundaryBox; - if( CurrentLibEntry ) + if( m_currentComponent ) { - BoundaryBox = CurrentLibEntry->GetBoundaryBox( CurrentUnit, - CurrentConvert ); + BoundaryBox = m_currentComponent->GetBoundaryBox( CurrentUnit, + CurrentConvert ); dx = BoundaryBox.GetWidth(); dy = BoundaryBox.GetHeight(); } @@ -266,7 +272,7 @@ int WinEDA_LibeditFrame::BestZoom() bestzoom = MAX( ii, jj ) + 1; - if( CurrentLibEntry ) + if( m_currentComponent ) { GetScreen()->m_Curseur = BoundaryBox.Centre(); } @@ -287,15 +293,15 @@ void WinEDA_LibeditFrame::UpdateAliasSelectList() m_SelAliasBox->Clear(); - if( CurrentLibEntry == NULL ) + if( m_currentComponent == NULL ) return; - m_SelAliasBox->Append( CurrentLibEntry->GetName() ); + m_SelAliasBox->Append( m_currentComponent->GetName() ); m_SelAliasBox->SetSelection( 0 ); - if( !CurrentLibEntry->m_AliasList.IsEmpty() ) + if( !m_currentComponent->m_AliasList.IsEmpty() ) { - m_SelAliasBox->Append( CurrentLibEntry->m_AliasList ); + m_SelAliasBox->Append( m_currentComponent->m_AliasList ); int index = m_SelAliasBox->FindString( CurrentAliasName ); @@ -314,13 +320,13 @@ void WinEDA_LibeditFrame::UpdatePartSelectList() if( m_SelpartBox->GetCount() != 0 ) m_SelpartBox->Clear(); - if( CurrentLibEntry == NULL || CurrentLibEntry->m_UnitCount <= 1 ) + if( m_currentComponent == NULL || m_currentComponent->m_UnitCount <= 1 ) { m_SelpartBox->Append( wxEmptyString ); } else { - for( int i = 0; i < CurrentLibEntry->m_UnitCount; i++ ) + for( int i = 0; i < m_currentComponent->m_UnitCount; i++ ) { wxString msg; msg.Printf( _( "Part %c" ), 'A' + i ); @@ -334,26 +340,26 @@ void WinEDA_LibeditFrame::UpdatePartSelectList() void WinEDA_LibeditFrame::OnUpdateEditingPart( wxUpdateUIEvent& event ) { - event.Enable( CurrentLibEntry != NULL ); + event.Enable( m_currentComponent != NULL ); } void WinEDA_LibeditFrame::OnUpdateNotEditingPart( wxUpdateUIEvent& event ) { - event.Enable( CurrentLibEntry == NULL ); + event.Enable( m_currentComponent == NULL ); } void WinEDA_LibeditFrame::OnUpdateUndo( wxUpdateUIEvent& event ) { - event.Enable( CurrentLibEntry != NULL && GetScreen() != NULL + event.Enable( m_currentComponent != NULL && GetScreen() != NULL && GetScreen()->GetUndoCommandCount() != 0 ); } void WinEDA_LibeditFrame::OnUpdateRedo( wxUpdateUIEvent& event ) { - event.Enable( CurrentLibEntry != NULL && GetScreen() != NULL + event.Enable( m_currentComponent != NULL && GetScreen() != NULL && GetScreen()->GetRedoCommandCount() != 0 ); } @@ -369,7 +375,7 @@ void WinEDA_LibeditFrame::OnUpdateViewDoc( wxUpdateUIEvent& event ) { bool enable = false; - if( CurrentLibEntry != NULL && CurrentLib != NULL ) + if( m_currentComponent != NULL && CurrentLib != NULL ) { if( !CurrentAliasName.IsEmpty() ) { @@ -378,7 +384,7 @@ void WinEDA_LibeditFrame::OnUpdateViewDoc( wxUpdateUIEvent& event ) if( entry != NULL ) enable = !entry->m_DocFile.IsEmpty(); } - else if( !CurrentLibEntry->m_DocFile.IsEmpty() ) + else if( !m_currentComponent->m_DocFile.IsEmpty() ) { enable = true; } @@ -390,8 +396,9 @@ void WinEDA_LibeditFrame::OnUpdateViewDoc( wxUpdateUIEvent& event ) void WinEDA_LibeditFrame::OnUpdatePinByPin( wxUpdateUIEvent& event ) { - event.Enable( ( CurrentLibEntry != NULL ) - && ( ( CurrentLibEntry->m_UnitCount > 1 ) || g_AsDeMorgan ) ); + event.Enable( ( m_currentComponent != NULL ) + && ( ( m_currentComponent->m_UnitCount > 1 ) + || g_AsDeMorgan ) ); if( m_HToolBar ) m_HToolBar->ToggleTool( event.GetId(), g_EditPinByPinIsOn ); @@ -406,8 +413,8 @@ void WinEDA_LibeditFrame::OnUpdatePartNumber( wxUpdateUIEvent& event ) /* Using the typical event.Enable() call dosen't seem to work with wxGTK * so use the pointer to alias combobox to directly enable or disable. */ - m_SelpartBox->Enable( CurrentLibEntry != NULL - && CurrentLibEntry->m_UnitCount > 1 ); + m_SelpartBox->Enable( m_currentComponent != NULL + && m_currentComponent->m_UnitCount > 1 ); } @@ -416,7 +423,8 @@ void WinEDA_LibeditFrame::OnUpdateDeMorganNormal( wxUpdateUIEvent& event ) if( m_HToolBar == NULL ) return; - event.Enable( CurrentLibEntry != NULL && CurrentLibEntry->HasConversion() ); + event.Enable( m_currentComponent != NULL + && m_currentComponent->HasConversion() ); m_HToolBar->ToggleTool( event.GetId(), CurrentConvert <= 1 ); } @@ -426,7 +434,8 @@ void WinEDA_LibeditFrame::OnUpdateDeMorganConvert( wxUpdateUIEvent& event ) if( m_HToolBar == NULL ) return; - event.Enable( CurrentLibEntry != NULL && CurrentLibEntry->HasConversion() ); + event.Enable( m_currentComponent != NULL + && m_currentComponent->HasConversion() ); m_HToolBar->ToggleTool( event.GetId(), CurrentConvert > 1 ); } @@ -439,8 +448,8 @@ void WinEDA_LibeditFrame::OnUpdateSelectAlias( wxUpdateUIEvent& event ) /* Using the typical event.Enable() call dosen't seem to work with wxGTK * so use the pointer to alias combobox to directly enable or disable. */ - m_SelAliasBox->Enable( CurrentLibEntry != NULL - && !CurrentLibEntry->m_AliasList.IsEmpty() ); + m_SelAliasBox->Enable( m_currentComponent != NULL + && !m_currentComponent->m_AliasList.IsEmpty() ); } @@ -452,7 +461,7 @@ void WinEDA_LibeditFrame::OnSelectAlias( wxCommandEvent& event ) LibItemToRepeat = NULL; - if( m_SelAliasBox->GetStringSelection().CmpNoCase(CurrentLibEntry->GetName() ) == 0 ) + if( m_SelAliasBox->GetStringSelection().CmpNoCase(m_currentComponent->GetName() ) == 0 ) CurrentAliasName.Empty(); else CurrentAliasName = m_SelAliasBox->GetStringSelection(); @@ -525,18 +534,6 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) switch( id ) { - case ID_LIBEDIT_NEW_PART: - { - g_EditPinByPinIsOn = false; - LibItemToRepeat = NULL; - CreateNewLibraryPart(); - UpdateAliasSelectList(); - UpdatePartSelectList(); - GetScreen()->ClearUndoRedoList(); - DrawPanel->Refresh(); - break; - } - case ID_LIBEDIT_SELECT_CURRENT_LIB: SelectActiveLibrary(); break; @@ -555,19 +552,8 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) SaveOnePartInMemory(); break; - case ID_LIBEDIT_GET_FRAME_EDIT_FIELDS: - InstallFieldsEditorDialog( ); - UpdateAliasSelectList(); - UpdatePartSelectList(); - break; - - case ID_LIBEDIT_DELETE_PART: - LibItemToRepeat = NULL; - DeleteOnePart(); - break; - case ID_LIBEDIT_CHECK_PART: - if( CurrentLibEntry && TestPins( CurrentLibEntry ) == false ) + if( m_currentComponent && TestPins( m_currentComponent ) == false ) DisplayInfoMessage( this, _( " Pins Test OK!" ) ); break; @@ -584,7 +570,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) break; case ID_LIBEDIT_VIEW_DOC: - if( CurrentLibEntry ) + if( m_currentComponent ) { wxString docfilename; if( !CurrentAliasName.IsEmpty() ) @@ -594,7 +580,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) docfilename = entry->m_DocFile; } else - docfilename = CurrentLibEntry->m_DocFile; + docfilename = m_currentComponent->m_DocFile; if( !docfilename.IsEmpty() ) GetAssociatedDocument( this, docfilename, @@ -611,7 +597,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) break; case ID_LIBEDIT_PIN_BUTT: - if( CurrentLibEntry ) + if( m_currentComponent ) { SetToolID( id, wxCURSOR_PENCIL, _( "Add Pin" ) ); } @@ -707,7 +693,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) case ID_LIBEDIT_DELETE_ITEM_BUTT: - if( CurrentLibEntry == NULL ) + if( m_currentComponent == NULL ) { wxBell(); break; @@ -729,18 +715,18 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) break; DrawPanel->MouseToCursorSchema(); DrawPanel->CursorOff( &dc ); - SaveCopyInUndoList( CurrentLibEntry ); + SaveCopyInUndoList( m_currentComponent ); if( CurrentDrawItem->Type() == COMPONENT_PIN_DRAW_TYPE ) { - DeletePin( &dc, CurrentLibEntry, (LibDrawPin*) CurrentDrawItem ); + DeletePin( &dc, m_currentComponent, (LibDrawPin*) CurrentDrawItem ); } else { if( DrawPanel->ManageCurseur && DrawPanel->ForceCloseManageCurseur ) DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc ); else - CurrentLibEntry->RemoveDrawItem( CurrentDrawItem, DrawPanel, - &dc ); + m_currentComponent->RemoveDrawItem( CurrentDrawItem, DrawPanel, + &dc ); } CurrentDrawItem = NULL; @@ -766,7 +752,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) DrawPanel->CursorOff( &dc ); DrawPanel->MouseToCursorSchema(); if( (CurrentDrawItem->m_Flags & IS_NEW) == 0 ) - SaveCopyInUndoList( CurrentLibEntry ); + SaveCopyInUndoList( m_currentComponent ); RotateSymbolText( &dc ); DrawPanel->CursorOn( &dc ); break; @@ -778,7 +764,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) DrawPanel->MouseToCursorSchema(); if( CurrentDrawItem->Type() == COMPONENT_FIELD_DRAW_TYPE ) { - SaveCopyInUndoList( CurrentLibEntry ); + SaveCopyInUndoList( m_currentComponent ); RotateField( &dc, (LibDrawField*) CurrentDrawItem ); } DrawPanel->CursorOn( &dc ); @@ -802,7 +788,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) if( (CurrentDrawItem == NULL ) || (CurrentDrawItem->Type() != COMPONENT_PIN_DRAW_TYPE) ) break; - SaveCopyInUndoList( CurrentLibEntry ); + SaveCopyInUndoList( m_currentComponent ); GlobalSetPins( &dc, (LibDrawPin*) CurrentDrawItem, id ); DrawPanel->MouseToCursorSchema(); break; diff --git a/eeschema/libviewfrm.h b/eeschema/libviewfrm.h new file mode 100644 index 0000000000..cbda1388bd --- /dev/null +++ b/eeschema/libviewfrm.h @@ -0,0 +1,71 @@ +#ifndef __LIBVIEWFRM_H__ +#define __LIBVIEWFRM_H__ + + +class WinEDAChoiceBox; +class SCH_SCREEN; +class CMP_LIBRARY; + + +/** + * Component library viewer main window. + */ +class WinEDA_ViewlibFrame : public WinEDA_DrawFrame +{ +private: + WinEDAChoiceBox* SelpartBox; + + // List of libraries (for selection ) + wxSashLayoutWindow* m_LibListWindow; + wxListBox* m_LibList; // The list of libs + wxSize m_LibListSize; // size of the window + + // List of components in the selected library + wxSashLayoutWindow* m_CmpListWindow; + wxListBox* m_CmpList; // The list of components + wxSize m_CmpListSize; // size of the window + + // Flags + wxSemaphore* m_Semaphore; // != NULL if the frame must emulate a modal dialog + wxString m_ConfigPath; // subpath for configuartion + +public: + WinEDA_ViewlibFrame( wxWindow* father, + CMP_LIBRARY* Library = NULL, + wxSemaphore* semaphore = NULL ); + + ~WinEDA_ViewlibFrame(); + + void OnSize( wxSizeEvent& event ); + void OnSashDrag( wxSashEvent& event ); + void ReCreateListLib(); + void ReCreateListCmp(); + void Process_Special_Functions( wxCommandEvent& event ); + void DisplayLibInfos(); + void RedrawActiveWindow( wxDC* DC, bool EraseBg ); + void OnCloseWindow( wxCloseEvent& Event ); + void ReCreateHToolbar(); + void ReCreateVToolbar(); + void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); + int BestZoom(); // Retourne le meilleur zoom + void ClickOnLibList( wxCommandEvent& event ); + void ClickOnCmpList( wxCommandEvent& event ); + + SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); } + + void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels ); + + void LoadSettings(); + void SaveSettings(); + +private: + void SelectCurrentLibrary(); + void SelectAndViewLibraryPart( int option ); + void ExportToSchematicLibraryPart( wxCommandEvent& event ); + void ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag ); + bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); + + DECLARE_EVENT_TABLE() +}; + +#endif /* __LIBVIEWFRM_H__ */ diff --git a/eeschema/menubar.cpp b/eeschema/menubar.cpp index 7e3c2cf680..f030579457 100644 --- a/eeschema/menubar.cpp +++ b/eeschema/menubar.cpp @@ -14,7 +14,7 @@ #include "general.h" #include "bitmaps.h" #include "protos.h" -#include "id.h" +#include "eeschema_id.h" #include "hotkeys.h" diff --git a/eeschema/onleftclick.cpp b/eeschema/onleftclick.cpp index 3e788cefa9..d328161f71 100644 --- a/eeschema/onleftclick.cpp +++ b/eeschema/onleftclick.cpp @@ -4,7 +4,7 @@ #include "fctsys.h" #include "common.h" -#include "id.h" +#include "eeschema_id.h" #include "class_drawpanel.h" #include "confirm.h" diff --git a/eeschema/onrightclick.cpp b/eeschema/onrightclick.cpp index b6479d066f..1452d12e9c 100644 --- a/eeschema/onrightclick.cpp +++ b/eeschema/onrightclick.cpp @@ -5,7 +5,7 @@ #include "fctsys.h" #include "common.h" -#include "id.h" +#include "eeschema_id.h" #include "class_drawpanel.h" #include "confirm.h" diff --git a/eeschema/pinedit-dialog.h b/eeschema/pinedit-dialog.h index 73de7604a2..d7992c8df2 100644 --- a/eeschema/pinedit-dialog.h +++ b/eeschema/pinedit-dialog.h @@ -14,9 +14,9 @@ #ifndef _PINEDIT_DIALOG_H_ #define _PINEDIT_DIALOG_H_ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "pinedit-dialog.h" -#endif +/* #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) */ +/* #pragma interface "pinedit-dialog.h" */ +/* #endif */ /*! * Includes @@ -29,8 +29,8 @@ #include "program.h" #include "libcmp.h" #include "general.h" -#include "id.h" - +#include "eeschema_id.h" +#include "libeditfrm.h" #include "protos.h" ////@begin includes diff --git a/eeschema/pinedit.cpp b/eeschema/pinedit.cpp index 995524f589..a9d60c66d4 100644 --- a/eeschema/pinedit.cpp +++ b/eeschema/pinedit.cpp @@ -2,9 +2,11 @@ /* EESchema - PinEdit.cpp */ /***************************/ -#if defined (__GNUG__) && !defined (NO_GCC_PRAGMA) -#pragma implementation "pinedit-dialog.h" -#endif +#include "fctsys.h" + +#include "program.h" +#include "libeditfrm.h" +#include "eeschema_id.h" #include "pinedit-dialog.h" @@ -83,7 +85,7 @@ void WinEDA_PinPropertiesFrame::PinPropertiesAccept( wxCommandEvent& event ) if( CurrentDrawItem ) // Set Pin Name & Num { if( !(CurrentDrawItem->m_Flags & IS_NEW) ) // if IS_NEW, copy for undo is done before place - m_Parent->SaveCopyInUndoList( CurrentLibEntry ); + m_Parent->SaveCopyInUndoList( CurrentDrawItem->GetParent() ); SetPinName( m_PinNameCtrl->GetValue(), LastPinNameSize ); msg = m_PinNumCtrl->GetValue(); @@ -117,13 +119,13 @@ void WinEDA_LibeditFrame::InitEditOnePin() LibDrawPin* Pin; LibDrawPin* CurrentPin = (LibDrawPin*) CurrentDrawItem; - if( CurrentLibEntry == NULL ) + if( m_currentComponent == NULL ) return; if( CurrentPin == NULL ) return; /* Marquage des pins a traiter,Si edition d'une pin non deja selectionnee */ - Pin = (LibDrawPin*) CurrentLibEntry->m_Drawings; + Pin = (LibDrawPin*) m_currentComponent->m_Drawings; for( ; Pin != NULL; Pin = Pin->Next() ) { if( Pin->Type() != COMPONENT_PIN_DRAW_TYPE ) @@ -153,11 +155,11 @@ static void AbortPinMove( WinEDA_DrawPanel* Panel, wxDC* DC ) { LibDrawPin* CurrentPin = (LibDrawPin*) CurrentDrawItem; - if( CurrentPin && ( CurrentPin->m_Flags & IS_NEW ) ) - CurrentLibEntry->RemoveDrawItem( CurrentPin, Panel, DC ); + if( CurrentPin && ( CurrentPin->m_Flags & IS_NEW ) ) + CurrentPin->GetParent()->RemoveDrawItem( CurrentPin, Panel, DC ); /* clear edit flags */ - LibEDA_BaseStruct* item = CurrentLibEntry->m_Drawings; + LibEDA_BaseStruct* item = CurrentPin->GetParent()->m_Drawings; for( ; item != NULL; item = item->Next() ) item->m_Flags = 0; @@ -186,7 +188,7 @@ void WinEDA_LibeditFrame::PlacePin( wxDC* DC ) newpos.x = GetScreen()->m_Curseur.x; newpos.y = -GetScreen()->m_Curseur.y; - Pin = (LibDrawPin*) CurrentLibEntry->m_Drawings; + Pin = (LibDrawPin*) m_currentComponent->m_Drawings; // Tst for an other pin in same new position: for( ; Pin != NULL; Pin = Pin->Next() ) @@ -227,7 +229,7 @@ void WinEDA_LibeditFrame::PlacePin( wxDC* DC ) } /* Put linked pins in new position, and clear flags */ - Pin = (LibDrawPin*) CurrentLibEntry->m_Drawings; + Pin = (LibDrawPin*) m_currentComponent->m_Drawings; for( ; Pin != NULL; Pin = Pin->Next() ) { if( Pin->Type() != COMPONENT_PIN_DRAW_TYPE ) @@ -255,7 +257,7 @@ void WinEDA_PinPropertiesFrame::SetPinOrient( int neworient ) LibDrawPin* CurrentPin = (LibDrawPin*) CurrentDrawItem; LibDrawPin* Pin, * RefPin = CurrentPin; - if( CurrentLibEntry == NULL ) + if( CurrentPin == NULL || CurrentPin->GetParent() == NULL ) return; if( RefPin == NULL ) return; @@ -265,7 +267,7 @@ void WinEDA_PinPropertiesFrame::SetPinOrient( int neworient ) /* Rotation */ RefPin->m_Orient = neworient; - Pin = (LibDrawPin*) CurrentLibEntry->m_Drawings; + Pin = (LibDrawPin*) CurrentPin->GetParent()->m_Drawings; for( ; Pin != NULL; Pin = Pin->Next() ) { if( Pin->m_Flags == 0 ) @@ -291,7 +293,7 @@ void WinEDA_LibeditFrame::StartMovePin( wxDC* DC ) wxPoint startPos; /* Marquage des pins a traiter */ - Pin = (LibDrawPin*) CurrentLibEntry->m_Drawings; + Pin = (LibDrawPin*) m_currentComponent->m_Drawings; for( ; Pin != NULL; Pin = Pin->Next() ) { Pin->m_Flags = 0; @@ -373,7 +375,7 @@ void WinEDA_PinPropertiesFrame::SetPinShape( int newshape ) m_Parent->GetScreen()->SetModify(); CurrentPin->DisplayInfo( m_Parent ); - Pin = (LibDrawPin*) CurrentLibEntry->m_Drawings; + Pin = (LibDrawPin*) CurrentPin->GetParent()->m_Drawings; for( ; Pin != NULL; Pin = Pin->Next() ) { if( Pin->Type() != COMPONENT_PIN_DRAW_TYPE ) @@ -400,13 +402,13 @@ void WinEDA_PinPropertiesFrame::SetPinType( int newtype ) LibDrawPin* Pin; LibDrawPin* CurrentPin = (LibDrawPin*) CurrentDrawItem; - if( CurrentPin == NULL ) + if( CurrentPin == NULL || CurrentPin->GetParent() == NULL ) return; CurrentPin->m_PinType = newtype; m_Parent->GetScreen()->SetModify(); - Pin = (LibDrawPin*) CurrentLibEntry->m_Drawings; + Pin = (LibDrawPin*) CurrentPin->GetParent()->m_Drawings; for( ; Pin != NULL; Pin = Pin->Next() ) { if( Pin->Type() != COMPONENT_PIN_DRAW_TYPE ) @@ -431,6 +433,9 @@ void WinEDA_PinPropertiesFrame::SetPinName( const wxString& newname, int newsize LibDrawPin* CurrentPin = (LibDrawPin*) CurrentDrawItem; wxString buf; + if( CurrentPin == NULL || CurrentPin->GetParent() == NULL ) + return; + buf = newname; buf.Replace( wxT( " " ), wxT( "_" ) ); @@ -442,7 +447,7 @@ void WinEDA_PinPropertiesFrame::SetPinName( const wxString& newname, int newsize m_Parent->GetScreen()->SetModify(); /* Traitement des autres pins */ - Pin = (LibDrawPin*) CurrentLibEntry->m_Drawings; + Pin = (LibDrawPin*) CurrentPin->GetParent()->m_Drawings; for( ; Pin != NULL; Pin = Pin->Next() ) { if( Pin->Type() != COMPONENT_PIN_DRAW_TYPE ) @@ -474,7 +479,7 @@ void WinEDA_PinPropertiesFrame::SetPinNum( const wxString& newnum, int newsize ) buf = newnum; buf.Replace( wxT( " " ), wxT( "_" ) ); - if( CurrentPin == NULL ) + if( CurrentPin == NULL || CurrentPin->GetParent() == NULL ) return; CurrentPin->m_PinNum = 0; @@ -484,7 +489,7 @@ void WinEDA_PinPropertiesFrame::SetPinNum( const wxString& newnum, int newsize ) CurrentPin->SetPinNumFromString( buf ); m_Parent->GetScreen()->SetModify(); - Pin = (LibDrawPin*) CurrentLibEntry->m_Drawings; + Pin = (LibDrawPin*) CurrentPin->GetParent()->m_Drawings; for( ; Pin != NULL; Pin = Pin->Next() ) { if( Pin->Type() != COMPONENT_PIN_DRAW_TYPE ) @@ -552,15 +557,15 @@ void WinEDA_LibeditFrame::CreatePin( wxDC* DC ) LibDrawPin* CurrentPin; bool showPinText = true; - if( CurrentLibEntry == NULL ) + if( m_currentComponent == NULL ) return; /* Effacement des flags */ - DrawItem = CurrentLibEntry->m_Drawings; + DrawItem = m_currentComponent->m_Drawings; for( ; DrawItem != NULL; DrawItem = DrawItem->Next() ) DrawItem->m_Flags = 0; - CurrentPin = new LibDrawPin(CurrentLibEntry); + CurrentPin = new LibDrawPin(m_currentComponent); CurrentDrawItem = CurrentPin; if( CurrentPin == NULL ) @@ -594,9 +599,9 @@ void WinEDA_LibeditFrame::CreatePin( wxDC* DC ) else CurrentPin->m_Attributs &= ~PINNOTDRAW; - CurrentPin->SetNext( CurrentLibEntry->m_Drawings ); - CurrentLibEntry->m_Drawings = CurrentPin; - CurrentLibEntry->SortDrawItems(); + CurrentPin->SetNext( m_currentComponent->m_Drawings ); + m_currentComponent->m_Drawings = CurrentPin; + m_currentComponent->SortDrawItems(); if( DC ) CurrentPin->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, @@ -644,18 +649,18 @@ void WinEDA_PinPropertiesFrame::SetAttributsPin( bool draw, m_Parent->GetScreen()->SetModify(); - if( unit ) + if( unit ) { if( LastPinCommonUnit ) CurrentPin->m_Unit = 0; else CurrentPin->m_Unit = CurrentUnit; - Pin = (LibDrawPin*) CurrentLibEntry->m_Drawings; + Pin = (LibDrawPin*) CurrentPin->GetParent()->m_Drawings; if( CurrentPin->m_Unit == 0 ) { - DrawItem = CurrentLibEntry->m_Drawings; + DrawItem = CurrentPin->GetParent()->m_Drawings; for( ; DrawItem != NULL; ) { Pin = (LibDrawPin*) DrawItem; @@ -674,7 +679,7 @@ void WinEDA_PinPropertiesFrame::SetAttributsPin( bool draw, if( Pin->m_Orient != CurrentPin->m_Orient ) continue; - CurrentLibEntry->RemoveDrawItem( (LibEDA_BaseStruct*) Pin ); + CurrentPin->GetParent()->RemoveDrawItem( (LibEDA_BaseStruct*) Pin ); } } } // end if unit @@ -688,7 +693,7 @@ void WinEDA_PinPropertiesFrame::SetAttributsPin( bool draw, if( CurrentPin->m_Convert == 0 ) /* Effacement des pins redondantes */ { - DrawItem = CurrentLibEntry->m_Drawings; + DrawItem = CurrentPin->GetParent()->m_Drawings; for( ; DrawItem != NULL; ) { Pin = (LibDrawPin*) DrawItem; @@ -706,7 +711,7 @@ void WinEDA_PinPropertiesFrame::SetAttributsPin( bool draw, if( Pin->m_Orient != CurrentPin->m_Orient ) continue; - CurrentLibEntry->RemoveDrawItem( (LibEDA_BaseStruct*) Pin ); + CurrentPin->GetParent()->RemoveDrawItem( (LibEDA_BaseStruct*) Pin ); } } } // end if convert @@ -718,7 +723,7 @@ void WinEDA_PinPropertiesFrame::SetAttributsPin( bool draw, else CurrentPin->m_Attributs &= ~PINNOTDRAW; - Pin = (LibDrawPin*) CurrentLibEntry->m_Drawings; + Pin = (LibDrawPin*) CurrentPin->GetParent()->m_Drawings; for( ; Pin != NULL; Pin = Pin->Next() ) { if( Pin->m_Flags == 0 ) @@ -744,9 +749,7 @@ void WinEDA_PinPropertiesFrame::NewSizePin( int newsize ) { LibDrawPin* RefPin, * Pin = (LibDrawPin*) CurrentDrawItem; - if( CurrentLibEntry == NULL ) - return; - if( Pin == NULL ) + if( Pin == NULL || Pin->GetParent() == NULL ) return; m_Parent->GetScreen()->SetModify(); @@ -759,7 +762,7 @@ void WinEDA_PinPropertiesFrame::NewSizePin( int newsize ) if( g_EditPinByPinIsOn == false ) { - Pin = (LibDrawPin*) CurrentLibEntry->m_Drawings; + Pin = (LibDrawPin*) Pin->GetParent()->m_Drawings; for( ; Pin != NULL; Pin = Pin->Next() ) { if( Pin->Type() != COMPONENT_PIN_DRAW_TYPE ) @@ -787,10 +790,11 @@ static void CreateImagePins( LibDrawPin* Pin ) LibDrawPin* NewPin; bool CreateConv = false; + if( g_EditPinByPinIsOn ) return; - if( g_AsDeMorgan && (Pin->m_Convert != 0 ) ) + if( g_AsDeMorgan && ( Pin->m_Convert != 0 ) ) CreateConv = true; /* Creation de la pin " convert " pour la part courante */ @@ -801,15 +805,13 @@ static void CreateImagePins( LibDrawPin* Pin ) NewPin->m_Convert = 1; else NewPin->m_Convert = 2; - NewPin->SetNext( CurrentLibEntry->m_Drawings ); - CurrentLibEntry->m_Drawings = NewPin; + NewPin->SetNext( Pin->GetParent()->m_Drawings ); + Pin->GetParent()->m_Drawings = NewPin; } - for( ii = 1; ii <= CurrentLibEntry->m_UnitCount; ii++ ) + for( ii = 1; ii <= Pin->GetParent()->m_UnitCount; ii++ ) { - if( ii == CurrentUnit ) - continue; /* Deja fait */ - if( Pin->m_Unit == 0 ) + if( ii == CurrentUnit || Pin->m_Unit == 0 ) continue; /* Pin commune a toutes les unites */ /* Creation pour la representation "normale" */ @@ -817,8 +819,8 @@ static void CreateImagePins( LibDrawPin* Pin ) if( CurrentConvert != 0 ) NewPin->m_Convert = 1; NewPin->m_Unit = ii; - NewPin->SetNext( CurrentLibEntry->m_Drawings ); - CurrentLibEntry->m_Drawings = NewPin; + NewPin->SetNext( Pin->GetParent()->m_Drawings ); + Pin->GetParent()->m_Drawings = NewPin; /* Creation pour la representation "Convert" */ if( CreateConv == false ) @@ -828,8 +830,8 @@ static void CreateImagePins( LibDrawPin* Pin ) NewPin->m_Convert = 2; if( Pin->m_Unit != 0 ) NewPin->m_Unit = ii; - NewPin->SetNext( CurrentLibEntry->m_Drawings ); - CurrentLibEntry->m_Drawings = NewPin; + NewPin->SetNext( Pin->GetParent()->m_Drawings ); + Pin->GetParent()->m_Drawings = NewPin; } } @@ -850,14 +852,14 @@ void WinEDA_LibeditFrame::GlobalSetPins( wxDC* DC, bool selected = ( MasterPin->m_Selected & IS_SELECTED ) != 0; bool showPinText = true; - if( ( CurrentLibEntry == NULL ) || ( MasterPin == NULL ) ) + if( ( m_currentComponent == NULL ) || ( MasterPin == NULL ) ) return; if( MasterPin->Type() != COMPONENT_PIN_DRAW_TYPE ) return; GetScreen()->SetModify(); - Pin = (LibDrawPin*) CurrentLibEntry->m_Drawings; + Pin = (LibDrawPin*) m_currentComponent->m_Drawings; for( ; Pin != NULL; Pin = Pin->Next() ) { if( Pin->Type() != COMPONENT_PIN_DRAW_TYPE ) @@ -902,16 +904,13 @@ void WinEDA_LibeditFrame::RepeatPinItem( wxDC* DC, LibDrawPin* SourcePin ) wxString msg; int ox = 0, oy = 0; - if( CurrentLibEntry == NULL ) - return; - if( SourcePin == NULL ) - return; - if( SourcePin->Type() != COMPONENT_PIN_DRAW_TYPE ) + if( m_currentComponent == NULL || SourcePin == NULL + || SourcePin->Type() != COMPONENT_PIN_DRAW_TYPE ) return; Pin = (LibDrawPin*)SourcePin->GenCopy(); - Pin->SetNext( CurrentLibEntry->m_Drawings ); - CurrentLibEntry->m_Drawings = Pin; + Pin->SetNext( m_currentComponent->m_Drawings ); + m_currentComponent->m_Drawings = Pin; Pin->m_Flags = IS_NEW; Pin->m_Pos.x += g_RepeatStep.x; @@ -966,11 +965,11 @@ bool WinEDA_LibeditFrame::TestPins( LIB_COMPONENT* LibEntry ) LibDrawPin** PinList; wxString msg; - if( CurrentLibEntry == NULL ) + if( m_currentComponent == NULL ) return false; // Construction de la liste des pins: - Pin = (LibDrawPin*) CurrentLibEntry->m_Drawings; + Pin = (LibDrawPin*) m_currentComponent->m_Drawings; for( nb_pins = 0; Pin != NULL; Pin = Pin->Next() ) { if( Pin->Type() == COMPONENT_PIN_DRAW_TYPE ) @@ -978,7 +977,7 @@ bool WinEDA_LibeditFrame::TestPins( LIB_COMPONENT* LibEntry ) } PinList = (LibDrawPin**) MyZMalloc( (nb_pins + 1) * sizeof(LibDrawPin*) ); - Pin = (LibDrawPin*) CurrentLibEntry->m_Drawings; + Pin = (LibDrawPin*) m_currentComponent->m_Drawings; for( ii = 0; Pin != NULL; Pin = Pin->Next() ) { if( Pin->Type() == COMPONENT_PIN_DRAW_TYPE ) @@ -1012,7 +1011,7 @@ bool WinEDA_LibeditFrame::TestPins( LIB_COMPONENT* LibEntry ) curr_pin->m_Pos.x, -curr_pin->m_Pos.y, Pin->m_PinName.GetData(), Pin->m_Pos.x, -Pin->m_Pos.y ); - if( CurrentLibEntry->m_UnitCount > 1 ) + if( m_currentComponent->m_UnitCount > 1 ) { aux_msg.Printf( _( " Part %d" ), curr_pin->m_Unit ); msg += aux_msg; diff --git a/eeschema/schedit.cpp b/eeschema/schedit.cpp index 6899f77bd7..c2c1176b56 100644 --- a/eeschema/schedit.cpp +++ b/eeschema/schedit.cpp @@ -15,7 +15,7 @@ #include "libcmp.h" #include "general.h" -#include "id.h" +#include "eeschema_id.h" #include "protos.h" diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index 6c44493d03..ce86c60ca4 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -17,7 +17,7 @@ #include "general.h" #include "bitmaps.h" #include "protos.h" -#include "id.h" +#include "eeschema_id.h" #include "netlist.h" #include "annotate_dialog.h" @@ -26,6 +26,8 @@ #include "dialog_find.h" #include "netlist_control.h" #include "dialog_erc.h" +#include "libeditfrm.h" +#include "libviewfrm.h" /*******************************/ @@ -92,6 +94,8 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame ) EVT_TOOL( ID_GET_TOOLS, WinEDA_SchematicFrame::OnCreateBillOfMaterials ) EVT_TOOL( ID_FIND_ITEMS, WinEDA_SchematicFrame::OnFindItems ) EVT_TOOL( ID_BACKANNO_ITEMS, WinEDA_SchematicFrame::OnLoadStuffFile ) + EVT_TOOL( ID_COMPONENT_BUTT, + WinEDA_SchematicFrame::Process_Special_Functions ) EVT_MENU( ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp ) EVT_MENU( ID_KICAD_ABOUT, WinEDA_DrawFrame::GetKicadAbout ) diff --git a/eeschema/symbdraw.cpp b/eeschema/symbdraw.cpp index 47629b074e..29d21e7b30 100644 --- a/eeschema/symbdraw.cpp +++ b/eeschema/symbdraw.cpp @@ -10,12 +10,14 @@ #include "common.h" #include "class_drawpanel.h" #include "confirm.h" +#include "eeschema_id.h" + #include "program.h" #include "libcmp.h" #include "general.h" #include "trigo.h" #include "protos.h" -#include "id.h" +#include "libeditfrm.h" /* Routines locales */ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); @@ -55,7 +57,7 @@ void WinEDA_bodygraphics_PropertiesFrame::bodygraphics_PropertiesAccept( wxComma if( CurrentDrawItem ) { if( !(CurrentDrawItem->m_Flags & IS_NEW) ) // if IS_NEW, copy for undo is done before place - m_Parent->SaveCopyInUndoList( CurrentLibEntry ); + m_Parent->SaveCopyInUndoList( CurrentDrawItem->GetParent() ); wxClientDC dc( m_Parent->DrawPanel ); m_Parent->DrawPanel->PrepareGraphicContext( &dc ); @@ -105,7 +107,8 @@ void WinEDA_bodygraphics_PropertiesFrame::bodygraphics_PropertiesAccept( wxComma break; } } - CurrentLibEntry->SortDrawItems(); + + CurrentDrawItem->GetParent()->SortDrawItems(); m_Parent->GetScreen()->SetModify(); @@ -641,10 +644,10 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) * courant, si elle existe et redessine toujours celle ci * Parametres: (tous globaux) * CurrentDrawItem - * CurrentLibEntry + * m_currentComponent */ { - if( CurrentLibEntry == NULL ) + if( m_currentComponent == NULL ) return; if( CurrentDrawItem == NULL ) return; @@ -666,9 +669,9 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) if( CurrentDrawItem->m_Flags & IS_NEW ) { - SaveCopyInUndoList( CurrentLibEntry ); - CurrentDrawItem->SetNext( CurrentLibEntry->m_Drawings ); - CurrentLibEntry->m_Drawings = CurrentDrawItem; + SaveCopyInUndoList( m_currentComponent ); + CurrentDrawItem->SetNext( m_currentComponent->m_Drawings ); + m_currentComponent->m_Drawings = CurrentDrawItem; switch( CurrentDrawItem->Type() ) { @@ -697,7 +700,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) ; } - CurrentLibEntry->SortDrawItems(); + m_currentComponent->SortDrawItems(); } if( m_ID_current_state ) @@ -713,8 +716,8 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) MoveLibDrawItemAt( CurrentDrawItem, pos ); } - CurrentLibEntry->Draw( DrawPanel, DC, wxPoint( 0, 0 ), CurrentUnit, - CurrentConvert, GR_DEFAULT_DRAWMODE ); + m_currentComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), CurrentUnit, + CurrentConvert, GR_DEFAULT_DRAWMODE ); CurrentDrawItem->m_Flags = 0; CurrentDrawItem = NULL; diff --git a/eeschema/symbedit.cpp b/eeschema/symbedit.cpp index cba6ea09f0..34d5baa3f1 100644 --- a/eeschema/symbedit.cpp +++ b/eeschema/symbedit.cpp @@ -19,6 +19,7 @@ #include "libcmp.h" #include "general.h" #include "protos.h" +#include "libeditfrm.h" /* @@ -37,7 +38,7 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void ) CMP_LIBRARY* Lib; /* Exit if no library entry is selected or a command is in progress. */ - if( CurrentLibEntry == NULL + if( m_currentComponent == NULL || ( CurrentDrawItem && CurrentDrawItem->m_Flags ) ) return; @@ -109,8 +110,8 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void ) if( DrawEntry->Next() == NULL ) /* Fin de liste trouvee */ { - DrawEntry->SetNext( CurrentLibEntry->m_Drawings ); - CurrentLibEntry->m_Drawings = Component->m_Drawings; + DrawEntry->SetNext( m_currentComponent->m_Drawings ); + m_currentComponent->m_Drawings = Component->m_Drawings; Component->m_Drawings = NULL; break; } @@ -119,10 +120,10 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void ) } // Remove duplicated drawings: - CurrentLibEntry->RemoveDuplicateDrawItems(); + m_currentComponent->RemoveDuplicateDrawItems(); // Clear flags - DrawEntry = CurrentLibEntry->m_Drawings; + DrawEntry = m_currentComponent->m_Drawings; while( DrawEntry ) { DrawEntry->m_Flags = 0; @@ -151,14 +152,14 @@ void WinEDA_LibeditFrame::SaveOneSymbol() wxString msg; FILE* ExportFile; - if( CurrentLibEntry->m_Drawings == NULL ) + if( m_currentComponent->m_Drawings == NULL ) return; /* Creation du fichier symbole */ wxString default_path = wxGetApp().ReturnLastVisitedLibraryPath(); wxFileDialog dlg( this, _( "Export Symbol Drawings" ), default_path, - CurrentLibEntry->m_Name.m_Text, SymbolFileWildcard, + m_currentComponent->m_Name.m_Text, SymbolFileWildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); if( dlg.ShowModal() == wxID_CANCEL ) @@ -194,28 +195,28 @@ void WinEDA_LibeditFrame::SaveOneSymbol() /* Creation du commentaire donnant le nom du composant */ fprintf( ExportFile, "# SYMBOL %s\n#\n", - CONV_TO_UTF8( CurrentLibEntry->m_Name.m_Text ) ); + CONV_TO_UTF8( m_currentComponent->m_Name.m_Text ) ); /* Generation des lignes utiles */ fprintf( ExportFile, "DEF %s", - CONV_TO_UTF8( CurrentLibEntry->m_Name.m_Text ) ); - if( !CurrentLibEntry->m_Prefix.m_Text.IsEmpty() ) + CONV_TO_UTF8( m_currentComponent->m_Name.m_Text ) ); + if( !m_currentComponent->m_Prefix.m_Text.IsEmpty() ) fprintf( ExportFile, " %s", - CONV_TO_UTF8( CurrentLibEntry->m_Prefix.m_Text ) ); + CONV_TO_UTF8( m_currentComponent->m_Prefix.m_Text ) ); else fprintf( ExportFile, " ~" ); fprintf( ExportFile, " %d %d %c %c %d %d %c\n", 0, /* unused */ - CurrentLibEntry->m_TextInside, - CurrentLibEntry->m_DrawPinNum ? 'Y' : 'N', - CurrentLibEntry->m_DrawPinName ? 'Y' : 'N', + m_currentComponent->m_TextInside, + m_currentComponent->m_DrawPinNum ? 'Y' : 'N', + m_currentComponent->m_DrawPinName ? 'Y' : 'N', 1, 0 /* unused */, 'N' ); /* Position / orientation / visibilite des champs */ - CurrentLibEntry->m_Prefix.Save( ExportFile ); - CurrentLibEntry->m_Name.Save( ExportFile ); - DrawEntry = CurrentLibEntry->m_Drawings; + m_currentComponent->m_Prefix.Save( ExportFile ); + m_currentComponent->m_Name.Save( ExportFile ); + DrawEntry = m_currentComponent->m_Drawings; if( DrawEntry ) { @@ -250,14 +251,14 @@ void WinEDA_LibeditFrame::SaveOneSymbol() /***************************************************************************/ void WinEDA_LibeditFrame::PlaceAncre() { - if( CurrentLibEntry == NULL ) + if( m_currentComponent == NULL ) return; wxPoint offset( -GetScreen()->m_Curseur.x, GetScreen()->m_Curseur.y ); GetScreen()->SetModify(); - CurrentLibEntry->SetOffset( offset ); + m_currentComponent->SetOffset( offset ); /* Redraw the symbol */ GetScreen()->m_Curseur.x = GetScreen()->m_Curseur.y = 0; diff --git a/eeschema/tool_lib.cpp b/eeschema/tool_lib.cpp index 2379178335..8bce36ac56 100644 --- a/eeschema/tool_lib.cpp +++ b/eeschema/tool_lib.cpp @@ -3,14 +3,16 @@ /********************************************/ #include "fctsys.h" - #include "common.h" +#include "hotkeys.h" +#include "bitmaps.h" +#include "eeschema_id.h" + #include "program.h" #include "libcmp.h" #include "general.h" - #include "protos.h" -#include "hotkeys.h" +#include "libeditfrm.h" #ifdef __UNIX__ #define LISTBOX_WIDTH 140 @@ -18,9 +20,6 @@ #define LISTBOX_WIDTH 120 #endif -#include "bitmaps.h" - -#include "id.h" extern int ExportPartId; extern int ImportPartId; @@ -42,7 +41,7 @@ void WinEDA_LibeditFrame::ReCreateVToolbar() m_VToolBar->AddSeparator(); m_VToolBar->AddTool( ID_LIBEDIT_PIN_BUTT, wxEmptyString, wxBitmap( pin_xpm ), - _( "Add Pins" ), wxITEM_CHECK ); + _( "Add pin" ), wxITEM_CHECK ); m_VToolBar->AddTool( ID_LIBEDIT_BODY_TEXT_BUTT, wxEmptyString, wxBitmap( add_text_xpm ), diff --git a/eeschema/tool_sch.cpp b/eeschema/tool_sch.cpp index 70e821a586..2fab94c00b 100644 --- a/eeschema/tool_sch.cpp +++ b/eeschema/tool_sch.cpp @@ -14,7 +14,7 @@ #include "hotkeys.h" #include "bitmaps.h" -#include "id.h" +#include "eeschema_id.h" /**************************************************************/ diff --git a/eeschema/tool_viewlib.cpp b/eeschema/tool_viewlib.cpp index aeadf60871..a2edbb971c 100644 --- a/eeschema/tool_viewlib.cpp +++ b/eeschema/tool_viewlib.cpp @@ -5,13 +5,14 @@ #include "fctsys.h" #include "common.h" #include "bitmaps.h" -#include "id.h" +#include "eeschema_id.h" #include "program.h" #include "libcmp.h" #include "general.h" #include "protos.h" #include "class_library.h" +#include "libviewfrm.h" void WinEDA_ViewlibFrame::ReCreateHToolbar() diff --git a/eeschema/viewlib_frame.cpp b/eeschema/viewlib_frame.cpp index cb89159f5b..d8e588585e 100644 --- a/eeschema/viewlib_frame.cpp +++ b/eeschema/viewlib_frame.cpp @@ -5,7 +5,7 @@ #include "fctsys.h" #include "appl_wxstruct.h" #include "common.h" -#include "id.h" +#include "eeschema_id.h" #include "class_drawpanel.h" #include "bitmaps.h" @@ -13,6 +13,7 @@ #include "libcmp.h" #include "general.h" #include "protos.h" +#include "libviewfrm.h" /*****************************/ @@ -30,8 +31,9 @@ BEGIN_EVENT_TABLE( WinEDA_ViewlibFrame, WinEDA_DrawFrame ) /* Toolbar events */ - EVT_TOOL_RANGE( ID_LIBVIEW_START_H_TOOL, ID_LIBVIEW_END_H_TOOL, + EVT_TOOL_RANGE( ID_LIBVIEW_NEXT, ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, WinEDA_ViewlibFrame::Process_Special_Functions ) + EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_ViewlibFrame::OnZoom ) EVT_TOOL( ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC, WinEDA_ViewlibFrame::ExportToSchematicLibraryPart ) diff --git a/eeschema/viewlibs.cpp b/eeschema/viewlibs.cpp index 4556a88b7b..ca6e14d448 100644 --- a/eeschema/viewlibs.cpp +++ b/eeschema/viewlibs.cpp @@ -9,12 +9,13 @@ #include "class_drawpanel.h" #include "confirm.h" #include "eda_doc.h" -#include "id.h" #include "program.h" #include "libcmp.h" #include "general.h" #include "protos.h" +#include "libviewfrm.h" +#include "eeschema_id.h" #define NEXT_PART 1 diff --git a/gerbview/controle.cpp b/gerbview/controle.cpp index 6ec24aa4bf..01a057fe6b 100644 --- a/gerbview/controle.cpp +++ b/gerbview/controle.cpp @@ -10,17 +10,12 @@ #include "fctsys.h" #include "common.h" -#include "id.h" #include "class_drawpanel.h" #include "pcbnew.h" #include "gerbview.h" #include "protos.h" -/* Routines Locales : */ - -/* Variables Locales */ - /**********************************************************************/ BOARD_ITEM* WinEDA_GerberFrame::GerberGeneralLocateAndDisplay() diff --git a/gerbview/edit.cpp b/gerbview/edit.cpp index b9aa1fdbfd..b6001a3676 100644 --- a/gerbview/edit.cpp +++ b/gerbview/edit.cpp @@ -3,7 +3,6 @@ /******************************************************/ #include "fctsys.h" -#include "id.h" #include "class_drawpanel.h" #include "confirm.h" #include "gestfich.h" @@ -13,6 +12,8 @@ #include "pcbplot.h" #include "protos.h" + + /************************************************************************/ void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) /************************************************************************/ diff --git a/gerbview/files.cpp b/gerbview/files.cpp index 0af7daf46e..48557119f2 100644 --- a/gerbview/files.cpp +++ b/gerbview/files.cpp @@ -11,7 +11,6 @@ #include "gerbview.h" #include "pcbplot.h" #include "protos.h" -#include "id.h" /* Routines locales */ @@ -50,7 +49,6 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event ) switch( id ) { - case ID_MENU_LOAD_FILE: case ID_LOAD_FILE: if( Clear_Pcb( TRUE ) ) { @@ -72,12 +70,10 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event ) } break; - case ID_MENU_APPEND_FILE: case ID_APPEND_FILE: LoadOneGerberFile( wxEmptyString, &dc, 0 ); break; - case ID_MENU_NEW_BOARD: case ID_NEW_BOARD: Clear_Pcb( TRUE ); Zoom_Automatique( FALSE ); @@ -93,11 +89,10 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event ) break; case ID_SAVE_BOARD: - case ID_MENU_SAVE_BOARD: SaveGerberFile( GetScreen()->m_FileName, &dc ); break; - case ID_MENU_SAVE_BOARD_AS: + case ID_SAVE_BOARD_AS: SaveGerberFile( wxEmptyString, &dc ); break; diff --git a/gerbview/gerberframe.cpp b/gerbview/gerberframe.cpp index 928366704b..21899925d3 100644 --- a/gerbview/gerberframe.cpp +++ b/gerbview/gerberframe.cpp @@ -16,7 +16,6 @@ #include "pcbplot.h" #include "bitmaps.h" #include "protos.h" -#include "id.h" /****************************************/ @@ -38,12 +37,12 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame ) EVT_TOOL( ID_SAVE_BOARD, WinEDA_GerberFrame::Files_io ) // Menu Files: - EVT_MENU( ID_MENU_LOAD_FILE, WinEDA_GerberFrame::Files_io ) - EVT_MENU( ID_MENU_APPEND_FILE, WinEDA_GerberFrame::Files_io ) + EVT_MENU( ID_LOAD_FILE, WinEDA_GerberFrame::Files_io ) + EVT_MENU( ID_APPEND_FILE, WinEDA_GerberFrame::Files_io ) EVT_MENU( ID_MENU_INC_LAYER_AND_APPEND_FILE, WinEDA_GerberFrame::Files_io ) - EVT_MENU( ID_MENU_NEW_BOARD, WinEDA_GerberFrame::Files_io ) - EVT_MENU( ID_MENU_SAVE_BOARD, WinEDA_GerberFrame::Files_io ) - EVT_MENU( ID_MENU_SAVE_BOARD_AS, WinEDA_GerberFrame::Files_io ) + EVT_MENU( ID_NEW_BOARD, WinEDA_GerberFrame::Files_io ) + EVT_MENU( ID_SAVE_BOARD, WinEDA_GerberFrame::Files_io ) + EVT_MENU( ID_SAVE_BOARD_AS, WinEDA_GerberFrame::Files_io ) EVT_MENU( ID_GEN_PLOT, WinEDA_GerberFrame::ToPlotter ) EVT_MENU( ID_GERBVIEW_EXPORT_TO_PCBNEW, WinEDA_GerberFrame::ExportDataInPcbnewFormat ) diff --git a/gerbview/gerbview_config.cpp b/gerbview/gerbview_config.cpp index d6e7caf9a5..2c8e9338ee 100644 --- a/gerbview/gerbview_config.cpp +++ b/gerbview/gerbview_config.cpp @@ -13,8 +13,8 @@ #include "pcbcommon.h" #include "gerbview.h" #include "pcbplot.h" -#include "id.h" #include "hotkeys.h" + #include "gerbview_config.h" #include "protos.h" diff --git a/gerbview/hotkeys.cpp b/gerbview/hotkeys.cpp index acb8f23646..d057308b7e 100644 --- a/gerbview/hotkeys.cpp +++ b/gerbview/hotkeys.cpp @@ -4,10 +4,9 @@ #include "fctsys.h" #include "common.h" -#include "gerbview.h" -#include "id.h" #include "hotkeys.h" +#include "gerbview.h" #include "protos.h" /* How to add a new hotkey: diff --git a/gerbview/onrightclick.cpp b/gerbview/onrightclick.cpp index 4c21c9b566..ee7d3cf332 100644 --- a/gerbview/onrightclick.cpp +++ b/gerbview/onrightclick.cpp @@ -5,7 +5,6 @@ #include "fctsys.h" #include "common.h" #include "class_drawpanel.h" -#include "id.h" #include "confirm.h" #include "gerbview.h" diff --git a/gerbview/options.cpp b/gerbview/options.cpp index 0570a921f5..eb96ff5f6f 100644 --- a/gerbview/options.cpp +++ b/gerbview/options.cpp @@ -14,12 +14,10 @@ #include "class_drawpanel.h" #include "confirm.h" -#include "gerbview.h" #include "pcbplot.h" - -#include "id.h" - +#include "gerbview.h" #include "protos.h" + #include diff --git a/gerbview/pcbplot.cpp b/gerbview/pcbplot.cpp index df3e330511..4538c8871d 100644 --- a/gerbview/pcbplot.cpp +++ b/gerbview/pcbplot.cpp @@ -4,7 +4,6 @@ #include "fctsys.h" #include "common.h" -#include "id.h" #include "gerbview.h" #include "pcbplot.h" diff --git a/gerbview/tool_gerber.cpp b/gerbview/tool_gerber.cpp index 3a9f34abf2..a8b08c2b27 100644 --- a/gerbview/tool_gerber.cpp +++ b/gerbview/tool_gerber.cpp @@ -10,7 +10,6 @@ #include "pcbplot.h" #include "protos.h" #include "bitmaps.h" -#include "id.h" #include "hotkeys.h" /***********************************************/ @@ -30,11 +29,11 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void ) menuBar = new wxMenuBar(); wxMenu* filesMenu = new wxMenu; - filesMenu->Append( ID_MENU_LOAD_FILE, _( "Clear and Load Gerber File" ), + filesMenu->Append( ID_LOAD_FILE, _( "Clear and Load Gerber File" ), _( "Clear all layers and Load new Gerber file" ), FALSE ); - filesMenu->Append( ID_MENU_APPEND_FILE, _( "Load Gerber File" ), + filesMenu->Append( ID_APPEND_FILE, _( "Load Gerber File" ), _( "Load new Gerber file on currrent layer" ), FALSE ); @@ -50,7 +49,7 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void ) _( "Load excellon drill file" ), FALSE ); #endif - filesMenu->Append( ID_MENU_NEW_BOARD, _( "&New" ), + filesMenu->Append( ID_NEW_BOARD, _( "&New" ), _( "Clear all layers" ), FALSE ); filesMenu->AppendSeparator(); @@ -59,10 +58,10 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void ) #if 0 filesMenu->AppendSeparator(); - filesMenu->Append( ID_MENU_SAVE_BOARD, _( "&Save Layers" ), + filesMenu->Append( ID_SAVE_BOARD, _( "&Save Layers" ), _( "Save current layers (GERBER format)" ), FALSE ); - filesMenu->Append( ID_MENU_SAVE_BOARD_AS, _( "Save Layers As..." ), + filesMenu->Append( ID_SAVE_BOARD_AS, _( "Save Layers As..." ), _( "Save current layers as.." ), FALSE ); #endif @@ -308,7 +307,7 @@ create or update the right vertical toolbar _( "Add layer alignment target" ) ); m_VToolBar->AddSeparator(); - m_VToolBar->AddTool( ID_TEXT_COMMENT_BUTT, wxEmptyString, + m_VToolBar->AddTool( ID_PCB_ADD_TEXT_BUTT, wxEmptyString, wxBitmap( tool_text_xpm ), _( "Add Text" ) ); diff --git a/gerbview/wxGerberFrame.h b/gerbview/wxGerberFrame.h index 08199b4dbb..8c37a18e65 100644 --- a/gerbview/wxGerberFrame.h +++ b/gerbview/wxGerberFrame.h @@ -5,6 +5,31 @@ #ifndef WX_GERBER_STRUCT_H #define WX_GERBER_STRUCT_H + +#include "id.h" + + +/** + * Command IDs for the gerber file viewer. + * + * Please add IDs that are unique to the gerber file viewer here and not in the + * global id.h file. This will prevent the entire project from being rebuilt + * when adding new command to the gerber file viewer. + */ +enum id_gerbview_frm +{ + ID_GERBVIEW_SHOW_LIST_DCODES, + ID_GERBVIEW_LOAD_DRILL_FILE, + ID_GERBVIEW_LOAD_DCODE_FILE, + ID_TOOLBARH_GERBER_SELECT_TOOL, + ID_MENU_INC_LAYER_AND_APPEND_FILE, + ID_INC_LAYER_AND_APPEND_FILE, + ID_GERBVIEW_SHOW_SOURCE, + ID_GERBVIEW_EXPORT_TO_PCBNEW, + ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, +}; + + /****************************************************************** class WinEDA_GerberFrame: this is the main window used in gerbview ******************************************************************/ @@ -61,34 +86,39 @@ public: * * @param DC A device context to draw on. */ - void Block_Delete( wxDC* DC ); - void Block_Rotate( wxDC* DC ); - void Block_Invert( wxDC* DC ); + void Block_Delete( wxDC* DC ); + void Block_Rotate( wxDC* DC ); + void Block_Invert( wxDC* DC ); + /** * Function Block_Move * moves all tracks and segments within the selected block. - * New location is determined by the current offset from the selected block's original location. + * New location is determined by the current offset from the selected + * block's original location. * Defined separately in pcbnew and gerbview * * @param DC A device context to draw on. */ - void Block_Move( wxDC* DC ); + void Block_Move( wxDC* DC ); + /** * Function Block_Mirror_X - * mirrors all tracks and segments within the currently selected block in the X axis. + * mirrors all tracks and segments within the currently selected block + * in the X axis. * * @param DC A device context to draw on. */ - void Block_Mirror_X( wxDC* DC ); + void Block_Mirror_X( wxDC* DC ); /** * Function Block_Duplicate * copies-and-moves all tracks and segments within the selected block. - * New location is determined by the current offset from the selected block's original location. + * New location is determined by the current offset from the selected + * block's original location. * Defined separately in pcbnew and gerbview * * @param DC A device context to draw on. */ - void Block_Duplicate( wxDC* DC ); + void Block_Duplicate( wxDC* DC ); void InstallDrillFrame( wxCommandEvent& event ); void ToPostProcess( wxCommandEvent& event ); @@ -96,16 +126,20 @@ public: void Genere_GERBER( const wxString& FullFileName, int Layers ); void Genere_PS( const wxString& FullFileName, int Layers ); void Plot_Layer_HPGL( FILE* File, int masque_layer, - int garde, bool trace_via, GRTraceMode trace_mode ); + int garde, bool trace_via, + GRTraceMode trace_mode ); void Plot_Layer_GERBER( FILE* File, int masque_layer, - int garde, bool trace_via, GRTraceMode trace_mode ); + int garde, bool trace_via, + GRTraceMode trace_mode ); int Gen_D_CODE_File( const wxString& Name_File ); void Plot_Layer_PS( FILE* File, int masque_layer, - int garde, bool trace_via, GRTraceMode trace_mode ); + int garde, bool trace_via, + GRTraceMode trace_mode ); void Files_io( wxCommandEvent& event ); void OnFileHistory( wxCommandEvent& event ); - bool LoadOneGerberFile( const wxString& FileName, wxDC* DC, int mode ); + bool LoadOneGerberFile( const wxString& FileName, wxDC* DC, + int mode ); int ReadGerberFile( wxDC* DC, FILE* File, bool Append ); bool Read_GERBER_File( wxDC* DC, const wxString& GERBER_FullFileName, @@ -117,22 +151,25 @@ public: /** * Function Read_D_Code_File - * reads in a dcode file assuming ALSPCB file format with ';' indicating comments. + * reads in a dcode file assuming ALSPCB file format with ';' indicating + * comments. *

* Format is like CSV but with optional ';' delineated comments:
- * tool, Horiz, Vert, drill, vitesse, acc. ,Type ; [DCODE (commentaire)]
- * ex: 1, 12, 12, 0, 0, 0, 3 ; D10 + * tool, Horiz, Vert, drill, vitesse, acc. ,Type ; [DCODE (commentaire)]
+ * ex: 1, 12, 12, 0, 0, 0, 3 ; D10 *

* Format:
* Ver, Hor, Type, Tool [,Drill]
- * example: 0.012, 0.012, L , D10
+ * example: 0.012, 0.012, L , D10
* * Categorize all found dcodes into a table of D_CODE instantiations. * @param D_CodeFullFileName The name of the file to read from. * @return int -
* -1 = file not found
* -2 = parsing problem
- * 0 = the \a D_Code_FullFileName is empty, no reading is done but an empty GERBER is put into g_GERBER_List[]
+ * 0 = the \a D_Code_FullFileName is empty, no reading + * is done but an empty GERBER is put into + * g_GERBER_List[]
* 1 = read OK
*/ int Read_D_Code_File( const wxString& D_Code_FullFileName ); @@ -170,20 +207,23 @@ public: * currently: do nothing in gerbview. * but but be defined because it is a pure virtual in WinEDA_BasePcbFrame */ - virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy, - UndoRedoOpType aTypeCommand = UR_UNSPECIFIED, - const wxPoint& aTransformPoint = wxPoint(0,0) ) - { - } + virtual void SaveCopyInUndoList( + BOARD_ITEM* aItemToCopy, + UndoRedoOpType aTypeCommand = UR_UNSPECIFIED, + 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 + * @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) ) + virtual void SaveCopyInUndoList( + PICKED_ITEMS_LIST& aItemsList, + UndoRedoOpType aTypeCommand, + const wxPoint& aTransformPoint = wxPoint(0,0) ) { // currently: do nothing in gerbview. } diff --git a/include/id.h b/include/id.h index 1d80b8a722..ab559dabf4 100644 --- a/include/id.h +++ b/include/id.h @@ -4,202 +4,147 @@ #define MAX_ITEMS_IN_PICKER 15 ///< max no. items in the popup menu for item selection -enum main_id { - ID_MAIN_FRAME = 100, - ID_LEFT_FRAME, - ID_BOTTOM_FRAME, - ID_MAIN_DIALOG, - ID_PROJECT_TREE, - ID_PROJECT_TXTEDIT, - ID_PROJECT_TREE_REFRESH, - ID_PROJECT_RUNPY, - ID_PROJECT_NEWFILE, - ID_PROJECT_UNUSED0, - ID_PROJECT_UNUSED1, - ID_PROJECT_NEWPY, - ID_PROJECT_UNUSED2, - ID_PROJECT_NEWTXT, - ID_PROJECT_UNUSED3, - ID_PROJECT_NEWDIR, - ID_PROJECT_DELETE, - ID_PROJECT_RENAME, - ID_PROJECT_OPEN_FILE_WITH_TEXT_EDITOR, - ID_PROJECT_UNUSED4, +/** + * Common command IDs shared by more than one of the kicad applications. + * + * Only place command IDs used in base window class event tables or shared + * across multple applications such as the zoom, grid, and language IDs. + * Application specific IDs should be defined in the appropriate header + * file to prevent the entire project from being rebuilt. + */ - ID_MAIN_COMMAND, - ID_TO_EDITOR, - ID_TO_EESCHEMA, - ID_TO_GERBVIEW, - ID_TO_PCB, - ID_TO_CVPCB, - ID_RUN_PYTHON, - ID_MAIN_MENUBAR, - ID_ON_ZOOM_SELECT, - ID_ON_GRID_SELECT, - ID_BROWSE_AN_SELECT_FILE, - ID_SELECT_PREFERED_EDITOR, - ID_SELECT_PREFERED_PDF_BROWSER_NAME, - ID_SELECT_PREFERED_PDF_BROWSER, - ID_SELECT_DEFAULT_PDF_BROWSER, - ID_SAVE_AND_ZIP_FILES, - ID_READ_ZIP_ARCHIVE, +enum main_id +{ + ID_TO_PCB = wxID_HIGHEST, + ID_TO_CVPCB, + ID_LOAD_PROJECT, + ID_LOAD_ONE_SHEET, + ID_NEW_PROJECT, + ID_SAVE_PROJECT, + ID_SAVE_ONE_SHEET, + ID_SAVE_ONE_SHEET_AS, + ID_LOAD_FILE, + ID_APPEND_FILE, + ID_NEW_BOARD, + ID_SAVE_BOARD, + ID_SAVE_BOARD_AS, - // ID du menu general - ID_LOAD_PROJECT, - ID_LOAD_ONE_SHEET, - ID_NEW_PROJECT, - ID_SAVE_PROJECT, - ID_SAVE_ONE_SHEET, - ID_SAVE_ONE_SHEET_AS, + ID_CONFIG_AND_PREFERENCES_START, + ID_CONFIG_REQ, + ID_CONFIG_SAVE, + ID_CONFIG_READ, + ID_PREFERENCES_CREATE_CONFIG_HOTKEYS, + ID_PREFERENCES_READ_CONFIG_HOTKEYS, + ID_PREFERENCES_EDIT_CONFIG_HOTKEYS, + ID_PREFERENCES_HOTKEY_PATH_IS_HOME, + ID_PREFERENCES_HOTKEY_PATH_IS_KICAD, + ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, + ID_PREFERENCES_UNUSED2, + ID_PREFERENCES_UNUSED3, + ID_CONFIG_AND_PREFERENCES_END, - ID_CONFIG_AND_PREFERENCES_START, - ID_CONFIG_REQ, - ID_CONFIG_SAVE, - ID_CONFIG_READ, - ID_PREFERENCES_CREATE_CONFIG_HOTKEYS, - ID_PREFERENCES_READ_CONFIG_HOTKEYS, - ID_PREFERENCES_EDIT_CONFIG_HOTKEYS, - ID_PREFERENCES_HOTKEY_PATH_IS_HOME, - ID_PREFERENCES_HOTKEY_PATH_IS_KICAD, - ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, - ID_PREFERENCES_UNUSED2, - ID_PREFERENCES_UNUSED3, - ID_CONFIG_AND_PREFERENCES_END, + ID_GEN_PRINT, + ID_GEN_PLOT, + ID_GEN_PLOT_PS, + ID_GEN_PLOT_HPGL, + ID_GEN_PLOT_GERBER, + ID_GEN_PLOT_SVG, + ID_GEN_PLOT_DXF, + ID_GEN_COPY_SHEET_TO_CLIPBOARD, + ID_GEN_COPY_BLOCK_TO_CLIPBOARD, + ID_GEN_UNUSED0, + ID_GEN_UNUSED1, + ID_GEN_UNUSED2, + ID_GEN_UNUSED3, + ID_GEN_UNUSED4, - ID_GEN_PRINT, - ID_GEN_PLOT, - ID_GEN_PLOT_PS, - ID_GEN_PLOT_HPGL, - ID_GEN_PLOT_GERBER, - ID_GEN_PLOT_SVG, - ID_GEN_PLOT_DXF, - ID_GEN_COPY_SHEET_TO_CLIPBOARD, - ID_GEN_COPY_BLOCK_TO_CLIPBOARD, - ID_GEN_UNUSED0, - ID_GEN_UNUSED1, - ID_GEN_UNUSED2, - ID_GEN_UNUSED3, - ID_GEN_UNUSED4, - - ID_GEN_EXPORT_FILE, + ID_GEN_EXPORT_FILE, ID_GEN_EXPORT_SPECCTRA, - ID_GEN_EXPORT_FILE_GENCADFORMAT, - ID_GEN_EXPORT_FILE_MODULE_REPORT, + ID_GEN_EXPORT_FILE_GENCADFORMAT, + ID_GEN_EXPORT_FILE_MODULE_REPORT, - ID_GEN_IMPORT_FILE, + ID_GEN_IMPORT_FILE, ID_GEN_IMPORT_SPECCTRA_SESSION, - ID_GEN_IMPORT_SPECCTRA_DESIGN, + ID_GEN_IMPORT_SPECCTRA_DESIGN, - ID_EXIT, - ID_OPTIONS_SETUP, + ID_EXIT, + ID_OPTIONS_SETUP, - // Find id menu - ID_H_TOOLBAR, - ID_V_TOOLBAR, - ID_OPT_TOOLBAR, - ID_AUX_TOOLBAR, - ID_AUX_V_TOOLBAR, - ID_TOOLBAR_UNUSED, + // Find id menu + ID_H_TOOLBAR, + ID_V_TOOLBAR, + ID_OPT_TOOLBAR, + ID_AUX_TOOLBAR, + ID_AUX_V_TOOLBAR, + ID_TOOLBAR_UNUSED, - ID_GENERAL_HELP, - ID_LOCAL_HELP, - ID_KICAD_ABOUT, + ID_GENERAL_HELP, + ID_LOCAL_HELP, + ID_KICAD_ABOUT, - ID_EDIT, + ID_EDIT, - ID_SEL_BG_COLOR, + ID_SEL_BG_COLOR, - ID_COLORS_SETUP, + ID_COLORS_SETUP, - ID_REPEAT_BUTT, - ID_UNDO_BUTT, - ID_REDO_BUTT, + ID_REPEAT_BUTT, + ID_UNDO_BUTT, + ID_REDO_BUTT, - ID_LANGUAGE_CHOICE, - ID_LANGUAGE_DEFAULT, - ID_LANGUAGE_ENGLISH, - ID_LANGUAGE_FRENCH, - ID_LANGUAGE_SPANISH, - ID_LANGUAGE_GERMAN, - ID_LANGUAGE_RUSSIAN, - ID_LANGUAGE_PORTUGUESE, - ID_LANGUAGE_ITALIAN, - ID_LANGUAGE_SLOVENIAN, - ID_LANGUAGE_HUNGARIAN, - ID_LANGUAGE_POLISH, - ID_LANGUAGE_CZECH, - ID_LANGUAGE_KOREAN, - ID_LANGUAGE_CATALAN, - ID_LANGUAGE_CHINESE_SIMPLIFIED, + ID_LANGUAGE_CHOICE, + ID_LANGUAGE_DEFAULT, + ID_LANGUAGE_ENGLISH, + ID_LANGUAGE_FRENCH, + ID_LANGUAGE_SPANISH, + ID_LANGUAGE_GERMAN, + ID_LANGUAGE_RUSSIAN, + ID_LANGUAGE_PORTUGUESE, + ID_LANGUAGE_ITALIAN, + ID_LANGUAGE_SLOVENIAN, + ID_LANGUAGE_HUNGARIAN, + ID_LANGUAGE_POLISH, + ID_LANGUAGE_CZECH, + ID_LANGUAGE_KOREAN, + ID_LANGUAGE_CATALAN, + ID_LANGUAGE_CHINESE_SIMPLIFIED, ID_LANGUAGE_DUTCH, - ID_LANGUAGE_CHOICE_END, + ID_LANGUAGE_CHOICE_END, + ID_SET_REPEAT_OPTION, - // ID du Main Toolbar de Schematique + // Popup Menu (mouse Right button) (id consecutifs) - ID_SCHEMATIC_UNDO, - ID_SCHEMATIC_REDO, + ID_POPUP_GENERAL_START_RANGE, // first number + ID_POPUP_CANCEL_CURRENT_COMMAND, + ID_POPUP_CLOSE_CURRENT_TOOL, + ID_POPUP_MOVE_BLOCK, + ID_POPUP_DRAG_BLOCK, + ID_POPUP_COPY_BLOCK, + ID_POPUP_ROTATE_BLOCK, + ID_POPUP_DELETE_BLOCK, + ID_POPUP_FLIP_BLOCK, + ID_POPUP_PLACE_BLOCK, + ID_POPUP_ZOOM_BLOCK, + ID_POPUP_SELECT_ITEMS_BLOCK, + ID_POPUP_MIRROR_X_BLOCK, + ID_POPUP_MIRROR_Y_BLOCK, + ID_POPUP_MIRROR_UNUSED0, + ID_POPUP_MIRROR_UNUSED1, + ID_POPUP_MIRROR_UNUSED2, + ID_POPUP_MIRROR_UNUSED3, + ID_POPUP_OTHER_COMMANDS, + ID_POPUP_GENERAL_END_RANGE, // last number - // ID du Vertical Toolbar de Schematique - ID_SCHEMATIC_VERTICAL_TOOLBAR_START, - ID_NO_SELECT_BUTT, - ID_HIERARCHY_PUSH_POP_BUTT, - ID_COMPONENT_BUTT, - ID_PLACE_POWER_BUTT, - ID_BUS_BUTT, - ID_WIRE_BUTT, - ID_BUSTOBUS_ENTRY_BUTT, - ID_WIRETOBUS_ENTRY_BUTT, - ID_LABEL_BUTT, - ID_GLABEL_BUTT, - ID_HIERLABEL_BUTT, - ID_IMPORT_HLABEL_BUTT, - ID_SHEET_LABEL_BUTT, - ID_NOCONN_BUTT, - ID_JUNCTION_BUTT, - ID_SHEET_SYMBOL_BUTT, - ID_TEXT_COMMENT_BUTT, - ID_LINE_COMMENT_BUTT, - ID_SCHEMATIC_DELETE_ITEM_BUTT, - ID_SCHEMATIC_UNUSED0, - ID_SCHEMATIC_UNUSED1, - ID_SCHEMATIC_UNUSED2, - ID_SCHEMATIC_VERTICAL_TOOLBAR_END, - // end ID Vertical Toolbar de Schematique + ID_POPUP_ENTER_MENU, - ID_SET_REPEAT_OPTION, - - // Popup Menu (mouse Right button) (id consecutifs) - - ID_POPUP_GENERAL_START_RANGE, // first number - ID_POPUP_CANCEL_CURRENT_COMMAND, // ID general annulation commande en cours - ID_POPUP_CLOSE_CURRENT_TOOL, - ID_POPUP_MOVE_BLOCK, - ID_POPUP_DRAG_BLOCK, - ID_POPUP_COPY_BLOCK, - ID_POPUP_ROTATE_BLOCK, - ID_POPUP_DELETE_BLOCK, - ID_POPUP_FLIP_BLOCK, - ID_POPUP_PLACE_BLOCK, - ID_POPUP_ZOOM_BLOCK, - ID_POPUP_SELECT_ITEMS_BLOCK, - ID_POPUP_MIRROR_X_BLOCK, - ID_POPUP_MIRROR_Y_BLOCK, - ID_POPUP_MIRROR_UNUSED0, - ID_POPUP_MIRROR_UNUSED1, - ID_POPUP_MIRROR_UNUSED2, - ID_POPUP_MIRROR_UNUSED3, - ID_POPUP_OTHER_COMMANDS, - ID_POPUP_GENERAL_END_RANGE, // last number - - ID_POPUP_ENTER_MENU, - - ID_POPUP_ZOOM_START_RANGE, // first zoom id - ID_POPUP_CANCEL, - ID_POPUP_ZOOM_IN, - ID_POPUP_ZOOM_OUT, - ID_POPUP_ZOOM_SELECT, - ID_POPUP_ZOOM_CENTER, + ID_ON_ZOOM_SELECT, + ID_POPUP_ZOOM_START_RANGE, // first zoom id + ID_POPUP_CANCEL, + ID_POPUP_ZOOM_IN, + ID_POPUP_ZOOM_OUT, + ID_POPUP_ZOOM_SELECT, + ID_POPUP_ZOOM_CENTER, /* Reserve IDs for popup menu zoom levels. If you need more * levels of zoom, change ID_POPUP_ZOOM_LEVEL_END. Note that more @@ -209,662 +154,99 @@ enum main_id { * currently room is provided for 32 levels (this is a very large value). * Pcbnew use 18 values. For schematic 15 is enought */ - ID_POPUP_ZOOM_LEVEL_START, - ID_POPUP_ZOOM_LEVEL_END = ID_POPUP_ZOOM_LEVEL_START + 32, - ID_POPUP_ZOOM_END_RANGE, // last zoom id + ID_POPUP_ZOOM_LEVEL_START, + ID_POPUP_ZOOM_LEVEL_END = ID_POPUP_ZOOM_LEVEL_START + 32, + ID_POPUP_ZOOM_END_RANGE, // last zoom id - ID_POPUP_GRID_PLUS, - ID_POPUP_GRID_MOINS, - ID_POPUP_GRID_SELECT, - ID_POPUP_GRID_LEVEL_1000, // id for first predefined grid in inches (1000 * 0.0001 inch) - ID_POPUP_GRID_LEVEL_500, - ID_POPUP_GRID_LEVEL_250, - ID_POPUP_GRID_LEVEL_200, - ID_POPUP_GRID_LEVEL_100, - ID_POPUP_GRID_LEVEL_50, - ID_POPUP_GRID_LEVEL_25, - ID_POPUP_GRID_LEVEL_20, - ID_POPUP_GRID_LEVEL_10, - ID_POPUP_GRID_LEVEL_5, - ID_POPUP_GRID_LEVEL_2, - ID_POPUP_GRID_LEVEL_1, // id for last predefined grid in inches ( 0.0001 inch) - ID_POPUP_GRID_LEVEL_1MM, // id for first predefined grid in mm (1mm) - ID_POPUP_GRID_LEVEL_0_5MM, - ID_POPUP_GRID_LEVEL_0_25MM, - ID_POPUP_GRID_LEVEL_0_2MM, - ID_POPUP_GRID_LEVEL_0_1MM, - ID_POPUP_GRID_USER, + ID_ON_GRID_SELECT, + ID_POPUP_GRID_PLUS, + ID_POPUP_GRID_MOINS, + ID_POPUP_GRID_SELECT, + ID_POPUP_GRID_LEVEL_1000, // id for first predefined grid in inches (1000 * 0.0001 inch) + ID_POPUP_GRID_LEVEL_500, + ID_POPUP_GRID_LEVEL_250, + ID_POPUP_GRID_LEVEL_200, + ID_POPUP_GRID_LEVEL_100, + ID_POPUP_GRID_LEVEL_50, + ID_POPUP_GRID_LEVEL_25, + ID_POPUP_GRID_LEVEL_20, + ID_POPUP_GRID_LEVEL_10, + ID_POPUP_GRID_LEVEL_5, + ID_POPUP_GRID_LEVEL_2, + ID_POPUP_GRID_LEVEL_1, // id for last predefined grid in inches ( 0.0001 inch) + ID_POPUP_GRID_LEVEL_1MM, // id for first predefined grid in mm (1mm) + ID_POPUP_GRID_LEVEL_0_5MM, + ID_POPUP_GRID_LEVEL_0_25MM, + ID_POPUP_GRID_LEVEL_0_2MM, + ID_POPUP_GRID_LEVEL_0_1MM, + ID_POPUP_GRID_USER, + ID_SHEET_SET, + ID_TO_LIBRARY, + ID_NO_SELECT_BUTT, + ID_COMPONENT_BUTT, - ID_POPUP_START_RANGE, // first number - ID_POPUP_LIBEDIT_PIN_EDIT, // Id pour menu PopUp de Libedit - ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM, - ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM, - ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM, - ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM, - ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, // Id pour menu PopUp de Libedit - ID_POPUP_LIBEDIT_DELETE_ITEM, - ID_POPUP_LIBEDIT_END_CREATE_ITEM, - ID_POPUP_LIBEDIT_CANCEL_EDITING, - ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, - ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM, - ID_POPUP_LIBEDIT_FIELD_ROTATE_ITEM, - - ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT, - ID_POPUP_LIBEDIT_ROTATE_GRAPHIC_TEXT, - ID_POPUP_LIBEDIT_UNUSED2, // En attente d'affectation - ID_POPUP_LIBEDIT_UNUSED3, // En attente d'affectation - ID_POPUP_LIBEDIT_UNUSED4, // En attente d'affectation - ID_POPUP_LIBEDIT_UNUSED5, // En attente d'affectation - - ID_POPUP_SCH_DELETE, - ID_POPUP_SCH_BREAK_WIRE, - ID_POPUP_SCH_DELETE_CONNECTION, - ID_POPUP_SCH_MOVE_ITEM_REQUEST, - ID_POPUP_SCH_DELETE_NODE, - ID_POPUP_SCH_MOVE_CMP_REQUEST, - ID_POPUP_SCH_DELETE_CMP, - ID_POPUP_SCH_DRAG_CMP_REQUEST, - ID_POPUP_SCH_DRAG_WIRE_REQUEST, - ID_POPUP_SCH_UNUSED_2, - ID_POPUP_SCH_ENTRY_SELECT_SLASH, - ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH, - - ID_POPUP_SCH_EDIT_CMP, - ID_POPUP_SCH_MIROR_X_CMP, - ID_POPUP_SCH_MIROR_Y_CMP, - ID_POPUP_SCH_ROTATE_CMP_CLOCKWISE, - ID_POPUP_SCH_ROTATE_CMP_COUNTERCLOCKWISE, - ID_POPUP_SCH_ORIENT_NORMAL_CMP, - ID_POPUP_SCH_INIT_CMP, - - ID_POPUP_SCH_EDIT_TEXT, - ID_POPUP_SCH_ROTATE_TEXT, - ID_POPUP_SCH_SET_SHAPE_TEXT, - ID_POPUP_END_LINE, - ID_POPUP_SCH_END_SHEET, - ID_POPUP_SCH_EDIT_SHEET, - ID_POPUP_SCH_RESIZE_SHEET, - ID_POPUP_SCH_CLEANUP_SHEET, - ID_POPUP_SCH_EDIT_PINSHEET, - ID_POPUP_SCH_MOVE_PINSHEET, - ID_POPUP_IMPORT_GLABEL, - ID_POPUP_SCH_GENERIC_ORIENT_CMP, - ID_POPUP_SCH_GENERIC_EDIT_CMP, - ID_POPUP_SCH_EDIT_VALUE_CMP, - ID_POPUP_SCH_EDIT_REF_CMP, - ID_POPUP_SCH_EDIT_FOOTPRINT_CMP, - ID_POPUP_SCH_EDIT_CONVERT_CMP, - ID_POPUP_SCH_COPY_COMPONENT_CMP, - ID_POPUP_SCH_SELECT_UNIT_CMP, - ID_POPUP_SCH_SELECT_UNIT1, - ID_POPUP_SCH_SELECT_UNIT2, - ID_POPUP_SCH_SELECT_UNIT3, - ID_POPUP_SCH_SELECT_UNIT4, - ID_POPUP_SCH_SELECT_UNIT5, - ID_POPUP_SCH_SELECT_UNIT6, - ID_POPUP_SCH_SELECT_UNIT7, - ID_POPUP_SCH_SELECT_UNIT8, - ID_POPUP_SCH_SELECT_UNIT9, - ID_POPUP_SCH_SELECT_UNIT10, - ID_POPUP_SCH_SELECT_UNIT11, - ID_POPUP_SCH_SELECT_UNIT12, - ID_POPUP_SCH_SELECT_UNIT13, - ID_POPUP_SCH_SELECT_UNIT14, - ID_POPUP_SCH_SELECT_UNIT15, - ID_POPUP_SCH_SELECT_UNIT16, - ID_POPUP_SCH_SELECT_UNIT17, - ID_POPUP_SCH_SELECT_UNIT18, - ID_POPUP_SCH_SELECT_UNIT19, - ID_POPUP_SCH_SELECT_UNIT20, - ID_POPUP_SCH_SELECT_UNIT21, - ID_POPUP_SCH_SELECT_UNIT22, - ID_POPUP_SCH_SELECT_UNIT23, - ID_POPUP_SCH_SELECT_UNIT24, - ID_POPUP_SCH_SELECT_UNIT25, - ID_POPUP_SCH_SELECT_UNIT26, - ID_POPUP_SCH_ROTATE_FIELD, - ID_POPUP_SCH_EDIT_FIELD, - ID_POPUP_SCH_CHANGE_TYPE_TEXT, - ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL, - ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL, - ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT, - ID_POPUP_SCH_DISPLAYDOC_CMP, - ID_POPUP_SCH_ENTER_SHEET, - ID_POPUP_SCH_LEAVE_SHEET, - ID_POPUP_SCH_ADD_JUNCTION, - ID_POPUP_SCH_ADD_LABEL, - ID_POPUP_SCH_ADD_GLABEL, - ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL, - ID_POPUP_SCH_GETINFO_MARKER, - ID_POPUP_SCH_UNUSED2, - ID_POPUP_SCH_UNUSED3, - - ID_POPUP_END_RANGE, // last number - - // Horizontal Toolbar de schematique - ID_SHEET_SET, - ID_HIERARCHY, - ID_TO_LIBRARY, - ID_TO_LIBVIEW, - - ID_ZOOM_IN, // Gestion zoom: id consecutifs - ID_ZOOM_OUT, - ID_ZOOM_REDRAW, - ID_ZOOM_PAGE, + ID_ZOOM_IN, + ID_ZOOM_OUT, + ID_ZOOM_REDRAW, + ID_ZOOM_PAGE, /* Panning command event IDs. */ - ID_PAN_UP, - ID_PAN_DOWN, - ID_PAN_LEFT, - ID_PAN_RIGHT, + ID_PAN_UP, + ID_PAN_DOWN, + ID_PAN_LEFT, + ID_PAN_RIGHT, - ID_GET_ANNOTATE, // Gestion fonctions : id consecutifs - ID_GET_ERC, - ID_GET_NETLIST, - ID_GET_TOOLS, - ID_FIND_ITEMS, - ID_BACKANNO_ITEMS, + ID_GET_NETLIST, + ID_GET_TOOLS, + ID_FIND_ITEMS, - // Id pour HToolBar de Libview (Process_Special_Functions) - ID_LIBVIEW_START_H_TOOL, - ID_LIBVIEW_NEXT, - ID_LIBVIEW_PREVIOUS, - ID_LIBVIEW_SELECT_PART, - ID_LIBVIEW_SELECT_LIB, - ID_LIBVIEW_VIEWDOC, - ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, - ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, - ID_LIBVIEW_TOOL_UNUSED0, - ID_LIBVIEW_TOOL_UNUSED1, - ID_LIBVIEW_END_H_TOOL, - ID_LIBVIEW_SELECT_PART_NUMBER, - ID_LIBVIEW_LIB_LIST, - ID_LIBVIEW_CMP_LIST, - ID_LIBVIEW_LIBWINDOW, - ID_LIBVIEW_CMPWINDOW, - ID_LIBVIEW_UNUSED3, - ID_LIBVIEW_UNUSED4, - ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC, // Used in Htoolbar, specific function + ID_EDA_SOCKET_EVENT_SERV, + ID_EDA_SOCKET_EVENT, - /* LibEdit: */ - /* Id for HToolBar Tools( buttons) for Libedit (Process_Special_Functions) */ - ID_LIBEDIT_START_H_TOOL, - ID_LIBEDIT_SELECT_PART, - ID_LIBEDIT_SELECT_CURRENT_LIB, - ID_LIBEDIT_SAVE_CURRENT_LIB, - ID_LIBEDIT_SAVE_CURRENT_PART, - ID_LIBEDIT_NEW_PART, - ID_LIBEDIT_GET_FRAME_EDIT_PART, - ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, - ID_LIBEDIT_DELETE_PART, - ID_LIBEDIT_UNDO, - ID_LIBEDIT_REDO, - ID_DE_MORGAN_NORMAL_BUTT, - ID_DE_MORGAN_CONVERT_BUTT, - ID_LIBEDIT_EDIT_PIN_BY_PIN, - ID_LIBEDIT_VIEW_DOC, - ID_LIBEDIT_CHECK_PART, - ID_LIBEDIT_END_H_TOOL, // End Id for HToolBar (Libedit) - ID_LIBEDIT_SELECT_PART_NUMBER, // Id selection unit of part (HToolBar, combo box) - ID_LIBEDIT_SELECT_ALIAS, // Id selection alias of part (HToolBar, combo box) - ID_LIBEDIT_HTOOL_UNUSED1, - ID_LIBEDIT_HTOOL_UNUSED2, - ID_LIBEDIT_HTOOL_UNUSED3, - ID_LIBEDIT_HTOOL_UNUSED4, + /* Command IDs common to PCBNew and GerbView. */ + ID_PCB_DISPLAY_FOOTPRINT_DOC, - /* Id pour VToolBar de Libedit */ - ID_LIBEDIT_START_V_TOOL, - ID_LIBEDIT_PIN_BUTT, - ID_LIBEDIT_BODY_LINE_BUTT, - ID_LIBEDIT_BODY_ARC_BUTT, - ID_LIBEDIT_BODY_CIRCLE_BUTT, - ID_LIBEDIT_BODY_RECT_BUTT, - ID_LIBEDIT_BODY_TEXT_BUTT, - ID_LIBEDIT_DELETE_ITEM_BUTT, - ID_LIBEDIT_ANCHOR_ITEM_BUTT, - ID_LIBEDIT_IMPORT_BODY_BUTT, - ID_LIBEDIT_EXPORT_BODY_BUTT, - ID_LIBEDIT_VTOOL_UNUSED0, - ID_LIBEDIT_VTOOL_UNUSED1, - ID_LIBEDIT_VTOOL_UNUSED2, - ID_LIBEDIT_VTOOL_UNUSED3, - ID_LIBEDIT_VTOOL_UNUSED4, - ID_LIBEDIT_END_V_TOOL, // End Id pour VToolBar de Libedit + ID_TB_OPTIONS_START, - // ID pour CVPCB - ID_CVPCB_QUIT, - ID_CVPCB_READ_INPUT_NETLIST, - ID_CVPCB_SAVEQUITCVPCB, - ID_CVPCB_CREATE_CONFIGWINDOW, - ID_CVPCB_CREATE_SCREENCMP, - ID_CVPCB_GOTO_FIRSTNA, - ID_CVPCB_GOTO_PREVIOUSNA, - ID_CVPCB_DEL_ASSOCIATIONS, - ID_CVPCB_AUTO_ASSOCIE, - ID_CVPCB_COMPONENT_LIST, - ID_CVPCB_FOOTPRINT_LIST, - ID_CVPCB_CREATE_STUFF_FILE, - ID_CVPCB_SHOW3D_FRAME, - ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, - ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, - ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, - ID_CVPCB_UNUSED0, - ID_CVPCB_UNUSED1, - - // id specifiques pcbnew - ID_LOAD_FILE, - ID_APPEND_FILE, - ID_NEW_BOARD, - ID_OPEN_MODULE_EDITOR, - ID_UNNUSED_BUTT, - ID_TRACK_BUTT, - ID_PCB_ZONES_BUTT, - ID_PCB_DELETE_ITEM_BUTT, - ID_READ_NETLIST, - ID_DRC_CONTROL, - ID_PCB_CIRCLE_BUTT, - ID_PCB_ARC_BUTT, - ID_PCB_HIGHLIGHT_BUTT, - ID_PCB_MIRE_BUTT, - ID_PCB_SHOW_1_RATSNEST_BUTT, - ID_PCB_PLACE_OFFSET_COORD_BUTT, - ID_PCB_COPPER_LAYERS_SETUP, - ID_PCB_UNUSED_BUTT1, - ID_PCB_UNUSED_BUTT2, - ID_PCB_UNUSED_BUTT3, - - ID_POPUP_PCB_START_RANGE, - ID_POPUP_PCB_MOVE_MODULE_REQUEST, - ID_POPUP_PCB_DRAG_MODULE_REQUEST, - ID_POPUP_PCB_EDIT_MODULE, - ID_POPUP_PCB_CHANGE_SIDE_MODULE, - ID_POPUP_PCB_DELETE_MODULE, - ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE, - ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE, - - - ID_POPUP_PCB_EDIT_PAD, - ID_POPUP_PCB_EDIT_MORE_PAD, - ID_POPUP_PCB_EDIT_PADS_ON_MODULE, - ID_POPUP_PCB_DELETE_PAD, - ID_POPUP_PCB_ADD_PAD, - ID_POPUP_PCB_NEWSIZE_PAD, - ID_POPUP_PCB_ROTATE_PAD, - ID_POPUP_PCB_MOVE_PAD_REQUEST, - ID_POPUP_PCB_DRAG_PAD_REQUEST, - - ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST, - ID_POPUP_PCB_ROTATE_TEXTMODULE, - ID_POPUP_PCB_EDIT_TEXTMODULE, - ID_POPUP_PCB_DELETE_TEXTMODULE, - - ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST, - ID_POPUP_PCB_ROTATE_TEXTEPCB, - ID_POPUP_PCB_EDIT_TEXTEPCB, - ID_POPUP_PCB_DELETE_TEXTEPCB, - - ID_POPUP_PCB_MOVE_DRAWING_REQUEST, - ID_POPUP_PCB_EDIT_DRAWING, - ID_POPUP_PCB_DELETE_DRAWING, - ID_POPUP_PCB_DELETE_DRAWING_LAYER, - - ID_POPUP_PCB_EDIT_TRACK, - ID_POPUP_PCB_DELETE_TRACKSEG, - ID_POPUP_PCB_DELETE_TRACK, - ID_POPUP_PCB_DELETE_TRACKNET, - ID_POPUP_PCB_DELETE_TRACK_MNU, - - ID_POPUP_PCB_MOVE_ZONE_CORNER, - ID_POPUP_PCB_ADD_ZONE_CORNER, - ID_POPUP_PCB_DELETE_ZONE_CORNER, - ID_POPUP_PCB_PLACE_ZONE_CORNER, - ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER, - ID_POPUP_PCB_EDIT_ZONE_PARAMS, - ID_POPUP_PCB_DELETE_ZONE, - ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE, - ID_POPUP_PCB_FILL_ALL_ZONES, - ID_POPUP_PCB_FILL_ZONE, - ID_POPUP_PCB_DELETE_ZONE_CONTAINER, - ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE, - ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE, - ID_POPUP_PCB_DELETE_ZONE_CUTOUT, - ID_POPUP_PCB_MOVE_ZONE_OUTLINES, - ID_POPUP_PCB_PLACE_ZONE_OUTLINES, - ID_POPUP_PCB_DRAG_ZONE_OUTLINE_SEGMENT, - ID_POPUP_PCB_PLACE_DRAGGED_ZONE_OUTLINE_SEGMENT, - ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES, - ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE, - - ID_POPUP_PCB_DELETE_MARKER, - ID_POPUP_PCB_DELETE_COTATION, - - ID_POPUP_PCB_MOVE_MIRE_REQUEST, - ID_POPUP_PCB_DELETE_MIRE, - ID_POPUP_PCB_EDIT_MIRE, - - ID_POPUP_PCB_STOP_CURRENT_DRAWING, - - ID_POPUP_PCB_EDIT_COTATION, - ID_POPUP_PCB_END_TRACK, - ID_POPUP_PCB_PLACE_VIA, - ID_POPUP_PCB_PLACE_MICROVIA, - - ID_POPUP_PCB_IMPORT_PAD_SETTINGS, - ID_POPUP_PCB_EXPORT_PAD_SETTINGS, - - ID_POPUP_PCB_SELECT_WIDTH, - ID_POPUP_PCB_SELECT_AUTO_WIDTH, - ID_POPUP_PCB_SELECT_WIDTH1, - ID_POPUP_PCB_SELECT_WIDTH2, - ID_POPUP_PCB_SELECT_WIDTH3, - ID_POPUP_PCB_SELECT_WIDTH4, - ID_POPUP_PCB_SELECT_WIDTH5, - ID_POPUP_PCB_SELECT_WIDTH6, - ID_POPUP_PCB_SELECT_WIDTH7, - ID_POPUP_PCB_SELECT_WIDTH8, - ID_POPUP_PCB_EDIT_TRACKSEG, - ID_POPUP_PCB_EDIT_TRACK_MNU, - ID_POPUP_PCB_EDIT_NET, - ID_POPUP_PCB_SELECT_LAYER, - ID_POPUP_PCB_SELECT_CU_LAYER, - ID_POPUP_PCB_SELECT_NO_CU_LAYER, - ID_POPUP_PCB_SELECT_LAYER_PAIR, - ID_POPUP_PCB_EDIT_EDGE, - ID_POPUP_PCB_DELETE_EDGE, - ID_POPUP_PCB_MOVE_EDGE, - ID_POPUP_PCB_PLACE_EDGE, - ID_POPUP_PCB_END_EDGE, - ID_POPUP_PCB_LOCK_ON_TRACKSEG, - ID_POPUP_PCB_LOCK_OFF_TRACKSEG, - ID_POPUP_PCB_LOCK_ON_TRACK, - ID_POPUP_PCB_LOCK_OFF_TRACK, - ID_POPUP_PCB_LOCK_ON_NET, - ID_POPUP_PCB_LOCK_OFF_NET, - ID_POPUP_PCB_SETFLAGS_TRACK_MNU, - - ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER, - ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER_DATA, - ID_POPUP_PCB_EDIT_WIDTH_CURRENT_EDGE, - ID_POPUP_PCB_EDIT_WIDTH_ALL_EDGE, - ID_POPUP_PCB_EDIT_LAYER_CURRENT_EDGE, - ID_POPUP_PCB_EDIT_LAYER_ALL_EDGE, - ID_POPUP_PCB_ENTER_EDGE_WIDTH, - ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS, - ID_POPUP_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE, - ID_POPUP_PCB_EDIT_ALL_VIAS_SIZE, - ID_POPUP_PCB_EDIT_ALL_TRACK_SIZE, - ID_POPUP_PCB_DISPLAY_FOOTPRINT_DOC, - ID_POPUP_PCB_MOVE_TRACK_NODE, - ID_POPUP_PCB_BREAK_TRACK, - ID_POPUP_PCB_PLACE_MOVED_TRACK_NODE, - ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE, - ID_POPUP_PCB_DRAG_TRACK_SEGMENT, - ID_POPUP_PCB_MOVE_TRACK_SEGMENT, - ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST, - ID_POPUP_PCB_GETINFO_MARKER, - ID_POPUP_PCB_UNUSED6, - ID_POPUP_PCB_UNUSED7, - ID_POPUP_PCB_UNUSED8, - ID_POPUP_PCB_END_RANGE, - - // Via edition - ID_POPUP_VIA_EDIT_START_RANGE, - ID_POPUP_PCB_SELECT_VIASIZE, - ID_POPUP_PCB_SELECT_VIASIZE1, - ID_POPUP_PCB_SELECT_VIASIZE2, - ID_POPUP_PCB_SELECT_VIASIZE3, - ID_POPUP_PCB_SELECT_VIASIZE4, - ID_POPUP_PCB_SELECT_VIASIZE5, - ID_POPUP_PCB_SELECT_VIASIZE6, - ID_POPUP_PCB_SELECT_VIASIZE7, - ID_POPUP_PCB_SELECT_VIASIZE8, - ID_POPUP_PCB_VIA_EDITING, - ID_POPUP_PCB_VIA_HOLE_TO_DEFAULT, - ID_POPUP_PCB_VIA_HOLE_TO_VALUE, - ID_POPUP_PCB_VIA_HOLE_ENTER_VALUE, - ID_POPUP_PCB_VIA_HOLE_EXPORT, - ID_POPUP_PCB_VIA_HOLE_RESET_TO_DEFAULT, - ID_POPUP_PCB_VIA_HOLE_EXPORT_TO_OTHERS, - ID_POPUP_VIA_EDIT_END_RANGE, - - // reserve a block of MAX_ITEMS_IN_PICKER ids for the item selection popup - ID_POPUP_PCB_ITEM_SELECTION_START, - ID_POPUP_PCB_ITEM_SELECTION_END = MAX_ITEMS_IN_PICKER + ID_POPUP_PCB_ITEM_SELECTION_START, - ID_POPUP_PCB_AUTOPLACE_START_RANGE, - ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, - ID_POPUP_PCB_AUTOPLACE_FREE_MODULE, - ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES, - ID_POPUP_PCB_AUTOPLACE_FIXE_ALL_MODULES, - ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE, - ID_POPUP_PCB_AUTOMOVE_ALL_MODULES, - ID_POPUP_PCB_AUTOMOVE_NEW_MODULES, - ID_POPUP_PCB_AUTOPLACE_COMMANDS, - - ID_POPUP_PCB_REORIENT_ALL_MODULES, - - ID_POPUP_PCB_AUTOPLACE_ALL_MODULES, - ID_POPUP_PCB_AUTOPLACE_NEW_MODULES, - ID_POPUP_PCB_AUTOPLACE_NEXT_MODULE, - - ID_POPUP_PCB_AUTOPLACE_UNUSED0, - ID_POPUP_PCB_AUTOPLACE_UNUSED1, - ID_POPUP_PCB_AUTOPLACE_UNUSED2, - ID_POPUP_PCB_AUTOPLACE_UNUSED3, - - ID_POPUP_PCB_AUTOROUTE_COMMANDS, - ID_POPUP_PCB_AUTOROUTE_ALL_MODULES, - ID_POPUP_PCB_AUTOROUTE_MODULE, - ID_POPUP_PCB_AUTOROUTE_PAD, - ID_POPUP_PCB_AUTOROUTE_NET, - - ID_POPUP_PCB_AUTOROUTE_RESET_UNROUTED, - - ID_POPUP_PCB_AUTOROUTE_SELECT_LAYERS, - ID_POPUP_PCB_AUTOROUTE_UNUSED1, - ID_POPUP_PCB_AUTOROUTE_UNUSED2, - ID_POPUP_PCB_AUTOROUTE_UNUSED3, - ID_POPUP_PCB_AUTOROUTE_UNUSED4, - ID_POPUP_PCB_AUTOROUTE_UNUSED5, - ID_POPUP_PCB_AUTOROUTE_UNUSED6, - ID_POPUP_PCB_AUTOROUTE_UNUSED7, - - ID_POPUP_PCB_AUTOPLACE_END_RANGE, - - ID_SAVE_BOARD, - ID_MENU_SAVE_BOARD, - ID_MENU_SAVE_BOARD_AS, - ID_MENU_LOAD_FILE, - ID_MENU_APPEND_FILE, - ID_MENU_NEW_BOARD, - ID_MENU_RECOVER_BOARD, - ID_MENU_READ_LAST_SAVED_VERSION_BOARD, - ID_MENU_ARCHIVE_MODULES, - ID_MENU_ARCHIVE_NEW_MODULES, - ID_MENU_ARCHIVE_ALL_MODULES, - ID_MENU_MICELLANOUS, - ID_MENU_LIST_NETS, - ID_MENU_PCB_CLEAN, - ID_MENU_PCB_SWAP_LAYERS, - ID_MENU_PCB_UNUSED0, - ID_MENU_PCB_UNUSED1, - ID_MENU_PCB_UNUSED2, - ID_MENU_PCB_UNUSED3, - ID_MENU_PCB_UNUSED4, - - ID_TOOLBARH_PCB_SELECT_LAYER, - ID_TOOLBARH_PCB_AUTOPLACE, - ID_TOOLBARH_PCB_AUTOROUTE, - ID_TOOLBARH_PCB_FREEROUTE_ACCESS, - - ID_AUX_TOOLBAR_PCB_VIA_SIZE, - ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, - ID_AUX_TOOLBAR_PCB_CLR_WIDTH, - ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, - ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, - ID_AUX_TOOLBAR_PCB_UNUSED3, - ID_AUX_TOOLBAR_PCB_UNUSED4, - ID_AUX_TOOLBAR_PCB_UNUSED5, - ID_AUX_TOOLBAR_PCB_UNUSED6, - ID_AUX_TOOLBAR_PCB_UNUSED7, - - ID_PCB_GEN_POS_MODULES_FILE, - ID_PCB_GEN_DRILL_FILE, - - ID_PCB_DISPLAY_OPTIONS_SETUP, - ID_PCB_TRACK_SIZE_SETUP, - ID_PCB_PAD_SETUP, - - ID_PCB_GLOBAL_DELETE, - ID_PCB_COTATION_BUTT, - ID_PCB_DRAWINGS_WIDTHS_SETUP, - - ID_PCB_GEN_CMP_FILE, - ID_MENU_PCB_SHOW_3D_FRAME, - ID_PCB_USER_GRID_SETUP, - ID_PCB_DISPLAY_FOOTPRINT_DOC, - ID_PCB_GEN_BOM_FILE_FROM_BOARD, - ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG, - ID_PCBUNUSED4, - ID_PCBUNUSED5, - ID_PCBUNUSED6, - ID_PCBUNUSED7, - - ID_MODEDIT_CHECK, - ID_MODEDIT_SAVE_LIBMODULE, - ID_MODEDIT_NEW_MODULE, - ID_MODEDIT_SHEET_SET, - ID_MODEDIT_LOAD_MODULE, - ID_MODEDIT_ADD_PAD, - ID_MODEDIT_PLACE_ANCHOR, - ID_MODEDIT_DELETE_ITEM_BUTT, - ID_MODEDIT_PAD_SETTINGS, - ID_MODEDIT_LOAD_MODULE_FROM_BOARD, - ID_MODEDIT_INSERT_MODULE_IN_BOARD, - ID_MODEDIT_UPDATE_MODULE_IN_BOARD, - ID_MODEDIT_EDIT_MODULE_PROPERTIES, - ID_MODEDIT_TRANSFORM_MODULE, - ID_MODEDIT_MODULE_ROTATE, - ID_MODEDIT_MODULE_MIRROR, - ID_MODEDIT_UNDO, - ID_MODEDIT_REDO, - ID_MODEDIT_IMPORT_PART, - ID_MODEDIT_EXPORT_PART, - ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART, - ID_MODEDIT_UNUSED0, - ID_MODEDIT_UNUSED1, - ID_MODEDIT_UNUSED2, - - // For GERBVIEW only ///////////////// - ID_GERBVIEW_SHOW_LIST_DCODES, - ID_GERBVIEW_LOAD_DRILL_FILE, - ID_GERBVIEW_LOAD_DCODE_FILE, - ID_TOOLBARH_GERBER_SELECT_TOOL, - ID_MENU_INC_LAYER_AND_APPEND_FILE, - ID_INC_LAYER_AND_APPEND_FILE, - ID_GERBVIEW_SHOW_SOURCE, - ID_GERBVIEW_EXPORT_TO_PCBNEW, - ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, - ID_GERBVIEW_UNUSED2, - ID_GERBVIEW_UNUSED3, - ID_GERBVIEW_UNUSED4, - ID_GERBVIEW_UNUSED5, - ID_GERBVIEW_UNUSED6, - ID_GERBVIEW_UNUSED7, - ID_GERBVIEW_UNUSED8, - ////////////////////////////////////// - - ID_EDA_SOCKET_EVENT_SERV, - ID_EDA_SOCKET_EVENT, - - ID_TB_OPTIONS_START, - - ID_TB_OPTIONS_DRC_OFF, - ID_TB_OPTIONS_SELECT_UNIT_MM, - ID_TB_OPTIONS_SELECT_UNIT_INCH, - ID_TB_OPTIONS_SELECT_CURSOR, - ID_TB_OPTIONS_SHOW_POLAR_COORD, - ID_TB_OPTIONS_SHOW_GRID, - ID_TB_OPTIONS_SHOW_RATSNEST, - ID_TB_OPTIONS_SHOW_MODULE_RATSNEST, - ID_TB_OPTIONS_AUTO_DEL_TRACK, - ID_TB_OPTIONS_SHOW_ZONES, - ID_TB_OPTIONS_SHOW_ZONES_DISABLE, - ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY, + ID_TB_OPTIONS_DRC_OFF, + ID_TB_OPTIONS_SELECT_UNIT_MM, + ID_TB_OPTIONS_SELECT_UNIT_INCH, + ID_TB_OPTIONS_SELECT_CURSOR, + ID_TB_OPTIONS_SHOW_POLAR_COORD, + ID_TB_OPTIONS_SHOW_GRID, + ID_TB_OPTIONS_SHOW_RATSNEST, + ID_TB_OPTIONS_SHOW_MODULE_RATSNEST, + ID_TB_OPTIONS_AUTO_DEL_TRACK, + ID_TB_OPTIONS_SHOW_ZONES, + ID_TB_OPTIONS_SHOW_ZONES_DISABLE, + ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY, ID_TB_OPTIONS_HIDDEN_PINS, - ID_TB_OPTIONS_BUS_WIRES_ORIENT, - ID_TB_OPTIONS_SHOW_PADS_SKETCH, - ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, - ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, - ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, - ID_TB_OPTIONS_SHOW_DCODES, - ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE, - ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1, - ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, - ID_TB_OPTIONS_SHOW_INVISIBLE_TEXT_MODE, - ID_TB_OPTIONS_UNUSED7, - ID_TB_OPTIONS_UNUSED8, + ID_TB_OPTIONS_BUS_WIRES_ORIENT, + ID_TB_OPTIONS_SHOW_PADS_SKETCH, + ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, + ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, + ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, + ID_TB_OPTIONS_SHOW_DCODES, + ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE, + ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1, + ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, + ID_TB_OPTIONS_SHOW_INVISIBLE_TEXT_MODE, - ID_TB_OPTIONS_END, + ID_TB_OPTIONS_END, + ID_DRC_CONTROL, + ID_PCB_GLOBAL_DELETE, + ID_TRACK_BUTT, + ID_PCB_ZONES_BUTT, + ID_PCB_DELETE_ITEM_BUTT, + ID_POPUP_PCB_DELETE_TRACKSEG, + ID_TOOLBARH_PCB_SELECT_LAYER, + ID_PCB_DISPLAY_OPTIONS_SETUP, + ID_PCB_TRACK_SIZE_SETUP, - ID_START_COMMAND_3D, - ID_ROTATE3D_X_NEG, - ID_ROTATE3D_X_POS, - ID_ROTATE3D_Y_NEG, - ID_ROTATE3D_Y_POS, - ID_ROTATE3D_Z_NEG, - ID_ROTATE3D_Z_POS, - ID_RELOAD3D_BOARD, - ID_TOOL_SCREENCOPY_TOCLIBBOARD, - ID_MOVE3D_LEFT, - ID_MOVE3D_RIGHT, - ID_MOVE3D_UP, - ID_MOVE3D_DOWN, - ID_MENU3D_BGCOLOR_SELECTION, - ID_MENU3D_AXIS_ONOFF, - ID_MENU3D_MODULE_ONOFF, - ID_MENU3D_UNUSED, - ID_MENU3D_ZONE_ONOFF, - ID_MENU3D_DRAWINGS_ONOFF, - ID_MENU3D_COMMENTS_ONOFF, - ID_MENU3D_ECO1_ONOFF, - ID_MENU3D_ECO2_ONOFF, - ID_3D_UNUSED0, - ID_3D_UNUSED1, - ID_3D_UNUSED2, - ID_3D_UNUSED3, - ID_3D_UNUSED4, - ID_3D_UNUSED5, - ID_3D_UNUSED6, - ID_END_COMMAND_3D, - - ID_MENU_SCREENCOPY_PNG, - ID_MENU_SCREENCOPY_JPEG, - ID_MENU_SCREENCOPY_TOCLIBBOARD, - ID_MENU_COMMAND3D_UNUSED2, - ID_MENU_COMMAND3D_UNUSED3, - ID_MENU_COMMAND3D_UNUSED4, - ID_MENU_COMMAND3D_UNUSED5, - ID_MENU_COMMAND3D_UNUSED6, - - ID_PCB_MUWAVE_START_CMD, - ID_PCB_MUWAVE_TOOL_DISPLAY_TOOLS, - ID_PCB_MUWAVE_TOOL_SELF_CMD, - ID_PCB_MUWAVE_TOOL_GAP_CMD, - ID_PCB_MUWAVE_TOOL_STUB_CMD, - ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD, - ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD, - ID_PCB_MUWAVE_UNUSED0, - ID_PCB_MUWAVE_UNUSED1, - ID_PCB_MUWAVE_UNUSED2, - ID_PCB_MUWAVE_END_CMD, - - ID_TOGGLE_PRESENT_COMMAND, - - - ID_END_LIST + ID_END_LIST }; -#endif /* define ID_H */ +#endif /* define ID_H */ diff --git a/include/pcbcommon.h b/include/pcbcommon.h index 7fd9777e84..b178b033fd 100644 --- a/include/pcbcommon.h +++ b/include/pcbcommon.h @@ -31,6 +31,7 @@ extern wxString NetCmpExtBuffer; extern const wxString ModuleFileExtension; extern const wxString ModuleFileWildcard; +extern const wxString PcbFileWildcard; extern wxString g_ViaType_Name[4]; diff --git a/include/wxEeschemaStruct.h b/include/wxEeschemaStruct.h index 8029490da6..7757684f9c 100644 --- a/include/wxEeschemaStruct.h +++ b/include/wxEeschemaStruct.h @@ -36,25 +36,23 @@ class SCH_CMP_FIELD; class LibDrawPin; class DrawJunctionStruct; - -/*******************************/ -/* class WinEDA_SchematicFrame */ -/*******************************/ - /* enum used in RotationMiroir() */ -enum fl_rot_cmp { - CMP_NORMAL, // orientation normale (O, pas de miroir) - CMP_ROTATE_CLOCKWISE, // nouvelle rotation de -90 - CMP_ROTATE_COUNTERCLOCKWISE, // nouvelle rotation de +90 - CMP_ORIENT_0, // orientation 0, pas de miroir, id CMP_NORMAL - CMP_ORIENT_90, // orientation 90, pas de miroir - CMP_ORIENT_180, // orientation 180, pas de miroir - CMP_ORIENT_270, // orientation -90, pas de miroir - CMP_MIROIR_X = 0x100, // miroir selon axe X - CMP_MIROIR_Y = 0x200 // miroir selon axe Y +enum fl_rot_cmp +{ + CMP_NORMAL, // orientation normale (O, pas de miroir) + CMP_ROTATE_CLOCKWISE, // nouvelle rotation de -90 + CMP_ROTATE_COUNTERCLOCKWISE, // nouvelle rotation de +90 + CMP_ORIENT_0, // orientation 0, pas de miroir, id CMP_NORMAL + CMP_ORIENT_90, // orientation 90, pas de miroir + CMP_ORIENT_180, // orientation 180, pas de miroir + CMP_ORIENT_270, // orientation -90, pas de miroir + CMP_MIROIR_X = 0x100, // miroir selon axe X + CMP_MIROIR_Y = 0x200 // miroir selon axe Y }; - +/** + * Schemitic editor (EESchema) main window. + */ class WinEDA_SchematicFrame : public WinEDA_DrawFrame { public: @@ -112,9 +110,9 @@ public: int hotkey, EDA_BaseStruct* DrawStruct ); - SCH_CMP_FIELD* GetCurrentField() { return m_CurrentField; } + SCH_CMP_FIELD* GetCurrentField() { return m_CurrentField; } - void SetCurrentField( SCH_CMP_FIELD* aCurrentField ) + void SetCurrentField( SCH_CMP_FIELD* aCurrentField ) { m_CurrentField = aCurrentField; } @@ -137,22 +135,23 @@ public: int BestZoom(); // Retourne le meilleur zoom SCH_ITEM* SchematicGeneralLocateAndDisplay( bool IncludePin = TRUE ); - SCH_ITEM* SchematicGeneralLocateAndDisplay( - const wxPoint& refpoint, - bool - IncludePin ); + SCH_ITEM* SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, + bool IncludePin ); /** * Function FillFootprintFieldForAllInstancesofComponent - * searches for component "aReference", and places a Footprint in Footprint field + * searches for component "aReference", and places a Footprint in + * Footprint field * @param aReference = reference of the component to initialise * @param aFootPrint = new value for the filed Fottprint component - * @param aSetVisible = true to have the field visible, false to set the invisible flag + * @param aSetVisible = true to have the field visible, false to set the + * invisible flag * @return true if the given component is found * Note: - * the component is searched in the whole schematic, and because some components - * have more than one instance (multiple parts per package components) - * the search is not stopped when a reference is found (all instances must be found). + * the component is searched in the whole schematic, and because some + * components have more than one instance (multiple parts per package + * components) the search is not stopped when a reference is found + * (all instances must be found). */ bool FillFootprintFieldForAllInstancesofComponent( const wxString& aReference, const wxString& aFootPrint, @@ -165,69 +164,74 @@ public: bool mouseWarp ); /* Cross probing with pcbnew */ - void SendMessageToPCBNEW( EDA_BaseStruct* objectToSync, - SCH_COMPONENT* LibItem ); + void SendMessageToPCBNEW( EDA_BaseStruct* objectToSync, + SCH_COMPONENT* LibItem ); /* netlist generation */ - void BuildNetListBase(); + void BuildNetListBase(); /** * Function DeleteAnnotation * Remove current component annotations - * @param aCurrentSheetOnly : if false: remove all annotations, else remove annotation relative to the current sheet only + * @param aCurrentSheetOnly : if false: remove all annotations, else + * remove annotation relative to the current + * sheet only * @param aRedraw : true to refresh display */ - void DeleteAnnotation( bool aCurrentSheetOnly, bool aRedraw ); + void DeleteAnnotation( bool aCurrentSheetOnly, bool aRedraw ); // Functions used for hierarchy handling - void InstallPreviousSheet(); - void InstallNextScreen( DrawSheetStruct* Sheet ); + void InstallPreviousSheet(); + void InstallNextScreen( DrawSheetStruct* Sheet ); /** Function GetUniqueFilenameForCurrentSheet * @return a filename that can be used in plot and print functions * for the current screen anad sheet path. * This filename is unique and must be used insteed of the sreen filename - * (or scheen filename) when one must creates file for each sheet in the heierarchy. - * because in complex hierarchies a sheet and a SCH_SCREEN is used more than once + * (or scheen filename) when one must creates file for each sheet in the + * heierarchy. because in complex hierarchies a sheet and a SCH_SCREEN is + * used more than once * Name is - * and has no extension. * However if filename is too long name is - */ - wxString GetUniqueFilenameForCurrentSheet(); + wxString GetUniqueFilenameForCurrentSheet(); /** * Function SetSheetNumberAndCount * Set the m_ScreenNumber and m_NumberOfScreen members for screens - * must be called after a delete or add sheet command, and when entering a sheet + * must be called after a delete or add sheet command, and when entering + * a sheet */ - void SetSheetNumberAndCount(); + void SetSheetNumberAndCount(); // Plot functions: - void ToPlot_PS( wxCommandEvent& event ); - void ToPlot_HPGL( wxCommandEvent& event ); - void ToPlot_DXF( wxCommandEvent& event ); - void ToPostProcess( wxCommandEvent& event ); + void ToPlot_PS( wxCommandEvent& event ); + void ToPlot_HPGL( wxCommandEvent& event ); + void ToPlot_DXF( wxCommandEvent& event ); + void ToPostProcess( wxCommandEvent& event ); // read and save files - void Save_File( wxCommandEvent& event ); - void SaveProject(); - int LoadOneEEProject( const wxString& FileName, bool IsNew ); - bool LoadOneEEFile( SCH_SCREEN* screen, const wxString& FullFileName ); - bool ReadInputStuffFile(); - + void Save_File( wxCommandEvent& event ); + void SaveProject(); + int LoadOneEEProject( const wxString& FileName, bool IsNew ); + bool LoadOneEEFile( SCH_SCREEN* screen, + const wxString& FullFileName ); + bool ReadInputStuffFile(); /** * Function ProcessStuffFile * gets footprint info from each line in the Stuff File by Ref Desg * @param aFilename The file to read from. - * @param aSetFielsAttributeToVisible = true to set the footprint field flag to visible + * @param aSetFielsAttributeToVisible = true to set the footprint field + flag to visible * @return bool - true if success, else true. */ - bool ProcessStuffFile( FILE* aFilename, - bool aSetFielsAttributeToVisible ); + bool ProcessStuffFile( FILE* aFilename, + bool aSetFielsAttributeToVisible ); - bool SaveEEFile( SCH_SCREEN* screen, int FileSave ); - SCH_SCREEN* CreateNewScreen( SCH_SCREEN* OldScreen, int TimeStamp ); + bool SaveEEFile( SCH_SCREEN* screen, int FileSave ); + SCH_SCREEN* CreateNewScreen( SCH_SCREEN* OldScreen, int TimeStamp ); // General search: @@ -241,132 +245,135 @@ public: * 2 => or for the next item * @param mouseWarp If true, then move the mouse cursor to the item. */ - SCH_ITEM* FindSchematicItem( const wxString& pattern, - int SearchType, - bool mouseWarp = true ); + SCH_ITEM* FindSchematicItem( const wxString& pattern, + int SearchType, + bool mouseWarp = true ); - SCH_ITEM* FindMarker( int SearchType ); + SCH_ITEM* FindMarker( int SearchType ); private: - void Process_Move_Item( SCH_ITEM* DrawStruct, wxDC* DC ); - void OnExit( wxCommandEvent& event ); - void OnAnnotate( wxCommandEvent& event ); - void OnErc( wxCommandEvent& event ); - void OnCreateNetlist( wxCommandEvent& event ); - void OnCreateBillOfMaterials( wxCommandEvent& event ); - void OnFindItems( wxCommandEvent& event ); - void OnLoadFile( wxCommandEvent& event ); - void OnLoadStuffFile( wxCommandEvent& event ); - void OnNewProject( wxCommandEvent& event ); - void OnLoadProject( wxCommandEvent& event ); - void OnOpenPcbnew( wxCommandEvent& event ); - void OnOpenCvpcb( wxCommandEvent& event ); - void OnOpenLibraryViewer( wxCommandEvent& event ); - void OnOpenLibraryEditor( wxCommandEvent& event ); + void Process_Move_Item( SCH_ITEM* DrawStruct, wxDC* DC ); + void OnExit( wxCommandEvent& event ); + void OnAnnotate( wxCommandEvent& event ); + void OnErc( wxCommandEvent& event ); + void OnCreateNetlist( wxCommandEvent& event ); + void OnCreateBillOfMaterials( wxCommandEvent& event ); + void OnFindItems( wxCommandEvent& event ); + void OnLoadFile( wxCommandEvent& event ); + void OnLoadStuffFile( wxCommandEvent& event ); + void OnNewProject( wxCommandEvent& event ); + void OnLoadProject( wxCommandEvent& event ); + void OnOpenPcbnew( wxCommandEvent& event ); + void OnOpenCvpcb( wxCommandEvent& event ); + void OnOpenLibraryViewer( wxCommandEvent& event ); + void OnOpenLibraryEditor( wxCommandEvent& event ); /* User interface update event handlers. */ - void OnUpdateBlockSelected( wxUpdateUIEvent& event ); - void OnUpdatePaste( wxUpdateUIEvent& event ); - void OnUpdateSchematicUndo( wxUpdateUIEvent& event ); - void OnUpdateSchematicRedo( wxUpdateUIEvent& event ); - void OnUpdateGrid( wxUpdateUIEvent& event ); - void OnUpdateUnits( wxUpdateUIEvent& event ); - void OnUpdateSelectCursor( wxUpdateUIEvent& event ); - void OnUpdateHiddenPins( wxUpdateUIEvent& event ); - void OnUpdateBusOrientation( wxUpdateUIEvent& event ); + void OnUpdateBlockSelected( wxUpdateUIEvent& event ); + void OnUpdatePaste( wxUpdateUIEvent& event ); + void OnUpdateSchematicUndo( wxUpdateUIEvent& event ); + void OnUpdateSchematicRedo( wxUpdateUIEvent& event ); + void OnUpdateGrid( wxUpdateUIEvent& event ); + void OnUpdateUnits( wxUpdateUIEvent& event ); + void OnUpdateSelectCursor( wxUpdateUIEvent& event ); + void OnUpdateHiddenPins( wxUpdateUIEvent& event ); + void OnUpdateBusOrientation( wxUpdateUIEvent& event ); // Bus Entry - DrawBusEntryStruct* CreateBusEntry( wxDC* DC, int entry_type ); - void SetBusEntryShape( wxDC* DC, - DrawBusEntryStruct* BusEntry, - int entry_type ); - int GetBusEntryShape( DrawBusEntryStruct* BusEntry ); - void StartMoveBusEntry( DrawBusEntryStruct* DrawLibItem, wxDC* DC ); + DrawBusEntryStruct* CreateBusEntry( wxDC* DC, int entry_type ); + void SetBusEntryShape( wxDC* DC, + DrawBusEntryStruct* BusEntry, + int entry_type ); + int GetBusEntryShape( DrawBusEntryStruct* BusEntry ); + void StartMoveBusEntry( DrawBusEntryStruct* DrawLibItem, + wxDC* DC ); // NoConnect - DrawNoConnectStruct* CreateNewNoConnectStruct( wxDC* DC ); + DrawNoConnectStruct* CreateNewNoConnectStruct( wxDC* DC ); // Junction - DrawJunctionStruct* CreateNewJunctionStruct( wxDC* DC, - const wxPoint& pos, - bool PutInUndoList = FALSE ); + DrawJunctionStruct* CreateNewJunctionStruct( wxDC* DC, + const wxPoint& pos, + bool PutInUndoList = FALSE ); // Text ,label, glabel - SCH_TEXT* CreateNewText( wxDC* DC, int type ); - void EditSchematicText( SCH_TEXT* TextStruct, wxDC* DC ); - void ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC ); - void StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC ); - void ConvertTextType( SCH_TEXT* Text, wxDC* DC, int newtype ); + SCH_TEXT* CreateNewText( wxDC* DC, int type ); + void EditSchematicText( SCH_TEXT* TextStruct, wxDC* DC ); + void ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC ); + void StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC ); + void ConvertTextType( SCH_TEXT* Text, wxDC* DC, int newtype ); // Wire, Bus - void BeginSegment( wxDC* DC, int type ); - void EndSegment( wxDC* DC ); - void DeleteCurrentSegment( wxDC* DC ); - void DeleteConnection( bool DeleteFullConnection ); + void BeginSegment( wxDC* DC, int type ); + void EndSegment( wxDC* DC ); + void DeleteCurrentSegment( wxDC* DC ); + void DeleteConnection( bool DeleteFullConnection ); // graphic lines - void Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC ); - void Drawing_SetNewWidth( DRAWSEGMENT* DrawSegm, wxDC* DC ); - void Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC ); - DRAWSEGMENT* Begin_Edge( DRAWSEGMENT* Segment, wxDC* DC ); + void Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC ); + void Drawing_SetNewWidth( DRAWSEGMENT* DrawSegm, wxDC* DC ); + void Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC ); + DRAWSEGMENT* Begin_Edge( DRAWSEGMENT* Segment, wxDC* DC ); // Hierarchical Sheet & PinSheet - void InstallHierarchyFrame( wxDC* DC, wxPoint& pos ); - DrawSheetStruct* CreateSheet( wxDC* DC ); - void ReSizeSheet( DrawSheetStruct* Sheet, wxDC* DC ); + void InstallHierarchyFrame( wxDC* DC, wxPoint& pos ); + DrawSheetStruct* CreateSheet( wxDC* DC ); + void ReSizeSheet( DrawSheetStruct* Sheet, wxDC* DC ); public: - bool EditSheet( DrawSheetStruct* Sheet, wxDC* DC ); + bool EditSheet( DrawSheetStruct* Sheet, wxDC* DC ); /** Function UpdateSheetNumberAndDate * Set a sheet number, the sheet count for sheets in the whole schematic * and update the date in all screens */ - void UpdateSheetNumberAndDate(); + void UpdateSheetNumberAndDate(); private: - void StartMoveSheet( DrawSheetStruct* sheet, wxDC* DC ); + void StartMoveSheet( DrawSheetStruct* sheet, wxDC* DC ); Hierarchical_PIN_Sheet_Struct* Create_PinSheet( DrawSheetStruct* Sheet, wxDC* DC ); - void Edit_PinSheet( Hierarchical_PIN_Sheet_Struct* SheetLabel, - wxDC* DC ); - void StartMove_PinSheet( Hierarchical_PIN_Sheet_Struct* SheetLabel, - wxDC* DC ); - void Place_PinSheet( Hierarchical_PIN_Sheet_Struct* SheetLabel, - wxDC* DC ); - Hierarchical_PIN_Sheet_Struct* Import_PinSheet( DrawSheetStruct* Sheet, wxDC* DC ); + void Edit_PinSheet( Hierarchical_PIN_Sheet_Struct* SheetLabel, + wxDC* DC ); + void StartMove_PinSheet( Hierarchical_PIN_Sheet_Struct* SheetLabel, + wxDC* DC ); + void Place_PinSheet( Hierarchical_PIN_Sheet_Struct* SheetLabel, + wxDC* DC ); + Hierarchical_PIN_Sheet_Struct* Import_PinSheet( DrawSheetStruct* Sheet, + wxDC* DC ); public: - void DeleteSheetLabel( bool aRedraw, Hierarchical_PIN_Sheet_Struct* aSheetLabelToDel ); + void DeleteSheetLabel( bool aRedraw, + Hierarchical_PIN_Sheet_Struct* aSheetLabelToDel ); private: // Component - SCH_COMPONENT* Load_Component( wxDC* DC, - const wxString& libname, - wxArrayString& List, - bool UseLibBrowser ); - void StartMovePart( SCH_COMPONENT* DrawLibItem, wxDC* DC ); + SCH_COMPONENT* Load_Component( wxDC* DC, + const wxString& libname, + wxArrayString& List, + bool UseLibBrowser ); + void StartMovePart( SCH_COMPONENT* DrawLibItem, wxDC* DC ); public: - void CmpRotationMiroir( SCH_COMPONENT* DrawComponent, + void CmpRotationMiroir( SCH_COMPONENT* DrawComponent, wxDC* DC, int type_rotate ); private: - void SelPartUnit( SCH_COMPONENT* DrawComponent, - int unit, wxDC* DC ); - void ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC ); - void SetInitCmp( SCH_COMPONENT* DrawComponent, wxDC* DC ); - void EditComponentReference( SCH_COMPONENT* DrawLibItem, + void SelPartUnit( SCH_COMPONENT* DrawComponent, + int unit, wxDC* DC ); + void ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC ); + void SetInitCmp( SCH_COMPONENT* DrawComponent, wxDC* DC ); + void EditComponentReference( SCH_COMPONENT* DrawLibItem, + wxDC* DC ); + void EditComponentValue( SCH_COMPONENT* DrawLibItem, wxDC* DC ); + void EditComponentFootprint( SCH_COMPONENT* DrawLibItem, wxDC* DC ); - void EditComponentValue( SCH_COMPONENT* DrawLibItem, wxDC* DC ); - void EditComponentFootprint( SCH_COMPONENT* DrawLibItem, - wxDC* DC ); - void StartMoveCmpField( SCH_CMP_FIELD* Field, wxDC* DC ); - void EditCmpFieldText( SCH_CMP_FIELD* Field, wxDC* DC ); - void RotateCmpField( SCH_CMP_FIELD* Field, wxDC* DC ); + void StartMoveCmpField( SCH_CMP_FIELD* Field, wxDC* DC ); + void EditCmpFieldText( SCH_CMP_FIELD* Field, wxDC* DC ); + void RotateCmpField( SCH_CMP_FIELD* Field, wxDC* DC ); /* Operations sur bloc */ - void PasteListOfItems( wxDC* DC ); + void PasteListOfItems( wxDC* DC ); /* Undo - redo */ public: @@ -376,29 +383,36 @@ public: * add a picker to handle aItemToCopy * @param aItemToCopy = the schematic 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 + * @param aTransformPoint = the reference point of the transformation, + * for commands like move */ - void SaveCopyInUndoList( SCH_ITEM* aItemToCopy, UndoRedoOpType aTypeCommand, - const wxPoint& aTransformPoint = wxPoint(0,0) ); + void SaveCopyInUndoList( SCH_ITEM* aItemToCopy, + 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 + * @param aTransformPoint = the reference point of the transformation, + * for commands like move */ - void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, UndoRedoOpType aTypeCommand, - const wxPoint& aTransformPoint = wxPoint(0,0) ); + void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, + UndoRedoOpType aTypeCommand, + const wxPoint& aTransformPoint = wxPoint(0,0) ); private: /** Function PutDataInPreviousState() * Used in undo or redo command. - * Put data pointed by List in the previous state, i.e. the state memorised by List - * @param aList = a PICKED_ITEMS_LIST pointer to the list of items to undo/redo + * Put data pointed by List in the previous state, i.e. the state + * memorised by List + * @param aList = a PICKED_ITEMS_LIST pointer to the list of items to + * undo/redo * @param aRedoCommand = a bool: true for redo, false for undo */ - void PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRedoCommand ); + void PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRedoCommand ); + /** Function GetSchematicFromRedoList * Redo the last edition: * - Save the current schematic in Undo list @@ -406,6 +420,7 @@ private: * @return none */ void GetSchematicFromRedoList(wxCommandEvent& event); + /** Function GetSchematicFromUndoList * Undo the last edition: * - Save the current schematic in Redo list @@ -442,7 +457,8 @@ public: * part number > number of parts * different values between parts * @return errors count - * @param aMessageList = a wxArrayString to store messages. If NULL, they are displayed in a wxMessageBox + * @param aMessageList = a wxArrayString to store messages. If NULL, + * they are displayed in a wxMessageBox * @param aOneSheetOnly : true = search is made only in the current sheet * false = search in whole hierarchy (usual search). */ @@ -458,200 +474,4 @@ public: }; -/*****************************/ -/* class WinEDA_LibeditFrame */ -/*****************************/ - -class WinEDA_LibeditFrame : public WinEDA_DrawFrame -{ -public: - WinEDAChoiceBox* m_SelpartBox; - WinEDAChoiceBox* m_SelAliasBox; - -public: - WinEDA_LibeditFrame( wxWindow* father, - const wxString& title, - const wxPoint& pos, const wxSize& size, - long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); - - ~WinEDA_LibeditFrame(); - - void Process_Special_Functions( wxCommandEvent& event ); - void OnImportPart( wxCommandEvent& event ); - void OnExportPart( wxCommandEvent& event ); - void OnSelectAlias( wxCommandEvent& event ); - void OnSelectPart( wxCommandEvent& event ); - void OnEditComponentProperties( wxCommandEvent& event ); - - void OnUpdateEditingPart( wxUpdateUIEvent& event ); - void OnUpdateNotEditingPart( wxUpdateUIEvent& event ); - void OnUpdateUndo( wxUpdateUIEvent& event ); - void OnUpdateRedo( wxUpdateUIEvent& event ); - void OnUpdateSaveCurrentLib( wxUpdateUIEvent& event ); - void OnUpdateViewDoc( wxUpdateUIEvent& event ); - void OnUpdatePinByPin( wxUpdateUIEvent& event ); - void OnUpdatePartNumber( wxUpdateUIEvent& event ); - void OnUpdateDeMorganNormal( wxUpdateUIEvent& event ); - void OnUpdateDeMorganConvert( wxUpdateUIEvent& event ); - void OnUpdateSelectAlias( wxUpdateUIEvent& event ); - - void UpdateAliasSelectList(); - void UpdatePartSelectList(); - void DisplayLibInfos(); - void RedrawActiveWindow( wxDC* DC, bool EraseBg ); - void OnCloseWindow( wxCloseEvent& Event ); - void ReCreateHToolbar(); - void ReCreateVToolbar(); - void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); - bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); - int BestZoom(); // Retourne le meilleur zoom - void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); - - SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); } - void OnHotKey( wxDC* DC, int hotkey, - EDA_BaseStruct* DrawStruct ); - - void GeneralControle( wxDC* DC, - wxPoint MousePositionInPixels ); - - void LoadSettings(); - void SaveSettings(); - -private: - - // General: - void CreateNewLibraryPart(); - void DeleteOnePart(); - void SaveOnePartInMemory(); - void SelectActiveLibrary(); - bool LoadOneLibraryPart(); - void SaveActiveLibrary( wxCommandEvent& event ); - - bool LoadOneLibraryPartAux( CMP_LIB_ENTRY* LibEntry, - CMP_LIBRARY* Library ); - - void DisplayCmpDoc(); - void EditComponentProperties(); - - // General editing -public: - void SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, int flag_type_command = 0 ); - void InstallFieldsEditorDialog( void ); - -private: - void GetComponentFromUndoList(wxCommandEvent& event); - void GetComponentFromRedoList(wxCommandEvent& event); - - // Edition des Pins: - void CreatePin( wxDC* DC ); - void DeletePin( wxDC* DC, - LIB_COMPONENT* LibEntry, - LibDrawPin* Pin ); - void StartMovePin( wxDC* DC ); - - // Test des pins ( duplicates...) - bool TestPins( LIB_COMPONENT* LibEntry ); - - // Edition de l'ancre - void PlaceAncre(); - - // Edition des graphismes: - LibEDA_BaseStruct* CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC ); - void GraphicItemBeginDraw( wxDC* DC ); - void StartMoveDrawSymbol( wxDC* DC ); - void EndDrawGraphicItem( wxDC* DC ); - void LoadOneSymbol(); - void SaveOneSymbol(); - void EditGraphicSymbol( wxDC* DC, - LibEDA_BaseStruct* DrawItem ); - void EditSymbolText( wxDC* DC, LibEDA_BaseStruct* DrawItem ); - void RotateSymbolText( wxDC* DC ); - void DeleteDrawPoly( wxDC* DC ); - LibDrawField* LocateField( LIB_COMPONENT* LibEntry ); - LibEDA_BaseStruct* LocateItemUsingCursor(); - void RotateField( wxDC* DC, LibDrawField* Field ); - void PlaceField( wxDC* DC, LibDrawField* Field ); - void EditField( wxDC* DC, LibDrawField* Field ); - void StartMoveField( wxDC* DC, LibDrawField* field ); - -public: - /* Block commands: */ - int ReturnBlockCommand( int key ); - void HandleBlockPlace( wxDC* DC ); - int HandleBlockEnd( wxDC* DC ); - - void PlacePin( wxDC* DC ); - void InitEditOnePin(); - void GlobalSetPins( wxDC* DC, LibDrawPin* MasterPin, int id ); - - // Repetition automatique de placement de pins - void RepeatPinItem( wxDC* DC, LibDrawPin* Pin ); - -protected: - wxString m_ConfigPath; - wxString m_LastLibImportPath; - wxString m_LastLibExportPath; - - DECLARE_EVENT_TABLE() -}; - - -class WinEDA_ViewlibFrame : public WinEDA_DrawFrame -{ -private: - WinEDAChoiceBox* SelpartBox; - - // List of libraries (for selection - wxSashLayoutWindow* m_LibListWindow; // The redimensionnable window to display the lib list - wxListBox* m_LibList; // The list of libs - wxSize m_LibListSize; // size of the window - - // List of components in the selected library - wxSashLayoutWindow* m_CmpListWindow; // The redimensionnable window to display the component list - wxListBox* m_CmpList; // The list of components - wxSize m_CmpListSize; // size of the window - - // Flags - wxSemaphore* m_Semaphore; // != NULL if the frame must emulate a modal dialog - wxString m_ConfigPath; // subpath for configuartion - -public: - WinEDA_ViewlibFrame( wxWindow* father, - CMP_LIBRARY* Library = NULL, - wxSemaphore* semaphore = NULL ); - - ~WinEDA_ViewlibFrame(); - - void OnSize( wxSizeEvent& event ); - void OnSashDrag( wxSashEvent& event ); - void ReCreateListLib(); - void ReCreateListCmp(); - void Process_Special_Functions( wxCommandEvent& event ); - void DisplayLibInfos(); - void RedrawActiveWindow( wxDC* DC, bool EraseBg ); - void OnCloseWindow( wxCloseEvent& Event ); - void ReCreateHToolbar(); - void ReCreateVToolbar(); - void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); - int BestZoom(); // Retourne le meilleur zoom - void ClickOnLibList( wxCommandEvent& event ); - void ClickOnCmpList( wxCommandEvent& event ); - - SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); } - - void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels ); - - void LoadSettings(); - void SaveSettings(); - -private: - void SelectCurrentLibrary(); - void SelectAndViewLibraryPart( int option ); - void ExportToSchematicLibraryPart( wxCommandEvent& event ); - void ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag ); - bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); - - DECLARE_EVENT_TABLE() -}; - #endif // WX_EESCHEMA_STRUCT_H diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index 40a27f7513..df7f1c7cec 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -249,7 +249,7 @@ public: void OnFileHistory( wxCommandEvent& event ); void Files_io( wxCommandEvent& event ); - int LoadOnePcbFile( const wxString& FileName, bool Append ); + bool LoadOnePcbFile( const wxString& FileName, bool Append ); int ReadPcbFile( FILE* File, bool Append ); bool SavePcbFile( const wxString& FileName ); int SavePcbFormatAscii( FILE* File ); @@ -261,7 +261,7 @@ public: * @param aQuery = true to prompt user for confirmation, false to initialize silently */ bool Clear_Pcb( bool aQuery ); - + // Drc control /* function GetDrcController * @return the DRC controller diff --git a/kicad/buildmnu.cpp b/kicad/buildmnu.cpp index 758664084b..ac9cb5fe9f 100644 --- a/kicad/buildmnu.cpp +++ b/kicad/buildmnu.cpp @@ -12,7 +12,6 @@ #include "kicad.h" #include "macros.h" #include "bitmaps.h" // Common bitmaps -#include "id.h" /*****************************************************************************/ diff --git a/kicad/commandframe.cpp b/kicad/commandframe.cpp index f5852ff015..4f144ffc1e 100644 --- a/kicad/commandframe.cpp +++ b/kicad/commandframe.cpp @@ -4,17 +4,10 @@ #include "fctsys.h" #include "common.h" - -#include "kicad.h" +#include "bitmaps.h" #include "macros.h" -// ---------------------------------------------------------------------------- -// resources -// ---------------------------------------------------------------------------- - -// USE_XPM_BITMAPS -#include "bitmaps.h" -#include "id.h" +#include "kicad.h" /************************************************************************************/ diff --git a/kicad/files-io.cpp b/kicad/files-io.cpp index fdeb0008ff..60f26c8d51 100644 --- a/kicad/files-io.cpp +++ b/kicad/files-io.cpp @@ -18,7 +18,6 @@ #include "bitmaps.h" #include "confirm.h" #include "gestfich.h" -#include "id.h" #include "kicad.h" #include "prjconfig.h" diff --git a/kicad/kicad.h b/kicad/kicad.h index 36d413c060..6794586db2 100644 --- a/kicad/kicad.h +++ b/kicad/kicad.h @@ -15,6 +15,7 @@ #include #include +#include "id.h" #include "wxstruct.h" #include "appl_wxstruct.h" @@ -24,6 +25,44 @@ class WinEDA_TreePrj; class WinEDA_PrjFrame; +/** + * Command IDs for Kicad. + * + * Please add IDs that are unique to Kica here and not in the global id.h + * file. This will prevent the entire project from being rebuilt when adding + * new commands to Kicad. + */ + +enum id_kicad_frm +{ + ID_LEFT_FRAME = ID_END_LIST, + ID_BOTTOM_FRAME, + ID_PROJECT_TREE, + ID_PROJECT_TXTEDIT, + ID_PROJECT_TREE_REFRESH, + ID_PROJECT_RUNPY, + ID_PROJECT_NEWFILE, + ID_PROJECT_NEWPY, + ID_PROJECT_NEWTXT, + ID_PROJECT_NEWDIR, + ID_PROJECT_DELETE, + ID_PROJECT_RENAME, + ID_PROJECT_OPEN_FILE_WITH_TEXT_EDITOR, + + ID_MAIN_COMMAND, + ID_TO_EDITOR, + ID_TO_EESCHEMA, + ID_TO_GERBVIEW, + ID_RUN_PYTHON, + ID_BROWSE_AN_SELECT_FILE, + ID_SELECT_PREFERED_EDITOR, + ID_SELECT_PREFERED_PDF_BROWSER_NAME, + ID_SELECT_PREFERED_PDF_BROWSER, + ID_SELECT_DEFAULT_PDF_BROWSER, + ID_SAVE_AND_ZIP_FILES, + ID_READ_ZIP_ARCHIVE, +}; + /*******************************************/ /* classe pour la Fenetre generale de kicad*/ @@ -140,19 +179,23 @@ enum TreeFileType { /**************************************************************/ /** class WinEDA_CommandFrame - * This is the window handling the main tools to launch eeschema, cvpcb, pcbnew and gerbview + * This is the window handling the main tools to launch eeschema, cvpcb, + * pcbnew and gerbview */ class WinEDA_CommandFrame : public wxSashLayoutWindow { public: - WinEDA_CommandFrame( wxWindow* parent, int id, wxPoint pos, wxSize size, long style ); + WinEDA_CommandFrame( wxWindow* parent, int id, wxPoint pos, wxSize size, + long style ); ~WinEDA_CommandFrame() { } /** Function AddFastLaunch * add a Bitmap Button (fast launch button) to the window */ -public: void AddFastLaunch( wxBitmapButton * button ); +public: + void AddFastLaunch( wxBitmapButton * button ); + private: /** Function CreateCommandToolbar @@ -187,7 +230,8 @@ private: public: - TreePrjItemData( TreeFileType type, const wxString& data, wxTreeCtrl* parent ); + TreePrjItemData( TreeFileType type, const wxString& data, + wxTreeCtrl* parent ); TreePrjItemData() : m_Parent( NULL ) { } TreePrjItemData( const TreePrjItemData& src ) : @@ -235,7 +279,8 @@ public: #ifdef KICAD_PYTHON boost::python::object GetFileNamePy() const; - bool RenamePy( const boost::python::str& newname, bool check = true ); + bool RenamePy( const boost::python::str& newname, + bool check = true ); boost::python::object GetDirPy() const; @@ -261,10 +306,11 @@ private: wxCursor m_Default; protected: - wxMenu* GetContextMenu( int type ); - void NewFile( TreeFileType type ); - void NewFile( const wxString& name, TreeFileType type, wxTreeItemId& root ); - TreePrjItemData* GetSelectedData(); + wxMenu* GetContextMenu( int type ); + void NewFile( TreeFileType type ); + void NewFile( const wxString& name, TreeFileType type, + wxTreeItemId& root ); + TreePrjItemData* GetSelectedData(); public: WinEDA_MainFrame* m_Parent; @@ -273,8 +319,8 @@ public: wxTreeItemId m_root; public: - static wxString GetFileExt( TreeFileType type ); - static wxString GetFileWildcard( TreeFileType type ); + static wxString GetFileExt( TreeFileType type ); + static wxString GetFileWildcard( TreeFileType type ); WinEDA_PrjFrame( WinEDA_MainFrame* parent, const wxPoint& pos, const wxSize& size ); @@ -330,7 +376,8 @@ public: boost::python::object GetTreeCtrl(); TreePrjItemData* GetItemData( const boost::python::object& item ); - void AddFilePy( const boost::python::str& name, boost::python::object& root ); + void AddFilePy( const boost::python::str& name, + boost::python::object& root ); void NewFilePy( const boost::python::str& name, TreeFileType type, boost::python::object& root ); diff --git a/kicad/mainframe.cpp b/kicad/mainframe.cpp index 601a246456..228e1b5cca 100644 --- a/kicad/mainframe.cpp +++ b/kicad/mainframe.cpp @@ -16,7 +16,6 @@ #include "confirm.h" #include "gestfich.h" #include "bitmaps.h" -#include "id.h" #include "kicad.h" @@ -81,7 +80,7 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent, m_BottomWin->SetSashVisible( wxSASH_LEFT, TRUE ); m_BottomWin->SetExtraBorderSize( 2 ); - m_DialogWin = new wxTextCtrl( m_BottomWin, ID_MAIN_DIALOG, wxEmptyString, + m_DialogWin = new wxTextCtrl( m_BottomWin, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxNO_BORDER | wxTE_READONLY ); diff --git a/kicad/preferences.cpp b/kicad/preferences.cpp index c97b9d03f0..afb65c39f9 100644 --- a/kicad/preferences.cpp +++ b/kicad/preferences.cpp @@ -12,7 +12,6 @@ #include "confirm.h" #include "gestfich.h" #include "bitmaps.h" -#include "id.h" #include "kicad.h" diff --git a/kicad/prjconfig.cpp b/kicad/prjconfig.cpp index e81d72b282..3a4a6bef9d 100644 --- a/kicad/prjconfig.cpp +++ b/kicad/prjconfig.cpp @@ -13,7 +13,6 @@ #include "confirm.h" #include "gestfich.h" #include "prjconfig.h" -#include "id.h" #include "kicad.h" static const wxString GeneralGroupName( wxT( "/general" ) ); diff --git a/kicad/treeprj_datas.cpp b/kicad/treeprj_datas.cpp index a227f11092..118c4ec4d4 100644 --- a/kicad/treeprj_datas.cpp +++ b/kicad/treeprj_datas.cpp @@ -11,6 +11,7 @@ #include "common.h" #include "gestfich.h" #include "appl_wxstruct.h" +#include "bitmaps.h" #include "kicad.h" @@ -20,10 +21,6 @@ #include "wx/regex.h" #include "wx/dir.h" -#include "bitmaps.h" - -#include "id.h" - /********************************************/ /* Methodes pour l'arbre gestion du projet */ diff --git a/kicad/treeprj_frame.cpp b/kicad/treeprj_frame.cpp index 3a220154ce..d277b2aef4 100644 --- a/kicad/treeprj_frame.cpp +++ b/kicad/treeprj_frame.cpp @@ -14,6 +14,7 @@ #include "confirm.h" #include "gestfich.h" #include "appl_wxstruct.h" +#include "bitmaps.h" #include "kicad.h" @@ -23,9 +24,6 @@ #include "wx/regex.h" #include "wx/dir.h" -#include "bitmaps.h" - -#include "id.h" // Comment this if you do no want to load subdirs files in the tree project // UnComment this to load subdirs files in the tree project diff --git a/pcbnew/automove.cpp b/pcbnew/automove.cpp index 9893b1e80f..ec1b304991 100644 --- a/pcbnew/automove.cpp +++ b/pcbnew/automove.cpp @@ -15,7 +15,7 @@ #include "wxPcbStruct.h" #include "autorout.h" #include "cell.h" -#include "id.h" +#include "pcbnew_id.h" #include "protos.h" diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 7bc2db7502..44dc68a013 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -15,7 +15,7 @@ #include "pcbnew.h" #include "bitmaps.h" #include "protos.h" -#include "id.h" +#include "pcbnew_id.h" #include "collectors.h" #include "class_drawpanel.h" diff --git a/pcbnew/class_board_item.cpp b/pcbnew/class_board_item.cpp index 7259ebc36a..f5a9c53af9 100644 --- a/pcbnew/class_board_item.cpp +++ b/pcbnew/class_board_item.cpp @@ -8,7 +8,7 @@ #include "common.h" #include "pcbnew.h" -#include "id.h" +#include "pcbnew_id.h" #include "collectors.h" #include "bitmaps.h" diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index 4a59d6d4c6..b346023529 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -9,7 +9,7 @@ #include "pcbnew.h" #include "trigo.h" -#include "id.h" // ID_TRACK_BUTT +#include "pcbnew_id.h" // ID_TRACK_BUTT /*******************************/ diff --git a/pcbnew/class_pad_draw_functions.cpp b/pcbnew/class_pad_draw_functions.cpp index f3af09d59a..341a1a7c92 100644 --- a/pcbnew/class_pad_draw_functions.cpp +++ b/pcbnew/class_pad_draw_functions.cpp @@ -6,7 +6,7 @@ #include "gr_basic.h" #include "common.h" #include "trigo.h" -#include "id.h" // ID_TRACK_BUTT +#include "pcbnew_id.h" // ID_TRACK_BUTT #include "class_drawpanel.h" #include "drawtxt.h" diff --git a/pcbnew/classpcb.cpp b/pcbnew/classpcb.cpp index a369ff5b78..a4cc5b383e 100644 --- a/pcbnew/classpcb.cpp +++ b/pcbnew/classpcb.cpp @@ -9,7 +9,7 @@ #include "pcbnew.h" #include "trigo.h" -#include "id.h" +#include "pcbnew_id.h" /* Default pcbnew zoom values. diff --git a/pcbnew/controle.cpp b/pcbnew/controle.cpp index e34c226d33..ac88639f91 100644 --- a/pcbnew/controle.cpp +++ b/pcbnew/controle.cpp @@ -11,7 +11,7 @@ #include "wxPcbStruct.h" #include "protos.h" -#include "id.h" +#include "pcbnew_id.h" #include "collectors.h" #include "bitmaps.h" diff --git a/pcbnew/cross-probing.cpp b/pcbnew/cross-probing.cpp index a145ab2c52..44f9e84bc3 100644 --- a/pcbnew/cross-probing.cpp +++ b/pcbnew/cross-probing.cpp @@ -17,7 +17,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" #include "eda_dde.h" -#include "id.h" +#include "pcbnew_id.h" #include "collectors.h" #include "protos.h" diff --git a/pcbnew/dialog_copper_layers_setup.cpp b/pcbnew/dialog_copper_layers_setup.cpp index 18fbbbe0c0..8c14334988 100644 --- a/pcbnew/dialog_copper_layers_setup.cpp +++ b/pcbnew/dialog_copper_layers_setup.cpp @@ -14,7 +14,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" -#include "id.h" +#include "pcbnew_id.h" #include "dialog_copper_layers_setup.h" #include "wx/generic/gridctrl.h" diff --git a/pcbnew/dialog_design_rules.cpp b/pcbnew/dialog_design_rules.cpp index d28d393ba4..ff59c5b2e7 100644 --- a/pcbnew/dialog_design_rules.cpp +++ b/pcbnew/dialog_design_rules.cpp @@ -38,7 +38,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" -#include "id.h" +#include "pcbnew_id.h" #include "dialog_design_rules.h" #include "wx/generic/gridctrl.h" diff --git a/pcbnew/dialog_display_options.cpp b/pcbnew/dialog_display_options.cpp index 8cbdf18787..f5046f2f8e 100644 --- a/pcbnew/dialog_display_options.cpp +++ b/pcbnew/dialog_display_options.cpp @@ -12,7 +12,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" -#include "id.h" +#include "pcbnew_id.h" #include "dialog_display_options_base.h" diff --git a/pcbnew/dialog_general_options.cpp b/pcbnew/dialog_general_options.cpp index e8ed95a3f1..960f6108a7 100644 --- a/pcbnew/dialog_general_options.cpp +++ b/pcbnew/dialog_general_options.cpp @@ -13,7 +13,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" -#include "id.h" +#include "pcbnew_id.h" #include "dialog_general_options_BoardEditor_base.h" #include "dialog_general_options.h" diff --git a/pcbnew/dialog_graphic_items_options.cpp b/pcbnew/dialog_graphic_items_options.cpp index c738e9785b..d39be863fe 100644 --- a/pcbnew/dialog_graphic_items_options.cpp +++ b/pcbnew/dialog_graphic_items_options.cpp @@ -15,7 +15,7 @@ #include "pcbplot.h" #include "autorout.h" -#include "id.h" +#include "pcbnew_id.h" #include "protos.h" diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 9cd114438d..f436d6df5f 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -8,7 +8,7 @@ #include "confirm.h" #include "eda_doc.h" #include "gestfich.h" -#include "id.h" +#include "pcbnew_id.h" #include "pcbnew.h" #include "wxPcbStruct.h" @@ -201,7 +201,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) toggle = 1; break; - case ID_LINE_COMMENT_BUTT: + case ID_PCB_ADD_LINE_BUTT: case ID_PCB_ARC_BUTT: case ID_PCB_CIRCLE_BUTT: if( DrawStruct == NULL ) @@ -344,13 +344,13 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) SetToolID( id, wxCURSOR_PENCIL, _( "Adjust Zero" ) ); break; - case ID_LINE_COMMENT_BUTT: + case ID_PCB_ADD_LINE_BUTT: case ID_PCB_ARC_BUTT: case ID_PCB_CIRCLE_BUTT: SetToolID( id, wxCURSOR_PENCIL, _( "Add Graphic" ) ); break; - case ID_TEXT_COMMENT_BUTT: + case ID_PCB_ADD_TEXT_BUTT: SetToolID( id, wxCURSOR_PENCIL, _( "Add Text" ) ); break; @@ -383,7 +383,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_CANCEL_CURRENT_COMMAND: break; - case ID_POPUP_END_LINE: + case ID_POPUP_PCB_END_LINE: DrawPanel->MouseToCursorSchema(); // EndSegment(&dc); diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index b3847e9a90..88803d88bb 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -11,7 +11,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" #include "protos.h" -#include "id.h" +#include "pcbnew_id.h" void WinEDA_PcbFrame::OnFileHistory( wxCommandEvent& event ) @@ -60,7 +60,6 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event ) switch( id ) { - case ID_MENU_LOAD_FILE: case ID_LOAD_FILE: LoadOnePcbFile( wxEmptyString, false ); ReCreateAuxiliaryToolbar(); @@ -102,26 +101,24 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event ) break; } - case ID_MENU_APPEND_FILE: case ID_APPEND_FILE: LoadOnePcbFile( wxEmptyString, TRUE ); break; - case ID_MENU_NEW_BOARD: case ID_NEW_BOARD: Clear_Pcb( TRUE ); GetScreen()->m_FileName.Printf( wxT( "%s%cnoname%s" ), - wxGetCwd().GetData(), DIR_SEP, PcbExtBuffer.GetData() ); + wxGetCwd().GetData(), DIR_SEP, + PcbExtBuffer.GetData() ); SetTitle( GetScreen()->m_FileName ); ReCreateLayerBox( NULL ); break; case ID_SAVE_BOARD: - case ID_MENU_SAVE_BOARD: SavePcbFile( GetScreen()->m_FileName ); break; - case ID_MENU_SAVE_BOARD_AS: + case ID_SAVE_BOARD_AS: SavePcbFile( wxEmptyString ); break; @@ -131,27 +128,24 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event ) } -/*******************************************************************************/ -int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append ) -/*******************************************************************************/ - /** * Read a board file * @param FullFileName = file name. If empty, a file name will be asked * @return 0 if fails or abort, 1 if OK */ +bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append ) { int ii; FILE* source; wxString msg; - char cbuf[1024]; + char cbuf[1024]; ActiveScreen = GetScreen(); - if( GetScreen()->IsModify() && !Append ) + if( GetScreen()->IsModify() && !Append ) { if( !IsOK( this, _( "Board Modified: Continue ?" ) ) ) - return 0; + return false; } m_SelTrackWidthBox_Changed = TRUE; @@ -169,20 +163,16 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append ) if( FullFileName == wxEmptyString ) { - msg = wxT( "*" ) + PcbExtBuffer; - fileName = - EDA_FileSelector( _( "Open Board File:" ), - wxEmptyString, /* Chemin par defaut */ - GetScreen()->m_FileName, /* nom fichier par defaut */ - PcbExtBuffer, /* extension par defaut */ - msg, /* Masque d'affichage */ - this, - wxFD_OPEN, - FALSE - ); + wxFileName fn = GetScreen()->m_FileName; - if( fileName == wxEmptyString ) - return FALSE; + wxFileDialog dlg( this, _( "Open Board File" ), wxEmptyString, + fn.GetFullName(), PcbFileWildcard, + wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + + if( dlg.ShowModal() == wxID_CANCEL ) + return false; + + fileName = dlg.GetPath(); } else fileName = FullFileName; @@ -198,9 +188,10 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append ) source = wxFopen( GetScreen()->m_FileName, wxT( "rt" ) ); if( source == NULL ) { - msg.Printf( _( "File <%s> not found" ), GetScreen()->m_FileName.GetData() ); + msg.Printf( _( "File <%s> not found" ), + GetScreen()->m_FileName.GetData() ); DisplayError( this, msg ); - return 0; + return false; } @@ -210,18 +201,21 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append ) { fclose( source ); DisplayError( this, wxT( "Unknown file type" ) ); - return 0; + return false; } int ver; sscanf(cbuf, "PCBNEW-BOARD Version %d date", &ver ); if ( ver > g_CurrentVersionPCB ) { - DisplayInfoMessage( this, _( "This file was created by a more recent version of PCBnew and may not load correctly. Please consider updating!")); + DisplayInfoMessage( this, _( "This file was created by a more recent \ +version of PCBnew and may not load correctly. Please consider updating!")); } else if ( ver < g_CurrentVersionPCB ) { - DisplayInfoMessage( this, _( "This file was created by an older version of PCBnew. It will be stored in the new file format when you save this file again.")); + DisplayInfoMessage( this, _( "This file was created by an older \ +version of PCBnew. It will be stored in the new file format when you save \ +this file again.")); } // Reload the corresponding configuration file: @@ -289,7 +283,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append ) GetBoard()->Show( 0, std::cout ); #endif - return 1; + return true; } @@ -348,13 +342,13 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName ) msg = _( "Warning: unable to create backup file " ) + backupFileName.GetFullPath(); DisplayError( this, msg, 15 ); - saveok = FALSE; + saveok = false; } } else { backupFileName.Clear(); - saveok = FALSE; + saveok = false; } /* Create the file */ @@ -364,7 +358,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName ) { msg = _( "Unable to create " ) + pcbFileName.GetFullPath(); DisplayError( this, msg ); - saveok = FALSE; + saveok = false; } if( dest ) @@ -395,5 +389,5 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName ) g_SaveTime = time( NULL ); /* Reset timer for the automatic saving */ GetScreen()->ClrModify(); - return TRUE; + return true; } diff --git a/pcbnew/find.cpp b/pcbnew/find.cpp index c78e1992df..64fee87f19 100644 --- a/pcbnew/find.cpp +++ b/pcbnew/find.cpp @@ -19,7 +19,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" -#include "id.h" +#include "pcbnew_id.h" #include "protos.h" diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index 71266d92a9..c70a2c1dcc 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -6,7 +6,7 @@ #include "common.h" #include "pcbnew.h" #include "wxPcbStruct.h" -#include "id.h" +#include "pcbnew_id.h" #include "class_drawpanel.h" #include "confirm.h" diff --git a/pcbnew/ioascii.cpp b/pcbnew/ioascii.cpp index 19a58240f5..56f46d8c4c 100644 --- a/pcbnew/ioascii.cpp +++ b/pcbnew/ioascii.cpp @@ -23,7 +23,7 @@ #include "cvpcb.h" #endif -#include "id.h" +#include "pcbnew_id.h" /* Format des structures de sauvegarde type ASCII : diff --git a/pcbnew/menubarmodedit.cpp b/pcbnew/menubarmodedit.cpp index 9a47bd39e5..9ea23023ee 100644 --- a/pcbnew/menubarmodedit.cpp +++ b/pcbnew/menubarmodedit.cpp @@ -10,7 +10,7 @@ #include "bitmaps.h" #include "protos.h" -#include "id.h" +#include "pcbnew_id.h" diff --git a/pcbnew/menubarpcb.cpp b/pcbnew/menubarpcb.cpp index fd6ec850cf..99e15fae85 100644 --- a/pcbnew/menubarpcb.cpp +++ b/pcbnew/menubarpcb.cpp @@ -9,7 +9,7 @@ #include "bitmaps.h" #include "protos.h" #include "hotkeys.h" -#include "id.h" +#include "pcbnew_id.h" /***********************************************/ void WinEDA_PcbFrame::ReCreateMenuBar() @@ -30,19 +30,19 @@ void WinEDA_PcbFrame::ReCreateMenuBar() wxMenu* filesMenu = new wxMenu; // New board - item = new wxMenuItem( filesMenu, ID_MENU_NEW_BOARD, _( "&New Board" ), + item = new wxMenuItem( filesMenu, ID_NEW_BOARD, _( "&New Board" ), _( "Clear old board and initialize a new one" ) ); item->SetBitmap( new_xpm ); filesMenu->Append( item ); // Load board - item = new wxMenuItem( filesMenu, ID_MENU_LOAD_FILE, _( "&Load Board" ), + item = new wxMenuItem( filesMenu, ID_LOAD_FILE, _( "&Load Board" ), _( "Delete old board and load new board" ) ); item->SetBitmap( open_xpm ); filesMenu->Append( item ); // Append board - item = new wxMenuItem( filesMenu, ID_MENU_APPEND_FILE, _( "Append Board" ), + item = new wxMenuItem( filesMenu, ID_APPEND_FILE, _( "Append Board" ), _( "Add board to old board" ) ); item->SetBitmap( import_xpm ); filesMenu->Append( item ); @@ -61,12 +61,12 @@ void WinEDA_PcbFrame::ReCreateMenuBar() // Add save menu filesMenu->AppendSeparator(); - item = new wxMenuItem( filesMenu, ID_MENU_SAVE_BOARD, + item = new wxMenuItem( filesMenu, ID_SAVE_BOARD, _( "&Save Board\tCtrl-S" ), _( "Save current board" ) ); item->SetBitmap( save_xpm ); filesMenu->Append( item ); - item = new wxMenuItem( filesMenu, ID_MENU_SAVE_BOARD_AS, + item = new wxMenuItem( filesMenu, ID_SAVE_BOARD_AS, _( "Save Board as..." ), _( "Save current board as.." ) ); item->SetBitmap( save_as_xpm ); diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index c8cbed0fca..5c81c5c3ae 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -9,7 +9,7 @@ #include "gestfich.h" #include "appl_wxstruct.h" #include "bitmaps.h" -#include "id.h" +#include "pcbnew_id.h" #include "trigo.h" #include "3d_viewer.h" @@ -199,11 +199,11 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event ) Close( true ); break; - case ID_LIBEDIT_SELECT_CURRENT_LIB: + case ID_MODEDIT_SELECT_CURRENT_LIB: Select_Active_Library(); break; - case ID_LIBEDIT_DELETE_PART: + case ID_MODEDIT_DELETE_PART: { wxFileName fn = wxFileName( wxEmptyString, m_CurrentLib, ModuleFileExtension ); @@ -418,10 +418,10 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event ) } break; - case ID_LINE_COMMENT_BUTT: + case ID_PCB_ADD_LINE_BUTT: case ID_PCB_ARC_BUTT: case ID_PCB_CIRCLE_BUTT: - case ID_TEXT_COMMENT_BUTT: + case ID_PCB_ADD_TEXT_BUTT: SetToolID( id, wxCURSOR_PENCIL, _( "Add Drawing" ) ); break; diff --git a/pcbnew/modedit_onclick.cpp b/pcbnew/modedit_onclick.cpp index ba024847d3..39ff3b6a1e 100644 --- a/pcbnew/modedit_onclick.cpp +++ b/pcbnew/modedit_onclick.cpp @@ -14,7 +14,7 @@ #include "bitmaps.h" #include "protos.h" -#include "id.h" +#include "pcbnew_id.h" /*************************************************************************/ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) @@ -79,7 +79,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) case ID_PCB_CIRCLE_BUTT: case ID_PCB_ARC_BUTT: - case ID_LINE_COMMENT_BUTT: + case ID_PCB_ADD_LINE_BUTT: if( !DrawStruct || DrawStruct->m_Flags == 0 ) { int shape = S_SEGMENT; @@ -145,7 +145,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) } break; - case ID_TEXT_COMMENT_BUTT: + case ID_PCB_ADD_TEXT_BUTT: SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT ); CreateTextModule( GetBoard()->m_Modules, DC ); break; @@ -353,7 +353,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, PopMenu->AppendSeparator(); if( append_set_width - || ( m_ID_current_state && ( (m_ID_current_state == ID_LINE_COMMENT_BUTT) + || ( m_ID_current_state && ( (m_ID_current_state == ID_PCB_ADD_LINE_BUTT) || (m_ID_current_state == ID_PCB_CIRCLE_BUTT) || (m_ID_current_state == ID_PCB_ARC_BUTT) ) ) ) { @@ -425,7 +425,7 @@ void WinEDA_ModuleEditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) break; // end case 0 - case ID_LINE_COMMENT_BUTT: + case ID_PCB_ADD_LINE_BUTT: { if( DrawStruct && (DrawStruct->m_Flags & IS_NEW) ) { diff --git a/pcbnew/modeditoptions.cpp b/pcbnew/modeditoptions.cpp index 7d6f99709c..c93c0a77aa 100644 --- a/pcbnew/modeditoptions.cpp +++ b/pcbnew/modeditoptions.cpp @@ -16,7 +16,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" -#include "id.h" +#include "pcbnew_id.h" #include "protos.h" diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp index 43348583c7..9af30d6b37 100644 --- a/pcbnew/moduleframe.cpp +++ b/pcbnew/moduleframe.cpp @@ -15,7 +15,7 @@ #include "wxPcbStruct.h" #include "bitmaps.h" #include "protos.h" -#include "id.h" +#include "pcbnew_id.h" #include "3d_viewer.h" @@ -37,11 +37,11 @@ BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, WinEDA_BasePcbFrame ) EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_ModuleEditFrame::OnZoom ) - EVT_TOOL( ID_LIBEDIT_SELECT_CURRENT_LIB, + EVT_TOOL( ID_MODEDIT_SELECT_CURRENT_LIB, WinEDA_ModuleEditFrame::Process_Special_Functions ) EVT_TOOL( ID_MODEDIT_SAVE_LIBMODULE, WinEDA_ModuleEditFrame::Process_Special_Functions ) - EVT_TOOL( ID_LIBEDIT_DELETE_PART, + EVT_TOOL( ID_MODEDIT_DELETE_PART, WinEDA_ModuleEditFrame::Process_Special_Functions ) EVT_TOOL( ID_MODEDIT_NEW_MODULE, WinEDA_ModuleEditFrame::Process_Special_Functions ) @@ -84,9 +84,9 @@ BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, WinEDA_BasePcbFrame ) WinEDA_ModuleEditFrame::Process_Special_Functions ) EVT_TOOL( ID_PCB_CIRCLE_BUTT, WinEDA_ModuleEditFrame::Process_Special_Functions ) - EVT_TOOL( ID_TEXT_COMMENT_BUTT, + EVT_TOOL( ID_PCB_ADD_TEXT_BUTT, WinEDA_ModuleEditFrame::Process_Special_Functions ) - EVT_TOOL( ID_LINE_COMMENT_BUTT, + EVT_TOOL( ID_PCB_ADD_LINE_BUTT, WinEDA_ModuleEditFrame::Process_Special_Functions ) EVT_TOOL( ID_MODEDIT_DELETE_ITEM_BUTT, WinEDA_ModuleEditFrame::Process_Special_Functions ) @@ -102,9 +102,9 @@ BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, WinEDA_BasePcbFrame ) WinEDA_ModuleEditFrame::ToolOnRightClick ) EVT_TOOL_RCLICKED( ID_PCB_ARC_BUTT, WinEDA_ModuleEditFrame::ToolOnRightClick ) - EVT_TOOL_RCLICKED( ID_TEXT_COMMENT_BUTT, + EVT_TOOL_RCLICKED( ID_PCB_ADD_TEXT_BUTT, WinEDA_ModuleEditFrame::ToolOnRightClick ) - EVT_TOOL_RCLICKED( ID_LINE_COMMENT_BUTT, + EVT_TOOL_RCLICKED( ID_PCB_ADD_LINE_BUTT, WinEDA_ModuleEditFrame::ToolOnRightClick ) EVT_TOOL_RCLICKED( ID_PCB_COTATION_BUTT, WinEDA_ModuleEditFrame::ToolOnRightClick ) @@ -250,7 +250,7 @@ void WinEDA_ModuleEditFrame::SetToolbars() islib = false; m_HToolBar->EnableTool( ID_MODEDIT_SAVE_LIBMODULE, islib ); - m_HToolBar->EnableTool( ID_LIBEDIT_DELETE_PART, islib ); + m_HToolBar->EnableTool( ID_MODEDIT_DELETE_PART, islib ); if( GetBoard()->m_Modules == NULL ) active = false; @@ -310,10 +310,10 @@ void WinEDA_ModuleEditFrame::SetToolbars() if( m_VToolBar ) { m_VToolBar->EnableTool( ID_MODEDIT_ADD_PAD, active ); - m_VToolBar->EnableTool( ID_LINE_COMMENT_BUTT, active ); + m_VToolBar->EnableTool( ID_PCB_ADD_LINE_BUTT, active ); m_VToolBar->EnableTool( ID_PCB_CIRCLE_BUTT, active ); m_VToolBar->EnableTool( ID_PCB_ARC_BUTT, active ); - m_VToolBar->EnableTool( ID_TEXT_COMMENT_BUTT, active ); + m_VToolBar->EnableTool( ID_PCB_ADD_TEXT_BUTT, active ); m_VToolBar->EnableTool( ID_MODEDIT_PLACE_ANCHOR, active ); m_VToolBar->EnableTool( ID_PCB_DELETE_ITEM_BUTT, active ); } diff --git a/pcbnew/move_or_drag_track.cpp b/pcbnew/move_or_drag_track.cpp index bdcd9bd464..4b8b5e4fd0 100644 --- a/pcbnew/move_or_drag_track.cpp +++ b/pcbnew/move_or_drag_track.cpp @@ -13,7 +13,7 @@ #include "trigo.h" #include "drag.h" -#include "id.h" +#include "pcbnew_id.h" #include "protos.h" diff --git a/pcbnew/muwave_command.cpp b/pcbnew/muwave_command.cpp index fa32a490e7..36c15b2f64 100644 --- a/pcbnew/muwave_command.cpp +++ b/pcbnew/muwave_command.cpp @@ -9,7 +9,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" -#include "id.h" +#include "pcbnew_id.h" #include "protos.h" diff --git a/pcbnew/onleftclick.cpp b/pcbnew/onleftclick.cpp index f31ab09d4f..aeff993606 100644 --- a/pcbnew/onleftclick.cpp +++ b/pcbnew/onleftclick.cpp @@ -11,7 +11,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" -#include "id.h" +#include "pcbnew_id.h" @@ -167,7 +167,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) case ID_PCB_CIRCLE_BUTT: case ID_PCB_ARC_BUTT: - case ID_LINE_COMMENT_BUTT: + case ID_PCB_ADD_LINE_BUTT: { int shape = S_SEGMENT; if( m_ID_current_state == ID_PCB_CIRCLE_BUTT ) @@ -244,7 +244,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) DisplayError( this, wxT( "Edit: zone internal error" ) ); break; - case ID_TEXT_COMMENT_BUTT: + case ID_PCB_ADD_TEXT_BUTT: if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) ) { SetCurItem( Create_Texte_Pcb( DC ) ); @@ -436,7 +436,7 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) } break; - case ID_LINE_COMMENT_BUTT: + case ID_PCB_ADD_LINE_BUTT: case ID_PCB_ARC_BUTT: case ID_PCB_CIRCLE_BUTT: if( DrawStruct == NULL ) diff --git a/pcbnew/onrightclick.cpp b/pcbnew/onrightclick.cpp index c001dd76f7..850d46415d 100644 --- a/pcbnew/onrightclick.cpp +++ b/pcbnew/onrightclick.cpp @@ -13,7 +13,7 @@ #include "wxPcbStruct.h" //#include "autorout.h" -#include "id.h" +#include "pcbnew_id.h" #include "hotkeys.h" #include "collectors.h" @@ -303,8 +303,8 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) case ID_PCB_CIRCLE_BUTT: case ID_PCB_ARC_BUTT: - case ID_TEXT_COMMENT_BUTT: - case ID_LINE_COMMENT_BUTT: + case ID_PCB_ADD_TEXT_BUTT: + case ID_PCB_ADD_LINE_BUTT: case ID_PCB_COTATION_BUTT: ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_NO_CU_LAYER, _( "Select Working Layer" ), select_w_layer_xpm ); diff --git a/pcbnew/pcbcfg.cpp b/pcbnew/pcbcfg.cpp index c165efcf9f..64816f879a 100644 --- a/pcbnew/pcbcfg.cpp +++ b/pcbnew/pcbcfg.cpp @@ -15,7 +15,7 @@ #include "pcbplot.h" #include "pcbcfg.h" #include "worksheet.h" -#include "id.h" +#include "pcbnew_id.h" #include "hotkeys.h" #include "protos.h" #include "dialog_copper_layers_setup.h" diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 1147395a3a..48f32f57db 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -12,7 +12,7 @@ #include "collectors.h" #include "bitmaps.h" #include "protos.h" -#include "id.h" +#include "pcbnew_id.h" #include "drc_stuff.h" #include "3d_viewer.h" #include "kbool/include/kbool/booleng.h" @@ -52,11 +52,11 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) // Menu Files: EVT_MENU( ID_MAIN_MENUBAR, WinEDA_PcbFrame::Process_Special_Functions ) - EVT_MENU( ID_MENU_LOAD_FILE, WinEDA_PcbFrame::Files_io ) - EVT_MENU( ID_MENU_NEW_BOARD, WinEDA_PcbFrame::Files_io ) - EVT_MENU( ID_MENU_SAVE_BOARD, WinEDA_PcbFrame::Files_io ) - EVT_MENU( ID_MENU_APPEND_FILE, WinEDA_PcbFrame::Files_io ) - EVT_MENU( ID_MENU_SAVE_BOARD_AS, WinEDA_PcbFrame::Files_io ) + EVT_MENU( ID_LOAD_FILE, WinEDA_PcbFrame::Files_io ) + EVT_MENU( ID_NEW_BOARD, WinEDA_PcbFrame::Files_io ) + EVT_MENU( ID_SAVE_BOARD, WinEDA_PcbFrame::Files_io ) + EVT_MENU( ID_APPEND_FILE, WinEDA_PcbFrame::Files_io ) + EVT_MENU( ID_SAVE_BOARD_AS, WinEDA_PcbFrame::Files_io ) EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, WinEDA_PcbFrame::OnFileHistory ) EVT_MENU( ID_GEN_PLOT, WinEDA_PcbFrame::ToPlotter ) @@ -168,8 +168,8 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) EVT_TOOL( ID_PCB_MIRE_BUTT, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_PCB_ARC_BUTT, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_PCB_CIRCLE_BUTT, WinEDA_PcbFrame::Process_Special_Functions ) - EVT_TOOL( ID_TEXT_COMMENT_BUTT, WinEDA_PcbFrame::Process_Special_Functions ) - EVT_TOOL( ID_LINE_COMMENT_BUTT, WinEDA_PcbFrame::Process_Special_Functions ) + EVT_TOOL( ID_PCB_ADD_TEXT_BUTT, WinEDA_PcbFrame::Process_Special_Functions ) + EVT_TOOL( ID_PCB_ADD_LINE_BUTT, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_PCB_COTATION_BUTT, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_PCB_DELETE_ITEM_BUTT, WinEDA_PcbFrame::Process_Special_Functions ) @@ -184,8 +184,8 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) EVT_TOOL_RCLICKED( ID_TRACK_BUTT, WinEDA_PcbFrame::ToolOnRightClick ) EVT_TOOL_RCLICKED( ID_PCB_CIRCLE_BUTT, WinEDA_PcbFrame::ToolOnRightClick ) EVT_TOOL_RCLICKED( ID_PCB_ARC_BUTT, WinEDA_PcbFrame::ToolOnRightClick ) - EVT_TOOL_RCLICKED( ID_TEXT_COMMENT_BUTT, WinEDA_PcbFrame::ToolOnRightClick ) - EVT_TOOL_RCLICKED( ID_LINE_COMMENT_BUTT, WinEDA_PcbFrame::ToolOnRightClick ) + EVT_TOOL_RCLICKED( ID_PCB_ADD_TEXT_BUTT, WinEDA_PcbFrame::ToolOnRightClick ) + EVT_TOOL_RCLICKED( ID_PCB_ADD_LINE_BUTT, WinEDA_PcbFrame::ToolOnRightClick ) EVT_TOOL_RCLICKED( ID_PCB_COTATION_BUTT, WinEDA_PcbFrame::ToolOnRightClick ) EVT_MENU_RANGE( ID_POPUP_PCB_AUTOPLACE_START_RANGE, @@ -199,7 +199,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE, WinEDA_PcbFrame::Process_Special_Functions ) -EVT_MENU_RANGE( ID_POPUP_VIA_EDIT_START_RANGE, ID_POPUP_VIA_EDIT_END_RANGE, + EVT_MENU_RANGE( ID_POPUP_VIA_EDIT_START_RANGE, ID_POPUP_VIA_EDIT_END_RANGE, WinEDA_PcbFrame::Via_Edit_Control ) // PopUp Menus pour Zooms traites dans drawpanel.cpp diff --git a/pcbnew/pcbnew_id.h b/pcbnew/pcbnew_id.h new file mode 100644 index 0000000000..f6697b3b47 --- /dev/null +++ b/pcbnew/pcbnew_id.h @@ -0,0 +1,289 @@ +#ifndef __PCBNEW_ID_H__ +#define __PCBNEW_ID_H__ + +#include "id.h" + +/** + * Command IDs for the printed circuit board editor. + * + * Please add IDs that are unique to the printed circuit board editor (PCBNew) + * here and not in the global id.h file. This will prevent the entire project + * from being rebuilt when adding new commands to the PCBNew. + */ + +enum pcbnew_ids +{ + ID_MAIN_MENUBAR = ID_END_LIST, + ID_OPEN_MODULE_EDITOR, + ID_UNNUSED_BUTT, + ID_READ_NETLIST, + ID_PCB_CIRCLE_BUTT, + ID_PCB_ARC_BUTT, + ID_PCB_HIGHLIGHT_BUTT, + ID_PCB_MIRE_BUTT, + ID_PCB_SHOW_1_RATSNEST_BUTT, + ID_PCB_PLACE_OFFSET_COORD_BUTT, + ID_PCB_COPPER_LAYERS_SETUP, + ID_PCB_ADD_LINE_BUTT, + ID_PCB_ADD_TEXT_BUTT, + + ID_POPUP_PCB_START_RANGE, + ID_POPUP_PCB_MOVE_MODULE_REQUEST, + ID_POPUP_PCB_DRAG_MODULE_REQUEST, + ID_POPUP_PCB_EDIT_MODULE, + ID_POPUP_PCB_CHANGE_SIDE_MODULE, + ID_POPUP_PCB_DELETE_MODULE, + ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE, + ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE, + + ID_POPUP_PCB_EDIT_PAD, + ID_POPUP_PCB_EDIT_MORE_PAD, + ID_POPUP_PCB_EDIT_PADS_ON_MODULE, + ID_POPUP_PCB_DELETE_PAD, + ID_POPUP_PCB_ADD_PAD, + ID_POPUP_PCB_NEWSIZE_PAD, + ID_POPUP_PCB_ROTATE_PAD, + ID_POPUP_PCB_MOVE_PAD_REQUEST, + ID_POPUP_PCB_DRAG_PAD_REQUEST, + + ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST, + ID_POPUP_PCB_ROTATE_TEXTMODULE, + ID_POPUP_PCB_EDIT_TEXTMODULE, + ID_POPUP_PCB_DELETE_TEXTMODULE, + + ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST, + ID_POPUP_PCB_ROTATE_TEXTEPCB, + ID_POPUP_PCB_EDIT_TEXTEPCB, + ID_POPUP_PCB_DELETE_TEXTEPCB, + + ID_POPUP_PCB_MOVE_DRAWING_REQUEST, + ID_POPUP_PCB_EDIT_DRAWING, + ID_POPUP_PCB_DELETE_DRAWING, + ID_POPUP_PCB_DELETE_DRAWING_LAYER, + ID_POPUP_PCB_END_LINE, + + ID_POPUP_PCB_EDIT_TRACK, + ID_POPUP_PCB_DELETE_TRACK, + ID_POPUP_PCB_DELETE_TRACKNET, + ID_POPUP_PCB_DELETE_TRACK_MNU, + + ID_POPUP_PCB_MOVE_ZONE_CORNER, + ID_POPUP_PCB_ADD_ZONE_CORNER, + ID_POPUP_PCB_DELETE_ZONE_CORNER, + ID_POPUP_PCB_PLACE_ZONE_CORNER, + ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER, + ID_POPUP_PCB_EDIT_ZONE_PARAMS, + ID_POPUP_PCB_DELETE_ZONE, + ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE, + ID_POPUP_PCB_FILL_ALL_ZONES, + ID_POPUP_PCB_FILL_ZONE, + ID_POPUP_PCB_DELETE_ZONE_CONTAINER, + ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE, + ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE, + ID_POPUP_PCB_DELETE_ZONE_CUTOUT, + ID_POPUP_PCB_MOVE_ZONE_OUTLINES, + ID_POPUP_PCB_PLACE_ZONE_OUTLINES, + ID_POPUP_PCB_DRAG_ZONE_OUTLINE_SEGMENT, + ID_POPUP_PCB_PLACE_DRAGGED_ZONE_OUTLINE_SEGMENT, + ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES, + ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE, + + ID_POPUP_PCB_DELETE_MARKER, + ID_POPUP_PCB_DELETE_COTATION, + + ID_POPUP_PCB_MOVE_MIRE_REQUEST, + ID_POPUP_PCB_DELETE_MIRE, + ID_POPUP_PCB_EDIT_MIRE, + + ID_POPUP_PCB_STOP_CURRENT_DRAWING, + + ID_POPUP_PCB_EDIT_COTATION, + ID_POPUP_PCB_END_TRACK, + ID_POPUP_PCB_PLACE_VIA, + ID_POPUP_PCB_PLACE_MICROVIA, + + ID_POPUP_PCB_IMPORT_PAD_SETTINGS, + ID_POPUP_PCB_EXPORT_PAD_SETTINGS, + + ID_POPUP_PCB_SELECT_WIDTH, + ID_POPUP_PCB_SELECT_AUTO_WIDTH, + ID_POPUP_PCB_SELECT_WIDTH1, + ID_POPUP_PCB_SELECT_WIDTH2, + ID_POPUP_PCB_SELECT_WIDTH3, + ID_POPUP_PCB_SELECT_WIDTH4, + ID_POPUP_PCB_SELECT_WIDTH5, + ID_POPUP_PCB_SELECT_WIDTH6, + ID_POPUP_PCB_SELECT_WIDTH7, + ID_POPUP_PCB_SELECT_WIDTH8, + ID_POPUP_PCB_EDIT_TRACKSEG, + ID_POPUP_PCB_EDIT_TRACK_MNU, + ID_POPUP_PCB_EDIT_NET, + ID_POPUP_PCB_SELECT_LAYER, + ID_POPUP_PCB_SELECT_CU_LAYER, + ID_POPUP_PCB_SELECT_NO_CU_LAYER, + ID_POPUP_PCB_SELECT_LAYER_PAIR, + ID_POPUP_PCB_EDIT_EDGE, + ID_POPUP_PCB_DELETE_EDGE, + ID_POPUP_PCB_MOVE_EDGE, + ID_POPUP_PCB_PLACE_EDGE, + ID_POPUP_PCB_END_EDGE, + ID_POPUP_PCB_LOCK_ON_TRACKSEG, + ID_POPUP_PCB_LOCK_OFF_TRACKSEG, + ID_POPUP_PCB_LOCK_ON_TRACK, + ID_POPUP_PCB_LOCK_OFF_TRACK, + ID_POPUP_PCB_LOCK_ON_NET, + ID_POPUP_PCB_LOCK_OFF_NET, + ID_POPUP_PCB_SETFLAGS_TRACK_MNU, + + ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER, + ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER_DATA, + ID_POPUP_PCB_EDIT_WIDTH_CURRENT_EDGE, + ID_POPUP_PCB_EDIT_WIDTH_ALL_EDGE, + ID_POPUP_PCB_EDIT_LAYER_CURRENT_EDGE, + ID_POPUP_PCB_EDIT_LAYER_ALL_EDGE, + ID_POPUP_PCB_ENTER_EDGE_WIDTH, + ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS, + ID_POPUP_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE, + ID_POPUP_PCB_EDIT_ALL_VIAS_SIZE, + ID_POPUP_PCB_EDIT_ALL_TRACK_SIZE, + ID_POPUP_PCB_DISPLAY_FOOTPRINT_DOC, + ID_POPUP_PCB_MOVE_TRACK_NODE, + ID_POPUP_PCB_BREAK_TRACK, + ID_POPUP_PCB_PLACE_MOVED_TRACK_NODE, + ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE, + ID_POPUP_PCB_DRAG_TRACK_SEGMENT, + ID_POPUP_PCB_MOVE_TRACK_SEGMENT, + ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST, + ID_POPUP_PCB_GETINFO_MARKER, + ID_POPUP_PCB_END_RANGE, + + // Via edition + ID_POPUP_VIA_EDIT_START_RANGE, + ID_POPUP_PCB_SELECT_VIASIZE, + ID_POPUP_PCB_SELECT_VIASIZE1, + ID_POPUP_PCB_SELECT_VIASIZE2, + ID_POPUP_PCB_SELECT_VIASIZE3, + ID_POPUP_PCB_SELECT_VIASIZE4, + ID_POPUP_PCB_SELECT_VIASIZE5, + ID_POPUP_PCB_SELECT_VIASIZE6, + ID_POPUP_PCB_SELECT_VIASIZE7, + ID_POPUP_PCB_SELECT_VIASIZE8, + ID_POPUP_PCB_VIA_EDITING, + ID_POPUP_PCB_VIA_HOLE_TO_DEFAULT, + ID_POPUP_PCB_VIA_HOLE_TO_VALUE, + ID_POPUP_PCB_VIA_HOLE_ENTER_VALUE, + ID_POPUP_PCB_VIA_HOLE_EXPORT, + ID_POPUP_PCB_VIA_HOLE_RESET_TO_DEFAULT, + ID_POPUP_PCB_VIA_HOLE_EXPORT_TO_OTHERS, + ID_POPUP_VIA_EDIT_END_RANGE, + + // reserve a block of MAX_ITEMS_IN_PICKER ids for the item selection popup + ID_POPUP_PCB_ITEM_SELECTION_START, + ID_POPUP_PCB_ITEM_SELECTION_END = MAX_ITEMS_IN_PICKER + ID_POPUP_PCB_ITEM_SELECTION_START, + ID_POPUP_PCB_AUTOPLACE_START_RANGE, + ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, + ID_POPUP_PCB_AUTOPLACE_FREE_MODULE, + ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES, + ID_POPUP_PCB_AUTOPLACE_FIXE_ALL_MODULES, + ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE, + ID_POPUP_PCB_AUTOMOVE_ALL_MODULES, + ID_POPUP_PCB_AUTOMOVE_NEW_MODULES, + ID_POPUP_PCB_AUTOPLACE_COMMANDS, + + ID_POPUP_PCB_REORIENT_ALL_MODULES, + + ID_POPUP_PCB_AUTOPLACE_ALL_MODULES, + ID_POPUP_PCB_AUTOPLACE_NEW_MODULES, + ID_POPUP_PCB_AUTOPLACE_NEXT_MODULE, + + ID_POPUP_PCB_AUTOPLACE_UNUSED0, + ID_POPUP_PCB_AUTOPLACE_UNUSED1, + ID_POPUP_PCB_AUTOPLACE_UNUSED2, + ID_POPUP_PCB_AUTOPLACE_UNUSED3, + + ID_POPUP_PCB_AUTOROUTE_COMMANDS, + ID_POPUP_PCB_AUTOROUTE_ALL_MODULES, + ID_POPUP_PCB_AUTOROUTE_MODULE, + ID_POPUP_PCB_AUTOROUTE_PAD, + ID_POPUP_PCB_AUTOROUTE_NET, + + ID_POPUP_PCB_AUTOROUTE_RESET_UNROUTED, + ID_POPUP_PCB_AUTOROUTE_SELECT_LAYERS, + ID_POPUP_PCB_AUTOPLACE_END_RANGE, + + ID_MENU_RECOVER_BOARD, + ID_MENU_READ_LAST_SAVED_VERSION_BOARD, + ID_MENU_ARCHIVE_MODULES, + ID_MENU_ARCHIVE_NEW_MODULES, + ID_MENU_ARCHIVE_ALL_MODULES, + ID_MENU_MICELLANOUS, + ID_MENU_LIST_NETS, + ID_MENU_PCB_CLEAN, + ID_MENU_PCB_SWAP_LAYERS, + + ID_TOOLBARH_PCB_AUTOPLACE, + ID_TOOLBARH_PCB_AUTOROUTE, + ID_TOOLBARH_PCB_FREEROUTE_ACCESS, + + ID_AUX_TOOLBAR_PCB_VIA_SIZE, + ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, + ID_AUX_TOOLBAR_PCB_CLR_WIDTH, + ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, + ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, + ID_AUX_TOOLBAR_PCB_UNUSED3, + ID_AUX_TOOLBAR_PCB_UNUSED4, + ID_AUX_TOOLBAR_PCB_UNUSED5, + ID_AUX_TOOLBAR_PCB_UNUSED6, + ID_AUX_TOOLBAR_PCB_UNUSED7, + + ID_PCB_GEN_POS_MODULES_FILE, + ID_PCB_GEN_DRILL_FILE, + + ID_PCB_PAD_SETUP, + + ID_PCB_COTATION_BUTT, + ID_PCB_DRAWINGS_WIDTHS_SETUP, + + ID_PCB_GEN_CMP_FILE, + ID_MENU_PCB_SHOW_3D_FRAME, + ID_PCB_USER_GRID_SETUP, + ID_PCB_GEN_BOM_FILE_FROM_BOARD, + ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG, + + ID_MODEDIT_CHECK, + ID_MODEDIT_SELECT_CURRENT_LIB, + ID_MODEDIT_SAVE_LIBMODULE, + ID_MODEDIT_DELETE_PART, + ID_MODEDIT_NEW_MODULE, + ID_MODEDIT_SHEET_SET, + ID_MODEDIT_LOAD_MODULE, + ID_MODEDIT_ADD_PAD, + ID_MODEDIT_PLACE_ANCHOR, + ID_MODEDIT_DELETE_ITEM_BUTT, + ID_MODEDIT_PAD_SETTINGS, + ID_MODEDIT_LOAD_MODULE_FROM_BOARD, + ID_MODEDIT_INSERT_MODULE_IN_BOARD, + ID_MODEDIT_UPDATE_MODULE_IN_BOARD, + ID_MODEDIT_EDIT_MODULE_PROPERTIES, + ID_MODEDIT_TRANSFORM_MODULE, + ID_MODEDIT_MODULE_ROTATE, + ID_MODEDIT_MODULE_MIRROR, + ID_MODEDIT_UNDO, + ID_MODEDIT_REDO, + ID_MODEDIT_IMPORT_PART, + ID_MODEDIT_EXPORT_PART, + ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART, + + ID_PCB_MUWAVE_START_CMD, + ID_PCB_MUWAVE_TOOL_DISPLAY_TOOLS, + ID_PCB_MUWAVE_TOOL_SELF_CMD, + ID_PCB_MUWAVE_TOOL_GAP_CMD, + ID_PCB_MUWAVE_TOOL_STUB_CMD, + ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD, + ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD, + ID_PCB_MUWAVE_END_CMD, + + ID_TOGGLE_PRESENT_COMMAND, +}; + +#endif /* __PCBNEW_IDS_H__ */ diff --git a/pcbnew/pcbplot.cpp b/pcbnew/pcbplot.cpp index bb0d3409fe..3eb4608207 100644 --- a/pcbnew/pcbplot.cpp +++ b/pcbnew/pcbplot.cpp @@ -12,7 +12,7 @@ #include "wxPcbStruct.h" #include "pcbplot.h" #include "worksheet.h" -#include "id.h" +#include "pcbnew_id.h" #include "protos.h" #define PLOT_DEFAULT_MARGE 300 // mils diff --git a/pcbnew/set_grid.cpp b/pcbnew/set_grid.cpp index 11b12cf613..eedcc193cc 100644 --- a/pcbnew/set_grid.cpp +++ b/pcbnew/set_grid.cpp @@ -15,7 +15,7 @@ #include "protos.h" #include -#include "id.h" +#include "pcbnew_id.h" #include "set_grid.h" diff --git a/pcbnew/tool_modedit.cpp b/pcbnew/tool_modedit.cpp index 279d3dc689..7aec9eb2df 100644 --- a/pcbnew/tool_modedit.cpp +++ b/pcbnew/tool_modedit.cpp @@ -12,7 +12,7 @@ #include "bitmaps.h" -#include "id.h" +#include "pcbnew_id.h" #include "hotkeys.h" @@ -37,7 +37,7 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar() SetToolBar( m_HToolBar ); // Set up toolbar - m_HToolBar->AddTool( ID_LIBEDIT_SELECT_CURRENT_LIB, wxEmptyString, + m_HToolBar->AddTool( ID_MODEDIT_SELECT_CURRENT_LIB, wxEmptyString, wxBitmap( open_library_xpm ), _( "Select working library" ) ); @@ -51,7 +51,7 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar() _( "Create new library and save current module" ) ); m_HToolBar->AddSeparator(); - m_HToolBar->AddTool( ID_LIBEDIT_DELETE_PART, wxEmptyString, + m_HToolBar->AddTool( ID_MODEDIT_DELETE_PART, wxEmptyString, wxBitmap( delete_xpm ), _( "Delete part in current library" ) ); @@ -159,7 +159,7 @@ void WinEDA_ModuleEditFrame::ReCreateVToolbar() _( "Add Pads" ), wxITEM_CHECK ); m_VToolBar->AddSeparator(); - m_VToolBar->AddTool( ID_LINE_COMMENT_BUTT, wxEmptyString, + m_VToolBar->AddTool( ID_PCB_ADD_LINE_BUTT, wxEmptyString, wxBitmap( add_polygon_xpm ), _( "Add graphic line or polygon" ), wxITEM_CHECK ); @@ -171,7 +171,7 @@ void WinEDA_ModuleEditFrame::ReCreateVToolbar() wxBitmap( add_arc_xpm ), _( "Add graphic arc" ), wxITEM_CHECK ); - m_VToolBar->AddTool( ID_TEXT_COMMENT_BUTT, wxEmptyString, + m_VToolBar->AddTool( ID_PCB_ADD_TEXT_BUTT, wxEmptyString, wxBitmap( add_text_xpm ), _( "Add Text" ), wxITEM_CHECK ); diff --git a/pcbnew/tool_onrightclick.cpp b/pcbnew/tool_onrightclick.cpp index 1b2c6fb33a..1e7753267c 100644 --- a/pcbnew/tool_onrightclick.cpp +++ b/pcbnew/tool_onrightclick.cpp @@ -8,7 +8,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" -#include "id.h" +#include "pcbnew_id.h" /*****************************************************************/ @@ -33,9 +33,9 @@ void WinEDA_PcbFrame::ToolOnRightClick( wxCommandEvent& event ) case ID_PCB_CIRCLE_BUTT: case ID_PCB_ARC_BUTT: - case ID_LINE_COMMENT_BUTT: + case ID_PCB_ADD_LINE_BUTT: case ID_PCB_COTATION_BUTT: - case ID_TEXT_COMMENT_BUTT: + case ID_PCB_ADD_TEXT_BUTT: InstallPcbOptionsFrame( pos, NULL, ID_PCB_DRAWINGS_WIDTHS_SETUP ); break; @@ -64,9 +64,9 @@ void WinEDA_ModuleEditFrame::ToolOnRightClick( wxCommandEvent& event ) case ID_PCB_CIRCLE_BUTT: case ID_PCB_ARC_BUTT: - case ID_LINE_COMMENT_BUTT: + case ID_PCB_ADD_LINE_BUTT: case ID_PCB_COTATION_BUTT: - case ID_TEXT_COMMENT_BUTT: + case ID_PCB_ADD_TEXT_BUTT: InstallOptionsFrame( pos ); break; diff --git a/pcbnew/tool_pcb.cpp b/pcbnew/tool_pcb.cpp index d162ddba88..f170289c37 100644 --- a/pcbnew/tool_pcb.cpp +++ b/pcbnew/tool_pcb.cpp @@ -10,7 +10,7 @@ #include "bitmaps.h" -#include "id.h" +#include "pcbnew_id.h" #ifdef __UNIX__ #define LISTBOX_WIDTH 140 @@ -443,7 +443,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar() _( "Add zones" ), wxITEM_CHECK ); m_VToolBar->AddSeparator(); - m_VToolBar->AddTool( ID_LINE_COMMENT_BUTT, wxEmptyString, + m_VToolBar->AddTool( ID_PCB_ADD_LINE_BUTT, wxEmptyString, wxBitmap( add_dashed_line_xpm ), _( "Add graphic line or polygon" ), wxITEM_CHECK ); @@ -455,7 +455,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar() wxBitmap( add_arc_xpm ), _( "Add graphic arc" ), wxITEM_CHECK ); - m_VToolBar->AddTool( ID_TEXT_COMMENT_BUTT, wxEmptyString, + m_VToolBar->AddTool( ID_PCB_ADD_TEXT_BUTT, wxEmptyString, wxBitmap( add_text_xpm ), _( "Add text" ), wxITEM_CHECK ); diff --git a/pcbnew/via_edit.cpp b/pcbnew/via_edit.cpp index 389acdea1b..1a2be9109f 100644 --- a/pcbnew/via_edit.cpp +++ b/pcbnew/via_edit.cpp @@ -8,7 +8,7 @@ #include "confirm.h" #include "pcbnew.h" #include "wxPcbStruct.h" -#include "id.h" +#include "pcbnew_id.h" /**********************************************************************************/ diff --git a/pcbnew/zones_by_polygon.cpp b/pcbnew/zones_by_polygon.cpp index b0fb4c547e..c0758daba7 100644 --- a/pcbnew/zones_by_polygon.cpp +++ b/pcbnew/zones_by_polygon.cpp @@ -12,7 +12,7 @@ #include "pcbnew.h" #include "wxPcbStruct.h" #include "zones.h" -#include "id.h" +#include "pcbnew_id.h" #include "protos.h" #include "zones_functions_for_undo_redo.h"