Commit 43d6c685 authored by stambaughw's avatar stambaughw

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.
parent dcc3463b
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "wx/dataobj.h" #include "wx/dataobj.h"
#include "wx/clipbrd.h" #include "wx/clipbrd.h"
#include "id.h"
#include "gestfich.h" #include "gestfich.h"
#include "3d_viewer.h" #include "3d_viewer.h"
...@@ -30,23 +29,6 @@ ...@@ -30,23 +29,6 @@
/* Tool and button Bitmaps */ /* Tool and button Bitmaps */
#include "bitmaps.h" #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 * Pcb3D_GLCanvas implementation
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#endif #endif
#include "bitmaps.h" #include "bitmaps.h"
#include "id.h"
#include "3d_viewer.h" #include "3d_viewer.h"
#include "trackball.h" #include "trackball.h"
......
...@@ -4,11 +4,8 @@ ...@@ -4,11 +4,8 @@
#include "fctsys.h" #include "fctsys.h"
#include "macros.h" #include "macros.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "id.h"
#include "3d_viewer.h" #include "3d_viewer.h"
......
...@@ -23,12 +23,68 @@ ...@@ -23,12 +23,68 @@
#include "pcbstruct.h" #include "pcbstruct.h"
#include "3d_struct.h" #include "3d_struct.h"
#include "id.h"
#define KICAD_DEFAULT_3D_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE|wxWANTS_CHARS #define KICAD_DEFAULT_3D_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE|wxWANTS_CHARS
#define LIB3D_PATH wxT("packages3d") #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 Pcb3D_GLCanvas;
class WinEDA3D_DrawFrame; class WinEDA3D_DrawFrame;
class Info_3D_Visu; class Info_3D_Visu;
......
...@@ -81,6 +81,8 @@ const wxString ModuleFileExtension( wxT( "mod" ) ); ...@@ -81,6 +81,8 @@ const wxString ModuleFileExtension( wxT( "mod" ) );
const wxString ModuleFileWildcard( const wxString ModuleFileWildcard(
_( "Kicad footprint library files (*.mod)|*.mod" ) _( "Kicad footprint library files (*.mod)|*.mod" )
); );
const wxString PcbFileWildcard(
_( "Printed circuit board files (*.brd)|*.brd" ) );
int g_CurrentVersionPCB = 1; int g_CurrentVersionPCB = 1;
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "common.h" #include "common.h"
#include "id.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h" #include "protos.h"
...@@ -33,8 +32,8 @@ COMPONENTS_LISTBOX::~COMPONENTS_LISTBOX() ...@@ -33,8 +32,8 @@ COMPONENTS_LISTBOX::~COMPONENTS_LISTBOX()
*/ */
BEGIN_EVENT_TABLE( COMPONENTS_LISTBOX, ITEMS_LISTBOX_BASE ) BEGIN_EVENT_TABLE( COMPONENTS_LISTBOX, ITEMS_LISTBOX_BASE )
EVT_SIZE( ITEMS_LISTBOX_BASE::OnSize ) EVT_SIZE( ITEMS_LISTBOX_BASE::OnSize )
EVT_CHAR( COMPONENTS_LISTBOX::OnChar ) EVT_CHAR( COMPONENTS_LISTBOX::OnChar )
END_EVENT_TABLE() END_EVENT_TABLE()
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "common.h" #include "common.h"
#include "id.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h" #include "protos.h"
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "confirm.h" #include "confirm.h"
#include "eda_doc.h" #include "eda_doc.h"
#include "gestfich.h" #include "gestfich.h"
#include "id.h"
#include "param_config.h" #include "param_config.h"
#include "bitmaps.h" #include "bitmaps.h"
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "common.h" #include "common.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "id.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "zones.h" #include "zones.h"
......
...@@ -17,10 +17,40 @@ class COMPONENTS_LISTBOX; ...@@ -17,10 +17,40 @@ class COMPONENTS_LISTBOX;
class WinEDA_DisplayFrame; class WinEDA_DisplayFrame;
/******************************************************/ #include "id.h"
/* classe derivee pour la Fenetre principale de cvpcb */
/******************************************************/
/**
* 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 class WinEDA_CvpcbFrame : public WinEDA_BasicFrame
{ {
public: public:
...@@ -241,7 +271,8 @@ public: ...@@ -241,7 +271,8 @@ public:
* @param aTypeCommand = command type (see enum UndoRedoOpType) * @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, virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
UndoRedoOpType aTypeCommand,
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) const wxPoint& aTransformPoint = wxPoint( 0, 0 ) )
{ {
// currently: do nothing in cvpcb. // currently: do nothing in cvpcb.
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "id.h"
#include "confirm.h" #include "confirm.h"
#include "macros.h" #include "macros.h"
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "confirm.h" #include "confirm.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "gestfich.h" #include "gestfich.h"
#include "id.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "cvpcb.h" #include "cvpcb.h"
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "common.h" #include "common.h"
#include "id.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h" #include "protos.h"
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
#include "bitmaps.h" #include "bitmaps.h"
#include "id.h"
/*******************************************/ /*******************************************/
void WinEDA_CvpcbFrame::ReCreateMenuBar() void WinEDA_CvpcbFrame::ReCreateMenuBar()
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "id.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "cvpcb.h" #include "cvpcb.h"
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "id.h"
#include "trigo.h" #include "trigo.h"
#include "bitmaps.h" #include "bitmaps.h"
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditfrm.h"
static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
...@@ -183,7 +184,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) ...@@ -183,7 +184,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC )
case BLOCK_DRAG: /* Drag */ case BLOCK_DRAG: /* Drag */
case BLOCK_MOVE: /* Move */ case BLOCK_MOVE: /* Move */
case BLOCK_COPY: /* Copy */ case BLOCK_COPY: /* Copy */
ItemsCount = MarkItemsInBloc( CurrentLibEntry, ItemsCount = MarkItemsInBloc( m_currentComponent,
GetScreen()->m_BlockLocate ); GetScreen()->m_BlockLocate );
if( ItemsCount ) if( ItemsCount )
{ {
...@@ -206,11 +207,11 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) ...@@ -206,11 +207,11 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC )
break; break;
case BLOCK_DELETE: /* Delete */ case BLOCK_DELETE: /* Delete */
ItemsCount = MarkItemsInBloc( CurrentLibEntry, ItemsCount = MarkItemsInBloc( m_currentComponent,
GetScreen()->m_BlockLocate ); GetScreen()->m_BlockLocate );
if( ItemsCount ) if( ItemsCount )
SaveCopyInUndoList( CurrentLibEntry ); SaveCopyInUndoList( m_currentComponent );
DeleteMarkedItems( CurrentLibEntry ); DeleteMarkedItems( m_currentComponent );
break; break;
case BLOCK_SAVE: /* Save */ case BLOCK_SAVE: /* Save */
...@@ -222,11 +223,11 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) ...@@ -222,11 +223,11 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC )
case BLOCK_MIRROR_Y: case BLOCK_MIRROR_Y:
ItemsCount = MarkItemsInBloc( CurrentLibEntry, ItemsCount = MarkItemsInBloc( m_currentComponent,
GetScreen()->m_BlockLocate ); GetScreen()->m_BlockLocate );
if( ItemsCount ) if( ItemsCount )
SaveCopyInUndoList( CurrentLibEntry ); SaveCopyInUndoList( m_currentComponent );
MirrorMarkedItems( CurrentLibEntry, MirrorMarkedItems( m_currentComponent,
GetScreen()->m_BlockLocate.Centre() ); GetScreen()->m_BlockLocate.Centre() );
break; break;
...@@ -245,7 +246,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) ...@@ -245,7 +246,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC )
{ {
if( GetScreen()->m_BlockLocate.m_Command != BLOCK_SELECT_ITEMS_ONLY ) 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_Flags = 0;
GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK;
...@@ -291,16 +292,16 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC ) ...@@ -291,16 +292,16 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC )
case BLOCK_MOVE: /* Move */ case BLOCK_MOVE: /* Move */
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
SaveCopyInUndoList( CurrentLibEntry ); SaveCopyInUndoList( m_currentComponent );
MoveMarkedItems( CurrentLibEntry, MoveMarkedItems( m_currentComponent,
GetScreen()->m_BlockLocate.m_MoveVector ); GetScreen()->m_BlockLocate.m_MoveVector );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
break; break;
case BLOCK_COPY: /* Copy */ case BLOCK_COPY: /* Copy */
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
SaveCopyInUndoList( CurrentLibEntry ); SaveCopyInUndoList( m_currentComponent );
CopyMarkedItems( CurrentLibEntry, CopyMarkedItems( m_currentComponent,
GetScreen()->m_BlockLocate.m_MoveVector ); GetScreen()->m_BlockLocate.m_MoveVector );
break; break;
...@@ -309,8 +310,8 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC ) ...@@ -309,8 +310,8 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC )
break; break;
case BLOCK_MIRROR_Y: /* Invert by popup menu, from block move */ case BLOCK_MIRROR_Y: /* Invert by popup menu, from block move */
SaveCopyInUndoList( CurrentLibEntry ); SaveCopyInUndoList( m_currentComponent );
MirrorMarkedItems( CurrentLibEntry, MirrorMarkedItems( m_currentComponent,
GetScreen()->m_BlockLocate.Centre() ); GetScreen()->m_BlockLocate.Centre() );
break; break;
...@@ -342,8 +343,7 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC ) ...@@ -342,8 +343,7 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC )
* Retrace le contour du block de recherche de structures * Retrace le contour du block de recherche de structures
* L'ensemble du block suit le curseur * L'ensemble du block suit le curseur
*/ */
static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
bool erase )
{ {
BLOCK_SELECTOR* PtBlock; BLOCK_SELECTOR* PtBlock;
BASE_SCREEN* screen = panel->GetScreen(); BASE_SCREEN* screen = panel->GetScreen();
...@@ -351,19 +351,22 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -351,19 +351,22 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
PtBlock = &screen->m_BlockLocate; 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 ) if( erase )
{ {
PtBlock->Draw( panel, DC, PtBlock->m_MoveVector, g_XorMode, PtBlock->Draw( panel, DC, PtBlock->m_MoveVector, g_XorMode,
PtBlock->m_Color ); PtBlock->m_Color );
if( CurrentLibEntry ) component->Draw( panel, DC, PtBlock->m_MoveVector, CurrentUnit,
{ CurrentConvert, g_XorMode, -1, DefaultTransformMatrix,
CurrentLibEntry->Draw( panel, DC, PtBlock->m_MoveVector, true, false, true );
CurrentUnit, CurrentConvert, g_XorMode,
-1, DefaultTransformMatrix, true, false,
true );
}
} }
/* Redessin nouvel affichage */ /* Redessin nouvel affichage */
...@@ -376,13 +379,9 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -376,13 +379,9 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
PtBlock->Draw( panel, DC, PtBlock->m_MoveVector, g_XorMode, PtBlock->Draw( panel, DC, PtBlock->m_MoveVector, g_XorMode,
PtBlock->m_Color ); PtBlock->m_Color );
if( CurrentLibEntry ) component->Draw( panel, DC, PtBlock->m_MoveVector, CurrentUnit,
{ CurrentConvert, g_XorMode, -1, DefaultTransformMatrix,
CurrentLibEntry->Draw( panel, DC, PtBlock->m_MoveVector, true, false, true );
CurrentUnit, CurrentConvert, g_XorMode,
-1, DefaultTransformMatrix, true, false,
true );
}
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "id.h" #include "eeschema_id.h"
#include "confirm.h" #include "confirm.h"
#include "program.h" #include "program.h"
......
...@@ -416,6 +416,37 @@ bool LibDrawField::DoTestInside( EDA_Rect& rect ) ...@@ -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 * Function ReturnDefaultFieldName
* Return the default field name from its index (REFERENCE, VALUE ..) * Return the default field name from its index (REFERENCE, VALUE ..)
......
...@@ -103,6 +103,8 @@ public: ...@@ -103,6 +103,8 @@ public:
m_Parent = field.m_Parent; m_Parent = field.m_Parent;
} }
wxString GetFullText( void );
protected: protected:
virtual LibEDA_BaseStruct* DoGenCopy(); virtual LibEDA_BaseStruct* DoGenCopy();
virtual bool DoCompare( const LibEDA_BaseStruct& other ) const; virtual bool DoCompare( const LibEDA_BaseStruct& other ) const;
......
...@@ -514,8 +514,8 @@ information." ); ...@@ -514,8 +514,8 @@ information." );
{ {
wxLogWarning( _( "The component library <%s> header version \ wxLogWarning( _( "The component library <%s> header version \
number is invalid.\n\nIn future versions of EESchema this library may not \ 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 \ load correctly. To resolve this problem open the library in the library \
editor and save it.\nIf this library is the project cache library, save \ editor and save it. If this library is the project cache library, save \
the current schematic." ), the current schematic." ),
(const wxChar*) GetName() ); (const wxChar*) GetName() );
} }
...@@ -636,7 +636,7 @@ bool CMP_LIBRARY::LoadDocs( wxString& errMsg ) ...@@ -636,7 +636,7 @@ bool CMP_LIBRARY::LoadDocs( wxString& errMsg )
if( f == NULL ) 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() ); (const wxChar*) fn.GetFullPath() );
return false; return false;
} }
......
...@@ -9,11 +9,14 @@ ...@@ -9,11 +9,14 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "drawtxt.h" #include "drawtxt.h"
#include "plot_common.h"
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "plot_common.h"
#include "protos.h" #include "protos.h"
#include "libeditfrm.h"
const wxChar* MsgPinElectricType[] = const wxChar* MsgPinElectricType[] =
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "id.h" #include "eeschema_id.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "trigo.h" #include "trigo.h"
#include "id.h" #include "eeschema_id.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "drawtxt.h" #include "drawtxt.h"
......
...@@ -7,12 +7,14 @@ ...@@ -7,12 +7,14 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "eda_dde.h" #include "eda_dde.h"
#include "id.h" #include "eeschema_id.h"
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditfrm.h"
#include "libviewfrm.h"
#include "class_marker_sch.h" #include "class_marker_sch.h"
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "eda_dde.h" #include "eda_dde.h"
#include "id.h" #include "eeschema_id.h"
#include "protos.h" #include "protos.h"
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
...@@ -13,10 +12,11 @@ ...@@ -13,10 +12,11 @@
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "protos.h"
#include "libeditfrm.h"
#include "dialog_edit_component_in_lib.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::DIALOG_EDIT_COMPONENT_IN_LIBRARY( WinEDA_LibeditFrame* aParent):
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE(aParent) DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE(aParent)
...@@ -45,7 +45,9 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::Init( ) ...@@ -45,7 +45,9 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::Init( )
SetFocus(); SetFocus();
m_AliasLocation = -1; m_AliasLocation = -1;
if( CurrentLibEntry == NULL ) LIB_COMPONENT* component = m_Parent->GetCurrentComponent();
if( component == NULL )
{ {
SetTitle( _( "Library Component Properties" ) ); SetTitle( _( "Library Component Properties" ) );
return; return;
...@@ -56,16 +58,15 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::Init( ) ...@@ -56,16 +58,15 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::Init( )
if( !CurrentAliasName.IsEmpty() ) if( !CurrentAliasName.IsEmpty() )
{ {
title += CurrentAliasName + _( " (alias of " ) + title += CurrentAliasName + _( " (alias of " ) +
wxString( CurrentLibEntry->m_Name.m_Text )+ wxT( ")" ); component->GetName() + wxT( ")" );
} }
else else
{ {
title += CurrentLibEntry->m_Name.m_Text; title += component->GetName();
CurrentAliasName.Empty(); CurrentAliasName.Empty();
} }
SetTitle( title ); SetTitle( title );
InitPanelDoc(); InitPanelDoc();
InitBasicPanel(); InitBasicPanel();
...@@ -73,26 +74,18 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::Init( ) ...@@ -73,26 +74,18 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::Init( )
m_ButtonDeleteAllAlias->Enable( false ); m_ButtonDeleteAllAlias->Enable( false );
/* Place list of alias names in listbox */ /* Place list of alias names in listbox */
if( CurrentLibEntry ) m_PartAliasList->Append( component->m_AliasList );
{
m_PartAliasList->Append( CurrentLibEntry->m_AliasList );
}
if( ( CurrentLibEntry == NULL ) if( component->m_AliasList.GetCount() == 0 )
|| ( CurrentLibEntry->m_AliasList.GetCount() == 0 ) )
{ {
m_ButtonDeleteAllAlias->Enable( false ); m_ButtonDeleteAllAlias->Enable( false );
m_ButtonDeleteOneAlias->Enable( false ); m_ButtonDeleteOneAlias->Enable( false );
} }
/* Read the Footprint Filter list */ /* Read the Footprint Filter list */
if( CurrentLibEntry ) m_FootprintFilterListBox->Append( component->m_FootprintList );
{
m_FootprintFilterListBox->Append( CurrentLibEntry->m_FootprintList );
}
if( ( CurrentLibEntry == NULL ) if( component->m_FootprintList.GetCount() == 0 )
|| ( CurrentLibEntry->m_FootprintList.GetCount() == 0 ) )
{ {
m_ButtonDeleteAllFootprintFilter->Enable( false ); m_ButtonDeleteAllFootprintFilter->Enable( false );
m_ButtonDeleteOneFootprintFilter->Enable( false ); m_ButtonDeleteOneFootprintFilter->Enable( false );
......
...@@ -2,17 +2,18 @@ ...@@ -2,17 +2,18 @@
/* library editor: edition of fields of lib entries (components in libraries) */ /* library editor: edition of fields of lib entries (components in libraries) */
/*******************************************************************************/ /*******************************************************************************/
#include "fctsys.h"
#include <algorithm> #include <algorithm>
#include "fctsys.h"
#include "common.h" #include "common.h"
#include "confirm.h" #include "confirm.h"
#include "class_drawpanel.h"
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditfrm.h"
#include "dialog_edit_libentry_fields_in_lib_base.h" #include "dialog_edit_libentry_fields_in_lib_base.h"
...@@ -97,25 +98,25 @@ private: ...@@ -97,25 +98,25 @@ private:
void reinitializeFieldsIdAndDefaultNames(); void reinitializeFieldsIdAndDefaultNames();
}; };
/*****************************************************************/
void WinEDA_LibeditFrame::InstallFieldsEditorDialog( void ) void WinEDA_LibeditFrame::InstallFieldsEditorDialog( wxCommandEvent& event )
/*****************************************************************/
{ {
if( CurrentLibEntry == NULL ) if( m_currentComponent == NULL )
return; return;
DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB* frame = DrawPanel->UnManageCursor( 0, wxCURSOR_ARROW );
new DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB( this, CurrentLibEntry );
int abort = frame->ShowModal(); frame->Destroy(); DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB dlg( this, m_currentComponent );
if( ! abort ) int abort = dlg.ShowModal();
{
ReCreateHToolbar();
Refresh();
}
if( abort )
return;
UpdateAliasSelectList();
UpdatePartSelectList();
DisplayLibInfos(); DisplayLibInfos();
Refresh();
} }
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#include "fctsys.h" #include "fctsys.h"
#include <wx/tokenzr.h>
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "confirm.h" #include "confirm.h"
...@@ -17,11 +16,11 @@ ...@@ -17,11 +16,11 @@
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "netlist.h" #include "netlist.h"
#include "libviewfrm.h"
#include "id.h" #include <wx/tokenzr.h>
#include "dialog_eeschema_config_fbp.h" #include "dialog_eeschema_config_fbp.h"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "id.h" #include "eeschema_id.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
......
This diff is collapsed.
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "protos.h"
#include "libeditfrm.h"
#include "dialog_bodygraphictext_properties_base.h" #include "dialog_bodygraphictext_properties_base.h"
#include "protos.h"
class Dialog_BodyGraphicText_Properties : public Dialog_BodyGraphicText_Properties_base class Dialog_BodyGraphicText_Properties : public Dialog_BodyGraphicText_Properties_base
{ {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "id.h" #include "eeschema_id.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "id.h" #include "eeschema_id.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "program.h" #include "program.h"
......
...@@ -102,7 +102,6 @@ LibEDA_BaseStruct* LibItemToRepeat = NULL; /* pointer on a graphic item than ...@@ -102,7 +102,6 @@ LibEDA_BaseStruct* LibItemToRepeat = NULL; /* pointer on a graphic item than
* can be duplicated by the Ins key * can be duplicated by the Ins key
* (usually the last created item */ * (usually the last created item */
CMP_LIBRARY* CurrentLib = NULL; /* Current opened library */ CMP_LIBRARY* CurrentLib = NULL; /* Current opened library */
LIB_COMPONENT* CurrentLibEntry = NULL; /* Current component */
LibEDA_BaseStruct* CurrentDrawItem = NULL; /* current edited item */ LibEDA_BaseStruct* CurrentDrawItem = NULL; /* current edited item */
// Current selected alias (for components which have aliases) // Current selected alias (for components which have aliases)
......
#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__ */
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "id.h" #include "eeschema_id.h"
/****************************************************************/ /****************************************************************/
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "class_library.h" #include "class_library.h"
#include "libviewfrm.h"
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
......
...@@ -3,17 +3,15 @@ ...@@ -3,17 +3,15 @@
/***************/ /***************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "eeschema_id.h"
#include "hotkeys.h"
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "id.h"
#include "hotkeys.h"
#include "protos.h" #include "protos.h"
#include "libeditfrm.h"
/* How to add a new hotkey: /* How to add a new hotkey:
* add a new id in the enum hotkey_id_commnand like MY_NEW_ID_FUNCTION (see * add a new id in the enum hotkey_id_commnand like MY_NEW_ID_FUNCTION (see
......
...@@ -13,12 +13,13 @@ ...@@ -13,12 +13,13 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "id.h" #include "eeschema_id.h"
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditfrm.h"
#include <wx/filename.h> #include <wx/filename.h>
...@@ -95,13 +96,13 @@ void WinEDA_LibeditFrame::OnExportPart( wxCommandEvent& event ) ...@@ -95,13 +96,13 @@ void WinEDA_LibeditFrame::OnExportPart( wxCommandEvent& event )
CMP_LIBRARY* CurLibTmp; CMP_LIBRARY* CurLibTmp;
bool createLib = ( event.GetId() != ExportPartId ) ? false : true; bool createLib = ( event.GetId() != ExportPartId ) ? false : true;
if( CurrentLibEntry == NULL ) if( m_currentComponent == NULL )
{ {
DisplayError( this, _( "There is no component selected to save." ) ); DisplayError( this, _( "There is no component selected to save." ) );
return; return;
} }
fn = CurrentLibEntry->GetName().Lower(); fn = m_currentComponent->GetName().Lower();
fn.SetExt( CompLibFileExtension ); fn.SetExt( CompLibFileExtension );
title = createLib ? _( "New Library" ) : _( "Export Component" ); title = createLib ? _( "New Library" ) : _( "Export Component" );
...@@ -132,7 +133,7 @@ void WinEDA_LibeditFrame::OnExportPart( wxCommandEvent& event ) ...@@ -132,7 +133,7 @@ void WinEDA_LibeditFrame::OnExportPart( wxCommandEvent& event )
{ {
msg = fn.GetFullPath() + _( " - OK" ); msg = fn.GetFullPath() + _( " - OK" );
DisplayInfoMessage( this, _( "This library will not be available \ 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." ) ); if you want to include it as part of this project." ) );
} }
else else
......
...@@ -20,6 +20,15 @@ ...@@ -20,6 +20,15 @@
LIB_VERSION( LIB_VERSION_MAJOR, LIB_VERSION_MINOR) \ 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. */ /* Must be the first line of component library document (.dcm) files. */
#define DOCFILE_IDENT "EESchema-DOCLIB Version 2.0" #define DOCFILE_IDENT "EESchema-DOCLIB Version 2.0"
...@@ -48,7 +57,6 @@ extern LibEDA_BaseStruct* LibItemToRepeat; /* pointer on a graphic item than ...@@ -48,7 +57,6 @@ extern LibEDA_BaseStruct* LibItemToRepeat; /* pointer on a graphic item than
* can be duplicated by the Ins key * can be duplicated by the Ins key
* (usually the last created item */ * (usually the last created item */
extern CMP_LIBRARY* CurrentLib; /* Current opened library */ extern CMP_LIBRARY* CurrentLib; /* Current opened library */
extern LIB_COMPONENT* CurrentLibEntry; /* Current component */
extern LibEDA_BaseStruct* CurrentDrawItem; /* current edited item */ extern LibEDA_BaseStruct* CurrentDrawItem; /* current edited item */
extern wxString CurrentAliasName; extern wxString CurrentAliasName;
......
This diff is collapsed.
...@@ -10,28 +10,27 @@ ...@@ -10,28 +10,27 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "eeschema_id.h"
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditfrm.h"
#include "id.h"
void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
LibEDA_BaseStruct* DrawEntry = CurrentDrawItem; LibEDA_BaseStruct* DrawEntry = CurrentDrawItem;
if( CurrentLibEntry == NULL ) // No component loaded ! if( m_currentComponent == NULL ) // No component loaded !
return; return;
if( m_ID_current_state == 0 ) if( m_ID_current_state == 0 )
{ {
if( DrawEntry && DrawEntry->m_Flags ) if( DrawEntry && DrawEntry->m_Flags )
{ {
SaveCopyInUndoList( CurrentLibEntry ); SaveCopyInUndoList( m_currentComponent );
switch( DrawEntry->Type() ) switch( DrawEntry->Type() )
{ {
...@@ -51,25 +50,27 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -51,25 +50,27 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
} }
else else
{ {
DrawEntry = LocatePin( GetScreen()->m_MousePosition, CurrentLibEntry, DrawEntry = LocatePin( GetScreen()->m_MousePosition,
CurrentUnit, CurrentConvert ); m_currentComponent, CurrentUnit,
CurrentConvert );
if( DrawEntry == NULL ) if( DrawEntry == NULL )
{ {
DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(), DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(),
GetScreen()->m_MousePosition, GetScreen()->m_MousePosition,
CurrentLibEntry, CurrentUnit, m_currentComponent, CurrentUnit,
CurrentConvert, CurrentConvert,
LOCATE_ALL_DRAW_ITEM ); LOCATE_ALL_DRAW_ITEM );
} }
if( DrawEntry == NULL ) if( DrawEntry == NULL )
DrawEntry = LocatePin( GetScreen()->m_Curseur, CurrentLibEntry, DrawEntry = LocatePin( GetScreen()->m_Curseur,
CurrentUnit, CurrentConvert ); m_currentComponent, CurrentUnit,
CurrentConvert );
if( DrawEntry == NULL ) if( DrawEntry == NULL )
{ {
DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(), DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(),
GetScreen()->m_Curseur, GetScreen()->m_Curseur,
CurrentLibEntry, CurrentUnit, m_currentComponent, CurrentUnit,
CurrentConvert, CurrentConvert,
LOCATE_ALL_DRAW_ITEM ); LOCATE_ALL_DRAW_ITEM );
} }
...@@ -96,7 +97,7 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -96,7 +97,7 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
} }
else else
{ {
SaveCopyInUndoList( CurrentLibEntry ); SaveCopyInUndoList( m_currentComponent );
PlacePin( DC ); PlacePin( DC );
} }
break; break;
...@@ -108,7 +109,7 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -108,7 +109,7 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
case ID_LIBEDIT_BODY_TEXT_BUTT: case ID_LIBEDIT_BODY_TEXT_BUTT:
if( CurrentDrawItem == NULL || CurrentDrawItem->m_Flags == 0 ) if( CurrentDrawItem == NULL || CurrentDrawItem->m_Flags == 0 )
{ {
CurrentDrawItem = CreateGraphicItem( CurrentLibEntry, DC ); CurrentDrawItem = CreateGraphicItem( m_currentComponent, DC );
} }
else if( CurrentDrawItem ) else if( CurrentDrawItem )
{ {
...@@ -116,48 +117,50 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -116,48 +117,50 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
GraphicItemBeginDraw( DC ); GraphicItemBeginDraw( DC );
else else
{ {
SaveCopyInUndoList( CurrentLibEntry ); SaveCopyInUndoList( m_currentComponent );
EndDrawGraphicItem( DC ); EndDrawGraphicItem( DC );
} }
} }
break; break;
case ID_LIBEDIT_DELETE_ITEM_BUTT: case ID_LIBEDIT_DELETE_ITEM_BUTT:
DrawEntry = LocatePin( GetScreen()->m_MousePosition, CurrentLibEntry, DrawEntry = LocatePin( GetScreen()->m_MousePosition,
CurrentUnit, CurrentConvert ); m_currentComponent, CurrentUnit,
CurrentConvert );
if( DrawEntry == NULL ) if( DrawEntry == NULL )
{ {
DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(), DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(),
GetScreen()->m_MousePosition, GetScreen()->m_MousePosition,
CurrentLibEntry, CurrentUnit, m_currentComponent, CurrentUnit,
CurrentConvert, CurrentConvert,
LOCATE_ALL_DRAW_ITEM ); LOCATE_ALL_DRAW_ITEM );
} }
if( DrawEntry == NULL ) if( DrawEntry == NULL )
DrawEntry = LocatePin( GetScreen()->m_Curseur, CurrentLibEntry, DrawEntry = LocatePin( GetScreen()->m_Curseur,
CurrentUnit, CurrentConvert ); m_currentComponent, CurrentUnit,
CurrentConvert );
if( DrawEntry == NULL ) if( DrawEntry == NULL )
{ {
DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(), DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(),
GetScreen()->m_Curseur, GetScreen()->m_Curseur,
CurrentLibEntry, CurrentUnit, m_currentComponent, CurrentUnit,
CurrentConvert, CurrentConvert,
LOCATE_ALL_DRAW_ITEM ); LOCATE_ALL_DRAW_ITEM );
} }
if( DrawEntry == NULL ) if( DrawEntry == NULL )
DisplayCmpDoc(); DisplayCmpDoc();
SaveCopyInUndoList( CurrentLibEntry ); SaveCopyInUndoList( m_currentComponent );
if( DrawEntry->Type() == COMPONENT_PIN_DRAW_TYPE ) if( DrawEntry->Type() == COMPONENT_PIN_DRAW_TYPE )
DeletePin( DC, CurrentLibEntry, (LibDrawPin*) DrawEntry ); DeletePin( DC, m_currentComponent, (LibDrawPin*) DrawEntry );
else else
CurrentLibEntry->RemoveDrawItem( DrawEntry, DrawPanel, DC ); m_currentComponent->RemoveDrawItem( DrawEntry, DrawPanel, DC );
DrawEntry = NULL; DrawEntry = NULL;
GetScreen()->SetModify(); GetScreen()->SetModify();
break; break;
case ID_LIBEDIT_ANCHOR_ITEM_BUTT: case ID_LIBEDIT_ANCHOR_ITEM_BUTT:
SaveCopyInUndoList( CurrentLibEntry ); SaveCopyInUndoList( m_currentComponent );
PlaceAncre(); PlaceAncre();
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString ); SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
break; break;
...@@ -183,22 +186,22 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -183,22 +186,22 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
wxPoint pos = GetPosition(); wxPoint pos = GetPosition();
LibEDA_BaseStruct* DrawEntry = CurrentDrawItem; LibEDA_BaseStruct* DrawEntry = CurrentDrawItem;
if( CurrentLibEntry == NULL ) if( m_currentComponent == NULL )
return; return;
if( ( DrawEntry == NULL ) || ( DrawEntry->m_Flags == 0 ) ) if( ( DrawEntry == NULL ) || ( DrawEntry->m_Flags == 0 ) )
{ // We can locate an item { // We can locate an item
DrawEntry = LocatePin( GetScreen()->m_MousePosition, CurrentLibEntry, DrawEntry = LocatePin( GetScreen()->m_MousePosition, m_currentComponent,
CurrentUnit, CurrentConvert ); CurrentUnit, CurrentConvert );
if( DrawEntry == NULL ) if( DrawEntry == NULL )
DrawEntry = LocatePin( GetScreen()->m_Curseur, CurrentLibEntry, DrawEntry = LocatePin( GetScreen()->m_Curseur, m_currentComponent,
CurrentUnit, CurrentConvert ); CurrentUnit, CurrentConvert );
if( DrawEntry == NULL ) if( DrawEntry == NULL )
{ {
DrawEntry = CurrentDrawItem = DrawEntry = CurrentDrawItem =
LocateDrawItem( (SCH_SCREEN*) GetScreen(), LocateDrawItem( (SCH_SCREEN*) GetScreen(),
GetScreen()->m_MousePosition, GetScreen()->m_MousePosition,
CurrentLibEntry, CurrentUnit, m_currentComponent, CurrentUnit,
CurrentConvert, LOCATE_ALL_DRAW_ITEM ); CurrentConvert, LOCATE_ALL_DRAW_ITEM );
} }
if( DrawEntry == NULL ) if( DrawEntry == NULL )
...@@ -206,13 +209,13 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -206,13 +209,13 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
DrawEntry = CurrentDrawItem = DrawEntry = CurrentDrawItem =
LocateDrawItem( (SCH_SCREEN*) GetScreen(), LocateDrawItem( (SCH_SCREEN*) GetScreen(),
GetScreen()->m_Curseur, GetScreen()->m_Curseur,
CurrentLibEntry, CurrentUnit, m_currentComponent, CurrentUnit,
CurrentConvert, LOCATE_ALL_DRAW_ITEM ); CurrentConvert, LOCATE_ALL_DRAW_ITEM );
} }
if( DrawEntry == NULL ) if( DrawEntry == NULL )
{ {
DrawEntry = CurrentDrawItem = DrawEntry = CurrentDrawItem =
(LibEDA_BaseStruct*) LocateField( CurrentLibEntry ); (LibEDA_BaseStruct*) LocateField( m_currentComponent );
} }
if( DrawEntry == NULL ) if( DrawEntry == NULL )
{ {
......
This diff is collapsed.
...@@ -9,9 +9,8 @@ ...@@ -9,9 +9,8 @@
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
//#include "id.h"
#include "protos.h" #include "protos.h"
#include "libeditfrm.h"
/*************************************************************************/ /*************************************************************************/
...@@ -55,16 +54,16 @@ void WinEDA_LibeditFrame::GetComponentFromRedoList(wxCommandEvent& event) ...@@ -55,16 +54,16 @@ void WinEDA_LibeditFrame::GetComponentFromRedoList(wxCommandEvent& event)
return; return;
PICKED_ITEMS_LIST* lastcmd = new PICKED_ITEMS_LIST(); PICKED_ITEMS_LIST* lastcmd = new PICKED_ITEMS_LIST();
ITEM_PICKER wrapper(CurrentLibEntry, UR_LIBEDIT); ITEM_PICKER wrapper(m_currentComponent, UR_LIBEDIT);
lastcmd->PushItem(wrapper); lastcmd->PushItem(wrapper);
GetScreen()->PushCommandToUndoList( lastcmd ); GetScreen()->PushCommandToUndoList( lastcmd );
lastcmd = GetScreen()->PopCommandFromRedoList( ); lastcmd = GetScreen()->PopCommandFromRedoList( );
wrapper = lastcmd->PopItem(); wrapper = lastcmd->PopItem();
CurrentLibEntry = (LIB_COMPONENT*) wrapper.m_PickedItem; m_currentComponent = (LIB_COMPONENT*) wrapper.m_PickedItem;
if( CurrentLibEntry ) if( m_currentComponent )
CurrentLibEntry->SetNext( NULL ); m_currentComponent->SetNext( NULL );
CurrentDrawItem = NULL; CurrentDrawItem = NULL;
GetScreen()->SetModify(); GetScreen()->SetModify();
DrawPanel->Refresh(); DrawPanel->Refresh();
...@@ -85,17 +84,17 @@ void WinEDA_LibeditFrame::GetComponentFromUndoList(wxCommandEvent& event) ...@@ -85,17 +84,17 @@ void WinEDA_LibeditFrame::GetComponentFromUndoList(wxCommandEvent& event)
return; return;
PICKED_ITEMS_LIST* lastcmd = new PICKED_ITEMS_LIST(); PICKED_ITEMS_LIST* lastcmd = new PICKED_ITEMS_LIST();
ITEM_PICKER wrapper(CurrentLibEntry, UR_LIBEDIT); ITEM_PICKER wrapper(m_currentComponent, UR_LIBEDIT);
lastcmd->PushItem(wrapper); lastcmd->PushItem(wrapper);
GetScreen()->PushCommandToRedoList( lastcmd ); GetScreen()->PushCommandToRedoList( lastcmd );
lastcmd = GetScreen()->PopCommandFromUndoList( ); lastcmd = GetScreen()->PopCommandFromUndoList( );
wrapper = lastcmd->PopItem(); wrapper = lastcmd->PopItem();
CurrentLibEntry = (LIB_COMPONENT*) wrapper.m_PickedItem; m_currentComponent = (LIB_COMPONENT*) wrapper.m_PickedItem;
if( CurrentLibEntry ) if( m_currentComponent )
CurrentLibEntry->SetNext( NULL ); m_currentComponent->SetNext( NULL );
CurrentDrawItem = NULL; CurrentDrawItem = NULL;
GetScreen()->SetModify(); GetScreen()->SetModify();
DrawPanel->Refresh(); DrawPanel->Refresh();
......
/*****************************/
/* 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__ */
...@@ -11,19 +11,13 @@ ...@@ -11,19 +11,13 @@
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditfrm.h"
/* Routines locales */ /* Routines locales */
static void ShowMoveField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); 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 */ /* Variables locales */
extern int CurrentUnit; extern int CurrentUnit;
...@@ -55,7 +49,7 @@ void WinEDA_LibeditFrame::StartMoveField( wxDC* DC, LibDrawField* field ) ...@@ -55,7 +49,7 @@ void WinEDA_LibeditFrame::StartMoveField( wxDC* DC, LibDrawField* field )
{ {
wxPoint startPos; wxPoint startPos;
if( ( CurrentLibEntry == NULL ) || ( field == NULL ) ) if( ( m_currentComponent == NULL ) || ( field == NULL ) )
return; return;
CurrentDrawItem = field; CurrentDrawItem = field;
...@@ -77,37 +71,6 @@ void WinEDA_LibeditFrame::StartMoveField( wxDC* DC, LibDrawField* 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 d'affichage du texte 'Field' en cours de deplacement. */
/* Routine normalement attachee au curseur */ /* Routine normalement attachee au curseur */
...@@ -116,10 +79,10 @@ static void ShowMoveField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -116,10 +79,10 @@ static void ShowMoveField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{ {
LibDrawField* Field = (LibDrawField*) CurrentDrawItem; LibDrawField* Field = (LibDrawField*) CurrentDrawItem;
if( ( CurrentLibEntry == NULL ) || ( Field == NULL ) ) if( Field == NULL )
return; return;
wxString text = ReturnFieldFullText( Field ); wxString text = Field->GetFullText();
if( erase ) if( erase )
Field->Draw( panel, DC, wxPoint( 0, 0 ), -1, g_XorMode, &text, Field->Draw( panel, DC, wxPoint( 0, 0 ), -1, g_XorMode, &text,
...@@ -144,7 +107,7 @@ void WinEDA_LibeditFrame::PlaceField( wxDC* DC, LibDrawField* Field ) ...@@ -144,7 +107,7 @@ void WinEDA_LibeditFrame::PlaceField( wxDC* DC, LibDrawField* Field )
Field->m_Pos.y = -GetScreen()->m_Curseur.y; Field->m_Pos.y = -GetScreen()->m_Curseur.y;
DrawPanel->CursorOff( DC ); DrawPanel->CursorOff( DC );
wxString fieldText = ReturnFieldFullText( Field ); wxString fieldText = Field->GetFullText();
Field->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE, Field->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE,
&fieldText, DefaultTransformMatrix ); &fieldText, DefaultTransformMatrix );
...@@ -196,13 +159,13 @@ void WinEDA_LibeditFrame::EditField( wxDC* DC, LibDrawField* Field ) ...@@ -196,13 +159,13 @@ void WinEDA_LibeditFrame::EditField( wxDC* DC, LibDrawField* Field )
wxString msg; wxString msg;
/* Test for an existing name in the current components alias list. */ /* 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 \ msg.Printf( _( "The field name <%s> is an existing alias of the \
component <%s>.\nPlease choose another name that does not conflict with any \ component <%s>.\nPlease choose another name that does not conflict with any \
names in the alias list." ), names in the alias list." ),
(const wxChar*) Text, (const wxChar*) Text,
(const wxChar*) CurrentLibEntry->GetName() ); (const wxChar*) Field->GetParent()->GetName() );
DisplayError( this, msg ); DisplayError( this, msg );
return; return;
} }
...@@ -222,14 +185,14 @@ not conflict with any library entries." ), ...@@ -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, Field->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, &fieldText,
DefaultTransformMatrix ); DefaultTransformMatrix );
if( !Text.IsEmpty() ) if( !Text.IsEmpty() )
{ {
SaveCopyInUndoList( CurrentLibEntry ); SaveCopyInUndoList( Field->GetParent() );
Field->m_Text = Text; Field->m_Text = Text;
} }
else else
...@@ -237,7 +200,7 @@ not conflict with any library entries." ), ...@@ -237,7 +200,7 @@ not conflict with any library entries." ),
DisplayError( this, _( "No new text: no change" ) ); DisplayError( this, _( "No new text: no change" ) );
} }
fieldText = ReturnFieldFullText( Field ); fieldText = Field->GetFullText();
int drawMode = g_XorMode; int drawMode = g_XorMode;
if( Field->m_Flags == 0 ) if( Field->m_Flags == 0 )
...@@ -266,7 +229,7 @@ void WinEDA_LibeditFrame::RotateField( wxDC* DC, LibDrawField* Field ) ...@@ -266,7 +229,7 @@ void WinEDA_LibeditFrame::RotateField( wxDC* DC, LibDrawField* Field )
DrawPanel->CursorOff( DC ); DrawPanel->CursorOff( DC );
GRSetDrawMode( DC, g_XorMode ); GRSetDrawMode( DC, g_XorMode );
wxString fieldText = ReturnFieldFullText( Field ); wxString fieldText = Field->GetFullText();
Field->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, &fieldText, Field->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, &fieldText,
DefaultTransformMatrix ); DefaultTransformMatrix );
...@@ -324,33 +287,33 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::LocateItemUsingCursor() ...@@ -324,33 +287,33 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::LocateItemUsingCursor()
{ {
LibEDA_BaseStruct* DrawEntry = CurrentDrawItem; LibEDA_BaseStruct* DrawEntry = CurrentDrawItem;
if( CurrentLibEntry == NULL ) if( m_currentComponent == NULL )
return NULL; return NULL;
if( ( DrawEntry == NULL ) || ( DrawEntry->m_Flags == 0 ) ) if( ( DrawEntry == NULL ) || ( DrawEntry->m_Flags == 0 ) )
{ {
DrawEntry = LocatePin( GetScreen()->m_Curseur, CurrentLibEntry, DrawEntry = LocatePin( GetScreen()->m_Curseur, m_currentComponent,
CurrentUnit, CurrentConvert ); CurrentUnit, CurrentConvert );
if( DrawEntry == NULL ) if( DrawEntry == NULL )
{ {
DrawEntry = CurrentDrawItem = DrawEntry = CurrentDrawItem =
LocateDrawItem( (SCH_SCREEN*) GetScreen(), LocateDrawItem( (SCH_SCREEN*) GetScreen(),
GetScreen()->m_MousePosition, GetScreen()->m_MousePosition,
CurrentLibEntry, CurrentUnit, m_currentComponent, CurrentUnit,
CurrentConvert, LOCATE_ALL_DRAW_ITEM ); CurrentConvert, LOCATE_ALL_DRAW_ITEM );
} }
if( DrawEntry == NULL ) if( DrawEntry == NULL )
{ {
DrawEntry = CurrentDrawItem = DrawEntry = CurrentDrawItem =
LocateDrawItem( (SCH_SCREEN*) GetScreen(), LocateDrawItem( (SCH_SCREEN*) GetScreen(),
GetScreen()->m_Curseur, CurrentLibEntry, GetScreen()->m_Curseur, m_currentComponent,
CurrentUnit, CurrentConvert, CurrentUnit, CurrentConvert,
LOCATE_ALL_DRAW_ITEM ); LOCATE_ALL_DRAW_ITEM );
} }
if( DrawEntry == NULL ) if( DrawEntry == NULL )
{ {
DrawEntry = CurrentDrawItem = DrawEntry = CurrentDrawItem =
(LibEDA_BaseStruct*) LocateField( CurrentLibEntry ); (LibEDA_BaseStruct*) LocateField( m_currentComponent );
} }
} }
......
This diff is collapsed.
#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__ */
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "general.h" #include "general.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "protos.h" #include "protos.h"
#include "id.h" #include "eeschema_id.h"
#include "hotkeys.h" #include "hotkeys.h"
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "id.h" #include "eeschema_id.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "id.h" #include "eeschema_id.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
#ifndef _PINEDIT_DIALOG_H_ #ifndef _PINEDIT_DIALOG_H_
#define _PINEDIT_DIALOG_H_ #define _PINEDIT_DIALOG_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) /* #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) */
#pragma interface "pinedit-dialog.h" /* #pragma interface "pinedit-dialog.h" */
#endif /* #endif */
/*! /*!
* Includes * Includes
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "id.h" #include "eeschema_id.h"
#include "libeditfrm.h"
#include "protos.h" #include "protos.h"
////@begin includes ////@begin includes
......
This diff is collapsed.
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "id.h" #include "eeschema_id.h"
#include "protos.h" #include "protos.h"
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "general.h" #include "general.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "protos.h" #include "protos.h"
#include "id.h" #include "eeschema_id.h"
#include "netlist.h" #include "netlist.h"
#include "annotate_dialog.h" #include "annotate_dialog.h"
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include "dialog_find.h" #include "dialog_find.h"
#include "netlist_control.h" #include "netlist_control.h"
#include "dialog_erc.h" #include "dialog_erc.h"
#include "libeditfrm.h"
#include "libviewfrm.h"
/*******************************/ /*******************************/
...@@ -92,6 +94,8 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame ) ...@@ -92,6 +94,8 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame )
EVT_TOOL( ID_GET_TOOLS, WinEDA_SchematicFrame::OnCreateBillOfMaterials ) EVT_TOOL( ID_GET_TOOLS, WinEDA_SchematicFrame::OnCreateBillOfMaterials )
EVT_TOOL( ID_FIND_ITEMS, WinEDA_SchematicFrame::OnFindItems ) EVT_TOOL( ID_FIND_ITEMS, WinEDA_SchematicFrame::OnFindItems )
EVT_TOOL( ID_BACKANNO_ITEMS, WinEDA_SchematicFrame::OnLoadStuffFile ) 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_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp )
EVT_MENU( ID_KICAD_ABOUT, WinEDA_DrawFrame::GetKicadAbout ) EVT_MENU( ID_KICAD_ABOUT, WinEDA_DrawFrame::GetKicadAbout )
......
...@@ -10,12 +10,14 @@ ...@@ -10,12 +10,14 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "eeschema_id.h"
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "trigo.h" #include "trigo.h"
#include "protos.h" #include "protos.h"
#include "id.h" #include "libeditfrm.h"
/* Routines locales */ /* Routines locales */
static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
...@@ -55,7 +57,7 @@ void WinEDA_bodygraphics_PropertiesFrame::bodygraphics_PropertiesAccept( wxComma ...@@ -55,7 +57,7 @@ void WinEDA_bodygraphics_PropertiesFrame::bodygraphics_PropertiesAccept( wxComma
if( CurrentDrawItem ) if( CurrentDrawItem )
{ {
if( !(CurrentDrawItem->m_Flags & IS_NEW) ) // if IS_NEW, copy for undo is done before place 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 ); wxClientDC dc( m_Parent->DrawPanel );
m_Parent->DrawPanel->PrepareGraphicContext( &dc ); m_Parent->DrawPanel->PrepareGraphicContext( &dc );
...@@ -105,7 +107,8 @@ void WinEDA_bodygraphics_PropertiesFrame::bodygraphics_PropertiesAccept( wxComma ...@@ -105,7 +107,8 @@ void WinEDA_bodygraphics_PropertiesFrame::bodygraphics_PropertiesAccept( wxComma
break; break;
} }
} }
CurrentLibEntry->SortDrawItems();
CurrentDrawItem->GetParent()->SortDrawItems();
m_Parent->GetScreen()->SetModify(); m_Parent->GetScreen()->SetModify();
...@@ -641,10 +644,10 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) ...@@ -641,10 +644,10 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC )
* courant, si elle existe et redessine toujours celle ci * courant, si elle existe et redessine toujours celle ci
* Parametres: (tous globaux) * Parametres: (tous globaux)
* CurrentDrawItem * CurrentDrawItem
* CurrentLibEntry * m_currentComponent
*/ */
{ {
if( CurrentLibEntry == NULL ) if( m_currentComponent == NULL )
return; return;
if( CurrentDrawItem == NULL ) if( CurrentDrawItem == NULL )
return; return;
...@@ -666,9 +669,9 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) ...@@ -666,9 +669,9 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC )
if( CurrentDrawItem->m_Flags & IS_NEW ) if( CurrentDrawItem->m_Flags & IS_NEW )
{ {
SaveCopyInUndoList( CurrentLibEntry ); SaveCopyInUndoList( m_currentComponent );
CurrentDrawItem->SetNext( CurrentLibEntry->m_Drawings ); CurrentDrawItem->SetNext( m_currentComponent->m_Drawings );
CurrentLibEntry->m_Drawings = CurrentDrawItem; m_currentComponent->m_Drawings = CurrentDrawItem;
switch( CurrentDrawItem->Type() ) switch( CurrentDrawItem->Type() )
{ {
...@@ -697,7 +700,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) ...@@ -697,7 +700,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC )
; ;
} }
CurrentLibEntry->SortDrawItems(); m_currentComponent->SortDrawItems();
} }
if( m_ID_current_state ) if( m_ID_current_state )
...@@ -713,7 +716,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) ...@@ -713,7 +716,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC )
MoveLibDrawItemAt( CurrentDrawItem, pos ); MoveLibDrawItemAt( CurrentDrawItem, pos );
} }
CurrentLibEntry->Draw( DrawPanel, DC, wxPoint( 0, 0 ), CurrentUnit, m_currentComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), CurrentUnit,
CurrentConvert, GR_DEFAULT_DRAWMODE ); CurrentConvert, GR_DEFAULT_DRAWMODE );
CurrentDrawItem->m_Flags = 0; CurrentDrawItem->m_Flags = 0;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditfrm.h"
/* /*
...@@ -37,7 +38,7 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void ) ...@@ -37,7 +38,7 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void )
CMP_LIBRARY* Lib; CMP_LIBRARY* Lib;
/* Exit if no library entry is selected or a command is in progress. */ /* Exit if no library entry is selected or a command is in progress. */
if( CurrentLibEntry == NULL if( m_currentComponent == NULL
|| ( CurrentDrawItem && CurrentDrawItem->m_Flags ) ) || ( CurrentDrawItem && CurrentDrawItem->m_Flags ) )
return; return;
...@@ -109,8 +110,8 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void ) ...@@ -109,8 +110,8 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void )
if( DrawEntry->Next() == NULL ) /* Fin de liste trouvee */ if( DrawEntry->Next() == NULL ) /* Fin de liste trouvee */
{ {
DrawEntry->SetNext( CurrentLibEntry->m_Drawings ); DrawEntry->SetNext( m_currentComponent->m_Drawings );
CurrentLibEntry->m_Drawings = Component->m_Drawings; m_currentComponent->m_Drawings = Component->m_Drawings;
Component->m_Drawings = NULL; Component->m_Drawings = NULL;
break; break;
} }
...@@ -119,10 +120,10 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void ) ...@@ -119,10 +120,10 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void )
} }
// Remove duplicated drawings: // Remove duplicated drawings:
CurrentLibEntry->RemoveDuplicateDrawItems(); m_currentComponent->RemoveDuplicateDrawItems();
// Clear flags // Clear flags
DrawEntry = CurrentLibEntry->m_Drawings; DrawEntry = m_currentComponent->m_Drawings;
while( DrawEntry ) while( DrawEntry )
{ {
DrawEntry->m_Flags = 0; DrawEntry->m_Flags = 0;
...@@ -151,14 +152,14 @@ void WinEDA_LibeditFrame::SaveOneSymbol() ...@@ -151,14 +152,14 @@ void WinEDA_LibeditFrame::SaveOneSymbol()
wxString msg; wxString msg;
FILE* ExportFile; FILE* ExportFile;
if( CurrentLibEntry->m_Drawings == NULL ) if( m_currentComponent->m_Drawings == NULL )
return; return;
/* Creation du fichier symbole */ /* Creation du fichier symbole */
wxString default_path = wxGetApp().ReturnLastVisitedLibraryPath(); wxString default_path = wxGetApp().ReturnLastVisitedLibraryPath();
wxFileDialog dlg( this, _( "Export Symbol Drawings" ), default_path, 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 ); wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
if( dlg.ShowModal() == wxID_CANCEL ) if( dlg.ShowModal() == wxID_CANCEL )
...@@ -194,28 +195,28 @@ void WinEDA_LibeditFrame::SaveOneSymbol() ...@@ -194,28 +195,28 @@ void WinEDA_LibeditFrame::SaveOneSymbol()
/* Creation du commentaire donnant le nom du composant */ /* Creation du commentaire donnant le nom du composant */
fprintf( ExportFile, "# SYMBOL %s\n#\n", 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 */ /* Generation des lignes utiles */
fprintf( ExportFile, "DEF %s", fprintf( ExportFile, "DEF %s",
CONV_TO_UTF8( CurrentLibEntry->m_Name.m_Text ) ); CONV_TO_UTF8( m_currentComponent->m_Name.m_Text ) );
if( !CurrentLibEntry->m_Prefix.m_Text.IsEmpty() ) if( !m_currentComponent->m_Prefix.m_Text.IsEmpty() )
fprintf( ExportFile, " %s", fprintf( ExportFile, " %s",
CONV_TO_UTF8( CurrentLibEntry->m_Prefix.m_Text ) ); CONV_TO_UTF8( m_currentComponent->m_Prefix.m_Text ) );
else else
fprintf( ExportFile, " ~" ); fprintf( ExportFile, " ~" );
fprintf( ExportFile, " %d %d %c %c %d %d %c\n", fprintf( ExportFile, " %d %d %c %c %d %d %c\n",
0, /* unused */ 0, /* unused */
CurrentLibEntry->m_TextInside, m_currentComponent->m_TextInside,
CurrentLibEntry->m_DrawPinNum ? 'Y' : 'N', m_currentComponent->m_DrawPinNum ? 'Y' : 'N',
CurrentLibEntry->m_DrawPinName ? 'Y' : 'N', m_currentComponent->m_DrawPinName ? 'Y' : 'N',
1, 0 /* unused */, 'N' ); 1, 0 /* unused */, 'N' );
/* Position / orientation / visibilite des champs */ /* Position / orientation / visibilite des champs */
CurrentLibEntry->m_Prefix.Save( ExportFile ); m_currentComponent->m_Prefix.Save( ExportFile );
CurrentLibEntry->m_Name.Save( ExportFile ); m_currentComponent->m_Name.Save( ExportFile );
DrawEntry = CurrentLibEntry->m_Drawings; DrawEntry = m_currentComponent->m_Drawings;
if( DrawEntry ) if( DrawEntry )
{ {
...@@ -250,14 +251,14 @@ void WinEDA_LibeditFrame::SaveOneSymbol() ...@@ -250,14 +251,14 @@ void WinEDA_LibeditFrame::SaveOneSymbol()
/***************************************************************************/ /***************************************************************************/
void WinEDA_LibeditFrame::PlaceAncre() void WinEDA_LibeditFrame::PlaceAncre()
{ {
if( CurrentLibEntry == NULL ) if( m_currentComponent == NULL )
return; return;
wxPoint offset( -GetScreen()->m_Curseur.x, GetScreen()->m_Curseur.y ); wxPoint offset( -GetScreen()->m_Curseur.x, GetScreen()->m_Curseur.y );
GetScreen()->SetModify(); GetScreen()->SetModify();
CurrentLibEntry->SetOffset( offset ); m_currentComponent->SetOffset( offset );
/* Redraw the symbol */ /* Redraw the symbol */
GetScreen()->m_Curseur.x = GetScreen()->m_Curseur.y = 0; GetScreen()->m_Curseur.x = GetScreen()->m_Curseur.y = 0;
......
...@@ -3,14 +3,16 @@ ...@@ -3,14 +3,16 @@
/********************************************/ /********************************************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "hotkeys.h"
#include "bitmaps.h"
#include "eeschema_id.h"
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "hotkeys.h" #include "libeditfrm.h"
#ifdef __UNIX__ #ifdef __UNIX__
#define LISTBOX_WIDTH 140 #define LISTBOX_WIDTH 140
...@@ -18,9 +20,6 @@ ...@@ -18,9 +20,6 @@
#define LISTBOX_WIDTH 120 #define LISTBOX_WIDTH 120
#endif #endif
#include "bitmaps.h"
#include "id.h"
extern int ExportPartId; extern int ExportPartId;
extern int ImportPartId; extern int ImportPartId;
...@@ -42,7 +41,7 @@ void WinEDA_LibeditFrame::ReCreateVToolbar() ...@@ -42,7 +41,7 @@ void WinEDA_LibeditFrame::ReCreateVToolbar()
m_VToolBar->AddSeparator(); m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_LIBEDIT_PIN_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_LIBEDIT_PIN_BUTT, wxEmptyString,
wxBitmap( pin_xpm ), wxBitmap( pin_xpm ),
_( "Add Pins" ), wxITEM_CHECK ); _( "Add pin" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_LIBEDIT_BODY_TEXT_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_LIBEDIT_BODY_TEXT_BUTT, wxEmptyString,
wxBitmap( add_text_xpm ), wxBitmap( add_text_xpm ),
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "hotkeys.h" #include "hotkeys.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "id.h" #include "eeschema_id.h"
/**************************************************************/ /**************************************************************/
......
...@@ -5,13 +5,14 @@ ...@@ -5,13 +5,14 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "id.h" #include "eeschema_id.h"
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "class_library.h" #include "class_library.h"
#include "libviewfrm.h"
void WinEDA_ViewlibFrame::ReCreateHToolbar() void WinEDA_ViewlibFrame::ReCreateHToolbar()
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "id.h" #include "eeschema_id.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "bitmaps.h" #include "bitmaps.h"
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libviewfrm.h"
/*****************************/ /*****************************/
...@@ -30,8 +31,9 @@ BEGIN_EVENT_TABLE( WinEDA_ViewlibFrame, WinEDA_DrawFrame ) ...@@ -30,8 +31,9 @@ BEGIN_EVENT_TABLE( WinEDA_ViewlibFrame, WinEDA_DrawFrame )
/* Toolbar events */ /* 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 ) WinEDA_ViewlibFrame::Process_Special_Functions )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_ViewlibFrame::OnZoom ) EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_ViewlibFrame::OnZoom )
EVT_TOOL( ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC, EVT_TOOL( ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC,
WinEDA_ViewlibFrame::ExportToSchematicLibraryPart ) WinEDA_ViewlibFrame::ExportToSchematicLibraryPart )
......
...@@ -9,12 +9,13 @@ ...@@ -9,12 +9,13 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "eda_doc.h" #include "eda_doc.h"
#include "id.h"
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libviewfrm.h"
#include "eeschema_id.h"
#define NEXT_PART 1 #define NEXT_PART 1
......
...@@ -10,17 +10,12 @@ ...@@ -10,17 +10,12 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "id.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "gerbview.h" #include "gerbview.h"
#include "protos.h" #include "protos.h"
/* Routines Locales : */
/* Variables Locales */
/**********************************************************************/ /**********************************************************************/
BOARD_ITEM* WinEDA_GerberFrame::GerberGeneralLocateAndDisplay() BOARD_ITEM* WinEDA_GerberFrame::GerberGeneralLocateAndDisplay()
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
/******************************************************/ /******************************************************/
#include "fctsys.h" #include "fctsys.h"
#include "id.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
...@@ -13,6 +12,8 @@ ...@@ -13,6 +12,8 @@
#include "pcbplot.h" #include "pcbplot.h"
#include "protos.h" #include "protos.h"
/************************************************************************/ /************************************************************************/
void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
/************************************************************************/ /************************************************************************/
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "gerbview.h" #include "gerbview.h"
#include "pcbplot.h" #include "pcbplot.h"
#include "protos.h" #include "protos.h"
#include "id.h"
/* Routines locales */ /* Routines locales */
...@@ -50,7 +49,6 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event ) ...@@ -50,7 +49,6 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
switch( id ) switch( id )
{ {
case ID_MENU_LOAD_FILE:
case ID_LOAD_FILE: case ID_LOAD_FILE:
if( Clear_Pcb( TRUE ) ) if( Clear_Pcb( TRUE ) )
{ {
...@@ -72,12 +70,10 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event ) ...@@ -72,12 +70,10 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
} }
break; break;
case ID_MENU_APPEND_FILE:
case ID_APPEND_FILE: case ID_APPEND_FILE:
LoadOneGerberFile( wxEmptyString, &dc, 0 ); LoadOneGerberFile( wxEmptyString, &dc, 0 );
break; break;
case ID_MENU_NEW_BOARD:
case ID_NEW_BOARD: case ID_NEW_BOARD:
Clear_Pcb( TRUE ); Clear_Pcb( TRUE );
Zoom_Automatique( FALSE ); Zoom_Automatique( FALSE );
...@@ -93,11 +89,10 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event ) ...@@ -93,11 +89,10 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
break; break;
case ID_SAVE_BOARD: case ID_SAVE_BOARD:
case ID_MENU_SAVE_BOARD:
SaveGerberFile( GetScreen()->m_FileName, &dc ); SaveGerberFile( GetScreen()->m_FileName, &dc );
break; break;
case ID_MENU_SAVE_BOARD_AS: case ID_SAVE_BOARD_AS:
SaveGerberFile( wxEmptyString, &dc ); SaveGerberFile( wxEmptyString, &dc );
break; break;
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "pcbplot.h" #include "pcbplot.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "protos.h" #include "protos.h"
#include "id.h"
/****************************************/ /****************************************/
...@@ -38,12 +37,12 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame ) ...@@ -38,12 +37,12 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame )
EVT_TOOL( ID_SAVE_BOARD, WinEDA_GerberFrame::Files_io ) EVT_TOOL( ID_SAVE_BOARD, WinEDA_GerberFrame::Files_io )
// Menu Files: // Menu Files:
EVT_MENU( ID_MENU_LOAD_FILE, WinEDA_GerberFrame::Files_io ) EVT_MENU( ID_LOAD_FILE, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_MENU_APPEND_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_INC_LAYER_AND_APPEND_FILE, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_MENU_NEW_BOARD, WinEDA_GerberFrame::Files_io ) EVT_MENU( ID_NEW_BOARD, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_MENU_SAVE_BOARD, WinEDA_GerberFrame::Files_io ) EVT_MENU( ID_SAVE_BOARD, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_MENU_SAVE_BOARD_AS, 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_GEN_PLOT, WinEDA_GerberFrame::ToPlotter )
EVT_MENU( ID_GERBVIEW_EXPORT_TO_PCBNEW, EVT_MENU( ID_GERBVIEW_EXPORT_TO_PCBNEW,
WinEDA_GerberFrame::ExportDataInPcbnewFormat ) WinEDA_GerberFrame::ExportDataInPcbnewFormat )
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
#include "pcbcommon.h" #include "pcbcommon.h"
#include "gerbview.h" #include "gerbview.h"
#include "pcbplot.h" #include "pcbplot.h"
#include "id.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "gerbview_config.h" #include "gerbview_config.h"
#include "protos.h" #include "protos.h"
......
...@@ -4,10 +4,9 @@ ...@@ -4,10 +4,9 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "gerbview.h"
#include "id.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "gerbview.h"
#include "protos.h" #include "protos.h"
/* How to add a new hotkey: /* How to add a new hotkey:
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "id.h"
#include "confirm.h" #include "confirm.h"
#include "gerbview.h" #include "gerbview.h"
......
...@@ -14,12 +14,10 @@ ...@@ -14,12 +14,10 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "gerbview.h"
#include "pcbplot.h" #include "pcbplot.h"
#include "gerbview.h"
#include "id.h"
#include "protos.h" #include "protos.h"
#include <wx/spinctrl.h> #include <wx/spinctrl.h>
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "id.h"
#include "gerbview.h" #include "gerbview.h"
#include "pcbplot.h" #include "pcbplot.h"
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "pcbplot.h" #include "pcbplot.h"
#include "protos.h" #include "protos.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "id.h"
#include "hotkeys.h" #include "hotkeys.h"
/***********************************************/ /***********************************************/
...@@ -30,11 +29,11 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void ) ...@@ -30,11 +29,11 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
menuBar = new wxMenuBar(); menuBar = new wxMenuBar();
wxMenu* filesMenu = new wxMenu; 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" ), _( "Clear all layers and Load new Gerber file" ),
FALSE ); 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" ), _( "Load new Gerber file on currrent layer" ),
FALSE ); FALSE );
...@@ -50,7 +49,7 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void ) ...@@ -50,7 +49,7 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
_( "Load excellon drill file" ), FALSE ); _( "Load excellon drill file" ), FALSE );
#endif #endif
filesMenu->Append( ID_MENU_NEW_BOARD, _( "&New" ), filesMenu->Append( ID_NEW_BOARD, _( "&New" ),
_( "Clear all layers" ), FALSE ); _( "Clear all layers" ), FALSE );
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
...@@ -59,10 +58,10 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void ) ...@@ -59,10 +58,10 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
#if 0 #if 0
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
filesMenu->Append( ID_MENU_SAVE_BOARD, _( "&Save Layers" ), filesMenu->Append( ID_SAVE_BOARD, _( "&Save Layers" ),
_( "Save current layers (GERBER format)" ), FALSE ); _( "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 ); _( "Save current layers as.." ), FALSE );
#endif #endif
...@@ -308,7 +307,7 @@ create or update the right vertical toolbar ...@@ -308,7 +307,7 @@ create or update the right vertical toolbar
_( "Add layer alignment target" ) ); _( "Add layer alignment target" ) );
m_VToolBar->AddSeparator(); m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_TEXT_COMMENT_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_ADD_TEXT_BUTT, wxEmptyString,
wxBitmap( tool_text_xpm ), wxBitmap( tool_text_xpm ),
_( "Add Text" ) ); _( "Add Text" ) );
......
...@@ -5,6 +5,31 @@ ...@@ -5,6 +5,31 @@
#ifndef WX_GERBER_STRUCT_H #ifndef WX_GERBER_STRUCT_H
#define 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 class WinEDA_GerberFrame: this is the main window used in gerbview
******************************************************************/ ******************************************************************/
...@@ -64,18 +89,22 @@ public: ...@@ -64,18 +89,22 @@ public:
void Block_Delete( wxDC* DC ); void Block_Delete( wxDC* DC );
void Block_Rotate( wxDC* DC ); void Block_Rotate( wxDC* DC );
void Block_Invert( wxDC* DC ); void Block_Invert( wxDC* DC );
/** /**
* Function Block_Move * Function Block_Move
* moves all tracks and segments within the selected block. * 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 * Defined separately in pcbnew and gerbview
* *
* @param DC A device context to draw on. * @param DC A device context to draw on.
*/ */
void Block_Move( wxDC* DC ); void Block_Move( wxDC* DC );
/** /**
* Function Block_Mirror_X * 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. * @param DC A device context to draw on.
*/ */
...@@ -83,7 +112,8 @@ public: ...@@ -83,7 +112,8 @@ public:
/** /**
* Function Block_Duplicate * Function Block_Duplicate
* copies-and-moves all tracks and segments within the selected block. * 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 * Defined separately in pcbnew and gerbview
* *
* @param DC A device context to draw on. * @param DC A device context to draw on.
...@@ -96,16 +126,20 @@ public: ...@@ -96,16 +126,20 @@ public:
void Genere_GERBER( const wxString& FullFileName, int Layers ); void Genere_GERBER( const wxString& FullFileName, int Layers );
void Genere_PS( const wxString& FullFileName, int Layers ); void Genere_PS( const wxString& FullFileName, int Layers );
void Plot_Layer_HPGL( FILE* File, int masque_layer, 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, 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 ); int Gen_D_CODE_File( const wxString& Name_File );
void Plot_Layer_PS( FILE* File, int masque_layer, 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 Files_io( wxCommandEvent& event );
void OnFileHistory( 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 ); int ReadGerberFile( wxDC* DC, FILE* File, bool Append );
bool Read_GERBER_File( wxDC* DC, bool Read_GERBER_File( wxDC* DC,
const wxString& GERBER_FullFileName, const wxString& GERBER_FullFileName,
...@@ -117,7 +151,8 @@ public: ...@@ -117,7 +151,8 @@ public:
/** /**
* Function Read_D_Code_File * 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.
* <p> * <p>
* Format is like CSV but with optional ';' delineated comments:<br> * Format is like CSV but with optional ';' delineated comments:<br>
* tool, Horiz, Vert, drill, vitesse, acc. ,Type ; [DCODE (commentaire)]<br> * tool, Horiz, Vert, drill, vitesse, acc. ,Type ; [DCODE (commentaire)]<br>
...@@ -132,7 +167,9 @@ public: ...@@ -132,7 +167,9 @@ public:
* @return int - <br> * @return int - <br>
* -1 = file not found<br> * -1 = file not found<br>
* -2 = parsing problem<br> * -2 = parsing problem<br>
* 0 = the \a D_Code_FullFileName is empty, no reading is done but an empty GERBER is put into g_GERBER_List[]<br> * 0 = the \a D_Code_FullFileName is empty, no reading
* is done but an empty GERBER is put into
* g_GERBER_List[]<br>
* 1 = read OK<br> * 1 = read OK<br>
*/ */
int Read_D_Code_File( const wxString& D_Code_FullFileName ); int Read_D_Code_File( const wxString& D_Code_FullFileName );
...@@ -170,19 +207,22 @@ public: ...@@ -170,19 +207,22 @@ public:
* currently: do nothing in gerbview. * currently: do nothing in gerbview.
* but but be defined because it is a pure virtual in WinEDA_BasePcbFrame * but but be defined because it is a pure virtual in WinEDA_BasePcbFrame
*/ */
virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy, virtual void SaveCopyInUndoList(
BOARD_ITEM* aItemToCopy,
UndoRedoOpType aTypeCommand = UR_UNSPECIFIED, UndoRedoOpType aTypeCommand = UR_UNSPECIFIED,
const wxPoint& aTransformPoint = wxPoint(0,0) ) const wxPoint& aTransformPoint = wxPoint(0,0) ) { }
{
}
/** Function SaveCopyInUndoList (overloaded). /** Function SaveCopyInUndoList (overloaded).
* Creates a new entry in undo list of commands. * Creates a new entry in undo list of commands.
* add a list of pickers to handle a list of items * add a list of pickers to handle a list of items
* @param aItemsList = the list of items modified by the command to undo * @param aItemsList = the list of items modified by the command to undo
* @param aTypeCommand = command type (see enum UndoRedoOpType) * @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, virtual void SaveCopyInUndoList(
PICKED_ITEMS_LIST& aItemsList,
UndoRedoOpType aTypeCommand,
const wxPoint& aTransformPoint = wxPoint(0,0) ) const wxPoint& aTransformPoint = wxPoint(0,0) )
{ {
// currently: do nothing in gerbview. // currently: do nothing in gerbview.
......
This diff is collapsed.
...@@ -31,6 +31,7 @@ extern wxString NetCmpExtBuffer; ...@@ -31,6 +31,7 @@ extern wxString NetCmpExtBuffer;
extern const wxString ModuleFileExtension; extern const wxString ModuleFileExtension;
extern const wxString ModuleFileWildcard; extern const wxString ModuleFileWildcard;
extern const wxString PcbFileWildcard;
extern wxString g_ViaType_Name[4]; extern wxString g_ViaType_Name[4];
......
This diff is collapsed.
...@@ -249,7 +249,7 @@ public: ...@@ -249,7 +249,7 @@ public:
void OnFileHistory( wxCommandEvent& event ); void OnFileHistory( wxCommandEvent& event );
void Files_io( 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 ); int ReadPcbFile( FILE* File, bool Append );
bool SavePcbFile( const wxString& FileName ); bool SavePcbFile( const wxString& FileName );
int SavePcbFormatAscii( FILE* File ); int SavePcbFormatAscii( FILE* File );
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "kicad.h" #include "kicad.h"
#include "macros.h" #include "macros.h"
#include "bitmaps.h" // Common bitmaps #include "bitmaps.h" // Common bitmaps
#include "id.h"
/*****************************************************************************/ /*****************************************************************************/
......
...@@ -4,17 +4,10 @@ ...@@ -4,17 +4,10 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "bitmaps.h"
#include "kicad.h"
#include "macros.h" #include "macros.h"
// ---------------------------------------------------------------------------- #include "kicad.h"
// resources
// ----------------------------------------------------------------------------
// USE_XPM_BITMAPS
#include "bitmaps.h"
#include "id.h"
/************************************************************************************/ /************************************************************************************/
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "bitmaps.h" #include "bitmaps.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "id.h"
#include "kicad.h" #include "kicad.h"
#include "prjconfig.h" #include "prjconfig.h"
......
This diff is collapsed.
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "id.h"
#include "kicad.h" #include "kicad.h"
...@@ -81,7 +80,7 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent, ...@@ -81,7 +80,7 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
m_BottomWin->SetSashVisible( wxSASH_LEFT, TRUE ); m_BottomWin->SetSashVisible( wxSASH_LEFT, TRUE );
m_BottomWin->SetExtraBorderSize( 2 ); 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, wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE | wxNO_BORDER | wxTE_READONLY ); wxTE_MULTILINE | wxNO_BORDER | wxTE_READONLY );
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "id.h"
#include "kicad.h" #include "kicad.h"
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "prjconfig.h" #include "prjconfig.h"
#include "id.h"
#include "kicad.h" #include "kicad.h"
static const wxString GeneralGroupName( wxT( "/general" ) ); static const wxString GeneralGroupName( wxT( "/general" ) );
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "common.h" #include "common.h"
#include "gestfich.h" #include "gestfich.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "bitmaps.h"
#include "kicad.h" #include "kicad.h"
...@@ -20,10 +21,6 @@ ...@@ -20,10 +21,6 @@
#include "wx/regex.h" #include "wx/regex.h"
#include "wx/dir.h" #include "wx/dir.h"
#include "bitmaps.h"
#include "id.h"
/********************************************/ /********************************************/
/* Methodes pour l'arbre gestion du projet */ /* Methodes pour l'arbre gestion du projet */
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "bitmaps.h"
#include "kicad.h" #include "kicad.h"
...@@ -23,9 +24,6 @@ ...@@ -23,9 +24,6 @@
#include "wx/regex.h" #include "wx/regex.h"
#include "wx/dir.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 // 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 // UnComment this to load subdirs files in the tree project
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "autorout.h" #include "autorout.h"
#include "cell.h" #include "cell.h"
#include "id.h" #include "pcbnew_id.h"
#include "protos.h" #include "protos.h"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "pcbnew.h" #include "pcbnew.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "protos.h" #include "protos.h"
#include "id.h" #include "pcbnew_id.h"
#include "collectors.h" #include "collectors.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "common.h" #include "common.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "id.h" #include "pcbnew_id.h"
#include "collectors.h" #include "collectors.h"
#include "bitmaps.h" #include "bitmaps.h"
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "pcbnew.h" #include "pcbnew.h"
#include "trigo.h" #include "trigo.h"
#include "id.h" // ID_TRACK_BUTT #include "pcbnew_id.h" // ID_TRACK_BUTT
/*******************************/ /*******************************/
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment