Commit b762f6aa authored by stambaughw's avatar stambaughw

Component library editor improvements.

* Eliminate external direct manipulation of component draw item pointer.
* Add draw item remove, add, and locate methods to library component object.
* Remove redundant locate pin, field, and draw item code.
* Fix add new pin drawing bug that left initial pin draw in place.
* Improved best zoom calculations for small components.
* Library component bounding box calculation now includes fields.
* Removed unnecessary header file "libcmp.h".
* Fixed potential locate draw item bug in library editor hot key handler.
parent d1e137d6
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "program.h" #include "program.h"
#include "general.h" #include "general.h"
#include "libcmp.h"
#include "protos.h" #include "protos.h"
/* Constructor and destructor for SCH_ITEM */ /* Constructor and destructor for SCH_ITEM */
......
...@@ -861,51 +861,47 @@ static LIB_DRAW_ITEM* GetNextPinPosition( SCH_COMPONENT* aDrawLibItem, ...@@ -861,51 +861,47 @@ static LIB_DRAW_ITEM* GetNextPinPosition( SCH_COMPONENT* aDrawLibItem,
*/ */
{ {
LIB_COMPONENT* Entry; LIB_COMPONENT* Entry;
static LIB_DRAW_ITEM* NextItem; static LibDrawPin* NextPin;
static int Multi, convert, TransMat[2][2]; static int Multi, convert, TransMat[2][2];
LIB_DRAW_ITEM* DEntry;
int orient; int orient;
LibDrawPin* Pin; LibDrawPin* Pin;
static wxPoint CmpPosition; static wxPoint CmpPosition;
if( aDrawLibItem ) if( aDrawLibItem )
{ {
NextItem = NULL; NextPin = NULL;
Entry = CMP_LIBRARY::FindLibraryComponent( aDrawLibItem->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( aDrawLibItem->m_ChipName );
if( Entry == NULL ) if( Entry == NULL )
return NULL; return NULL;
DEntry = Entry->m_Drawings; Pin = Entry->GetNextPin();
Multi = aDrawLibItem->m_Multi; Multi = aDrawLibItem->m_Multi;
convert = aDrawLibItem->m_Convert; convert = aDrawLibItem->m_Convert;
CmpPosition = aDrawLibItem->m_Pos; CmpPosition = aDrawLibItem->m_Pos;
memcpy( TransMat, aDrawLibItem->m_Transform, sizeof(TransMat) ); memcpy( TransMat, aDrawLibItem->m_Transform, sizeof(TransMat) );
} }
else else
DEntry = NextItem; Pin = NextPin;
for( ; DEntry != NULL; DEntry = DEntry->Next() ) for( ; Pin != NULL; NextPin = Entry->GetNextPin( Pin ) )
{ {
wxASSERT( Pin->Type() == COMPONENT_PIN_DRAW_TYPE );
/* Elimination des elements non relatifs a l'unite */ /* Elimination des elements non relatifs a l'unite */
if( Multi && DEntry->m_Unit && (DEntry->m_Unit != Multi) ) if( Multi && Pin->m_Unit && ( Pin->m_Unit != Multi ) )
continue;
if( convert && DEntry->m_Convert && (DEntry->m_Convert != convert) )
continue; continue;
if( DEntry->Type() != COMPONENT_PIN_DRAW_TYPE ) if( convert && Pin->m_Convert && ( Pin->m_Convert != convert ) )
continue; continue;
Pin = (LibDrawPin*) DEntry;
/* Calcul de l'orientation reelle de la Pin */ /* Calcul de l'orientation reelle de la Pin */
orient = Pin->ReturnPinDrawOrient( TransMat ); orient = Pin->ReturnPinDrawOrient( TransMat );
/* Calcul de la position du point de reference */ /* Calcul de la position du point de reference */
aPosition = TransformCoordinate( TransMat, Pin->m_Pos ) + CmpPosition; aPosition = TransformCoordinate( TransMat, Pin->m_Pos ) + CmpPosition;
NextItem = DEntry->Next(); return Pin;
return DEntry;
} }
NextItem = NULL; NextPin = NULL;
return NULL; return NULL;
} }
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
bool erase ); bool erase );
static void MirrorMarkedItems( LIB_COMPONENT* LibEntry, wxPoint offset );
/* /*
...@@ -77,6 +76,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) ...@@ -77,6 +76,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC )
{ {
int ItemCount = 0; int ItemCount = 0;
int MustDoPlace = 0; int MustDoPlace = 0;
wxPoint pt;
if( GetScreen()->m_BlockLocate.GetCount() ) if( GetScreen()->m_BlockLocate.GetCount() )
{ {
...@@ -147,7 +147,9 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) ...@@ -147,7 +147,9 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC )
g_EditPinByPinIsOn ); g_EditPinByPinIsOn );
if( ItemCount ) if( ItemCount )
SaveCopyInUndoList( m_component ); SaveCopyInUndoList( m_component );
MirrorMarkedItems( m_component, GetScreen()->m_BlockLocate.Centre() ); pt = GetScreen()->m_BlockLocate.Centre();
pt.y *= -1;
m_component->MirrorSelectedItemsH( pt );
break; break;
case BLOCK_ZOOM: /* Window Zoom */ case BLOCK_ZOOM: /* Window Zoom */
...@@ -191,7 +193,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) ...@@ -191,7 +193,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC )
void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC ) void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC )
{ {
bool err = FALSE; bool err = FALSE;
wxPoint offset; wxPoint pt;
if( DrawPanel->ManageCurseur == NULL ) if( DrawPanel->ManageCurseur == NULL )
{ {
...@@ -212,18 +214,18 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC ) ...@@ -212,18 +214,18 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC )
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( m_component ); SaveCopyInUndoList( m_component );
offset = GetScreen()->m_BlockLocate.m_MoveVector; pt = GetScreen()->m_BlockLocate.m_MoveVector;
offset.y *= -1; pt.y *= -1;
m_component->MoveSelectedItems( offset ); m_component->MoveSelectedItems( pt );
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( m_component ); SaveCopyInUndoList( m_component );
offset = GetScreen()->m_BlockLocate.m_MoveVector; pt = GetScreen()->m_BlockLocate.m_MoveVector;
offset.y *= -1; pt.y *= -1;
m_component->CopySelectedItems( offset ); m_component->CopySelectedItems( pt );
break; break;
case BLOCK_PASTE: /* Paste (recopie du dernier bloc sauve */ case BLOCK_PASTE: /* Paste (recopie du dernier bloc sauve */
...@@ -232,7 +234,9 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC ) ...@@ -232,7 +234,9 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC )
case BLOCK_MIRROR_Y: /* Invert by popup menu, from block move */ case BLOCK_MIRROR_Y: /* Invert by popup menu, from block move */
SaveCopyInUndoList( m_component ); SaveCopyInUndoList( m_component );
MirrorMarkedItems( m_component, GetScreen()->m_BlockLocate.Centre() ); pt = GetScreen()->m_BlockLocate.Centre();
pt.y *= -1;
m_component->MirrorSelectedItemsH( pt );
break; break;
case BLOCK_ZOOM: // Handled by HandleBlockEnd case BLOCK_ZOOM: // Handled by HandleBlockEnd
...@@ -305,88 +309,3 @@ void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -305,88 +309,3 @@ void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
g_XorMode, -1, DefaultTransformMatrix, g_XorMode, -1, DefaultTransformMatrix,
true, true, true ); true, true, true );
} }
/*
* Mirror marked items, refer to a Vertical axis at position offset
*/
void MirrorMarkedItems( LIB_COMPONENT* LibEntry, wxPoint offset )
{
#define SETMIRROR( z ) (z) -= offset.x; (z) = -(z); (z) += offset.x;
LIB_DRAW_ITEM* item;
if( LibEntry == NULL )
return;
offset.y = -offset.y; // Y axis for lib items is Down to Up: reverse y offset value
item = LibEntry->m_Drawings;
for( ; item != NULL; item = item->Next() )
{
if( item->m_Selected == 0 )
continue;
switch( item->Type() )
{
case COMPONENT_PIN_DRAW_TYPE:
SETMIRROR( ( (LibDrawPin*) item )->m_Pos.x );
switch( ( (LibDrawPin*) item )->m_Orient )
{
case PIN_RIGHT:
( (LibDrawPin*) item )->m_Orient = PIN_LEFT;
break;
case PIN_LEFT:
( (LibDrawPin*) item )->m_Orient = PIN_RIGHT;
break;
case PIN_UP:
case PIN_DOWN:
break;
}
break;
case COMPONENT_ARC_DRAW_TYPE:
{
SETMIRROR( ( (LibDrawArc*) item )->m_Pos.x );
SETMIRROR( ( (LibDrawArc*) item )->m_ArcStart.x );
SETMIRROR( ( (LibDrawArc*) item )->m_ArcEnd.x );
EXCHG( ( (LibDrawArc*) item )->m_ArcStart,
( (LibDrawArc*) item )->m_ArcEnd );
break;
}
case COMPONENT_CIRCLE_DRAW_TYPE:
SETMIRROR( ( (LibDrawCircle*) item )->m_Pos.x );
break;
case COMPONENT_RECT_DRAW_TYPE:
SETMIRROR( ( (LibDrawSquare*) item )->m_Pos.x );
SETMIRROR( ( (LibDrawSquare*) item )->m_End.x );
break;
case COMPONENT_POLYLINE_DRAW_TYPE:
{
unsigned ii, imax = ( (LibDrawPolyline*) item )->GetCornerCount();
for( ii = 0; ii < imax; ii ++ )
{
SETMIRROR( ( (LibDrawPolyline*) item )->m_PolyPoints[ii].x );
}
}
break;
case COMPONENT_LINE_DRAW_TYPE:
break;
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
SETMIRROR( ( (LibDrawText*) item )->m_Pos.x );
break;
default:
break;
}
item->m_Flags = item->m_Selected = 0;
}
}
...@@ -226,6 +226,14 @@ void LibDrawText::DoMove( const wxPoint& newPosition ) ...@@ -226,6 +226,14 @@ void LibDrawText::DoMove( const wxPoint& newPosition )
} }
void LibDrawText::DoMirrorHorizontal( const wxPoint& center )
{
m_Pos.x -= center.x;
m_Pos.x *= -1;
m_Pos.x += center.x;
}
/** Function GetPenSize /** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item * @return the size of the "pen" that be used to draw or plot this item
*/ */
......
...@@ -326,7 +326,6 @@ LIB_COMPONENT::LIB_COMPONENT( const LIB_COMPONENT& component, ...@@ -326,7 +326,6 @@ LIB_COMPONENT::LIB_COMPONENT( const LIB_COMPONENT& component,
LibDrawField* oldField; LibDrawField* oldField;
LibDrawField* newField; LibDrawField* newField;
m_Prefix = component.m_Prefix; m_Prefix = component.m_Prefix;
m_AliasList = component.m_AliasList; m_AliasList = component.m_AliasList;
m_FootprintList = component.m_FootprintList; m_FootprintList = component.m_FootprintList;
...@@ -336,6 +335,7 @@ LIB_COMPONENT::LIB_COMPONENT( const LIB_COMPONENT& component, ...@@ -336,6 +335,7 @@ LIB_COMPONENT::LIB_COMPONENT( const LIB_COMPONENT& component,
m_DrawPinNum = component.m_DrawPinNum; m_DrawPinNum = component.m_DrawPinNum;
m_DrawPinName = component.m_DrawPinName; m_DrawPinName = component.m_DrawPinName;
m_LastDate = component.m_LastDate; m_LastDate = component.m_LastDate;
m_Drawings = NULL;
m_Prefix.SetParent( this ); m_Prefix.SetParent( this );
...@@ -505,6 +505,8 @@ void LIB_COMPONENT::RemoveDrawItem( LIB_DRAW_ITEM* item, ...@@ -505,6 +505,8 @@ void LIB_COMPONENT::RemoveDrawItem( LIB_DRAW_ITEM* item,
item->Draw( panel, dc, wxPoint( 0, 0 ), -1, g_XorMode, NULL, item->Draw( panel, dc, wxPoint( 0, 0 ), -1, g_XorMode, NULL,
DefaultTransformMatrix ); DefaultTransformMatrix );
if( item->Type() != COMPONENT_FIELD_DRAW_TYPE )
{
if( m_Drawings == item ) if( m_Drawings == item )
{ {
m_Drawings = item->Next(); m_Drawings = item->Next();
...@@ -523,6 +525,63 @@ void LIB_COMPONENT::RemoveDrawItem( LIB_DRAW_ITEM* item, ...@@ -523,6 +525,63 @@ void LIB_COMPONENT::RemoveDrawItem( LIB_DRAW_ITEM* item,
prevItem = prevItem->Next(); prevItem = prevItem->Next();
} }
}
else
{
LibDrawField* field;
for( field = m_Fields; field != NULL; field = field->Next() )
{
if( field == item )
{
m_Fields.Remove( field );
delete field;
break;
}
}
}
}
void LIB_COMPONENT::AddDrawItem( LIB_DRAW_ITEM* item )
{
wxASSERT( item != NULL );
if( m_Drawings == NULL )
{
m_Drawings = item;
item->SetNext( NULL );
return;
}
LIB_DRAW_ITEM* i = m_Drawings;
while( i->Next() != NULL )
i = i->Next();
i->SetNext( item );
item->SetNext( NULL );
SortDrawItems();
}
LIB_DRAW_ITEM* LIB_COMPONENT::GetNextDrawItem( LIB_DRAW_ITEM* item,
KICAD_T type )
{
if( type == TYPE_NOT_INIT )
return ( item == NULL ) ? m_Drawings : item->Next();
LIB_DRAW_ITEM* i = ( item == NULL ) ? m_Drawings : item->Next();
while( i != NULL )
{
if( i->Type() == type )
return i;
i = i->Next();
}
return i;
} }
...@@ -940,7 +999,7 @@ void LIB_COMPONENT::SortDrawItems() ...@@ -940,7 +999,7 @@ void LIB_COMPONENT::SortDrawItems()
if( Entry == NULL ) if( Entry == NULL )
return; /* Pas d'alias pour ce composant */ return; /* Pas d'alias pour ce composant */
/* calcul du nombre d'items */
for( nbitems = 0; Entry != NULL; Entry = Entry->Next() ) for( nbitems = 0; Entry != NULL; Entry = Entry->Next() )
nbitems++; nbitems++;
...@@ -978,23 +1037,25 @@ void LIB_COMPONENT::SortDrawItems() ...@@ -978,23 +1037,25 @@ void LIB_COMPONENT::SortDrawItems()
/**********************************************************************/ /**********************************************************************/
EDA_Rect LIB_COMPONENT::GetBoundaryBox( int Unit, int Convert ) EDA_Rect LIB_COMPONENT::GetBoundaryBox( int Unit, int Convert )
{ {
LIB_DRAW_ITEM* DrawEntry; LIB_DRAW_ITEM* item;
EDA_Rect bBox( wxPoint( 0, 0 ), wxSize( 0, 0 ) ); EDA_Rect bBox( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
for( DrawEntry = m_Drawings; DrawEntry != NULL; for( item = m_Drawings; item != NULL; item = item->Next() )
DrawEntry = DrawEntry->Next() )
{ {
if( DrawEntry->m_Unit > 0 ) // The item is non common to units if( ( item->m_Unit > 0 )
if( ( m_UnitCount > 1 ) && ( Unit > 0 ) && ( ( m_UnitCount > 1 ) && ( Unit > 0 )
&& ( Unit != DrawEntry->m_Unit ) ) && ( Unit != item->m_Unit ) ) )
continue; continue;
if( DrawEntry->m_Convert > 0 ) // The item is not common to all convert if( item->m_Convert > 0
if( ( Convert > 0 ) && ( Convert != DrawEntry->m_Convert ) ) && ( ( Convert > 0 ) && ( Convert != item->m_Convert ) ) )
continue; continue;
bBox.Merge( DrawEntry->GetBoundingBox() ); bBox.Merge( item->GetBoundingBox() );
} }
bBox.Merge( m_Name.GetBoundingBox() );
bBox.Merge( m_Prefix.GetBoundingBox() );
return bBox; return bBox;
} }
...@@ -1172,6 +1233,22 @@ bool LIB_COMPONENT::HasConversion() const ...@@ -1172,6 +1233,22 @@ bool LIB_COMPONENT::HasConversion() const
} }
void LIB_COMPONENT::ClearStatus( void )
{
LIB_DRAW_ITEM* item;
LibDrawField* field;
for( item = m_Drawings; item != NULL; item = item->Next() )
item->m_Flags = 0;
m_Name.m_Flags = 0;
m_Prefix.m_Flags = 0;
for( field = m_Fields.GetFirst(); field != NULL; field = field->Next() )
field->m_Flags = 0;
}
int LIB_COMPONENT::SelectItems( EDA_Rect& rect, int unit, int convert, int LIB_COMPONENT::SelectItems( EDA_Rect& rect, int unit, int convert,
bool editPinByPin ) bool editPinByPin )
{ {
...@@ -1318,3 +1395,77 @@ void LIB_COMPONENT::CopySelectedItems( const wxPoint& offset ) ...@@ -1318,3 +1395,77 @@ void LIB_COMPONENT::CopySelectedItems( const wxPoint& offset )
MoveSelectedItems( offset ); MoveSelectedItems( offset );
SortDrawItems(); SortDrawItems();
} }
void LIB_COMPONENT::MirrorSelectedItemsH( const wxPoint& center )
{
LIB_DRAW_ITEM* item;
LibDrawField* field;
for( item = m_Drawings; item != NULL; item = item->Next() )
{
if( item->m_Selected == 0 )
continue;
item->SetOffset( center );
item->m_Flags = item->m_Selected = 0;
}
if( m_Name.m_Selected )
{
m_Name.SetOffset( center );
m_Name.m_Flags = m_Name.m_Selected = 0;
}
if( m_Prefix.m_Selected )
{
m_Prefix.SetOffset( center );
m_Prefix.m_Flags = m_Prefix.m_Selected = 0;
}
for( field = m_Fields.GetFirst(); field != NULL; field = field->Next() )
{
if( field->m_Selected )
{
field->SetOffset( center );
field->m_Flags = field->m_Selected = 0;
}
}
SortDrawItems();
}
LIB_DRAW_ITEM* LIB_COMPONENT::LocateDrawItem( int unit, int convert,
KICAD_T type, const wxPoint& pt )
{
LIB_DRAW_ITEM* item;
LibDrawField* field;
for( item = m_Drawings; item != NULL; item = item->Next() )
{
if( ( unit && item->m_Unit && ( unit != item->m_Unit) )
|| ( convert && item->m_Convert && ( convert != item->m_Convert ) )
|| ( ( item->Type() != type ) && ( type != TYPE_NOT_INIT ) ) )
continue;
if( item->HitTest( pt ) )
return item;
}
if( type == COMPONENT_FIELD_DRAW_TYPE || type == TYPE_NOT_INIT )
{
if( m_Name.HitTest( pt ) )
return &m_Name;
if( m_Prefix.HitTest( pt ) )
return &m_Prefix;
for( field = m_Fields.GetFirst(); field != NULL; field = field->Next() )
{
if( field->HitTest( pt ) )
return field;
}
}
return NULL;
}
...@@ -204,6 +204,13 @@ public: ...@@ -204,6 +204,13 @@ public:
bool showPinText = true, bool drawFields = true, bool showPinText = true, bool drawFields = true,
bool onlySelected = false ); bool onlySelected = false );
/**
* Add a new draw item to the draw object list.
*
* @param item - New draw object to add to component.
*/
void AddDrawItem( LIB_DRAW_ITEM* item );
/** /**
* Remove draw item from list. * Remove draw item from list.
* *
...@@ -215,6 +222,23 @@ public: ...@@ -215,6 +222,23 @@ public:
WinEDA_DrawPanel* panel = NULL, WinEDA_DrawPanel* panel = NULL,
wxDC* dc = NULL ); wxDC* dc = NULL );
/**
* Return the next draw object pointer.
*
* @param item - Pointer to the current draw item. Setting item NULL
* with return the first item of type in the list.
*
*/
LIB_DRAW_ITEM* GetNextDrawItem( LIB_DRAW_ITEM* item = NULL,
KICAD_T type = TYPE_NOT_INIT );
LibDrawPin* GetNextPin( LibDrawPin* item = NULL )
{
return (LibDrawPin*) GetNextDrawItem( (LIB_DRAW_ITEM*) item,
COMPONENT_PIN_DRAW_TYPE );
}
/** /**
* Move the component offset. * Move the component offset.
* *
...@@ -249,6 +273,11 @@ public: ...@@ -249,6 +273,11 @@ public:
return m_AliasList.Index( name ) != wxNOT_FOUND; return m_AliasList.Index( name ) != wxNOT_FOUND;
} }
/**
* Clears the status flag all draw objects in this component.
*/
void ClearStatus( void );
/** /**
* Checks all draw objects of component to see if they are with block. * Checks all draw objects of component to see if they are with block.
* *
...@@ -294,6 +323,27 @@ public: ...@@ -294,6 +323,27 @@ public:
* make sense in this context. * make sense in this context.
*/ */
void CopySelectedItems( const wxPoint& offset ); void CopySelectedItems( const wxPoint& offset );
/**
* Horizontally (X axis) mirror selected draw items about a point.
*
* @param center - Center point to mirror around.
*/
void MirrorSelectedItemsH( const wxPoint& center );
/**
* Locate a draw object.
*
* @param unit - Unit number of draw item.
* @param convert - Body style of draw item.
* @param type - Draw object type, set to 0 to search for any type.
* @param pt - Coordinate for hit testing.
*
* @return LIB_DRAW_ITEM - Pointer the the draw object if found.
* Otherwise NULL.
*/
LIB_DRAW_ITEM* LocateDrawItem( int unit, int convert, KICAD_T type,
const wxPoint& pt );
}; };
......
...@@ -437,6 +437,14 @@ void LibDrawField::DoMove( const wxPoint& newPosition ) ...@@ -437,6 +437,14 @@ void LibDrawField::DoMove( const wxPoint& newPosition )
} }
void LibDrawField::DoMirrorHorizontal( const wxPoint& center )
{
m_Pos.x -= center.x;
m_Pos.x *= -1;
m_Pos.x += center.x;
}
/* /*
* If the field is the reference, return reference like schematic, * If the field is the reference, return reference like schematic,
* i.e U -> U? or U?A or the field text for others * i.e U -> U? or U?A or the field text for others
......
...@@ -74,6 +74,13 @@ public: ...@@ -74,6 +74,13 @@ public:
int aColor, int aDrawMode, void* aData, int aColor, int aDrawMode, void* aData,
const int aTransformMatrix[2][2] ); const int aTransformMatrix[2][2] );
/**
* Return the bounding rectangle of the field text.
*
* @return EDA_Rect - Bounding rectangle.
*/
virtual EDA_Rect GetBoundingBox() { return GetTextBox(); }
/** /**
* Function HitTest * Function HitTest
* tests if the given wxPoint is within the bounds of this object. * tests if the given wxPoint is within the bounds of this object.
...@@ -82,13 +89,16 @@ public: ...@@ -82,13 +89,16 @@ public:
*/ */
bool HitTest( const wxPoint& refPos ); bool HitTest( const wxPoint& refPos );
/** Function HitTest /**
* Function HitTest
* @return true if the point aPosRef is near this object * @return true if the point aPosRef is near this object
* @param aPosRef = a wxPoint to test * @param aPosRef = a wxPoint to test
* @param aThreshold = max distance to this object (usually the half thickness of a line) * @param aThreshold = max distance to this object (usually the half
* thickness of a line)
* @param aTransMat = the transform matrix * @param aTransMat = the transform matrix
*/ */
virtual bool HitTest( wxPoint aPosRef, int aThreshold, const int aTransMat[2][2] ); virtual bool HitTest( wxPoint aPosRef, int aThreshold,
const int aTransMat[2][2] );
void operator=( const LibDrawField& field ) void operator=( const LibDrawField& field )
{ {
...@@ -127,6 +137,7 @@ protected: ...@@ -127,6 +137,7 @@ protected:
virtual bool DoTestInside( EDA_Rect& rect ); virtual bool DoTestInside( EDA_Rect& rect );
virtual void DoMove( const wxPoint& newPosition ); virtual void DoMove( const wxPoint& newPosition );
virtual wxPoint DoGetPosition( void ) { return m_Pos; } virtual wxPoint DoGetPosition( void ) { return m_Pos; }
virtual void DoMirrorHorizontal( const wxPoint& center );
}; };
#endif // CLASS_LIBENTRY_FIELDS_H #endif // CLASS_LIBENTRY_FIELDS_H
...@@ -1113,6 +1113,19 @@ void LibDrawPin::DoMove( const wxPoint& newPosition ) ...@@ -1113,6 +1113,19 @@ void LibDrawPin::DoMove( const wxPoint& newPosition )
} }
void LibDrawPin::DoMirrorHorizontal( const wxPoint& center )
{
m_Pos.x -= center.x;
m_Pos.x *= -1;
m_Pos.x += center.x;
if( m_Orient == PIN_RIGHT )
m_Orient = PIN_LEFT;
else if( m_Orient == PIN_LEFT )
m_Orient = PIN_RIGHT;
}
/** Function LibDrawPin::DisplayInfo /** Function LibDrawPin::DisplayInfo
* Displays info (pin num and name, orientation ... * Displays info (pin num and name, orientation ...
* on the Info window * on the Info window
......
...@@ -45,8 +45,8 @@ void CreateDummyCmp() ...@@ -45,8 +45,8 @@ void CreateDummyCmp()
Text->m_Size.x = Text->m_Size.y = 150; Text->m_Size.x = Text->m_Size.y = 150;
Text->m_Text = wxT( "??" ); Text->m_Text = wxT( "??" );
DummyCmp->m_Drawings = Square; DummyCmp->AddDrawItem( Square );
Square->SetNext( Text ); DummyCmp->AddDrawItem( Text );
} }
......
...@@ -311,6 +311,21 @@ void LibDrawArc::DoMove( const wxPoint& newPosition ) ...@@ -311,6 +311,21 @@ void LibDrawArc::DoMove( const wxPoint& newPosition )
} }
void LibDrawArc::DoMirrorHorizontal( const wxPoint& center )
{
m_Pos.x -= center.x;
m_Pos.x *= -1;
m_Pos.x += center.x;
m_ArcStart.x -= center.x;
m_ArcStart.x *= -1;
m_ArcStart.x += center.x;
m_ArcEnd.x -= center.x;
m_ArcEnd.x *= -1;
m_ArcEnd.x += center.x;
EXCHG( m_ArcStart, m_ArcEnd );
}
/** Function GetPenSize /** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item * @return the size of the "pen" that be used to draw or plot this item
*/ */
...@@ -608,6 +623,14 @@ void LibDrawCircle::DoMove( const wxPoint& newPosition ) ...@@ -608,6 +623,14 @@ void LibDrawCircle::DoMove( const wxPoint& newPosition )
} }
void LibDrawCircle::DoMirrorHorizontal( const wxPoint& center )
{
m_Pos.x -= center.x;
m_Pos.x *= -1;
m_Pos.x += center.x;
}
/** Function GetPenSize /** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item * @return the size of the "pen" that be used to draw or plot this item
*/ */
...@@ -793,6 +816,17 @@ void LibDrawSquare::DoMove( const wxPoint& newPosition ) ...@@ -793,6 +816,17 @@ void LibDrawSquare::DoMove( const wxPoint& newPosition )
} }
void LibDrawSquare::DoMirrorHorizontal( const wxPoint& center )
{
m_Pos.x -= center.x;
m_Pos.x *= -1;
m_Pos.x += center.x;
m_End.x -= center.x;
m_End.x *= -1;
m_End.x += center.x;
}
/** Function GetPenSize /** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item * @return the size of the "pen" that be used to draw or plot this item
*/ */
...@@ -1006,6 +1040,17 @@ void LibDrawSegment::DoMove( const wxPoint& newPosition ) ...@@ -1006,6 +1040,17 @@ void LibDrawSegment::DoMove( const wxPoint& newPosition )
} }
void LibDrawSegment::DoMirrorHorizontal( const wxPoint& center )
{
m_Pos.x -= center.x;
m_Pos.x *= -1;
m_Pos.x += center.x;
m_End.x -= center.x;
m_End.x *= -1;
m_End.x += center.x;
}
/** Function GetPenSize /** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item * @return the size of the "pen" that be used to draw or plot this item
*/ */
...@@ -1255,6 +1300,19 @@ void LibDrawPolyline::DoMove( const wxPoint& newPosition ) ...@@ -1255,6 +1300,19 @@ void LibDrawPolyline::DoMove( const wxPoint& newPosition )
} }
void LibDrawPolyline::DoMirrorHorizontal( const wxPoint& center )
{
size_t i, imax = m_PolyPoints.size();
for( i = 0; i < imax; i++ )
{
m_PolyPoints[i].x -= center.x;
m_PolyPoints[i].x *= -1;
m_PolyPoints[i].x += center.x;
}
}
void LibDrawPolyline::AddPoint( const wxPoint& point ) void LibDrawPolyline::AddPoint( const wxPoint& point )
{ {
m_PolyPoints.push_back( point ); m_PolyPoints.push_back( point );
...@@ -1580,6 +1638,27 @@ void LibDrawBezier::DoMove( const wxPoint& newPosition ) ...@@ -1580,6 +1638,27 @@ void LibDrawBezier::DoMove( const wxPoint& newPosition )
} }
void LibDrawBezier::DoMirrorHorizontal( const wxPoint& center )
{
size_t i, imax = m_PolyPoints.size();
for( i = 0; i < imax; i++ )
{
m_PolyPoints[i].x -= center.x;
m_PolyPoints[i].x *= -1;
m_PolyPoints[i].x += center.x;
}
imax = m_BezierPoints.size();
for( i = 0; i < imax; i++ )
{
m_BezierPoints[i].x -= center.x;
m_BezierPoints[i].x *= -1;
m_BezierPoints[i].x += center.x;
}
}
/** Function GetPenSize /** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item * @return the size of the "pen" that be used to draw or plot this item
*/ */
......
...@@ -114,7 +114,9 @@ public: ...@@ -114,7 +114,9 @@ public:
LIB_DRAW_ITEM( const LIB_DRAW_ITEM& item ); LIB_DRAW_ITEM( const LIB_DRAW_ITEM& item );
virtual ~LIB_DRAW_ITEM() { } virtual ~LIB_DRAW_ITEM() { }
/** Function Draw (virtual pure) /**
* Function Draw (virtual pure)
*
* Draw A body item * Draw A body item
* @param aPanel = DrawPanel to use (can be null) mainly used for clipping * @param aPanel = DrawPanel to use (can be null) mainly used for clipping
* purposes * purposes
...@@ -241,6 +243,16 @@ public: ...@@ -241,6 +243,16 @@ public:
*/ */
wxPoint GetPosition( void ) { return DoGetPosition(); } wxPoint GetPosition( void ) { return DoGetPosition(); }
/**
* Mirror the draw object along the horizontal (X) axis about a point.
*
* @param center - Point to mirror around.
*/
void MirrorHorizontal( const wxPoint& center )
{
DoMirrorHorizontal( center );
}
protected: protected:
virtual LIB_DRAW_ITEM* DoGenCopy() = 0; virtual LIB_DRAW_ITEM* DoGenCopy() = 0;
...@@ -254,6 +266,7 @@ protected: ...@@ -254,6 +266,7 @@ protected:
virtual bool DoTestInside( EDA_Rect& rect ) = 0; virtual bool DoTestInside( EDA_Rect& rect ) = 0;
virtual void DoMove( const wxPoint& newPosition ) = 0; virtual void DoMove( const wxPoint& newPosition ) = 0;
virtual wxPoint DoGetPosition( void ) = 0; virtual wxPoint DoGetPosition( void ) = 0;
virtual void DoMirrorHorizontal( const wxPoint& center ) = 0;
}; };
...@@ -387,6 +400,7 @@ protected: ...@@ -387,6 +400,7 @@ protected:
virtual bool DoTestInside( EDA_Rect& rect ); virtual bool DoTestInside( EDA_Rect& rect );
virtual void DoMove( const wxPoint& newPosition ); virtual void DoMove( const wxPoint& newPosition );
virtual wxPoint DoGetPosition( void ) { return m_Pos; } virtual wxPoint DoGetPosition( void ) { return m_Pos; }
virtual void DoMirrorHorizontal( const wxPoint& center );
}; };
...@@ -462,6 +476,7 @@ protected: ...@@ -462,6 +476,7 @@ protected:
virtual bool DoTestInside( EDA_Rect& rect ); virtual bool DoTestInside( EDA_Rect& rect );
virtual void DoMove( const wxPoint& newPosition ); virtual void DoMove( const wxPoint& newPosition );
virtual wxPoint DoGetPosition( void ) { return m_Pos; } virtual wxPoint DoGetPosition( void ) { return m_Pos; }
virtual void DoMirrorHorizontal( const wxPoint& center );
}; };
...@@ -533,6 +548,7 @@ protected: ...@@ -533,6 +548,7 @@ protected:
virtual bool DoTestInside( EDA_Rect& rect ); virtual bool DoTestInside( EDA_Rect& rect );
virtual void DoMove( const wxPoint& newPosition ); virtual void DoMove( const wxPoint& newPosition );
virtual wxPoint DoGetPosition( void ) { return m_Pos; } virtual wxPoint DoGetPosition( void ) { return m_Pos; }
virtual void DoMirrorHorizontal( const wxPoint& center );
}; };
...@@ -611,6 +627,7 @@ protected: ...@@ -611,6 +627,7 @@ protected:
virtual bool DoTestInside( EDA_Rect& rect ); virtual bool DoTestInside( EDA_Rect& rect );
virtual void DoMove( const wxPoint& newPosition ); virtual void DoMove( const wxPoint& newPosition );
virtual wxPoint DoGetPosition( void ) { return m_Pos; } virtual wxPoint DoGetPosition( void ) { return m_Pos; }
virtual void DoMirrorHorizontal( const wxPoint& center );
}; };
...@@ -681,6 +698,7 @@ protected: ...@@ -681,6 +698,7 @@ protected:
virtual bool DoTestInside( EDA_Rect& rect ); virtual bool DoTestInside( EDA_Rect& rect );
virtual void DoMove( const wxPoint& newPosition ); virtual void DoMove( const wxPoint& newPosition );
virtual wxPoint DoGetPosition( void ) { return m_Pos; } virtual wxPoint DoGetPosition( void ) { return m_Pos; }
virtual void DoMirrorHorizontal( const wxPoint& center );
}; };
/**********************************/ /**********************************/
...@@ -750,6 +768,7 @@ protected: ...@@ -750,6 +768,7 @@ protected:
virtual bool DoTestInside( EDA_Rect& rect ); virtual bool DoTestInside( EDA_Rect& rect );
virtual void DoMove( const wxPoint& newPosition ); virtual void DoMove( const wxPoint& newPosition );
virtual wxPoint DoGetPosition( void ) { return m_Pos; } virtual wxPoint DoGetPosition( void ) { return m_Pos; }
virtual void DoMirrorHorizontal( const wxPoint& center );
}; };
...@@ -830,6 +849,7 @@ protected: ...@@ -830,6 +849,7 @@ protected:
virtual bool DoTestInside( EDA_Rect& rect ); virtual bool DoTestInside( EDA_Rect& rect );
virtual void DoMove( const wxPoint& newPosition ); virtual void DoMove( const wxPoint& newPosition );
virtual wxPoint DoGetPosition( void ) { return m_PolyPoints[0]; } virtual wxPoint DoGetPosition( void ) { return m_PolyPoints[0]; }
virtual void DoMirrorHorizontal( const wxPoint& center );
}; };
/**********************************************************/ /**********************************************************/
...@@ -910,6 +930,7 @@ protected: ...@@ -910,6 +930,7 @@ protected:
virtual bool DoTestInside( EDA_Rect& rect ); virtual bool DoTestInside( EDA_Rect& rect );
virtual void DoMove( const wxPoint& newPosition ); virtual void DoMove( const wxPoint& newPosition );
virtual wxPoint DoGetPosition( void ) { return m_PolyPoints[0]; } virtual wxPoint DoGetPosition( void ) { return m_PolyPoints[0]; }
virtual void DoMirrorHorizontal( const wxPoint& center );
}; };
#endif // CLASSES_BODY_ITEMS_H #endif // CLASSES_BODY_ITEMS_H
...@@ -215,9 +215,8 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin ...@@ -215,9 +215,8 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin
} }
/*************************************************************************************/ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC,
void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels ) wxPoint MousePositionInPixels )
/*************************************************************************************/
{ {
wxRealPoint delta; wxRealPoint delta;
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
...@@ -309,9 +308,8 @@ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPi ...@@ -309,9 +308,8 @@ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPi
} }
/*************************************************************************************/ void WinEDA_LibeditFrame::GeneralControle( wxDC* DC,
void WinEDA_LibeditFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels ) wxPoint MousePositionInPixels )
/*************************************************************************************/
{ {
wxRealPoint delta; wxRealPoint delta;
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
...@@ -402,7 +400,6 @@ void WinEDA_LibeditFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixe ...@@ -402,7 +400,6 @@ void WinEDA_LibeditFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixe
} }
/*****************************************************************************/
void WinEDA_ViewlibFrame::GeneralControle( wxDC* DC, void WinEDA_ViewlibFrame::GeneralControle( wxDC* DC,
wxPoint MousePositionInPixels ) wxPoint MousePositionInPixels )
{ {
......
...@@ -392,20 +392,17 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList ) ...@@ -392,20 +392,17 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList )
if( Entry == NULL ) if( Entry == NULL )
break; break;
LIB_DRAW_ITEM* DrawLibItem = Entry->m_Drawings; for( LibDrawPin* Pin = Entry->GetNextPin(); Pin != NULL;
for( ; DrawLibItem != NULL; DrawLibItem = DrawLibItem->Next() ) Pin = Entry->GetNextPin( Pin ) )
{ {
if( DrawLibItem->Type() != COMPONENT_PIN_DRAW_TYPE ) wxASSERT( Pin->Type() == COMPONENT_PIN_DRAW_TYPE );
continue;
LibDrawPin* Pin = (LibDrawPin*) DrawLibItem;
if( Pin->m_Unit && DrawLibItem->m_Unit if( Pin->m_Unit && STRUCT->m_Multi
&& (DrawLibItem->m_Unit != Pin->m_Unit) ) && ( STRUCT->m_Multi != Pin->m_Unit ) )
continue; continue;
if( Pin->m_Convert && DrawLibItem->m_Convert if( Pin->m_Convert && STRUCT->m_Convert
&& (DrawLibItem->m_Convert != Pin->m_Convert) ) && ( STRUCT->m_Convert != Pin->m_Convert ) )
continue; continue;
item = new DanglingEndHandle( PIN_END ); item = new DanglingEndHandle( PIN_END );
......
...@@ -680,7 +680,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel() ...@@ -680,7 +680,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel()
convertCheckBox->SetValue( true ); convertCheckBox->SetValue( true );
} }
if( m_LibEntry == NULL || LookForConvertPart( m_LibEntry ) <= 1 ) if( m_LibEntry == NULL || !m_LibEntry->HasConversion() )
{ {
convertCheckBox->Enable( false ); convertCheckBox->Enable( false );
} }
......
...@@ -377,7 +377,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::ChangeNbUnitsPerPackage( int MaxUnit ) ...@@ -377,7 +377,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::ChangeNbUnitsPerPackage( int MaxUnit )
/* Traitement des unites enlevees ou rajoutees */ /* Traitement des unites enlevees ou rajoutees */
if( OldNumUnits > component->m_UnitCount ) if( OldNumUnits > component->m_UnitCount )
{ {
DrawItem = component->m_Drawings; DrawItem = component->GetNextDrawItem();
for( ; DrawItem != NULL; DrawItem = NextDrawItem ) for( ; DrawItem != NULL; DrawItem = NextDrawItem )
{ {
NextDrawItem = DrawItem->Next(); NextDrawItem = DrawItem->Next();
...@@ -410,7 +410,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::ChangeNbUnitsPerPackage( int MaxUnit ) ...@@ -410,7 +410,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::ChangeNbUnitsPerPackage( int MaxUnit )
if( OldNumUnits < component->m_UnitCount ) if( OldNumUnits < component->m_UnitCount )
{ {
DrawItem = component->m_Drawings; DrawItem = component->GetNextDrawItem();
for( ; DrawItem != NULL; DrawItem = DrawItem->Next() ) for( ; DrawItem != NULL; DrawItem = DrawItem->Next() )
{ {
/* Duplication des items pour autres elements */ /* Duplication des items pour autres elements */
...@@ -419,13 +419,13 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::ChangeNbUnitsPerPackage( int MaxUnit ) ...@@ -419,13 +419,13 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::ChangeNbUnitsPerPackage( int MaxUnit )
for( ii = OldNumUnits + 1; ii <= MaxUnit; ii++ ) for( ii = OldNumUnits + 1; ii <= MaxUnit; ii++ )
{ {
NextDrawItem = DrawItem->GenCopy(); NextDrawItem = DrawItem->GenCopy();
NextDrawItem->SetNext( component->m_Drawings );
component->m_Drawings = NextDrawItem;
NextDrawItem->m_Unit = ii; NextDrawItem->m_Unit = ii;
component->AddDrawItem( NextDrawItem );
} }
} }
} }
} }
return TRUE; return TRUE;
} }
...@@ -446,7 +446,8 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::SetUnsetConvert() ...@@ -446,7 +446,8 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::SetUnsetConvert()
{ {
/* Traitement des elements a ajouter ( pins seulement ) */ /* Traitement des elements a ajouter ( pins seulement ) */
if( component ) if( component )
DrawItem = component->m_Drawings; DrawItem = component->GetNextDrawItem();
for( ; DrawItem != NULL; DrawItem = DrawItem->Next() ) for( ; DrawItem != NULL; DrawItem = DrawItem->Next() )
{ {
/* Duplication des items pour autres elements */ /* Duplication des items pour autres elements */
...@@ -456,7 +457,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::SetUnsetConvert() ...@@ -456,7 +457,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::SetUnsetConvert()
{ {
if( FlagDel == 0 ) if( FlagDel == 0 )
{ {
if( IsOK( this, _( "Create pins for Convert items" ) ) ) if( IsOK( this, _( "Create pins for convert items." ) ) )
FlagDel = 1; FlagDel = 1;
else else
{ {
...@@ -467,10 +468,10 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::SetUnsetConvert() ...@@ -467,10 +468,10 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::SetUnsetConvert()
return FALSE; return FALSE;
} }
} }
NextDrawItem = DrawItem->GenCopy(); NextDrawItem = DrawItem->GenCopy();
NextDrawItem->SetNext( component->m_Drawings );
component->m_Drawings = NextDrawItem;
NextDrawItem->m_Convert = 2; NextDrawItem->m_Convert = 2;
component->AddDrawItem( NextDrawItem );
} }
} }
} }
...@@ -478,7 +479,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::SetUnsetConvert() ...@@ -478,7 +479,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::SetUnsetConvert()
{ {
/* Traitement des elements � supprimer */ /* Traitement des elements � supprimer */
if( component ) if( component )
DrawItem = component->m_Drawings; DrawItem = component->GetNextDrawItem();
for( ; DrawItem != NULL; DrawItem = NextDrawItem ) for( ; DrawItem != NULL; DrawItem = NextDrawItem )
{ {
NextDrawItem = DrawItem->Next(); NextDrawItem = DrawItem->Next();
......
...@@ -402,7 +402,7 @@ void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent, ...@@ -402,7 +402,7 @@ void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent,
if( LibEntry == NULL ) if( LibEntry == NULL )
return; return;
if( ( ii = LookForConvertPart( LibEntry ) ) < 2 ) if( !LibEntry->HasConversion() )
{ {
DisplayError( this, wxT( "No convert found" ) ); DisplayError( this, wxT( "No convert found" ) );
return; return;
...@@ -430,32 +430,6 @@ void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent, ...@@ -430,32 +430,6 @@ void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent,
} }
/*
* Retourne la plus grande valeur trouvee dans la liste des elements
* "drawings" du composant LibEntry, pour le membre .Convert
* Si il n'y a pas de representation type "convert", la valeur
* retournee est 0 ou 1
* Si il y a une representation type "convert",
* la valeur retournee est > 1 (typiquement 2)
*/
int LookForConvertPart( LIB_COMPONENT* LibEntry )
{
int ii;
LIB_DRAW_ITEM* DrawLibEntry;
DrawLibEntry = LibEntry->m_Drawings;
ii = 0;
while( DrawLibEntry )
{
if( ii < DrawLibEntry->m_Convert )
ii = DrawLibEntry->m_Convert;
DrawLibEntry = DrawLibEntry->Next();
}
return ii;
}
void WinEDA_SchematicFrame::StartMovePart( SCH_COMPONENT* Component, void WinEDA_SchematicFrame::StartMovePart( SCH_COMPONENT* Component,
wxDC* DC ) wxDC* DC )
{ {
......
...@@ -471,16 +471,13 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -471,16 +471,13 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
cmd.SetEventObject( this ); cmd.SetEventObject( this );
wxPoint MousePos = GetScreen()->m_MousePosition;
bool ItemInEdit = GetScreen()->GetCurItem() bool ItemInEdit = GetScreen()->GetCurItem()
&& GetScreen()->GetCurItem()->m_Flags; && GetScreen()->GetCurItem()->m_Flags;
if( hotkey == 0 ) if( hotkey == 0 )
return; return;
wxPoint MousePos = GetScreen()->m_MousePosition;
LIB_DRAW_ITEM* DrawEntry = LocateItemUsingCursor();
// Remap the control key Ctrl A (0x01) to GR_KB_CTRL + 'A' (easier to // Remap the control key Ctrl A (0x01) to GR_KB_CTRL + 'A' (easier to
// handle...) // handle...)
if( (hotkey & GR_KB_CTRL) != 0 ) if( (hotkey & GR_KB_CTRL) != 0 )
...@@ -564,18 +561,16 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -564,18 +561,16 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_EDIT_PIN: case HK_EDIT_PIN:
if( DrawEntry ) m_drawItem = LocateItemUsingCursor();
m_drawItem = DrawEntry;
if( m_drawItem ) if( m_drawItem && m_drawItem->Type() == COMPONENT_PIN_DRAW_TYPE )
{
if( m_drawItem->Type() == COMPONENT_PIN_DRAW_TYPE )
InstallPineditFrame( this, DC, MousePos ); InstallPineditFrame( this, DC, MousePos );
}
break; break;
case HK_DELETE_PIN: case HK_DELETE_PIN:
if( DrawEntry ) m_drawItem = LocateItemUsingCursor();
m_drawItem = DrawEntry;
if( m_drawItem ) if( m_drawItem )
{ {
wxCommandEvent evt; wxCommandEvent evt;
...@@ -585,8 +580,8 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -585,8 +580,8 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_MOVE_PIN: case HK_MOVE_PIN:
if( DrawEntry ) m_drawItem = LocateItemUsingCursor();
m_drawItem = DrawEntry;
if( m_drawItem ) if( m_drawItem )
{ {
wxCommandEvent evt; wxCommandEvent evt;
......
/*****************************************************************/
/* Headers for library definition and lib component definitions */
/*****************************************************************/
#ifndef LIBCMP_H
#define LIBCMP_H
enum LocateDrawStructType
{
LOCATE_COMPONENT_ARC_DRAW_TYPE = 1,
LOCATE_COMPONENT_CIRCLE_DRAW_TYPE = 2,
LOCATE_COMPONENT_GRAPHIC_TEXT_DRAW_TYPE = 4,
LOCATE_COMPONENT_RECT_DRAW_TYPE = 8,
LOCATE_LINE_DRAW_TYPE = 0x10,
LOCATE_COMPONENT_POLYLINE_DRAW_TYPE = 0x20,
LOCATE_COMPONENT_LINE_DRAW_TYPE = 0x40
};
#define LOCATE_ALL_DRAW_ITEM 0xFFFFFFFF
#endif // LIBCMP_H
...@@ -179,7 +179,7 @@ bool WinEDA_LibeditFrame::LoadOneLibraryPartAux( CMP_LIB_ENTRY* LibEntry, ...@@ -179,7 +179,7 @@ bool WinEDA_LibeditFrame::LoadOneLibraryPartAux( CMP_LIB_ENTRY* LibEntry,
m_showDeMorgan = false; m_showDeMorgan = false;
if( LookForConvertPart( m_component ) > 1 ) if( m_component->HasConversion() )
m_showDeMorgan = true; m_showDeMorgan = true;
GetBaseScreen()->ClrModify(); GetBaseScreen()->ClrModify();
...@@ -265,7 +265,7 @@ void WinEDA_LibeditFrame::SaveActiveLibrary( wxCommandEvent& event ) ...@@ -265,7 +265,7 @@ void WinEDA_LibeditFrame::SaveActiveLibrary( wxCommandEvent& event )
if( !IsOK( this, msg ) ) if( !IsOK( this, msg ) )
return; return;
bool success = m_library->Save( fn.GetFullPath() ); bool success = m_library->Save( fn.GetFullPath(), true );
MsgPanel->EraseMsgBox(); MsgPanel->EraseMsgBox();
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "program.h" #include "program.h"
#include "general.h" #include "general.h"
#include "libcmp.h"
#include "protos.h" #include "protos.h"
#include "libeditfrm.h" #include "libeditfrm.h"
#include "class_libentry.h" #include "class_libentry.h"
...@@ -51,25 +50,16 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -51,25 +50,16 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
} }
else else
{ {
DrawEntry = LocatePin( GetScreen()->m_MousePosition, m_component, DrawEntry =
m_unit, m_convert ); m_component->LocateDrawItem( m_unit, m_convert, TYPE_NOT_INIT,
if( DrawEntry == NULL ) GetScreen()->m_MousePosition );
{
DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(),
GetScreen()->m_MousePosition,
m_component, m_unit, m_convert,
LOCATE_ALL_DRAW_ITEM );
}
if( DrawEntry == NULL )
DrawEntry = LocatePin( GetScreen()->m_Curseur, m_component,
m_unit, m_convert );
if( DrawEntry == NULL ) if( DrawEntry == NULL )
{ {
DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(), DrawEntry =
GetScreen()->m_Curseur, m_component->LocateDrawItem( m_unit, m_convert,
m_component, m_unit, m_convert, TYPE_NOT_INIT,
LOCATE_ALL_DRAW_ITEM ); GetScreen()->m_Curseur );
} }
if( DrawEntry ) if( DrawEntry )
...@@ -121,26 +111,16 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -121,26 +111,16 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
break; break;
case ID_LIBEDIT_DELETE_ITEM_BUTT: case ID_LIBEDIT_DELETE_ITEM_BUTT:
DrawEntry = LocatePin( GetScreen()->m_MousePosition, m_component, DrawEntry =
m_unit, m_convert ); m_component->LocateDrawItem( m_unit, m_convert, TYPE_NOT_INIT,
if( DrawEntry == NULL ) GetScreen()->m_MousePosition );
{
DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(),
GetScreen()->m_MousePosition,
m_component, m_unit, m_convert,
LOCATE_ALL_DRAW_ITEM );
}
if( DrawEntry == NULL )
DrawEntry = LocatePin( GetScreen()->m_Curseur,
m_component, m_unit,
m_convert );
if( DrawEntry == NULL ) if( DrawEntry == NULL )
{ {
DrawEntry = LocateDrawItem( (SCH_SCREEN*)GetScreen(), DrawEntry =
GetScreen()->m_Curseur, m_component->LocateDrawItem( m_unit, m_convert,
m_component, m_unit, m_convert, TYPE_NOT_INIT,
LOCATE_ALL_DRAW_ITEM ); GetScreen()->m_Curseur );
} }
if( DrawEntry == NULL ) if( DrawEntry == NULL )
DisplayCmpDoc(); DisplayCmpDoc();
...@@ -185,29 +165,14 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -185,29 +165,14 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
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, m_component,
m_unit, m_convert );
if( DrawEntry == NULL )
DrawEntry = LocatePin( GetScreen()->m_Curseur, m_component,
m_unit, m_convert );
if( DrawEntry == NULL )
{
DrawEntry = m_drawItem =
LocateDrawItem( (SCH_SCREEN*) GetScreen(),
GetScreen()->m_MousePosition, m_component,
m_unit, m_convert, LOCATE_ALL_DRAW_ITEM );
}
if( DrawEntry == NULL )
{
DrawEntry = m_drawItem = DrawEntry = m_drawItem =
LocateDrawItem( (SCH_SCREEN*) GetScreen(), m_component->LocateDrawItem( m_unit, m_convert, TYPE_NOT_INIT,
GetScreen()->m_Curseur, m_component, m_unit, GetScreen()->m_MousePosition );
m_convert, LOCATE_ALL_DRAW_ITEM );
}
if( DrawEntry == NULL ) if( DrawEntry == NULL )
{ {
DrawEntry = m_drawItem = DrawEntry = m_drawItem =
(LIB_DRAW_ITEM*) LocateField( m_component ); m_component->LocateDrawItem( m_unit, m_convert, TYPE_NOT_INIT,
GetScreen()->m_Curseur );
} }
if( DrawEntry == NULL ) if( DrawEntry == NULL )
{ {
......
...@@ -31,9 +31,9 @@ void WinEDA_LibeditFrame::SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, ...@@ -31,9 +31,9 @@ void WinEDA_LibeditFrame::SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy,
ITEM_PICKER wrapper(CopyItem, UR_LIBEDIT); ITEM_PICKER wrapper(CopyItem, UR_LIBEDIT);
lastcmd->PushItem(wrapper); lastcmd->PushItem(wrapper);
GetScreen()->PushCommandToUndoList( lastcmd ); GetScreen()->PushCommandToUndoList( lastcmd );
/* Clear current flags (which can be temporary set by a current edit command) */ /* Clear current flags (which can be temporary set by a current edit
for( item = CopyItem->m_Drawings; item != NULL; item = item->Next() ) * command) */
item->m_Flags = 0; CopyItem->ClearStatus();
/* Clear redo list, because after new save there is no redo to do */ /* Clear redo list, because after new save there is no redo to do */
GetScreen()->ClearUndoORRedoList( GetScreen()->m_RedoList ); GetScreen()->ClearUndoORRedoList( GetScreen()->m_RedoList );
......
...@@ -110,10 +110,7 @@ public: ...@@ -110,10 +110,7 @@ public:
LIB_DRAW_ITEM* GetDrawItem( void ) { return m_drawItem; } LIB_DRAW_ITEM* GetDrawItem( void ) { return m_drawItem; }
void SetDrawItem( LIB_DRAW_ITEM* drawItem ) void SetDrawItem( LIB_DRAW_ITEM* drawItem );
{
m_drawItem = drawItem;
}
bool GetShowDeMorgan( void ) { return m_showDeMorgan; } bool GetShowDeMorgan( void ) { return m_showDeMorgan; }
...@@ -163,7 +160,6 @@ private: ...@@ -163,7 +160,6 @@ private:
void EditSymbolText( wxDC* DC, LIB_DRAW_ITEM* DrawItem ); void EditSymbolText( wxDC* DC, LIB_DRAW_ITEM* DrawItem );
void RotateSymbolText( wxDC* DC ); void RotateSymbolText( wxDC* DC );
void DeleteDrawPoly( wxDC* DC ); void DeleteDrawPoly( wxDC* DC );
LibDrawField* LocateField( LIB_COMPONENT* LibEntry );
LIB_DRAW_ITEM* LocateItemUsingCursor(); LIB_DRAW_ITEM* LocateItemUsingCursor();
void RotateField( wxDC* DC, LibDrawField* Field ); void RotateField( wxDC* DC, LibDrawField* Field );
void PlaceField( wxDC* DC, LibDrawField* Field ); void PlaceField( wxDC* DC, LibDrawField* Field );
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "program.h" #include "program.h"
#include "general.h" #include "general.h"
#include "libcmp.h"
#include "protos.h" #include "protos.h"
#include "libeditfrm.h" #include "libeditfrm.h"
#include "class_library.h" #include "class_library.h"
...@@ -263,38 +262,6 @@ void WinEDA_LibeditFrame::RotateField( wxDC* DC, LibDrawField* Field ) ...@@ -263,38 +262,6 @@ void WinEDA_LibeditFrame::RotateField( wxDC* DC, LibDrawField* Field )
} }
/*
* Locate the component fiels (ref, name or auxiliary fields) under the
* mouse cursor
* return:
* pointer on the field (or NULL )
*/
LibDrawField* WinEDA_LibeditFrame::LocateField( LIB_COMPONENT* LibEntry )
{
wxPoint refpos = GetScreen()->m_Curseur;
/* Test reference */
if( LibEntry->m_Name.HitTest( refpos ) )
return &LibEntry->m_Name;
/* Test Prefix */
if( LibEntry->m_Prefix.HitTest( refpos ) )
return &LibEntry->m_Prefix;
/* Test others fields */
for( LibDrawField* field = LibEntry->m_Fields; field != NULL;
field = field->Next() )
{
if( field->m_Text.IsEmpty() )
continue;
if( field->HitTest( refpos ) )
return field;
}
return NULL;
}
LIB_DRAW_ITEM* WinEDA_LibeditFrame::LocateItemUsingCursor() LIB_DRAW_ITEM* WinEDA_LibeditFrame::LocateItemUsingCursor()
{ {
LIB_DRAW_ITEM* DrawEntry = m_drawItem; LIB_DRAW_ITEM* DrawEntry = m_drawItem;
...@@ -303,27 +270,16 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::LocateItemUsingCursor() ...@@ -303,27 +270,16 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::LocateItemUsingCursor()
return NULL; return NULL;
if( ( DrawEntry == NULL ) || ( DrawEntry->m_Flags == 0 ) ) if( ( DrawEntry == NULL ) || ( DrawEntry->m_Flags == 0 ) )
{
DrawEntry = LocatePin( GetScreen()->m_Curseur, m_component,
m_unit, m_convert );
if( DrawEntry == NULL )
{ {
DrawEntry = m_drawItem = DrawEntry = m_drawItem =
LocateDrawItem( (SCH_SCREEN*) GetScreen(), m_component->LocateDrawItem( m_unit, m_convert, TYPE_NOT_INIT,
GetScreen()->m_MousePosition, m_component, GetScreen()->m_MousePosition );
m_unit, m_convert, LOCATE_ALL_DRAW_ITEM );
}
if( DrawEntry == NULL )
{
DrawEntry = m_drawItem =
LocateDrawItem( (SCH_SCREEN*) GetScreen(),
GetScreen()->m_Curseur, m_component,
m_unit, m_convert, LOCATE_ALL_DRAW_ITEM );
}
if( DrawEntry == NULL ) if( DrawEntry == NULL )
{ {
DrawEntry = m_drawItem = DrawEntry = m_drawItem =
(LIB_DRAW_ITEM*) LocateField( m_component ); m_component->LocateDrawItem( m_unit, m_convert, TYPE_NOT_INIT,
GetScreen()->m_Curseur );
} }
} }
......
...@@ -203,6 +203,12 @@ void WinEDA_LibeditFrame::LoadSettings() ...@@ -203,6 +203,12 @@ void WinEDA_LibeditFrame::LoadSettings()
} }
void WinEDA_LibeditFrame::SetDrawItem( LIB_DRAW_ITEM* drawItem )
{
m_drawItem = drawItem;
}
/** /**
* Save library editor frame specific configuration settings. * Save library editor frame specific configuration settings.
* *
......
This diff is collapsed.
...@@ -18,12 +18,14 @@ ...@@ -18,12 +18,14 @@
/* Routines locales */ /* Routines locales */
static void Write_GENERIC_NetList( WinEDA_SchematicFrame* frame, const wxString& FullFileName ); static void Write_GENERIC_NetList( WinEDA_SchematicFrame* frame,
const wxString& FullFileName );
static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f,
bool with_pcbnew ); bool with_pcbnew );
static void WriteNetListCADSTAR( WinEDA_SchematicFrame* frame, FILE* f ); static void WriteNetListCADSTAR( WinEDA_SchematicFrame* frame, FILE* f );
static void WriteListOfNetsCADSTAR( FILE* f, NETLIST_OBJECT_LIST& aObjectsList ); static void WriteListOfNetsCADSTAR( FILE* f, NETLIST_OBJECT_LIST& aObjectsList );
static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, bool use_netnames ); static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f,
bool use_netnames );
static void WriteGENERICListOfNets( FILE* f, NETLIST_OBJECT_LIST& aObjectsList ); static void WriteGENERICListOfNets( FILE* f, NETLIST_OBJECT_LIST& aObjectsList );
static void AddPinToComponentPinList( SCH_COMPONENT* Component, static void AddPinToComponentPinList( SCH_COMPONENT* Component,
...@@ -97,21 +99,19 @@ void WriteNetList( WinEDA_SchematicFrame* frame, const wxString& FileNameNL, ...@@ -97,21 +99,19 @@ void WriteNetList( WinEDA_SchematicFrame* frame, const wxString& FileNameNL,
} }
/****************************************************************************/
static SCH_COMPONENT* FindNextComponentAndCreatPinList(
EDA_BaseStruct* DrawList, DrawSheetPath* sheet )
/****************************************************************************/
/* Find a "suitable" component from the DrawList /* Find a "suitable" component from the DrawList
* build its pin list s_SortedComponentPinList. * build its pin list s_SortedComponentPinList.
* The list is sorted by pin num * The list is sorted by pin num
* A suitable component is a "new" real component (power symbols are not considered) * A suitable component is a "new" real component (power symbols are not
* considered)
* Must be deallocated by the user * Must be deallocated by the user
*/ */
static SCH_COMPONENT* FindNextComponentAndCreatPinList( EDA_BaseStruct* DrawList,
DrawSheetPath* sheet )
{ {
SCH_COMPONENT* Component = NULL; SCH_COMPONENT* Component = NULL;
LIB_COMPONENT* Entry; LIB_COMPONENT* Entry;
LIB_DRAW_ITEM* DEntry; LibDrawPin* Pin;
s_SortedComponentPinList.clear(); s_SortedComponentPinList.clear();
for( ; DrawList != NULL; DrawList = DrawList->Next() ) for( ; DrawList != NULL; DrawList = DrawList->Next() )
...@@ -129,14 +129,16 @@ static SCH_COMPONENT* FindNextComponentAndCreatPinList( ...@@ -129,14 +129,16 @@ static SCH_COMPONENT* FindNextComponentAndCreatPinList(
//if( Component->m_FlagControlMulti == 1 ) //if( Component->m_FlagControlMulti == 1 )
// continue; /* yes */ // continue; /* yes */
// removed because with multiple instances of one schematic // removed because with multiple instances of one schematic
// (several sheets pointing to 1 screen), this will be erroneously be toggled. // (several sheets pointing to 1 screen), this will be erroneously be
// toggled.
Entry = CMP_LIBRARY::FindLibraryComponent( Component->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( Component->m_ChipName );
if( Entry == NULL ) if( Entry == NULL )
continue; continue;
if( Entry->m_UnitCount > 1 ) // Multi parts per package: test if already visited: // Multi parts per package: test if already visited:
if( Entry->m_UnitCount > 1 )
{ {
bool found = false; bool found = false;
for( unsigned jj = 0; jj < s_ReferencesAlreadyFound.GetCount(); jj++ ) for( unsigned jj = 0; jj < s_ReferencesAlreadyFound.GetCount(); jj++ )
...@@ -156,29 +158,29 @@ static SCH_COMPONENT* FindNextComponentAndCreatPinList( ...@@ -156,29 +158,29 @@ static SCH_COMPONENT* FindNextComponentAndCreatPinList(
} }
} }
DEntry = Entry->m_Drawings;
if( Entry->m_UnitCount <= 1 ) // One part per package if( Entry->m_UnitCount <= 1 ) // One part per package
{ {
for( ; DEntry != NULL; DEntry = DEntry->Next() ) for( Pin = Entry->GetNextPin(); Pin != NULL;
Pin = Entry->GetNextPin( Pin ) )
{ {
if( DEntry->Type() != COMPONENT_PIN_DRAW_TYPE ) wxASSERT( Pin->Type() == COMPONENT_PIN_DRAW_TYPE );
continue;
if( DEntry->m_Unit if( Pin->m_Unit
&& ( DEntry->m_Unit != Component->GetUnitSelection( sheet ) ) ) && ( Pin->m_Unit != Component->GetUnitSelection( sheet ) ) )
continue; continue;
if( DEntry->m_Convert if( Pin->m_Convert
&& (DEntry->m_Convert != Component->m_Convert) ) && ( Pin->m_Convert != Component->m_Convert ) )
continue; continue;
{
AddPinToComponentPinList( Component, sheet, (LibDrawPin*) DEntry ); AddPinToComponentPinList( Component, sheet, Pin );
}
} }
} }
else // Multiple parts per package: Collect all parts ans pins for this reference else // Multiple parts per package: Collect all parts ans pins for this reference
FindAllsInstancesOfComponent( Component, Entry, sheet ); FindAllsInstancesOfComponent( Component, Entry, sheet );
/* Sort Pins in s_SortedComponentPinList by pin number */ /* Sort Pins in s_SortedComponentPinList by pin number */
sort( s_SortedComponentPinList.begin(), s_SortedComponentPinList.end(),SortPinsByNum ); sort( s_SortedComponentPinList.begin(),
s_SortedComponentPinList.end(), SortPinsByNum );
/* Remove duplicate Pins in s_SortedComponentPinList */ /* Remove duplicate Pins in s_SortedComponentPinList */
EraseDuplicatePins( s_SortedComponentPinList ); EraseDuplicatePins( s_SortedComponentPinList );
...@@ -754,29 +756,30 @@ static void EraseDuplicatePins( NETLIST_OBJECT_LIST& aPinList ) ...@@ -754,29 +756,30 @@ static void EraseDuplicatePins( NETLIST_OBJECT_LIST& aPinList )
} }
/**********************************************************************************/
static void FindAllsInstancesOfComponent( SCH_COMPONENT* Component_in,
LIB_COMPONENT* Entry,
DrawSheetPath* Sheet_in )
/**********************************************************************************/
/** /**
* Used for multiple parts per package components * Used for multiple parts per package components.
*
* Search all instances of Component_in, * Search all instances of Component_in,
* Calls AddPinToComponentPinList() to and pins founds to the current component pin list * Calls AddPinToComponentPinList() to and pins founds to the current
* component pin list
*/ */
static void FindAllsInstancesOfComponent( SCH_COMPONENT* Component_in,
LIB_COMPONENT* Entry,
DrawSheetPath* Sheet_in )
{ {
EDA_BaseStruct* SchItem; EDA_BaseStruct* SchItem;
SCH_COMPONENT* Component2; SCH_COMPONENT* Component2;
LIB_DRAW_ITEM* DEntry; LibDrawPin* pin;
DrawSheetPath* sheet; DrawSheetPath* sheet;
wxString str, Reference = Component_in->GetRef( Sheet_in ); wxString str, Reference = Component_in->GetRef( Sheet_in );
EDA_SheetList SheetList; EDA_SheetList SheetList;
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() ) for( sheet = SheetList.GetFirst(); sheet != NULL;
sheet = SheetList.GetNext() )
{ {
for( SchItem = sheet->LastDrawList(); SchItem; SchItem = SchItem->Next() ) for( SchItem = sheet->LastDrawList(); SchItem;
SchItem = SchItem->Next() )
{ {
if( SchItem->Type() != TYPE_SCH_COMPONENT ) if( SchItem->Type() != TYPE_SCH_COMPONENT )
continue; continue;
...@@ -787,36 +790,35 @@ static void FindAllsInstancesOfComponent( SCH_COMPONENT* Component_in, ...@@ -787,36 +790,35 @@ static void FindAllsInstancesOfComponent( SCH_COMPONENT* Component_in,
if( str.CmpNoCase( Reference ) != 0 ) if( str.CmpNoCase( Reference ) != 0 )
continue; continue;
if( Entry && Entry->m_Drawings != NULL ) if( Entry == NULL )
{
DEntry = Entry->m_Drawings;
for( ; DEntry != NULL; DEntry = DEntry->Next() )
{
if( DEntry->Type() != COMPONENT_PIN_DRAW_TYPE )
continue; continue;
if( DEntry->m_Unit
&& ( DEntry->m_Unit != Component2->GetUnitSelection( sheet ) ) ) for( pin = Entry->GetNextPin(); pin != NULL;
pin = Entry->GetNextPin( pin ) )
{
wxASSERT( pin->Type() != COMPONENT_PIN_DRAW_TYPE );
if( pin->m_Unit
&& ( pin->m_Unit != Component2->GetUnitSelection( sheet ) ) )
continue; continue;
if( DEntry->m_Convert
&& (DEntry->m_Convert != Component2->m_Convert) ) if( pin->m_Convert
&& ( pin->m_Convert != Component2->m_Convert ) )
continue; continue;
// A suitable pin in found: add it to the current list // A suitable pin in found: add it to the current list
AddPinToComponentPinList( Component2, sheet, (LibDrawPin*) DEntry ); AddPinToComponentPinList( Component2, sheet, pin );
}
} }
} }
} }
} }
/**************************************************************************/ /*
static bool SortPinsByNum( NETLIST_OBJECT* Pin1, NETLIST_OBJECT* Pin2 ) Routine de comparaison pour le tri des pins par numero croissant
/**************************************************************************/
/* Routine de comparaison pour le tri des pins par numero croissant
* du tableau des pins s_SortedComponentPinList par qsort() * du tableau des pins s_SortedComponentPinList par qsort()
*/ */
static bool SortPinsByNum( NETLIST_OBJECT* Pin1, NETLIST_OBJECT* Pin2 )
{ {
int Num1, Num2; int Num1, Num2;
char Line[5]; char Line[5];
......
...@@ -355,7 +355,7 @@ static void ListeObjetConnection( DrawSheetPath* sheetlist, ...@@ -355,7 +355,7 @@ static void ListeObjetConnection( DrawSheetPath* sheetlist,
NETLIST_OBJECT* new_item; NETLIST_OBJECT* new_item;
SCH_COMPONENT* DrawLibItem; SCH_COMPONENT* DrawLibItem;
LIB_COMPONENT* Entry; LIB_COMPONENT* Entry;
LIB_DRAW_ITEM* DEntry; LibDrawPin* pin;
Hierarchical_PIN_Sheet_Struct* SheetLabel; Hierarchical_PIN_Sheet_Struct* SheetLabel;
DrawSheetPath list; DrawSheetPath list;
...@@ -479,43 +479,38 @@ static void ListeObjetConnection( DrawSheetPath* sheetlist, ...@@ -479,43 +479,38 @@ static void ListeObjetConnection( DrawSheetPath* sheetlist,
if( Entry == NULL ) if( Entry == NULL )
break; break;
if( Entry->m_Drawings == NULL ) for( pin = Entry->GetNextPin(); pin != NULL;
break; pin = Entry->GetNextPin( pin ) )
DEntry = Entry->m_Drawings;
for( ; DEntry; DEntry = DEntry->Next() )
{ {
LibDrawPin* Pin = (LibDrawPin*) DEntry; wxASSERT( pin->Type() == COMPONENT_PIN_DRAW_TYPE );
if( DEntry->Type() != COMPONENT_PIN_DRAW_TYPE )
continue;
if( DEntry->m_Unit && ( DEntry->m_Unit != DrawLibItem->GetUnitSelection( sheetlist ) ) ) if( pin->m_Unit
&& ( pin->m_Unit != DrawLibItem->GetUnitSelection( sheetlist ) ) )
continue; continue;
if( DEntry->m_Convert if( pin->m_Convert
&& (DEntry->m_Convert != DrawLibItem->m_Convert) ) && ( pin->m_Convert != DrawLibItem->m_Convert ) )
continue; continue;
wxPoint pos2 = wxPoint pos2 =
TransformCoordinate( DrawLibItem->m_Transform, TransformCoordinate( DrawLibItem->m_Transform,
Pin->m_Pos ) + DrawLibItem->m_Pos; pin->m_Pos ) + DrawLibItem->m_Pos;
new_item = new NETLIST_OBJECT(); new_item = new NETLIST_OBJECT();
new_item->m_SheetListInclude = *sheetlist; new_item->m_SheetListInclude = *sheetlist;
new_item->m_Comp = DEntry; new_item->m_Comp = pin;
new_item->m_SheetList = *sheetlist; new_item->m_SheetList = *sheetlist;
new_item->m_Type = NET_PIN; new_item->m_Type = NET_PIN;
new_item->m_Link = DrawLibItem; new_item->m_Link = DrawLibItem;
new_item->m_ElectricalType = Pin->m_PinType; new_item->m_ElectricalType = pin->m_PinType;
new_item->m_PinNum = Pin->m_PinNum; new_item->m_PinNum = pin->m_PinNum;
new_item->m_Label = &Pin->m_PinName; new_item->m_Label = &pin->m_PinName;
new_item->m_Start = new_item->m_End = pos2; new_item->m_Start = new_item->m_End = pos2;
aNetItemBuffer.push_back( new_item ); aNetItemBuffer.push_back( new_item );
if( ( (int) Pin->m_PinType == (int) PIN_POWER_IN ) if( ( (int) pin->m_PinType == (int) PIN_POWER_IN )
&& ( Pin->m_Attributs & PINNOTDRAW ) ) && ( pin->m_Attributs & PINNOTDRAW ) )
{ {
/* Il y a un PIN_LABEL Associe */ /* Il y a un PIN_LABEL Associe */
new_item = new NETLIST_OBJECT(); new_item = new NETLIST_OBJECT();
...@@ -523,7 +518,7 @@ static void ListeObjetConnection( DrawSheetPath* sheetlist, ...@@ -523,7 +518,7 @@ static void ListeObjetConnection( DrawSheetPath* sheetlist,
new_item->m_Comp = NULL; new_item->m_Comp = NULL;
new_item->m_SheetList = *sheetlist; new_item->m_SheetList = *sheetlist;
new_item->m_Type = NET_PINLABEL; new_item->m_Type = NET_PINLABEL;
new_item->m_Label = &Pin->m_PinName; new_item->m_Label = &pin->m_PinName;
new_item->m_Start = pos2; new_item->m_Start = pos2;
new_item->m_End = new_item->m_Start; new_item->m_End = new_item->m_Start;
...@@ -545,8 +540,7 @@ static void ListeObjetConnection( DrawSheetPath* sheetlist, ...@@ -545,8 +540,7 @@ static void ListeObjetConnection( DrawSheetPath* sheetlist,
list = *sheetlist; list = *sheetlist;
list.Push( STRUCT ); list.Push( STRUCT );
SheetLabel = STRUCT->m_Label; SheetLabel = STRUCT->m_Label;
for( ; SheetLabel != NULL; for( ; SheetLabel != NULL; SheetLabel = SheetLabel->Next() )
SheetLabel = SheetLabel->Next() )
{ {
ii = IsBusLabel( SheetLabel->m_Text ); ii = IsBusLabel( SheetLabel->m_Text );
new_item = new NETLIST_OBJECT(); new_item = new NETLIST_OBJECT();
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "common.h" #include "common.h"
#include "program.h" #include "program.h"
#include "libcmp.h"
#include "general.h" #include "general.h"
#include "eeschema_id.h" #include "eeschema_id.h"
#include "libeditfrm.h" #include "libeditfrm.h"
...@@ -133,8 +132,8 @@ public: ...@@ -133,8 +132,8 @@ public:
void NewSizePin(int newsize); void NewSizePin(int newsize);
void SetPinShape( int newshape); void SetPinShape( int newshape);
void SetPinType(int newtype); void SetPinType(int newtype);
void SetPinOrient(int neworient); void SetPinOrientation(int neworient);
void SetAttributsPin(bool draw, bool unit, bool convert); void SetPinAttributes(bool draw, bool unit, bool convert);
////@begin WinEDA_PinPropertiesFrame member variables ////@begin WinEDA_PinPropertiesFrame member variables
wxTextCtrl* m_PinNameCtrl; wxTextCtrl* m_PinNameCtrl;
......
This diff is collapsed.
...@@ -65,7 +65,7 @@ static void PlotLibPart( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem ) ...@@ -65,7 +65,7 @@ static void PlotLibPart( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem )
Multi = DrawLibItem->m_Multi; Multi = DrawLibItem->m_Multi;
convert = DrawLibItem->m_Convert; convert = DrawLibItem->m_Convert;
for( LIB_DRAW_ITEM* DEntry = Entry->m_Drawings; for( LIB_DRAW_ITEM* DEntry = Entry->GetNextDrawItem();
DEntry != NULL; DEntry = DEntry->Next() ) DEntry != NULL; DEntry = DEntry->Next() )
{ {
/* Elimination des elements non relatifs a l'unite */ /* Elimination des elements non relatifs a l'unite */
......
...@@ -21,14 +21,6 @@ class DrawSheetStruct; ...@@ -21,14 +21,6 @@ class DrawSheetStruct;
class LibDrawPin; class LibDrawPin;
LIB_DRAW_ITEM* LocatePin( const wxPoint& RefPos,
LIB_COMPONENT* Entry,
int Unit,
int Convert,
SCH_COMPONENT* DrawItem = NULL );
/* Routine de localisation d'une PIN de la PartLib pointee par Entry */
wxString ReturnDefaultFieldName( int aFieldNdx ); wxString ReturnDefaultFieldName( int aFieldNdx );
...@@ -158,13 +150,6 @@ SCH_ITEM* PickStruct( const wxPoint& refpos, ...@@ -158,13 +150,6 @@ SCH_ITEM* PickStruct( const wxPoint& refpos,
int SearchMask ); int SearchMask );
LIB_DRAW_ITEM* LocateDrawItem( SCH_SCREEN* Screen,
const wxPoint& refpoint,
LIB_COMPONENT* LibEntry,
int Unit,
int Convert,
int masque );
Hierarchical_PIN_Sheet_Struct* LocateSheetLabel( DrawSheetStruct* Sheet, Hierarchical_PIN_Sheet_Struct* LocateSheetLabel( DrawSheetStruct* Sheet,
const wxPoint& pos ); const wxPoint& pos );
LibDrawPin* LocateAnyPin( SCH_ITEM* DrawList, LibDrawPin* LocateAnyPin( SCH_ITEM* DrawList,
...@@ -252,20 +237,6 @@ void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Window ); ...@@ -252,20 +237,6 @@ void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Window );
void DeleteAllMarkers( int type ); void DeleteAllMarkers( int type );
/**************/
/* GETPART.CPP */
/**************/
int LookForConvertPart( LIB_COMPONENT* LibEntry );
/* Retourne la plus grande valeur trouvee dans la liste des elements
* "drawings" du composant LibEntry, pour le membre .Convert
* Si il n'y a pas de representation type "convert", la valeur
* retournee est 0 ou 1
* Si il y a une representation type "convert",
* la valeur retournee est > 1 (typiquement 2) */
/**************/ /**************/
/* PINEDIT.CPP */ /* PINEDIT.CPP */
/**************/ /**************/
......
...@@ -140,13 +140,12 @@ void WinEDA_LibeditFrame::EditGraphicSymbol( wxDC* DC, LIB_DRAW_ITEM* DrawItem ) ...@@ -140,13 +140,12 @@ void WinEDA_LibeditFrame::EditGraphicSymbol( wxDC* DC, LIB_DRAW_ITEM* DrawItem )
} }
/****************************************************************/
static void AbortSymbolTraceOn( WinEDA_DrawPanel* Panel, wxDC* DC ) static void AbortSymbolTraceOn( WinEDA_DrawPanel* Panel, wxDC* DC )
/****************************************************************/
{ {
LIB_DRAW_ITEM* item; LIB_DRAW_ITEM* item;
WinEDA_LibeditFrame* parent = ( WinEDA_LibeditFrame* ) Panel->GetParent();
item = ( ( WinEDA_LibeditFrame* ) Panel->GetParent() )->GetDrawItem(); item = parent->GetDrawItem();
if( item == NULL ) if( item == NULL )
return; return;
...@@ -164,6 +163,7 @@ static void AbortSymbolTraceOn( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -164,6 +163,7 @@ static void AbortSymbolTraceOn( WinEDA_DrawPanel* Panel, wxDC* DC )
DefaultTransformMatrix ); DefaultTransformMatrix );
SAFE_DELETE( item ); SAFE_DELETE( item );
parent->SetDrawItem( NULL );
} }
else else
{ {
...@@ -297,12 +297,10 @@ error" ) ); ...@@ -297,12 +297,10 @@ error" ) );
} }
/********************************************************/ /*
void WinEDA_LibeditFrame::GraphicItemBeginDraw( wxDC* DC ) * Routine de creation d'un nouvel element type LibraryDrawStruct
/********************************************************/
/* Routine de creation d'un nouvel element type LibraryDrawStruct
*/ */
void WinEDA_LibeditFrame::GraphicItemBeginDraw( wxDC* DC )
{ {
if( m_drawItem == NULL ) if( m_drawItem == NULL )
return; return;
...@@ -520,16 +518,14 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -520,16 +518,14 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
} }
/******************************************************/ /*
void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) * Place la structure courante en liste des structures du composant
/******************************************************/
/* Place la structure courante en liste des structures du composant
* courant, si elle existe et redessine toujours celle ci * courant, si elle existe et redessine toujours celle ci
* Parametres: (tous globaux) * Parametres: (tous globaux)
* m_drawItem * m_drawItem
* m_component * m_component
*/ */
void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC )
{ {
if( m_component == NULL || m_drawItem == NULL ) if( m_component == NULL || m_drawItem == NULL )
return; return;
...@@ -538,11 +534,12 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) ...@@ -538,11 +534,12 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC )
{ {
if( StateDrawArc == 1 ) /* Trace d'arc en cours: doit etre termine */ if( StateDrawArc == 1 ) /* Trace d'arc en cours: doit etre termine */
{ {
DisplayError( this, wxT( "Arc in progress.." ), 10 ); return; DisplayError( this, wxT( "Arc in progress.." ) );
return;
} }
else else
{ {
if( (m_drawItem->m_Flags & IS_MOVED) == 0 ) if( ( m_drawItem->m_Flags & IS_MOVED ) == 0 )
SymbolDisplayDraw( DrawPanel, DC, FALSE ); SymbolDisplayDraw( DrawPanel, DC, FALSE );
} }
} }
...@@ -552,8 +549,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) ...@@ -552,8 +549,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC )
if( m_drawItem->m_Flags & IS_NEW ) if( m_drawItem->m_Flags & IS_NEW )
{ {
SaveCopyInUndoList( m_component ); SaveCopyInUndoList( m_component );
m_drawItem->SetNext( m_component->m_Drawings ); m_component->AddDrawItem( m_drawItem );
m_component->m_Drawings = m_drawItem;
switch( m_drawItem->Type() ) switch( m_drawItem->Type() )
{ {
...@@ -581,8 +577,6 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) ...@@ -581,8 +577,6 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC )
default: default:
; ;
} }
m_component->SortDrawItems();
} }
if( m_ID_current_state ) if( m_ID_current_state )
...@@ -590,7 +584,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) ...@@ -590,7 +584,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC )
else else
SetCursor( wxCURSOR_ARROW ); SetCursor( wxCURSOR_ARROW );
if( (m_drawItem->m_Flags & IS_MOVED) ) if( m_drawItem->m_Flags & IS_MOVED )
{ {
wxPoint pos; wxPoint pos;
pos.x = GetScreen()->m_Curseur.x + InitPosition.x - StartCursor.x, pos.x = GetScreen()->m_Curseur.x + InitPosition.x - StartCursor.x,
...@@ -702,12 +696,10 @@ static void ComputeArc( LibDrawArc* DrawItem, wxPoint ArcCentre ) ...@@ -702,12 +696,10 @@ static void ComputeArc( LibDrawArc* DrawItem, wxPoint ArcCentre )
} }
/***************************************************/ /*
void WinEDA_LibeditFrame::DeleteDrawPoly( wxDC* DC ) * Used for deleting last entered segment while creating a Polyline
/**************************************************/
/* Used for deleting last entered segment while creating a Polyline
*/ */
void WinEDA_LibeditFrame::DeleteDrawPoly( wxDC* DC )
{ {
if( m_drawItem == NULL if( m_drawItem == NULL
|| m_drawItem->Type() != COMPONENT_POLYLINE_DRAW_TYPE ) || m_drawItem->Type() != COMPONENT_POLYLINE_DRAW_TYPE )
...@@ -718,7 +710,8 @@ void WinEDA_LibeditFrame::DeleteDrawPoly( wxDC* DC ) ...@@ -718,7 +710,8 @@ void WinEDA_LibeditFrame::DeleteDrawPoly( wxDC* DC )
m_drawItem->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, NULL, m_drawItem->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, NULL,
DefaultTransformMatrix ); DefaultTransformMatrix );
while( Poly->GetCornerCount() > 2 ) // First segment is kept, only its end point is changed // First segment is kept, only its end point is changed
while( Poly->GetCornerCount() > 2 )
{ {
Poly->m_PolyPoints.pop_back(); Poly->m_PolyPoints.pop_back();
unsigned idx = Poly->GetCornerCount() - 1; unsigned idx = Poly->GetCornerCount() - 1;
......
...@@ -96,9 +96,9 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void ) ...@@ -96,9 +96,9 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void )
DisplayError( this, _( "Warning: more than 1 part in Symbol File" ) ); DisplayError( this, _( "Warning: more than 1 part in Symbol File" ) );
Component = (LIB_COMPONENT*) Lib->GetFirstEntry(); Component = (LIB_COMPONENT*) Lib->GetFirstEntry();
DrawEntry = Component->m_Drawings; DrawEntry = Component->GetNextDrawItem();
while( DrawEntry ) while( DrawEntry != NULL )
{ {
if( DrawEntry->m_Unit ) if( DrawEntry->m_Unit )
DrawEntry->m_Unit = m_unit; DrawEntry->m_Unit = m_unit;
...@@ -107,14 +107,9 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void ) ...@@ -107,14 +107,9 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void )
DrawEntry->m_Flags = IS_NEW; DrawEntry->m_Flags = IS_NEW;
DrawEntry->m_Selected = IS_SELECTED; DrawEntry->m_Selected = IS_SELECTED;
if( DrawEntry->Next() == NULL ) /* Fin de liste trouvee */ LIB_DRAW_ITEM* newItem = DrawEntry->GenCopy();
{ newItem->SetParent( m_component );
DrawEntry->SetNext( m_component->m_Drawings ); m_component->AddDrawItem( newItem );
m_component->m_Drawings = Component->m_Drawings;
Component->m_Drawings = NULL;
break;
}
DrawEntry = DrawEntry->Next(); DrawEntry = DrawEntry->Next();
} }
...@@ -122,13 +117,7 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void ) ...@@ -122,13 +117,7 @@ void WinEDA_LibeditFrame::LoadOneSymbol( void )
m_component->RemoveDuplicateDrawItems(); m_component->RemoveDuplicateDrawItems();
// Clear flags // Clear flags
DrawEntry = m_component->m_Drawings; m_component->ClearSelectedItems();
while( DrawEntry )
{
DrawEntry->m_Flags = 0;
DrawEntry->m_Selected = 0;
DrawEntry = DrawEntry->Next();
}
GetScreen()->SetModify(); GetScreen()->SetModify();
DrawPanel->Refresh(); DrawPanel->Refresh();
...@@ -151,7 +140,7 @@ void WinEDA_LibeditFrame::SaveOneSymbol() ...@@ -151,7 +140,7 @@ void WinEDA_LibeditFrame::SaveOneSymbol()
wxString msg; wxString msg;
FILE* ExportFile; FILE* ExportFile;
if( m_component->m_Drawings == NULL ) if( m_component->GetNextDrawItem() == NULL )
return; return;
/* Creation du fichier symbole */ /* Creation du fichier symbole */
...@@ -215,11 +204,12 @@ void WinEDA_LibeditFrame::SaveOneSymbol() ...@@ -215,11 +204,12 @@ void WinEDA_LibeditFrame::SaveOneSymbol()
/* Position / orientation / visibilite des champs */ /* Position / orientation / visibilite des champs */
m_component->m_Prefix.Save( ExportFile ); m_component->m_Prefix.Save( ExportFile );
m_component->m_Name.Save( ExportFile ); m_component->m_Name.Save( ExportFile );
DrawEntry = m_component->m_Drawings; DrawEntry = m_component->GetNextDrawItem();
if( DrawEntry ) if( DrawEntry )
{ {
fprintf( ExportFile, "DRAW\n" ); fprintf( ExportFile, "DRAW\n" );
for( ; DrawEntry != NULL; DrawEntry = DrawEntry->Next() ) for( ; DrawEntry != NULL; DrawEntry = DrawEntry->Next() )
{ {
/* Elimination des elements non relatifs a l'unite */ /* Elimination des elements non relatifs a l'unite */
......
...@@ -255,7 +255,7 @@ protected: ...@@ -255,7 +255,7 @@ protected:
public: public:
int m_Flags; // flags for editing and other misc. uses int m_Flags; // flags for editing and other uses.
unsigned long m_TimeStamp; // Time stamp used for logical links unsigned long m_TimeStamp; // Time stamp used for logical links
int m_Selected; /* Used by block commands, and selective editing */ int m_Selected; /* Used by block commands, and selective editing */
......
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