Commit 4f3708c1 authored by jean-pierre charras's avatar jean-pierre charras

Eeschema: bug 706677 fixed (delete connection, junction persist).

This was due to a duplicate constants ( with sligtly different values)  used to select items in some seach functions that broke filtering. Old definitions removed.
parent da9f4b8a
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#endif #endif
#ifndef KICAD_BUILD_VERSION #ifndef KICAD_BUILD_VERSION
#define KICAD_BUILD_VERSION "(2011-01-21 BZR 2753)" #define KICAD_BUILD_VERSION "(2011-01-25 BZR 2758)"
#endif #endif
//#define VERSION_STABILITY "stable" //#define VERSION_STABILITY "stable"
......
...@@ -666,7 +666,7 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer ) ...@@ -666,7 +666,7 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
switch( layer ) switch( layer )
{ {
case LAYER_BUS: case LAYER_BUS:
item = PickStruct( pos, screen, BUSITEM ); item = PickStruct( pos, screen, BUS_T );
if( item ) if( item )
return TRUE; return TRUE;
...@@ -683,13 +683,13 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer ) ...@@ -683,13 +683,13 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
break; break;
case LAYER_NOTES: case LAYER_NOTES:
item = PickStruct( pos, screen, DRAWITEM ); item = PickStruct( pos, screen, DRAW_ITEM_T );
if( item ) if( item )
return TRUE; return TRUE;
break; break;
case LAYER_WIRE: case LAYER_WIRE:
item = PickStruct( pos, screen, RACCORDITEM | JUNCTIONITEM ); item = PickStruct( pos, screen, BUS_ENTRY_T | JUNCTION_T );
if( item ) if( item )
return TRUE; return TRUE;
...@@ -708,12 +708,12 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer ) ...@@ -708,12 +708,12 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
return TRUE; return TRUE;
} }
item = PickStruct( pos, screen, WIREITEM ); item = PickStruct( pos, screen, WIRE_T );
if( item ) if( item )
return TRUE; return TRUE;
item = PickStruct( pos, screen, LABELITEM ); item = PickStruct( pos, screen, LABEL_T );
if( item && (item->Type() != SCH_TEXT_T) if( item && (item->Type() != SCH_TEXT_T)
&& ( ( (SCH_GLOBALLABEL*) item )->m_Pos.x == pos.x ) && ( ( (SCH_GLOBALLABEL*) item )->m_Pos.x == pos.x )
&& ( ( (SCH_GLOBALLABEL*) item )->m_Pos.y == pos.y ) ) && ( ( (SCH_GLOBALLABEL*) item )->m_Pos.y == pos.y ) )
...@@ -749,12 +749,12 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer ) ...@@ -749,12 +749,12 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
*/ */
bool IsJunctionNeeded( SCH_EDIT_FRAME* frame, wxPoint& pos ) bool IsJunctionNeeded( SCH_EDIT_FRAME* frame, wxPoint& pos )
{ {
if( PickStruct( pos, frame->GetScreen(), JUNCTIONITEM ) ) if( PickStruct( pos, frame->GetScreen(), JUNCTION_T ) )
return FALSE; return FALSE;
if( PickStruct( pos, frame->GetScreen(), WIREITEM | EXCLUDE_WIRE_BUS_ENDPOINTS ) ) if( PickStruct( pos, frame->GetScreen(), WIRE_T | EXCLUDE_ENDPOINTS_T ) )
{ {
if( PickStruct( pos, frame->GetScreen(), WIREITEM | WIRE_BUS_ENDPOINTS_ONLY ) ) if( PickStruct( pos, frame->GetScreen(), WIRE_T | ENDPOINTS_ONLY_T ) )
return TRUE; return TRUE;
if( frame->GetScreen()->GetPin( pos, NULL, true ) ) if( frame->GetScreen()->GetPin( pos, NULL, true ) )
......
...@@ -127,7 +127,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo ...@@ -127,7 +127,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo
wxString Text; wxString Text;
wxString msg; wxString msg;
DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), MARKERITEM ); DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), MARKER_T );
if( DrawStruct ) if( DrawStruct )
{ {
...@@ -135,7 +135,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo ...@@ -135,7 +135,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo
return DrawStruct; return DrawStruct;
} }
DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), NOCONNECTITEM ); DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), NO_CONNECT_T );
if( DrawStruct ) if( DrawStruct )
{ {
...@@ -143,7 +143,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo ...@@ -143,7 +143,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo
return DrawStruct; return DrawStruct;
} }
DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), JUNCTIONITEM ); DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), JUNCTION_T );
if( DrawStruct ) if( DrawStruct )
{ {
...@@ -152,7 +152,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo ...@@ -152,7 +152,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo
} }
DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(),
WIREITEM | BUSITEM | RACCORDITEM ); WIRE_T | BUS_T | BUS_ENTRY_T );
if( DrawStruct ) // We have found a wire: Search for a connected pin at the same location if( DrawStruct ) // We have found a wire: Search for a connected pin at the same location
{ {
...@@ -172,7 +172,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo ...@@ -172,7 +172,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo
return DrawStruct; return DrawStruct;
} }
DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), FIELDCMPITEM ); DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), FIELD_T );
if( DrawStruct ) if( DrawStruct )
{ {
...@@ -183,7 +183,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo ...@@ -183,7 +183,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo
return DrawStruct; return DrawStruct;
} }
DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), LABELITEM | TEXTITEM ); DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), LABEL_T | TEXT_T );
if( DrawStruct ) if( DrawStruct )
{ {
...@@ -205,7 +205,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo ...@@ -205,7 +205,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo
return LibItem; return LibItem;
} }
DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), LIBITEM ); DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), COMPONENT_T );
if( DrawStruct ) if( DrawStruct )
{ {
...@@ -215,7 +215,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo ...@@ -215,7 +215,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo
return DrawStruct; return DrawStruct;
} }
DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), SHEETITEM ); DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), SHEET_T );
if( DrawStruct ) if( DrawStruct )
{ {
...@@ -223,7 +223,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo ...@@ -223,7 +223,7 @@ SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpo
return DrawStruct; return DrawStruct;
} }
DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), SEARCHALL ); DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), NO_FILTER_T );
if( DrawStruct ) if( DrawStruct )
{ {
......
...@@ -98,7 +98,7 @@ void SCH_EDIT_FRAME::DeleteConnection( bool DeleteFullConnection ) ...@@ -98,7 +98,7 @@ void SCH_EDIT_FRAME::DeleteConnection( bool DeleteFullConnection )
while( DelStruct while( DelStruct
&& ( DelStruct = PickStruct( screen->m_Curseur, screen, && ( DelStruct = PickStruct( screen->m_Curseur, screen,
JUNCTIONITEM | WIREITEM | BUSITEM ) ) != NULL ) JUNCTION_T | WIRE_T | BUS_T ) ) != NULL )
{ {
DelStruct->m_Flags = SELECTEDNODE | STRUCT_DELETED; DelStruct->m_Flags = SELECTEDNODE | STRUCT_DELETED;
...@@ -111,7 +111,7 @@ void SCH_EDIT_FRAME::DeleteConnection( bool DeleteFullConnection ) ...@@ -111,7 +111,7 @@ void SCH_EDIT_FRAME::DeleteConnection( bool DeleteFullConnection )
screen->SetDrawItems( DelStruct ); screen->SetDrawItems( DelStruct );
} }
screen->SetDrawItems( savedItems ); screen->SetDrawItems( savedItems ); // Restore the list entry point.
/* Mark all wires, junctions, .. connected to one of the item to delete /* Mark all wires, junctions, .. connected to one of the item to delete
*/ */
...@@ -246,7 +246,7 @@ void SCH_EDIT_FRAME::DeleteConnection( bool DeleteFullConnection ) ...@@ -246,7 +246,7 @@ void SCH_EDIT_FRAME::DeleteConnection( bool DeleteFullConnection )
continue; continue;
GetScreen()->m_Curseur = ( (SCH_TEXT*) DelStruct )->m_Pos; GetScreen()->m_Curseur = ( (SCH_TEXT*) DelStruct )->m_Pos;
EDA_ITEM* TstStruct = PickStruct( screen->m_Curseur, GetScreen(), WIREITEM | BUSITEM ); EDA_ITEM* TstStruct = PickStruct( screen->m_Curseur, GetScreen(), WIRE_T | BUS_T );
if( TstStruct && TstStruct->m_Flags & STRUCT_DELETED ) if( TstStruct && TstStruct->m_Flags & STRUCT_DELETED )
{ {
...@@ -279,9 +279,9 @@ void SCH_EDIT_FRAME::DeleteConnection( bool DeleteFullConnection ) ...@@ -279,9 +279,9 @@ void SCH_EDIT_FRAME::DeleteConnection( bool DeleteFullConnection )
* 2 : JUNCTION * 2 : JUNCTION
* 2 : NOCONNECT * 2 : NOCONNECT
* 3 : WIRE or BUS * 3 : WIRE or BUS
* 4 : DRAWITEM * 4 : GRAPHIC ITEM
* 5 : TEXT * 5 : TEXT
* 6 : COMPOSANT * 6 : COMPONENT
* 7 : SHEET * 7 : SHEET
* *
* return TRUE if an item was deleted * return TRUE if an item was deleted
...@@ -292,23 +292,23 @@ bool LocateAndDeleteItem( SCH_EDIT_FRAME* frame, wxDC* DC ) ...@@ -292,23 +292,23 @@ bool LocateAndDeleteItem( SCH_EDIT_FRAME* frame, wxDC* DC )
SCH_SCREEN* screen = (SCH_SCREEN*) ( frame->GetScreen() ); SCH_SCREEN* screen = (SCH_SCREEN*) ( frame->GetScreen() );
bool item_deleted = FALSE; bool item_deleted = FALSE;
DelStruct = PickStruct( screen->m_Curseur, screen, MARKERITEM ); DelStruct = PickStruct( screen->m_Curseur, screen, MARKER_T );
if( DelStruct == NULL ) if( DelStruct == NULL )
DelStruct = PickStruct( screen->m_Curseur, screen, JUNCTIONITEM ); DelStruct = PickStruct( screen->m_Curseur, screen, JUNCTION_T );
if( DelStruct == NULL ) if( DelStruct == NULL )
DelStruct = PickStruct( screen->m_Curseur, screen, NOCONNECTITEM ); DelStruct = PickStruct( screen->m_Curseur, screen, NO_CONNECT_T );
if( DelStruct == NULL ) if( DelStruct == NULL )
DelStruct = PickStruct( screen->m_Curseur, screen, RACCORDITEM ); DelStruct = PickStruct( screen->m_Curseur, screen, BUS_ENTRY_T );
if( DelStruct == NULL ) if( DelStruct == NULL )
DelStruct = PickStruct( screen->m_Curseur, screen, WIREITEM | BUSITEM ); DelStruct = PickStruct( screen->m_Curseur, screen, WIRE_T | BUS_T );
if( DelStruct == NULL ) if( DelStruct == NULL )
DelStruct = PickStruct( screen->m_Curseur, screen, DRAWITEM ); DelStruct = PickStruct( screen->m_Curseur, screen, DRAW_ITEM_T );
if( DelStruct == NULL ) if( DelStruct == NULL )
DelStruct = PickStruct( screen->m_Curseur, screen, TEXTITEM | LABELITEM ); DelStruct = PickStruct( screen->m_Curseur, screen, TEXT_T | LABEL_T );
if( DelStruct == NULL ) if( DelStruct == NULL )
DelStruct = PickStruct( screen->m_Curseur, screen, LIBITEM ); DelStruct = PickStruct( screen->m_Curseur, screen, COMPONENT_T );
if( DelStruct == NULL ) if( DelStruct == NULL )
DelStruct = PickStruct( screen->m_Curseur, screen, SHEETITEM ); DelStruct = PickStruct( screen->m_Curseur, screen, SHEET_T );
if( DelStruct ) if( DelStruct )
{ {
......
...@@ -79,7 +79,7 @@ void SCH_EDIT_FRAME::ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC ) ...@@ -79,7 +79,7 @@ void SCH_EDIT_FRAME::ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC )
{ {
if( TextStruct == NULL ) if( TextStruct == NULL )
TextStruct = (SCH_TEXT*) PickStruct( GetScreen()->m_Curseur, TextStruct = (SCH_TEXT*) PickStruct( GetScreen()->m_Curseur,
GetScreen(), TEXTITEM | LABELITEM ); GetScreen(), TEXT_T | LABEL_T );
if( TextStruct == NULL ) if( TextStruct == NULL )
return; return;
......
...@@ -45,29 +45,6 @@ class TRANSFORM; ...@@ -45,29 +45,6 @@ class TRANSFORM;
extern wxString g_DefaultSchematicFileName; extern wxString g_DefaultSchematicFileName;
/* Search mask for locating objects in editor. */
#define LIBITEM 1
#define WIREITEM 2
#define BUSITEM 4
#define RACCORDITEM 4
#define JUNCTIONITEM 0x10
#define DRAWITEM 0x20
#define TEXTITEM 0x40
#define LABELITEM 0x80
#define SHEETITEM 0x100
#define MARKERITEM 0x200
#define NOCONNECTITEM 0x400
#define SEARCH_PINITEM 0x800
#define SHEETLABELITEM 0x1000
#define FIELDCMPITEM 0x2000
#define EXCLUDE_WIRE_BUS_ENDPOINTS 0x4000
#define WIRE_BUS_ENDPOINTS_ONLY 0x8000
#define SEARCHALL ( LIBITEM | WIREITEM | BUSITEM | RACCORDITEM | \
JUNCTIONITEM | DRAWITEM | TEXTITEM | LABELITEM | \
SHEETITEM | MARKERITEM | NOCONNECTITEM | \
SEARCH_PINITEM | SHEETLABELITEM )
typedef enum typedef enum
{ {
LAYER_WIRE, LAYER_WIRE,
......
...@@ -699,7 +699,7 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct ) ...@@ -699,7 +699,7 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct )
if( DrawStruct->Type() == SCH_JUNCTION_T ) if( DrawStruct->Type() == SCH_JUNCTION_T )
{ {
// If it's a junction, pick the underlying wire instead // If it's a junction, pick the underlying wire instead
DrawStruct = PickStruct( GetScreen()->m_Curseur, GetScreen(), WIREITEM ); DrawStruct = PickStruct( GetScreen()->m_Curseur, GetScreen(), WIRE_T );
} }
if( DrawStruct == NULL ) if( DrawStruct == NULL )
break; break;
...@@ -778,7 +778,7 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct ) ...@@ -778,7 +778,7 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct )
if( DrawStruct == NULL ) if( DrawStruct == NULL )
{ {
DrawStruct = PickStruct( GetScreen()->m_Curseur, GetScreen(), DrawStruct = PickStruct( GetScreen()->m_Curseur, GetScreen(),
LIBITEM | TEXTITEM | LABELITEM | SHEETITEM ); COMPONENT_T | TEXT_T | LABEL_T | SHEET_T );
if( DrawStruct == NULL ) if( DrawStruct == NULL )
break; break;
if( DrawStruct->Type() == SCH_COMPONENT_T ) if( DrawStruct->Type() == SCH_COMPONENT_T )
......
...@@ -45,9 +45,9 @@ SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen ) ...@@ -45,9 +45,9 @@ SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen )
while( DrawList ) while( DrawList )
{ {
if( !SnapPoint2( Screen->m_MousePosition, LIBITEM, DrawList ) ) if( !SnapPoint2( Screen->m_MousePosition, COMPONENT_T, DrawList ) )
{ {
if( !SnapPoint2( Screen->m_Curseur, LIBITEM, DrawList ) ) if( !SnapPoint2( Screen->m_Curseur, COMPONENT_T, DrawList ) )
break; break;
} }
...@@ -79,24 +79,24 @@ SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen ) ...@@ -79,24 +79,24 @@ SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen )
/* Search an item at pos refpos /* Search an item at pos refpos
* SearchMask = (bitwise OR): * SearchMask = (bitwise OR):
* LIBITEM * COMPONENT_T
* WIREITEM * WIRE_T
* BUSITEM * BUS_T
* RACCORDITEM * BUS_ENTRY_T
* JUNCTIONITEM * JUNCTION_T
* DRAWITEM * DRAW_ITEM_T
* TEXTITEM * TEXT_T
* LABELITEM * LABEL_T
* SHEETITEM * SHEETITEM
* MARKERITEM * MARKER_T
* NOCONNECTITEM * NO_CONNECT_T
* SEARCH_PINITEM * SEARCH_PINITEM
* SHEETLABELITEM * SHEETLABEL_T
* FIELDCMPITEM * FIELDCMPITEM
* *
* if EXCLUDE_WIRE_BUS_ENDPOINTS is set, in wire or bus search and locate, * if EXCLUDE_ENDPOINTS_T is set, in wire or bus search and locate,
* start and end points are not included in search * start and end points are not included in search
* if WIRE_BUS_ENDPOINTS_ONLY is set, in wire or bus search and locate, * if ENDPOINTS_ONLY_T is set, in wire or bus search and locate,
* only start and end points are included in search * only start and end points are included in search
* *
* *
...@@ -137,7 +137,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList ) ...@@ -137,7 +137,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList )
case SCH_POLYLINE_T: case SCH_POLYLINE_T:
#undef STRUCT #undef STRUCT
#define STRUCT ( (SCH_POLYLINE*) DrawList ) #define STRUCT ( (SCH_POLYLINE*) DrawList )
if( !( SearchMask & (DRAWITEM | WIREITEM | BUSITEM) ) ) if( !( SearchMask & (DRAW_ITEM_T | WIRE_T | BUS_T) ) )
break; break;
for( unsigned i = 0; i < STRUCT->GetCornerCount() - 1; i++ ) for( unsigned i = 0; i < STRUCT->GetCornerCount() - 1; i++ )
...@@ -155,19 +155,19 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList ) ...@@ -155,19 +155,19 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList )
case SCH_LINE_T: case SCH_LINE_T:
#undef STRUCT #undef STRUCT
#define STRUCT ( (SCH_LINE*) DrawList ) #define STRUCT ( (SCH_LINE*) DrawList )
if( !( SearchMask & (DRAWITEM | WIREITEM | BUSITEM) ) ) if( !( SearchMask & (DRAW_ITEM_T | WIRE_T | BUS_T) ) )
break; break;
if( TestSegmentHit( aPosRef, STRUCT->m_Start, STRUCT->m_End, 0 ) ) if( TestSegmentHit( aPosRef, STRUCT->m_Start, STRUCT->m_End, 0 ) )
{ {
if( ( ( SearchMask & DRAWITEM ) && ( STRUCT->GetLayer() == LAYER_NOTES ) ) if( ( ( SearchMask & DRAW_ITEM_T ) && ( STRUCT->GetLayer() == LAYER_NOTES ) )
|| ( ( SearchMask & WIREITEM ) && ( STRUCT->GetLayer() == LAYER_WIRE ) ) || ( ( SearchMask & WIRE_T ) && ( STRUCT->GetLayer() == LAYER_WIRE ) )
|| ( ( SearchMask & BUSITEM ) && ( STRUCT->GetLayer() == LAYER_BUS ) ) ) || ( ( SearchMask & BUS_T ) && ( STRUCT->GetLayer() == LAYER_BUS ) ) )
{ {
if( SearchMask & EXCLUDE_WIRE_BUS_ENDPOINTS && STRUCT->IsEndPoint( aPosRef ) ) if( SearchMask & EXCLUDE_ENDPOINTS_T && STRUCT->IsEndPoint( aPosRef ) )
break; break;
if( SearchMask & WIRE_BUS_ENDPOINTS_ONLY && !STRUCT->IsEndPoint( aPosRef ) ) if( SearchMask & ENDPOINTS_ONLY_T && !STRUCT->IsEndPoint( aPosRef ) )
break; break;
LastSnappedStruct = DrawList; LastSnappedStruct = DrawList;
...@@ -180,7 +180,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList ) ...@@ -180,7 +180,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList )
case SCH_BUS_ENTRY_T: case SCH_BUS_ENTRY_T:
#undef STRUCT #undef STRUCT
#define STRUCT ( (SCH_BUS_ENTRY*) DrawList ) #define STRUCT ( (SCH_BUS_ENTRY*) DrawList )
if( !( SearchMask & (RACCORDITEM) ) ) if( !( SearchMask & (BUS_ENTRY_T) ) )
break; break;
if( TestSegmentHit( aPosRef, STRUCT->m_Pos, STRUCT->m_End(), hitminDist ) ) if( TestSegmentHit( aPosRef, STRUCT->m_Pos, STRUCT->m_End(), hitminDist ) )
...@@ -193,7 +193,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList ) ...@@ -193,7 +193,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList )
case SCH_JUNCTION_T: case SCH_JUNCTION_T:
#undef STRUCT #undef STRUCT
#define STRUCT ( (SCH_JUNCTION*) DrawList ) #define STRUCT ( (SCH_JUNCTION*) DrawList )
if( !(SearchMask & JUNCTIONITEM) ) if( !(SearchMask & JUNCTION_T) )
break; break;
if( STRUCT->HitTest( aPosRef ) ) if( STRUCT->HitTest( aPosRef ) )
{ {
...@@ -205,7 +205,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList ) ...@@ -205,7 +205,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList )
case SCH_NO_CONNECT_T: case SCH_NO_CONNECT_T:
#undef STRUCT #undef STRUCT
#define STRUCT ( (SCH_NO_CONNECT*) DrawList ) #define STRUCT ( (SCH_NO_CONNECT*) DrawList )
if( !(SearchMask & NOCONNECTITEM) ) if( !(SearchMask & NO_CONNECT_T) )
break; break;
if( STRUCT->HitTest( aPosRef ) ) if( STRUCT->HitTest( aPosRef ) )
{ {
...@@ -218,7 +218,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList ) ...@@ -218,7 +218,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList )
{ {
#undef STRUCT #undef STRUCT
#define STRUCT ( (SCH_MARKER*) DrawList ) #define STRUCT ( (SCH_MARKER*) DrawList )
if( !(SearchMask & MARKERITEM) ) if( !(SearchMask & MARKER_T) )
break; break;
if( STRUCT->HitTest( aPosRef ) ) if( STRUCT->HitTest( aPosRef ) )
{ {
...@@ -231,7 +231,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList ) ...@@ -231,7 +231,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList )
case SCH_TEXT_T: case SCH_TEXT_T:
#undef STRUCT #undef STRUCT
#define STRUCT ( (SCH_TEXT*) DrawList ) #define STRUCT ( (SCH_TEXT*) DrawList )
if( !( SearchMask & TEXTITEM) ) if( !( SearchMask & TEXT_T) )
break; break;
if( STRUCT->HitTest( aPosRef ) ) if( STRUCT->HitTest( aPosRef ) )
{ {
...@@ -247,7 +247,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList ) ...@@ -247,7 +247,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList )
#undef STRUCT #undef STRUCT
#define STRUCT ( (SCH_TEXT*) DrawList ) // SCH_TEXT is the base #define STRUCT ( (SCH_TEXT*) DrawList ) // SCH_TEXT is the base
// class of these labels // class of these labels
if( !(SearchMask & LABELITEM) ) if( !(SearchMask & LABEL_T) )
break; break;
if( STRUCT->HitTest( aPosRef ) ) if( STRUCT->HitTest( aPosRef ) )
{ {
...@@ -257,10 +257,10 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList ) ...@@ -257,10 +257,10 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList )
break; break;
case SCH_COMPONENT_T: case SCH_COMPONENT_T:
if( !( SearchMask & (LIBITEM | FIELDCMPITEM) ) ) if( !( SearchMask & (COMPONENT_T | FIELD_T) ) )
break; break;
if( SearchMask & FIELDCMPITEM ) if( SearchMask & FIELD_T )
{ {
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) DrawList; SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) DrawList;
for( int i = REFERENCE; i < DrawLibItem->GetFieldCount(); i++ ) for( int i = REFERENCE; i < DrawLibItem->GetFieldCount(); i++ )
...@@ -299,7 +299,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList ) ...@@ -299,7 +299,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList )
case SCH_SHEET_T: case SCH_SHEET_T:
#undef STRUCT #undef STRUCT
#define STRUCT ( (SCH_SHEET*) DrawList ) #define STRUCT ( (SCH_SHEET*) DrawList )
if( !(SearchMask & SHEETITEM) ) if( !(SearchMask & SHEET_T) )
break; break;
if( STRUCT->HitTest( aPosRef ) ) if( STRUCT->HitTest( aPosRef ) )
{ {
......
...@@ -498,14 +498,14 @@ void AddMenusForJunction( wxMenu* PopMenu, SCH_JUNCTION* Junction, SCH_EDIT_FRAM ...@@ -498,14 +498,14 @@ void AddMenusForJunction( wxMenu* PopMenu, SCH_JUNCTION* Junction, SCH_EDIT_FRAM
if( !is_new ) if( !is_new )
{ {
if( PickStruct( frame->GetScreen()->m_Curseur, frame->GetScreen(), if( PickStruct( frame->GetScreen()->m_Curseur, frame->GetScreen(),
WIREITEM | BUSITEM | EXCLUDE_WIRE_BUS_ENDPOINTS ) ) WIRE_T | BUS_T | EXCLUDE_ENDPOINTS_T ) )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Wire" ), break_line_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Wire" ), break_line_xpm );
} }
msg = AddHotkeyName( _( "Delete Junction" ), s_Schematic_Hokeys_Descr, HK_DELETE ); msg = AddHotkeyName( _( "Delete Junction" ), s_Schematic_Hokeys_Descr, HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, msg, delete_xpm );
if( PickStruct( frame->GetScreen()->m_Curseur, frame->GetScreen(), WIREITEM | BUSITEM ) ) if( PickStruct( frame->GetScreen()->m_Curseur, frame->GetScreen(), WIRE_T | BUS_T ) )
{ {
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete Node" ), delete_node_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete Node" ), delete_node_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_CONNECTION, _( "Delete Connection" ), ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE_CONNECTION, _( "Delete Connection" ),
...@@ -536,7 +536,7 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame ) ...@@ -536,7 +536,7 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame )
delete_connection_xpm ); delete_connection_xpm );
if( PickStruct( frame->GetScreen()->m_Curseur, frame->GetScreen(), if( PickStruct( frame->GetScreen()->m_Curseur, frame->GetScreen(),
WIREITEM | BUSITEM | EXCLUDE_WIRE_BUS_ENDPOINTS ) ) WIRE_T | BUS_T | EXCLUDE_ENDPOINTS_T ) )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Wire" ), break_line_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Wire" ), break_line_xpm );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
......
...@@ -423,10 +423,10 @@ bool SCH_LINE::doHitTest( const wxPoint& aPoint, int aAccuracy, SCH_FILTER_T aFi ...@@ -423,10 +423,10 @@ bool SCH_LINE::doHitTest( const wxPoint& aPoint, int aAccuracy, SCH_FILTER_T aFi
if( !TestSegmentHit( aPoint, m_Start, m_End, aAccuracy ) ) if( !TestSegmentHit( aPoint, m_Start, m_End, aAccuracy ) )
return false; return false;
if( ( aFilter & EXCLUDE_WIRE_BUS_ENDPOINTS ) && IsEndPoint( aPoint ) ) if( ( aFilter & EXCLUDE_ENDPOINTS_T ) && IsEndPoint( aPoint ) )
return false; return false;
if( ( aFilter & WIRE_BUS_ENDPOINTS_ONLY ) && !IsEndPoint( aPoint ) ) if( ( aFilter & ENDPOINTS_ONLY_T ) && !IsEndPoint( aPoint ) )
return false; return false;
return true; return true;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
; General Product Description Definitions ; General Product Description Definitions
!define PRODUCT_NAME "KiCad" !define PRODUCT_NAME "KiCad"
!define PRODUCT_VERSION "2011.01.22" !define PRODUCT_VERSION "2011.01.25"
!define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/" !define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/"
!define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/" !define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/"
!define COMPANY_NAME "" !define COMPANY_NAME ""
......
...@@ -1133,10 +1133,10 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() ...@@ -1133,10 +1133,10 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
m_MessagesList->AppendToPage( msg ); m_MessagesList->AppendToPage( msg );
} }
if( viadia < viadrill ) if( viadia <= viadrill )
{ {
result = false; result = false;
msg.Printf( _( "<b>Extra Via %d Size</b> %s &lt; <b> Drill Size</b> %s<br>" ), msg.Printf( _( "<b>Extra Via %d Size</b> %s &le; <b> Drill Size</b> %s<br>" ),
row + 1, GetChars( tvalue ), GetChars( drlvalue ) ); row + 1, GetChars( tvalue ), GetChars( drlvalue ) );
m_MessagesList->AppendToPage( msg ); m_MessagesList->AppendToPage( msg );
......
release version: release version:
2011 jan 22 (BZR 2754) 2011 jan 25
files (.zip,.tgz): files (.zip,.tgz):
kicad-2011-01-22 kicad-2011-01-25
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