Commit fe504483 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: remove duplicate definitions of some flags (like EDIT and IN_EDIT)...

Pcbnew: remove duplicate definitions of some flags (like EDIT and IN_EDIT) that have exactly the same meaning, but different values... (very dangerous)
Remove obsolete code.
parent 2ce4f404
...@@ -292,13 +292,13 @@ class DHEAD; ...@@ -292,13 +292,13 @@ class DHEAD;
// These define are used for the .m_Flags and .m_UndoRedoStatus member of the // These define are used for the .m_Flags and .m_UndoRedoStatus member of the
// class EDA_ITEM // class EDA_ITEM
#define IS_CHANGED (1 << 0) #define IS_CHANGED (1 << 0) ///< Item was edited, and modified
#define IS_LINKED (1 << 1) #define IS_LINKED (1 << 1) ///< Used in calculation to mark linked items (temporary use)
#define IN_EDIT (1 << 2) #define IN_EDIT (1 << 2) ///< Item currently edited
#define IS_MOVED (1 << 3) #define IS_MOVED (1 << 3) ///< Item being moved
#define IS_NEW (1 << 4) #define IS_NEW (1 << 4) ///< New item, just created
#define IS_RESIZED (1 << 5) #define IS_RESIZED (1 << 5) ///< Item being resized
#define IS_DRAGGED (1 << 6) #define IS_DRAGGED (1 << 6) ///< Item being dragged
#define IS_DELETED (1 << 7) #define IS_DELETED (1 << 7)
#define IS_WIRE_IMAGE (1 << 8) #define IS_WIRE_IMAGE (1 << 8)
#define STARTPOINT (1 << 9) #define STARTPOINT (1 << 9)
...@@ -311,6 +311,14 @@ class DHEAD; ...@@ -311,6 +311,14 @@ class DHEAD;
#define DO_NOT_DRAW (1 << 16) ///< Used to disable draw function #define DO_NOT_DRAW (1 << 16) ///< Used to disable draw function
#define IS_CANCELLED (1 << 17) ///< flag set when edit dialogs are canceled when editing a #define IS_CANCELLED (1 << 17) ///< flag set when edit dialogs are canceled when editing a
///< new object ///< new object
#define TRACK_LOCKED (1 << 18) ///< Pcbnew: track locked: protected from global deletion
#define TRACK_AR (1 << 19) ///< Pcbnew: autorouted track
#define FLAG1 (1 << 20) ///< Pcbnew: flag used in local computations
#define FLAG0 (1 << 21) ///< Pcbnew: flag used in local computations
#define BEGIN_ONPAD (1 << 22) ///< Pcbnew: flag set for track segment starting on a pad
#define END_ONPAD (1 << 23) ///< Pcbnew: flag set for track segment ending on a pad
#define BUSY (1 << 24) ///< Pcbnew: flag indicating that the structure has
// already been edited, in some functions
class EDA_ITEM class EDA_ITEM
{ {
......
...@@ -16,24 +16,6 @@ ...@@ -16,24 +16,6 @@
#define L_ENTETE_LIB 18 #define L_ENTETE_LIB 18
#define EXT_DOC wxT( "mdc" ) #define EXT_DOC wxT( "mdc" )
#define FLAG1 (1 << 13) // flag for free local computations
#define FLAG0 (1 << 12) // flag for free local computations
#define BEGIN_ONPAD (1 << 11) // flag indicating a start of segment pad
#define END_ONPAD (1 << 10) // flag indicating an end of segment pad
#define BUSY (1 << 9) // flag indicating that the structure has
// already been edited, in some routines
#define DELETED (1 << 8) // structures erased and set string "DELETED"
#define NO_TRACE (1 << 7) // The element must not be displayed
#define SURBRILL (1 << 5) // element highlighted
#define DRAG (1 << 4) // segment in drag mode
#define EDIT (1 << 3) // element being edited
#define SEGM_FIXE (1 << 2) // segment fixed (not erase global)
#define SEGM_AR (1 << 1) // segment marked for auto routing
#define CHAIN (1 << 0) // mark segment
class NETINFO_ITEM; class NETINFO_ITEM;
class MARKER_PCB; class MARKER_PCB;
class RATSNEST_ITEM; class RATSNEST_ITEM;
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
/* Attribute change for 1 track segment. /* Attribute change for 1 track segment.
* Attributes are * Attributes are
* SEGM_FIXE protection against global delete * TRACK_LOCKED protection against global delete
* SEGM_AR AutoRouted segment * TRACK_AR AutoRouted segment
*/ */
void WinEDA_PcbFrame::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On ) void WinEDA_PcbFrame::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On )
{ {
...@@ -23,7 +23,7 @@ void WinEDA_PcbFrame::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On ) ...@@ -23,7 +23,7 @@ void WinEDA_PcbFrame::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On )
OnModify(); OnModify();
DrawPanel->CrossHairOff( DC ); // Erase cursor shape DrawPanel->CrossHairOff( DC ); // Erase cursor shape
track->SetState( SEGM_FIXE, Flag_On ); track->SetState( TRACK_LOCKED, Flag_On );
track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL ); track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
DrawPanel->CrossHairOn( DC ); // Display cursor shape DrawPanel->CrossHairOn( DC ); // Display cursor shape
track->DisplayInfo( this ); track->DisplayInfo( this );
...@@ -45,7 +45,7 @@ void WinEDA_PcbFrame::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On ) ...@@ -45,7 +45,7 @@ void WinEDA_PcbFrame::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On )
for( ; (Track != NULL) && (nb_segm > 0); nb_segm-- ) for( ; (Track != NULL) && (nb_segm > 0); nb_segm-- )
{ {
Track->SetState( SEGM_FIXE, Flag_On ); Track->SetState( TRACK_LOCKED, Flag_On );
Track->SetState( BUSY, OFF ); Track->SetState( BUSY, OFF );
Track = Track->Next(); Track = Track->Next();
} }
...@@ -56,7 +56,7 @@ void WinEDA_PcbFrame::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On ) ...@@ -56,7 +56,7 @@ void WinEDA_PcbFrame::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On )
} }
/* Modify the flag SEGM_FIXE according to Flag_On value, /* Modify the flag TRACK_LOCKED according to Flag_On value,
* for all the segments related to net_code. * for all the segments related to net_code.
* if net_code < 0 all the segments are modified. * if net_code < 0 all the segments are modified.
*/ */
...@@ -81,7 +81,7 @@ void WinEDA_PcbFrame::Attribut_net( wxDC* DC, int net_code, bool Flag_On ) ...@@ -81,7 +81,7 @@ void WinEDA_PcbFrame::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
break; break;
OnModify(); OnModify();
Track->SetState( SEGM_FIXE, Flag_On ); Track->SetState( TRACK_LOCKED, Flag_On );
Track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL ); Track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
Track = Track->Next(); Track = Track->Next();
} }
......
...@@ -348,9 +348,6 @@ void DIMENSION::Mirror(const wxPoint& axis_pos) ...@@ -348,9 +348,6 @@ void DIMENSION::Mirror(const wxPoint& axis_pos)
bool DIMENSION::Save( FILE* aFile ) const bool DIMENSION::Save( FILE* aFile ) const
{ {
if( GetState( DELETED ) )
return true;
bool rc = false; bool rc = false;
// note: COTATION was the previous name of DIMENSION // note: COTATION was the previous name of DIMENSION
// this old keyword is used here for compatibility // this old keyword is used here for compatibility
......
...@@ -79,9 +79,6 @@ void DRAWSEGMENT::Flip(const wxPoint& aCentre ) ...@@ -79,9 +79,6 @@ void DRAWSEGMENT::Flip(const wxPoint& aCentre )
bool DRAWSEGMENT::Save( FILE* aFile ) const bool DRAWSEGMENT::Save( FILE* aFile ) const
{ {
if( GetState( DELETED ) )
return true;
bool rc = false; bool rc = false;
if( fprintf( aFile, "$DRAWSEGMENT\n" ) != sizeof("$DRAWSEGMENT\n") - 1 ) if( fprintf( aFile, "$DRAWSEGMENT\n" ) != sizeof("$DRAWSEGMENT\n") - 1 )
......
...@@ -70,9 +70,6 @@ bool MIREPCB::ReadMirePcbDescr( LINE_READER* aReader ) ...@@ -70,9 +70,6 @@ bool MIREPCB::ReadMirePcbDescr( LINE_READER* aReader )
bool MIREPCB::Save( FILE* aFile ) const bool MIREPCB::Save( FILE* aFile ) const
{ {
if( GetState( DELETED ) )
return true;
bool rc = false; bool rc = false;
if( fprintf( aFile, "$MIREPCB\n" ) != sizeof("$MIREPCB\n")-1 ) if( fprintf( aFile, "$MIREPCB\n" ) != sizeof("$MIREPCB\n")-1 )
......
...@@ -261,9 +261,6 @@ bool MODULE::Save( FILE* aFile ) const ...@@ -261,9 +261,6 @@ bool MODULE::Save( FILE* aFile ) const
char statusTxt[8]; char statusTxt[8];
BOARD_ITEM* item; BOARD_ITEM* item;
if( GetState( DELETED ) )
return true;
bool rc = false; bool rc = false;
fprintf( aFile, "$MODULE %s\n", CONV_TO_UTF8( m_LibRef ) ); fprintf( aFile, "$MODULE %s\n", CONV_TO_UTF8( m_LibRef ) );
......
...@@ -148,9 +148,6 @@ int TEXTE_PCB::ReadTextePcbDescr( LINE_READER* aReader ) ...@@ -148,9 +148,6 @@ int TEXTE_PCB::ReadTextePcbDescr( LINE_READER* aReader )
bool TEXTE_PCB::Save( FILE* aFile ) const bool TEXTE_PCB::Save( FILE* aFile ) const
{ {
if( GetState( DELETED ) )
return true;
if( m_Text.IsEmpty() ) if( m_Text.IsEmpty() )
return true; return true;
......
...@@ -532,9 +532,6 @@ bool TRACK::Save( FILE* aFile ) const ...@@ -532,9 +532,6 @@ bool TRACK::Save( FILE* aFile ) const
if( Type() == TYPE_VIA ) if( Type() == TYPE_VIA )
type = 1; type = 1;
if( GetState( DELETED ) )
return true;
fprintf( aFile, "Po %d %d %d %d %d %d %d\n", m_Shape, fprintf( aFile, "Po %d %d %d %d %d %d %d\n", m_Shape,
m_Start.x, m_Start.y, m_End.x, m_End.y, m_Width, m_Drill ); m_Start.x, m_Start.y, m_End.x, m_End.y, m_Width, m_Drill );
...@@ -1020,10 +1017,10 @@ void TRACK::DisplayInfoBase( EDA_DRAW_FRAME* frame ) ...@@ -1020,10 +1017,10 @@ void TRACK::DisplayInfoBase( EDA_DRAW_FRAME* frame )
/* Display the State member */ /* Display the State member */
msg = wxT( ". . " ); msg = wxT( ". . " );
if( GetState( SEGM_FIXE ) ) if( GetState( TRACK_LOCKED ) )
msg[0] = 'F'; msg[0] = 'F';
if( GetState( SEGM_AR ) ) if( GetState( TRACK_AR ) )
msg[2] = 'A'; msg[2] = 'A';
frame->AppendMsgPanel( _( "Status" ), msg, MAGENTA ); frame->AppendMsgPanel( _( "Status" ), msg, MAGENTA );
...@@ -1224,22 +1221,20 @@ wxString TRACK::ShowState( int stateBits ) ...@@ -1224,22 +1221,20 @@ wxString TRACK::ShowState( int stateBits )
{ {
wxString ret; wxString ret;
if( stateBits & CHAIN ) if( stateBits & IS_LINKED )
ret << wxT( " | CHAIN" ); ret << wxT( " | IS_LINKED" );
if( stateBits & SEGM_AR ) if( stateBits & TRACK_AR )
ret << wxT( " | SEGM_AR" ); ret << wxT( " | TRACK_AR" );
if( stateBits & SEGM_FIXE ) if( stateBits & TRACK_LOCKED )
ret << wxT( " | SEGM_FIXE" ); ret << wxT( " | TRACK_LOCKED" );
if( stateBits & EDIT ) if( stateBits & IN_EDIT )
ret << wxT( " | EDIT" ); ret << wxT( " | IN_EDIT" );
if( stateBits & DRAG ) if( stateBits & IS_DRAGGED )
ret << wxT( " | DRAG" ); ret << wxT( " | IS_DRAGGED" );
if( stateBits & SURBRILL ) if( stateBits & DO_NOT_DRAW )
ret << wxT( " | SURBRILL" ); ret << wxT( " | DO_NOT_DRAW" );
if( stateBits & NO_TRACE ) if( stateBits & IS_DELETED )
ret << wxT( " | NO_TRACE" ); ret << wxT( " | IS_DELETED" );
if( stateBits & DELETED )
ret << wxT( " | DELETED" );
if( stateBits & BUSY ) if( stateBits & BUSY )
ret << wxT( " | BUSY" ); ret << wxT( " | BUSY" );
if( stateBits & END_ONPAD ) if( stateBits & END_ONPAD )
......
...@@ -94,9 +94,6 @@ void ZONE_CONTAINER::SetNet( int anet_code ) ...@@ -94,9 +94,6 @@ void ZONE_CONTAINER::SetNet( int anet_code )
bool ZONE_CONTAINER::Save( FILE* aFile ) const bool ZONE_CONTAINER::Save( FILE* aFile ) const
/********************************************/ /********************************************/
{ {
if( GetState( DELETED ) )
return true;
unsigned item_pos; unsigned item_pos;
int ret; int ret;
unsigned corners_count = m_Poly->corner.size(); unsigned corners_count = m_Poly->corner.size();
......
...@@ -610,7 +610,7 @@ void WinEDA_BasePcbFrame::RecalculateAllTracksNetcode( ) ...@@ -610,7 +610,7 @@ void WinEDA_BasePcbFrame::RecalculateAllTracksNetcode( )
pt_piste = m_Pcb->m_Track; pt_piste = m_Pcb->m_Track;
for( ; pt_piste != NULL; pt_piste = pt_piste->Next() ) for( ; pt_piste != NULL; pt_piste = pt_piste->Next() )
{ {
pt_piste->SetState( BUSY | EDIT | BEGIN_ONPAD | END_ONPAD, OFF ); pt_piste->SetState( BUSY | IN_EDIT | BEGIN_ONPAD | END_ONPAD, OFF );
pt_piste->SetZoneSubNet( 0 ); pt_piste->SetZoneSubNet( 0 );
pt_piste->SetNet( 0 ); // net code = 0 means not connected pt_piste->SetNet( 0 ); // net code = 0 means not connected
} }
......
...@@ -25,12 +25,6 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) ...@@ -25,12 +25,6 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack )
if( aTrack == NULL ) if( aTrack == NULL )
return NULL; return NULL;
if( aTrack->GetState( DELETED ) )
{
D( printf( "WinEDA_PcbFrame::Delete_Segment(): bug deleted already deleted TRACK\n" ); )
return NULL;
}
if( aTrack->m_Flags & IS_NEW ) // Trace in progress, erase the last segment if( aTrack->m_Flags & IS_NEW ) // Trace in progress, erase the last segment
{ {
if( g_CurrentTrackList.GetCount() > 0 ) if( g_CurrentTrackList.GetCount() > 0 )
......
...@@ -110,13 +110,13 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete( ) ...@@ -110,13 +110,13 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete( )
{ {
int track_mask_filter = 0; int track_mask_filter = 0;
if( !m_TrackFilterLocked->GetValue() ) if( !m_TrackFilterLocked->GetValue() )
track_mask_filter |= SEGM_FIXE; track_mask_filter |= TRACK_LOCKED;
if( !m_TrackFilterAR->GetValue() ) if( !m_TrackFilterAR->GetValue() )
track_mask_filter |= SEGM_AR; track_mask_filter |= TRACK_AR;
for( item = pcb->m_Track; item != NULL; item = nextitem ) for( item = pcb->m_Track; item != NULL; item = nextitem )
{ {
nextitem = item->Next(); nextitem = item->Next();
if( (item->GetState( SEGM_FIXE | SEGM_AR ) & track_mask_filter) != 0 ) if( (item->GetState( TRACK_LOCKED | TRACK_AR ) & track_mask_filter) != 0 )
continue; continue;
itemPicker.m_PickedItem = item; itemPicker.m_PickedItem = item;
pickersList.PushItem( itemPicker ); pickersList.PushItem( itemPicker );
......
...@@ -143,7 +143,7 @@ void AddSegmentToDragList( EDA_DRAW_PANEL* panel, wxDC* DC, int flag, TRACK* Tra ...@@ -143,7 +143,7 @@ void AddSegmentToDragList( EDA_DRAW_PANEL* panel, wxDC* DC, int flag, TRACK* Tra
wrapper.m_Flag |= 2; wrapper.m_Flag |= 2;
Track->Draw( panel, DC, GR_XOR ); Track->Draw( panel, DC, GR_XOR );
Track->SetState( EDIT, ON ); Track->SetState( IN_EDIT, ON );
if( (flag & STARTPOINT) ) if( (flag & STARTPOINT) )
Track->m_Flags |= STARTPOINT; Track->m_Flags |= STARTPOINT;
......
/****************************/ /*******************************/
/* Footprint edges editing. */ /* Footprint outlines editing. */
/****************************/ /*******************************/
/** /**
* Functions to edit graphic items used to draw footprint edges. * Functions to edit graphic items used to draw footprint edges.
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
#include "module_editor_frame.h" #include "module_editor_frame.h"
static void ShowEdgeModule( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition, static void ShowNewEdgeModule( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
bool erase ); bool erase );
static void Exit_EditEdge_Module( EDA_DRAW_PANEL* Panel, wxDC* DC ); static void Abort_Move_ModuleOutline( EDA_DRAW_PANEL* Panel, wxDC* DC );
static void Move_Segment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition, static void ShowCurrentOutlineWhileMoving( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
bool aErase ); bool aErase );
int ArcValue = 900; int ArcValue = 900;
...@@ -43,7 +43,7 @@ void WinEDA_ModuleEditFrame::Start_Move_EdgeMod( EDGE_MODULE* Edge, wxDC* DC ) ...@@ -43,7 +43,7 @@ void WinEDA_ModuleEditFrame::Start_Move_EdgeMod( EDGE_MODULE* Edge, wxDC* DC )
Edge->m_Flags |= IS_MOVED; Edge->m_Flags |= IS_MOVED;
MoveVector.x = MoveVector.y = 0; MoveVector.x = MoveVector.y = 0;
CursorInitialPosition = GetScreen()->GetCrossHairPosition(); CursorInitialPosition = GetScreen()->GetCrossHairPosition();
DrawPanel->SetMouseCapture( Move_Segment, Exit_EditEdge_Module ); DrawPanel->SetMouseCapture( ShowCurrentOutlineWhileMoving, Abort_Move_ModuleOutline );
SetCurItem( Edge ); SetCurItem( Edge );
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, FALSE ); DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, FALSE );
} }
...@@ -72,8 +72,10 @@ void WinEDA_ModuleEditFrame::Place_EdgeMod( EDGE_MODULE* Edge ) ...@@ -72,8 +72,10 @@ void WinEDA_ModuleEditFrame::Place_EdgeMod( EDGE_MODULE* Edge )
} }
/* Move and redraw the current edited graphic item when mouse is moving */ /* Redraw the current moved graphic item when mouse is moving
static void Move_Segment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition, bool aErase ) * Use this function to show an existing outline, in move command
*/
static void ShowCurrentOutlineWhileMoving( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition, bool aErase )
{ {
BASE_SCREEN* screen = aPanel->GetScreen(); BASE_SCREEN* screen = aPanel->GetScreen();
EDGE_MODULE* Edge = (EDGE_MODULE*) screen->GetCurItem(); EDGE_MODULE* Edge = (EDGE_MODULE*) screen->GetCurItem();
...@@ -96,9 +98,10 @@ static void Move_Segment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPos ...@@ -96,9 +98,10 @@ static void Move_Segment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPos
} }
/* Redraw the current edited (moved) graphic item /* Redraw the current graphic item during its creation
* Use this function to show a new outline, in begin command
*/ */
static void ShowEdgeModule( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition, static void ShowNewEdgeModule( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
bool aErase ) bool aErase )
{ {
BASE_SCREEN* screen = aPanel->GetScreen(); BASE_SCREEN* screen = aPanel->GetScreen();
...@@ -267,22 +270,24 @@ void WinEDA_ModuleEditFrame::Delete_Edge_Module( EDGE_MODULE* Edge ) ...@@ -267,22 +270,24 @@ void WinEDA_ModuleEditFrame::Delete_Edge_Module( EDGE_MODULE* Edge )
} }
/* abort function in moving edge. /* abort function in moving outline.
*/ */
static void Exit_EditEdge_Module( EDA_DRAW_PANEL* Panel, wxDC* DC ) static void Abort_Move_ModuleOutline( EDA_DRAW_PANEL* Panel, wxDC* DC )
{ {
EDGE_MODULE* Edge = (EDGE_MODULE*) Panel->GetScreen()->GetCurItem(); EDGE_MODULE* Edge = (EDGE_MODULE*) Panel->GetScreen()->GetCurItem();
Panel->SetMouseCapture( NULL, NULL );
if( Edge && ( Edge->Type() == TYPE_EDGE_MODULE ) ) if( Edge && ( Edge->Type() == TYPE_EDGE_MODULE ) )
{ {
if( Edge->m_Flags & IS_NEW ) /* Delete if new module. */ if( Edge->m_Flags & IS_NEW ) // On aborting, delete new outline.
{ {
MODULE* Module = (MODULE*) Edge->GetParent(); MODULE* Module = (MODULE*) Edge->GetParent();
Edge->Draw( Panel, DC, GR_XOR, MoveVector ); Edge->Draw( Panel, DC, GR_XOR, MoveVector );
Edge->DeleteStructure(); Edge->DeleteStructure();
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
} }
else else // On aborting, move existing outline to its initial position.
{ {
Edge->Draw( Panel, DC, GR_XOR, MoveVector ); Edge->Draw( Panel, DC, GR_XOR, MoveVector );
Edge->m_Flags = 0; Edge->m_Flags = 0;
...@@ -350,11 +355,11 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge, ...@@ -350,11 +355,11 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge,
Edge->m_End0 = Edge->m_Start0; Edge->m_End0 = Edge->m_Start0;
module->Set_Rectangle_Encadrement(); module->Set_Rectangle_Encadrement();
DrawPanel->SetMouseCapture( ShowEdgeModule, Exit_EditEdge_Module ); DrawPanel->SetMouseCapture( ShowNewEdgeModule, Abort_Move_ModuleOutline );
} }
/* Segment creation in progress. /* Segment creation in progress.
* The ending coordinate are updated by the function * The ending coordinate is updated by the function
* Montre_Position_New_Edge_Module() called on move mouse event * ShowNewEdgeModule() called on move mouse event
* during the segment craetion * during the segment craetion
*/ */
else else
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "protos.h" #include "protos.h"
static void Exit_EditEdge( EDA_DRAW_PANEL* Panel, wxDC* DC ); static void Abort_EditEdge( EDA_DRAW_PANEL* Panel, wxDC* DC );
static void Montre_Position_NewSegment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, static void Montre_Position_NewSegment( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aPosition, bool aErase ); const wxPoint& aPosition, bool aErase );
static void Move_Segment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition, static void Move_Segment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
...@@ -34,7 +34,7 @@ void WinEDA_PcbFrame::Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ) ...@@ -34,7 +34,7 @@ void WinEDA_PcbFrame::Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC )
drawitem->m_Flags |= IS_MOVED; drawitem->m_Flags |= IS_MOVED;
s_InitialPosition = s_LastPosition = GetScreen()->GetCrossHairPosition(); s_InitialPosition = s_LastPosition = GetScreen()->GetCrossHairPosition();
drawitem->DisplayInfo( this ); drawitem->DisplayInfo( this );
DrawPanel->SetMouseCapture( Move_Segment, Exit_EditEdge ); DrawPanel->SetMouseCapture( Move_Segment, Abort_EditEdge );
SetCurItem( drawitem ); SetCurItem( drawitem );
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
} }
...@@ -48,12 +48,12 @@ void WinEDA_PcbFrame::Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ) ...@@ -48,12 +48,12 @@ void WinEDA_PcbFrame::Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC )
if( drawitem == NULL ) if( drawitem == NULL )
return; return;
drawitem->m_Flags = 0;
SaveCopyInUndoList(drawitem, UR_MOVED, s_LastPosition - s_InitialPosition); SaveCopyInUndoList(drawitem, UR_MOVED, s_LastPosition - s_InitialPosition);
drawitem->Draw( DrawPanel, DC, GR_OR ); drawitem->Draw( DrawPanel, DC, GR_OR );
DrawPanel->SetMouseCapture( NULL, NULL ); DrawPanel->SetMouseCapture( NULL, NULL );
SetCurItem( NULL ); SetCurItem( NULL );
OnModify(); OnModify();
drawitem->m_Flags = 0;
} }
/* /*
...@@ -63,13 +63,10 @@ static void Move_Segment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPos ...@@ -63,13 +63,10 @@ static void Move_Segment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPos
bool aErase ) bool aErase )
{ {
DRAWSEGMENT* Segment = (DRAWSEGMENT*) aPanel->GetScreen()->GetCurItem(); DRAWSEGMENT* Segment = (DRAWSEGMENT*) aPanel->GetScreen()->GetCurItem();
int t_fill = DisplayOpt.DisplayDrawItems;
if( Segment == NULL ) if( Segment == NULL )
return; return;
DisplayOpt.DisplayDrawItems = SKETCH;
if( aErase ) if( aErase )
Segment->Draw( aPanel, aDC, GR_XOR ); Segment->Draw( aPanel, aDC, GR_XOR );
...@@ -80,7 +77,6 @@ static void Move_Segment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPos ...@@ -80,7 +77,6 @@ static void Move_Segment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPos
s_LastPosition = aPanel->GetScreen()->GetCrossHairPosition(); s_LastPosition = aPanel->GetScreen()->GetCrossHairPosition();
Segment->Draw( aPanel, aDC, GR_XOR ); Segment->Draw( aPanel, aDC, GR_XOR );
DisplayOpt.DisplayDrawItems = t_fill;
} }
...@@ -169,12 +165,15 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( int aLayer ) ...@@ -169,12 +165,15 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( int aLayer )
} }
static void Exit_EditEdge( EDA_DRAW_PANEL* Panel, wxDC* DC ) static void Abort_EditEdge( EDA_DRAW_PANEL* Panel, wxDC* DC )
{ {
DRAWSEGMENT* Segment = (DRAWSEGMENT*) Panel->GetScreen()->GetCurItem(); DRAWSEGMENT* Segment = (DRAWSEGMENT*) Panel->GetScreen()->GetCurItem();
if( Segment == NULL ) if( Segment == NULL )
{
Panel->SetMouseCapture( NULL, NULL );
return; return;
}
if( Segment->m_Flags & IS_NEW ) if( Segment->m_Flags & IS_NEW )
{ {
...@@ -192,6 +191,7 @@ static void Exit_EditEdge( EDA_DRAW_PANEL* Panel, wxDC* DC ) ...@@ -192,6 +191,7 @@ static void Exit_EditEdge( EDA_DRAW_PANEL* Panel, wxDC* DC )
Segment->Draw( Panel, DC, GR_OR ); Segment->Draw( Panel, DC, GR_OR );
} }
Panel->SetMouseCapture( NULL, NULL );
( (WinEDA_PcbFrame*) Panel->GetParent() )->SetCurItem( NULL ); ( (WinEDA_PcbFrame*) Panel->GetParent() )->SetCurItem( NULL );
} }
...@@ -223,7 +223,7 @@ DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment, ...@@ -223,7 +223,7 @@ DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment,
Segment->m_Shape = shape; Segment->m_Shape = shape;
Segment->m_Angle = 900; Segment->m_Angle = 900;
Segment->m_Start = Segment->m_End = GetScreen()->GetCrossHairPosition(); Segment->m_Start = Segment->m_End = GetScreen()->GetCrossHairPosition();
DrawPanel->SetMouseCapture( Montre_Position_NewSegment, Exit_EditEdge ); DrawPanel->SetMouseCapture( Montre_Position_NewSegment, Abort_EditEdge );
} }
else /* The ending point ccordinate Segment->m_End was updated by he function else /* The ending point ccordinate Segment->m_End was updated by he function
* Montre_Position_NewSegment() called on a move mouse event * Montre_Position_NewSegment() called on a move mouse event
......
...@@ -473,7 +473,7 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC ) ...@@ -473,7 +473,7 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC )
g_HighLight_NetCode = adr_buf->GetNet(); g_HighLight_NetCode = adr_buf->GetNet();
/* Possible establishment of a hanging point. */ /* Possible establishment of a hanging point. */
LockPoint = CreateLockPoint( GetBoard(), LockPoint = CreateLockPoint( GetBoard(),
g_CurrentTrackSegment->m_End, g_CurrentTrackSegment->m_End,
adr_buf, adr_buf,
&s_ItemsListPicker ); &s_ItemsListPicker );
...@@ -556,7 +556,7 @@ TRACK* LocateIntrusion( TRACK* listStart, TRACK* aTrack, int aLayer, const wxPoi ...@@ -556,7 +556,7 @@ TRACK* LocateIntrusion( TRACK* listStart, TRACK* aTrack, int aLayer, const wxPoi
{ {
if( track->Type() == TYPE_TRACK ) // skip vias if( track->Type() == TYPE_TRACK ) // skip vias
{ {
if( track->GetState( BUSY | DELETED ) ) if( track->GetState( BUSY | IS_DELETED ) )
continue; continue;
if( aLayer != track->GetLayer() ) if( aLayer != track->GetLayer() )
......
...@@ -35,7 +35,7 @@ TRACK* Locate_Via( BOARD* Pcb, const wxPoint& pos, int layer ) ...@@ -35,7 +35,7 @@ TRACK* Locate_Via( BOARD* Pcb, const wxPoint& pos, int layer )
if( track->m_Start != pos ) if( track->m_Start != pos )
continue; continue;
if( track->GetState( BUSY | DELETED ) ) if( track->GetState( BUSY | IS_DELETED ) )
continue; continue;
if( layer < 0 ) if( layer < 0 )
...@@ -61,7 +61,7 @@ TRACK* Locate_Via_Area( TRACK* aStart, const wxPoint& pos, int layer ) ...@@ -61,7 +61,7 @@ TRACK* Locate_Via_Area( TRACK* aStart, const wxPoint& pos, int layer )
if( !track->HitTest(pos) ) if( !track->HitTest(pos) )
continue; continue;
if( track->GetState( BUSY | DELETED ) ) if( track->GetState( BUSY | IS_DELETED ) )
continue; continue;
if( layer < 0 ) if( layer < 0 )
...@@ -327,7 +327,7 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base, TRACK* pt_lim, ...@@ -327,7 +327,7 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base, TRACK* pt_lim,
if( PtSegmN ) if( PtSegmN )
{ {
if( PtSegmN->GetState( BUSY | DELETED ) ) if( PtSegmN->GetState( BUSY | IS_DELETED ) )
goto suite; goto suite;
if( PtSegmN == PtRefSegm ) if( PtSegmN == PtRefSegm )
...@@ -357,7 +357,7 @@ suite: ...@@ -357,7 +357,7 @@ suite:
if( PtSegmB ) if( PtSegmB )
{ {
if( PtSegmB->GetState( BUSY | DELETED ) ) if( PtSegmB->GetState( BUSY | IS_DELETED ) )
goto suite1; goto suite1;
if( PtSegmB == PtRefSegm ) if( PtSegmB == PtRefSegm )
...@@ -389,7 +389,7 @@ suite1: ...@@ -389,7 +389,7 @@ suite1:
/* General search. */ /* General search. */
for( PtSegmN = pt_base; PtSegmN != NULL; PtSegmN = PtSegmN->Next() ) for( PtSegmN = pt_base; PtSegmN != NULL; PtSegmN = PtSegmN->Next() )
{ {
if( PtSegmN->GetState( DELETED | BUSY ) ) if( PtSegmN->GetState( IS_DELETED | BUSY ) )
{ {
if( PtSegmN == pt_lim ) if( PtSegmN == pt_lim )
break; break;
...@@ -438,11 +438,11 @@ TRACK* Locate_Pistes( BOARD* aPcb, TRACK* start_adresse, const wxPoint& ref_pos, ...@@ -438,11 +438,11 @@ TRACK* Locate_Pistes( BOARD* aPcb, TRACK* start_adresse, const wxPoint& ref_pos,
{ {
int layer = track->GetLayer(); int layer = track->GetLayer();
if( track->GetState( BUSY | DELETED ) ) if( track->GetState( BUSY | IS_DELETED ) )
{ {
// D( printf( "track %p is BUSY | DELETED. BUSY=%d DELETED=%d\n", // D( printf( "track %p is BUSY | IS_DELETED. BUSY=%d IS_DELETED=%d\n",
// track, track->GetState( BUSY ), // track, track->GetState( BUSY ),
// track->GetState( DELETED ) );) // track->GetState( IS_DELETED ) );)
continue; continue;
} }
...@@ -524,7 +524,7 @@ D_PAD* Fast_Locate_Pad_Connecte( BOARD* Pcb, const wxPoint& ref_pos, int masque_ ...@@ -524,7 +524,7 @@ D_PAD* Fast_Locate_Pad_Connecte( BOARD* Pcb, const wxPoint& ref_pos, int masque_
* Data on layers by masklayer * Data on layers by masklayer
* Research is done to address start_adr has end_adr * Research is done to address start_adr has end_adr
* If end_adr = NULL, end search list * If end_adr = NULL, end search list
* The segments of track marks with the flag are not DELETED or taken * The segments of track marks with the flag are not IS_DELETED or taken
* into account * into account
*/ */
TRACK* Fast_Locate_Piste( TRACK* start_adr, TRACK* end_adr, const wxPoint& ref_pos, int MaskLayer ) TRACK* Fast_Locate_Piste( TRACK* start_adr, TRACK* end_adr, const wxPoint& ref_pos, int MaskLayer )
...@@ -536,7 +536,7 @@ TRACK* Fast_Locate_Piste( TRACK* start_adr, TRACK* end_adr, const wxPoint& ref_p ...@@ -536,7 +536,7 @@ TRACK* Fast_Locate_Piste( TRACK* start_adr, TRACK* end_adr, const wxPoint& ref_p
for( PtSegm = start_adr; PtSegm != NULL; PtSegm = PtSegm->Next() ) for( PtSegm = start_adr; PtSegm != NULL; PtSegm = PtSegm->Next() )
{ {
if( PtSegm->GetState( DELETED | BUSY ) == 0 ) if( PtSegm->GetState( IS_DELETED | BUSY ) == 0 )
{ {
if( ref_pos == PtSegm->m_Start ) if( ref_pos == PtSegm->m_Start )
{ {
...@@ -562,7 +562,7 @@ TRACK* Fast_Locate_Piste( TRACK* start_adr, TRACK* end_adr, const wxPoint& ref_p ...@@ -562,7 +562,7 @@ TRACK* Fast_Locate_Piste( TRACK* start_adr, TRACK* end_adr, const wxPoint& ref_p
/* Locates via through the point x, y, on layer data by masklayer. /* Locates via through the point x, y, on layer data by masklayer.
* Search is done to address start_adr has end_adr. * Search is done to address start_adr has end_adr.
* If end_adr = NULL, end search list * If end_adr = NULL, end search list
* Vias whose parameter has the State or DELETED bit BUSY = 1 are ignored * Vias whose parameter has the State or IS_DELETED bit BUSY = 1 are ignored
*/ */
TRACK* Fast_Locate_Via( TRACK* start_adr, TRACK* end_adr, const wxPoint& pos, int MaskLayer ) TRACK* Fast_Locate_Via( TRACK* start_adr, TRACK* end_adr, const wxPoint& pos, int MaskLayer )
{ {
...@@ -574,7 +574,7 @@ TRACK* Fast_Locate_Via( TRACK* start_adr, TRACK* end_adr, const wxPoint& pos, in ...@@ -574,7 +574,7 @@ TRACK* Fast_Locate_Via( TRACK* start_adr, TRACK* end_adr, const wxPoint& pos, in
{ {
if( pos == PtSegm->m_Start ) if( pos == PtSegm->m_Start )
{ {
if( PtSegm->GetState( BUSY | DELETED ) == 0 ) if( PtSegm->GetState( BUSY | IS_DELETED ) == 0 )
{ {
if( MaskLayer & PtSegm->ReturnMaskLayer() ) if( MaskLayer & PtSegm->ReturnMaskLayer() )
return PtSegm; return PtSegm;
......
...@@ -89,7 +89,7 @@ void WinEDA_PcbFrame::StartMove_Module( MODULE* module, wxDC* DC ) ...@@ -89,7 +89,7 @@ void WinEDA_PcbFrame::StartMove_Module( MODULE* module, wxDC* DC )
TRACK* segm = g_DragSegmentList[ii].m_Segm; TRACK* segm = g_DragSegmentList[ii].m_Segm;
itemWrapper.m_PickedItem = segm; itemWrapper.m_PickedItem = segm;
itemWrapper.m_Link = segm->Copy(); itemWrapper.m_Link = segm->Copy();
itemWrapper.m_Link->SetState( EDIT, OFF ); itemWrapper.m_Link->SetState( IN_EDIT, OFF );
s_PickedList.PushItem( itemWrapper ); s_PickedList.PushItem( itemWrapper );
} }
} }
...@@ -147,7 +147,7 @@ void Abort_MoveOrCopyModule( EDA_DRAW_PANEL* Panel, wxDC* DC ) ...@@ -147,7 +147,7 @@ void Abort_MoveOrCopyModule( EDA_DRAW_PANEL* Panel, wxDC* DC )
for( unsigned ii = 0; ii < g_DragSegmentList.size(); ii++ ) for( unsigned ii = 0; ii < g_DragSegmentList.size(); ii++ )
{ {
pt_segm = g_DragSegmentList[ii].m_Segm; pt_segm = g_DragSegmentList[ii].m_Segm;
pt_segm->SetState( EDIT, OFF ); pt_segm->SetState( IN_EDIT, OFF );
g_DragSegmentList[ii].SetInitialValues(); g_DragSegmentList[ii].SetInitialValues();
pt_segm->Draw( Panel, DC, GR_OR ); pt_segm->Draw( Panel, DC, GR_OR );
} }
...@@ -290,7 +290,7 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* aModule, ...@@ -290,7 +290,7 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* aModule,
/* Remove module from list, and put it in undo command list */ /* Remove module from list, and put it in undo command list */
m_Pcb->m_Modules.Remove( aModule ); m_Pcb->m_Modules.Remove( aModule );
aModule->SetState( DELETED, ON ); aModule->SetState( IS_DELETED, ON );
SaveCopyInUndoList( aModule, UR_DELETED ); SaveCopyInUndoList( aModule, UR_DELETED );
if( aDC && GetBoard()->IsElementVisible( RATSNEST_VISIBLE ) ) if( aDC && GetBoard()->IsElementVisible( RATSNEST_VISIBLE ) )
...@@ -439,7 +439,7 @@ void WinEDA_BasePcbFrame::Place_Module( MODULE* module, ...@@ -439,7 +439,7 @@ void WinEDA_BasePcbFrame::Place_Module( MODULE* module,
for( unsigned ii = 0; ii < g_DragSegmentList.size(); ii++ ) for( unsigned ii = 0; ii < g_DragSegmentList.size(); ii++ )
{ {
pt_segm = g_DragSegmentList[ii].m_Segm; pt_segm = g_DragSegmentList[ii].m_Segm;
pt_segm->SetState( EDIT, OFF ); pt_segm->SetState( IN_EDIT, OFF );
if( DC ) if( DC )
pt_segm->Draw( DrawPanel, DC, GR_OR ); pt_segm->Draw( DrawPanel, DC, GR_OR );
......
...@@ -43,7 +43,7 @@ static void Abort_Move_Pad( EDA_DRAW_PANEL* Panel, wxDC* DC ) ...@@ -43,7 +43,7 @@ static void Abort_Move_Pad( EDA_DRAW_PANEL* Panel, wxDC* DC )
{ {
TRACK* Track = g_DragSegmentList[ii].m_Segm; TRACK* Track = g_DragSegmentList[ii].m_Segm;
Track->Draw( Panel, DC, GR_XOR ); Track->Draw( Panel, DC, GR_XOR );
Track->SetState( EDIT, OFF ); Track->SetState( IN_EDIT, OFF );
g_DragSegmentList[ii].SetInitialValues(); g_DragSegmentList[ii].SetInitialValues();
Track->Draw( Panel, DC, GR_OR ); Track->Draw( Panel, DC, GR_OR );
} }
...@@ -356,7 +356,7 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC ) ...@@ -356,7 +356,7 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
if( g_DragSegmentList[ii].m_Pad_End ) if( g_DragSegmentList[ii].m_Pad_End )
Track->m_End = Pad->m_Pos; Track->m_End = Pad->m_Pos;
Track->SetState( EDIT, OFF ); Track->SetState( IN_EDIT, OFF );
if( DC ) if( DC )
Track->Draw( DrawPanel, DC, GR_OR ); Track->Draw( DrawPanel, DC, GR_OR );
} }
......
...@@ -114,7 +114,7 @@ static void Abort_MoveTrack( EDA_DRAW_PANEL* Panel, wxDC* DC ) ...@@ -114,7 +114,7 @@ static void Abort_MoveTrack( EDA_DRAW_PANEL* Panel, wxDC* DC )
{ {
TRACK* Track = g_DragSegmentList[jj].m_Segm; TRACK* Track = g_DragSegmentList[jj].m_Segm;
g_DragSegmentList[jj].SetInitialValues(); g_DragSegmentList[jj].SetInitialValues();
Track->SetState( EDIT, OFF ); Track->SetState( IN_EDIT, OFF );
Track->m_Flags = 0; Track->m_Flags = 0;
Track->Draw( Panel, DC, GR_OR ); Track->Draw( Panel, DC, GR_OR );
} }
...@@ -997,14 +997,14 @@ bool WinEDA_PcbFrame::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC ) ...@@ -997,14 +997,14 @@ bool WinEDA_PcbFrame::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC )
// DRC Ok: place track segments // DRC Ok: place track segments
Track->m_Flags = 0; Track->m_Flags = 0;
Track->SetState( EDIT, OFF ); Track->SetState( IN_EDIT, OFF );
Track->Draw( DrawPanel, DC, draw_mode ); Track->Draw( DrawPanel, DC, draw_mode );
/* Draw dragged tracks */ /* Draw dragged tracks */
for( unsigned ii = 0; ii < g_DragSegmentList.size(); ii++ ) for( unsigned ii = 0; ii < g_DragSegmentList.size(); ii++ )
{ {
Track = g_DragSegmentList[ii].m_Segm; Track = g_DragSegmentList[ii].m_Segm;
Track->SetState( EDIT, OFF ); Track->SetState( IN_EDIT, OFF );
Track->m_Flags = 0; Track->m_Flags = 0;
Track->Draw( DrawPanel, DC, draw_mode ); Track->Draw( DrawPanel, DC, draw_mode );
......
...@@ -525,7 +525,7 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) ...@@ -525,7 +525,7 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
track_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACKSEG, _( "Locked: Yes" ), wxEmptyString, true ); track_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACKSEG, _( "Locked: Yes" ), wxEmptyString, true );
track_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, _( "Locked: No" ), wxEmptyString, true ); track_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, _( "Locked: No" ), wxEmptyString, true );
if( Track->GetState( SEGM_FIXE ) ) if( Track->GetState( TRACK_LOCKED ) )
track_mnu->Check( ID_POPUP_PCB_LOCK_ON_TRACKSEG, true ); track_mnu->Check( ID_POPUP_PCB_LOCK_ON_TRACKSEG, true );
else else
track_mnu->Check( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, true ); track_mnu->Check( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, true );
......
...@@ -31,22 +31,11 @@ ...@@ -31,22 +31,11 @@
#define DIM_ANCRE_TEXTE 2 /* Anchor size (Text centre) */ #define DIM_ANCRE_TEXTE 2 /* Anchor size (Text centre) */
#define TEXTS_MIN_SIZE 50 // Min size in pcbnew units value (50 * 0.0001 mils) #define TEXTS_MIN_SIZE 50 // Min size in pcbnew units value (50 * 0.0001 mils)
#define TEXTS_MAX_SIZE 100000 // Min size in pcbnew units value (1 inch) ) #define TEXTS_MAX_SIZE 10000 // Min size in pcbnew units value (1 inch) )
#define TEXTS_MAX_WIDTH 5000 // Max width in pcbnew units value (0.5 inches) #define TEXTS_MAX_WIDTH 5000 // Max width in pcbnew units value (0.5 inches)
/* Used in Zoom menu */ /* Flag to force the SKETCH mode to display items (.m_Flags member) */
#define ZOOM_PLUS -1 #define FORCE_SKETCH ( IS_DRAGGED | IN_EDIT )
#define ZOOM_MOINS -2
#define ZOOM_AUTO -3
#define ZOOM_CENTER -4
#define ZOOM_REDRAW -5
/* Flag to force the SKETCH mode to display items (.flags member) */
#define FORCE_SKETCH (DRAG | EDIT )
/* Flags used in read board file */
#define APPEND_PCB 1 /* used to append the new board to the existing board */
#define NEWPCB 0 /* used for normal load file */
/* variables */ /* variables */
extern bool Drc_On; extern bool Drc_On;
......
...@@ -1115,7 +1115,7 @@ static void OrCell_Trace( BOARD* pcb, int col, int row, ...@@ -1115,7 +1115,7 @@ static void OrCell_Trace( BOARD* pcb, int col, int row,
g_CurrentTrackList.PushBack( newTrack ); g_CurrentTrackList.PushBack( newTrack );
g_CurrentTrackSegment->SetState( SEGM_AR, ON ); g_CurrentTrackSegment->SetState( TRACK_AR, ON );
g_CurrentTrackSegment->SetLayer( 0x0F ); g_CurrentTrackSegment->SetLayer( 0x0F );
g_CurrentTrackSegment->m_Start.x = g_CurrentTrackSegment->m_Start.x =
...@@ -1141,7 +1141,7 @@ static void OrCell_Trace( BOARD* pcb, int col, int row, ...@@ -1141,7 +1141,7 @@ static void OrCell_Trace( BOARD* pcb, int col, int row,
if( side == TOP ) if( side == TOP )
g_CurrentTrackSegment->SetLayer( Route_Layer_TOP ); g_CurrentTrackSegment->SetLayer( Route_Layer_TOP );
g_CurrentTrackSegment->SetState( SEGM_AR, ON ); g_CurrentTrackSegment->SetState( TRACK_AR, ON );
g_CurrentTrackSegment->m_End.x = pcb->m_BoundaryBox.m_Pos.x + g_CurrentTrackSegment->m_End.x = pcb->m_BoundaryBox.m_Pos.x +
( g_GridRoutingSize * row ); ( g_GridRoutingSize * row );
g_CurrentTrackSegment->m_End.y = pcb->m_BoundaryBox.m_Pos.y + g_CurrentTrackSegment->m_End.y = pcb->m_BoundaryBox.m_Pos.y +
......
...@@ -87,9 +87,9 @@ int WinEDA_PcbFrame::EraseRedundantTrack( ...@@ -87,9 +87,9 @@ int WinEDA_PcbFrame::EraseRedundantTrack(
/* Flags for cleaning the net. */ /* Flags for cleaning the net. */
for( pt_del = BufDeb; pt_del; pt_del = pt_del->Next() ) for( pt_del = BufDeb; pt_del; pt_del = pt_del->Next() )
{ {
//D( printf( "track %p turning off BUSY | EDIT | CHAIN\n", pt_del ); ) //D( printf( "track %p turning off BUSY | IN_EDIT | IS_LINKED\n", pt_del ); )
D( std::cout<<"track "<<pt_del<<" turning off BUSY | EDIT | CHAIN"<<std::endl; ) D( std::cout<<"track "<<pt_del<<" turning off BUSY | IN_EDIT | IS_LINKED"<<std::endl; )
pt_del->SetState( BUSY | EDIT | CHAIN, OFF ); pt_del->SetState( BUSY | IN_EDIT | IS_LINKED, OFF );
if( pt_del == BufEnd ) // Last segment reached if( pt_del == BufEnd ) // Last segment reached
break; break;
} }
...@@ -137,7 +137,7 @@ int WinEDA_PcbFrame::EraseRedundantTrack( ...@@ -137,7 +137,7 @@ int WinEDA_PcbFrame::EraseRedundantTrack(
/* Mark as deleted a new track (which is not involved in the search for /* Mark as deleted a new track (which is not involved in the search for
* other connections) * other connections)
*/ */
ListSetState( aNewTrack, aNewTrackSegmentsCount, DELETED, ON ); ListSetState( aNewTrack, aNewTrackSegmentsCount, IS_DELETED, ON );
/* A segment must be connected to the starting point, otherwise /* A segment must be connected to the starting point, otherwise
* it is unnecessary to analyze the other point * it is unnecessary to analyze the other point
...@@ -147,7 +147,7 @@ int WinEDA_PcbFrame::EraseRedundantTrack( ...@@ -147,7 +147,7 @@ int WinEDA_PcbFrame::EraseRedundantTrack(
if( pt_segm == NULL ) /* Not connected to the track starting point. */ if( pt_segm == NULL ) /* Not connected to the track starting point. */
{ {
/* Clear the delete flag. */ /* Clear the delete flag. */
ListSetState( aNewTrack, aNewTrackSegmentsCount, DELETED, OFF ); ListSetState( aNewTrack, aNewTrackSegmentsCount, IS_DELETED, OFF );
return 0; return 0;
} }
...@@ -163,9 +163,9 @@ int WinEDA_PcbFrame::EraseRedundantTrack( ...@@ -163,9 +163,9 @@ int WinEDA_PcbFrame::EraseRedundantTrack(
if( pt_segm->Type() != TYPE_VIA ) if( pt_segm->Type() != TYPE_VIA )
{ {
if( pt_segm->GetState( CHAIN ) == 0 ) if( pt_segm->GetState( IS_LINKED ) == 0 )
{ {
pt_segm->SetState( CHAIN, ON ); pt_segm->SetState( IS_LINKED, ON );
nbconnect++; nbconnect++;
} }
} }
...@@ -180,7 +180,7 @@ int WinEDA_PcbFrame::EraseRedundantTrack( ...@@ -180,7 +180,7 @@ int WinEDA_PcbFrame::EraseRedundantTrack(
/* Clear used flags */ /* Clear used flags */
for( pt_del = BufDeb; pt_del; pt_del = pt_del->Next() ) for( pt_del = BufDeb; pt_del; pt_del = pt_del->Next() )
{ {
pt_del->SetState( BUSY | DELETED | EDIT | CHAIN, OFF ); pt_del->SetState( BUSY | IS_DELETED | IN_EDIT | IS_LINKED, OFF );
if( pt_del == BufEnd ) // Last segment reached if( pt_del == BufEnd ) // Last segment reached
break; break;
} }
...@@ -191,22 +191,22 @@ int WinEDA_PcbFrame::EraseRedundantTrack( ...@@ -191,22 +191,22 @@ int WinEDA_PcbFrame::EraseRedundantTrack(
/* Mark trace as edited (which does not involve searching for other /* Mark trace as edited (which does not involve searching for other
* tracks) * tracks)
*/ */
ListSetState( aNewTrack, aNewTrackSegmentsCount, DELETED, OFF ); ListSetState( aNewTrack, aNewTrackSegmentsCount, IS_DELETED, OFF );
ListSetState( aNewTrack, aNewTrackSegmentsCount, EDIT, ON ); ListSetState( aNewTrack, aNewTrackSegmentsCount, IN_EDIT, ON );
/* Test all marked segments. */ /* Test all marked segments. */
while( nbconnect ) while( nbconnect )
{ {
for( pt_del = BufDeb; pt_del; pt_del = pt_del->Next() ) for( pt_del = BufDeb; pt_del; pt_del = pt_del->Next() )
{ {
if( pt_del->GetState( CHAIN ) ) if( pt_del->GetState( IS_LINKED ) )
break; break;
if( pt_del == BufEnd ) // Last segment reached if( pt_del == BufEnd ) // Last segment reached
break; break;
} }
nbconnect--; nbconnect--;
pt_del->SetState( CHAIN, OFF ); pt_del->SetState( IS_LINKED, OFF );
pt_del = Marque_Une_Piste( GetBoard(), pt_del, &nb_segm, NULL, true ); pt_del = Marque_Une_Piste( GetBoard(), pt_del, &nb_segm, NULL, true );
...@@ -246,13 +246,13 @@ int WinEDA_PcbFrame::EraseRedundantTrack( ...@@ -246,13 +246,13 @@ int WinEDA_PcbFrame::EraseRedundantTrack(
for( pt_del = m_Pcb->m_Track; pt_del != NULL; for( pt_del = m_Pcb->m_Track; pt_del != NULL;
pt_del = pt_del->Next() ) pt_del = pt_del->Next() )
{ {
if( pt_del->GetState( EDIT ) ) if( pt_del->GetState( IN_EDIT ) )
{ {
pt_del->SetState( EDIT, OFF ); pt_del->SetState( IN_EDIT, OFF );
if( aDC ) if( aDC )
pt_del->Draw( DrawPanel, aDC, GR_OR ); pt_del->Draw( DrawPanel, aDC, GR_OR );
} }
pt_del->SetState( EDIT | CHAIN, OFF ); pt_del->SetState( IN_EDIT | IS_LINKED, OFF );
} }
return 1; return 1;
...@@ -267,7 +267,7 @@ int WinEDA_PcbFrame::EraseRedundantTrack( ...@@ -267,7 +267,7 @@ int WinEDA_PcbFrame::EraseRedundantTrack(
/* Clear used flags */ /* Clear used flags */
for( pt_del = m_Pcb->m_Track; pt_del; pt_del = pt_del->Next() ) for( pt_del = m_Pcb->m_Track; pt_del; pt_del = pt_del->Next() )
{ {
pt_del->SetState( BUSY | DELETED | EDIT | CHAIN, OFF ); pt_del->SetState( BUSY | IS_DELETED | IN_EDIT | IS_LINKED, OFF );
if( pt_del == BufEnd ) // Last segment reached if( pt_del == BufEnd ) // Last segment reached
break; break;
} }
......
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