Commit 1f842ae1 authored by CHARRAS's avatar CHARRAS

bug in move pad fixed (could crash pcbnew).Other minor changes

parent 88ef06ef
...@@ -150,7 +150,7 @@ glEnable(GL_FOG); ...@@ -150,7 +150,7 @@ glEnable(GL_FOG);
glVertex3f( sx, -sy , zpos); glVertex3f( sx, -sy , zpos);
glEnd(); glEnd();
glBegin(GL_QUADS); glBegin(GL_QUADS);
SetGLColor(g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[CUIVRE_N]); SetGLColor(g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[COPPER_LAYER_N]);
glNormal3f( 0.0, 0.0, -1.0); // Normal is -Z axis glNormal3f( 0.0, 0.0, -1.0); // Normal is -Z axis
glVertex3f( -sx, -sy , 0); glVertex3f( -sx, -sy , 0);
glVertex3f( -sx, sy , 0); glVertex3f( -sx, sy , 0);
...@@ -213,7 +213,7 @@ double w; ...@@ -213,7 +213,7 @@ double w;
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer]; zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
SetGLColor(color); SetGLColor(color);
glNormal3f( 0.0, 0.0, (layer == CUIVRE_N) ? -1.0 : 1.0); glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0);
w = track->m_Width * g_Parm_3D_Visu.m_BoardScale; w = track->m_Width * g_Parm_3D_Visu.m_BoardScale;
ox = track->m_Start.x * g_Parm_3D_Visu.m_BoardScale; ox = track->m_Start.x * g_Parm_3D_Visu.m_BoardScale;
...@@ -250,7 +250,7 @@ int color; ...@@ -250,7 +250,7 @@ int color;
else color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[CMP_N]; else color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[CMP_N];
if ( color & ITEM_NOT_SHOW ) continue; if ( color & ITEM_NOT_SHOW ) continue;
SetGLColor(color); SetGLColor(color);
glNormal3f( 0.0, 0.0, (layer == CUIVRE_N) ? -1.0 : 1.0); glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0);
Draw3D_FilledCircle(x, -y, r, hole, zpos); Draw3D_FilledCircle(x, -y, r, hole, zpos);
if ( layer >= top_layer) break; if ( layer >= top_layer) break;
...@@ -284,7 +284,7 @@ int color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[segment->GetLayer()]; ...@@ -284,7 +284,7 @@ int color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[segment->GetLayer()];
{ {
for ( layer = 0; layer < g_Parm_3D_Visu.m_Layers; layer++ ) for ( layer = 0; layer < g_Parm_3D_Visu.m_Layers; layer++ )
{ {
glNormal3f( 0.0, 0.0, (layer == CUIVRE_N) ? -1.0 : 1.0); glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0);
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer]; zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
Draw3D_FilledSegment( x, -y, xf, -yf, w, zpos); Draw3D_FilledSegment( x, -y, xf, -yf, w, zpos);
} }
...@@ -312,7 +312,7 @@ D_PAD * pad = m_Pads; ...@@ -312,7 +312,7 @@ D_PAD * pad = m_Pads;
} }
if( ! DisplayOpt.Show_Modules_Cu ) if( ! DisplayOpt.Show_Modules_Cu )
{ {
if(m_Layer == CUIVRE_N) return; if(m_Layer == COPPER_LAYER_N) return;
} }
#endif #endif
...@@ -335,7 +335,7 @@ bool As3dShape = FALSE; ...@@ -335,7 +335,7 @@ bool As3dShape = FALSE;
{ {
glRotatef( (double)m_Orient / 10, 0.0, 0.0, 1.0 ); glRotatef( (double)m_Orient / 10, 0.0, 0.0, 1.0 );
} }
if ( m_Layer == CUIVRE_N ) if ( m_Layer == COPPER_LAYER_N )
{ {
glRotatef( 180.0, 0.0, 1.0, 0.0 ); glRotatef( 180.0, 0.0, 1.0, 0.0 );
glRotatef( 180.0, 0.0, 0.0, 1.0 ); glRotatef( 180.0, 0.0, 0.0, 1.0 );
...@@ -384,7 +384,7 @@ int color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[m_Layer]; ...@@ -384,7 +384,7 @@ int color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[m_Layer];
if ( color & ITEM_NOT_SHOW ) return; if ( color & ITEM_NOT_SHOW ) return;
SetGLColor(color); SetGLColor(color);
glNormal3f( 0.0, 0.0, (m_Layer == CUIVRE_N) ? -1.0 : 1.0); glNormal3f( 0.0, 0.0, (m_Layer == COPPER_LAYER_N) ? -1.0 : 1.0);
scale = g_Parm_3D_Visu.m_BoardScale; scale = g_Parm_3D_Visu.m_BoardScale;
ux0 = m_Start.x; ux0 = m_Start.x;
...@@ -477,16 +477,16 @@ int color; ...@@ -477,16 +477,16 @@ int color;
x = xc * scale; x = xc * scale;
y = yc * scale; y = yc * scale;
r = (double)dx * scale; r = (double)dx * scale;
for ( layer = CUIVRE_N; layer <= CMP_N; layer ++) for ( layer = COPPER_LAYER_N; layer <= CMP_N; layer ++)
{ {
if (layer && (layer == nlmax) ) layer = CMP_N; if (layer && (layer == nlmax) ) layer = CMP_N;
if ( (layer == CMP_N) && ! Oncmp ) continue; if ( (layer == CMP_N) && ! Oncmp ) continue;
if ( (layer == CUIVRE_N) && ! Oncu ) continue; if ( (layer == COPPER_LAYER_N) && ! Oncu ) continue;
if ( (layer > CUIVRE_N) && (layer < CMP_N) && !Both) continue; if ( (layer > COPPER_LAYER_N) && (layer < CMP_N) && !Both) continue;
color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer]; color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
if ( color & ITEM_NOT_SHOW ) continue; if ( color & ITEM_NOT_SHOW ) continue;
SetGLColor(color); SetGLColor(color);
glNormal3f( 0.0, 0.0, (layer == CUIVRE_N) ? -1.0 : 1.0); glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0);
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer]; zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
Draw3D_FilledCircle(x, -y, r, hole, zpos); Draw3D_FilledCircle(x, -y, r, hole, zpos);
} }
...@@ -513,14 +513,14 @@ int color; ...@@ -513,14 +513,14 @@ int color;
oy = (double)(uy0 + delta_cy) * scale; oy = (double)(uy0 + delta_cy) * scale;
fx = (double)(ux0 - delta_cx) * scale; fx = (double)(ux0 - delta_cx) * scale;
fy = (double)(uy0 - delta_cy) * scale; fy = (double)(uy0 - delta_cy) * scale;
for ( layer = CUIVRE_N; layer <= CMP_N; layer ++) for ( layer = COPPER_LAYER_N; layer <= CMP_N; layer ++)
{ {
if (layer && (layer == nlmax) ) layer = CMP_N; if (layer && (layer == nlmax) ) layer = CMP_N;
if ( (layer == CMP_N) && ! Oncmp ) continue; if ( (layer == CMP_N) && ! Oncmp ) continue;
if ( (layer == CUIVRE_N) && ! Oncu ) continue; if ( (layer == COPPER_LAYER_N) && ! Oncu ) continue;
if ( (layer > CUIVRE_N) && (layer < CMP_N) && !Both) continue; if ( (layer > COPPER_LAYER_N) && (layer < CMP_N) && !Both) continue;
color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer]; color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
glNormal3f( 0.0, 0.0, (layer == CUIVRE_N) ? -1.0 : 1.0); glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0);
if ( color & ITEM_NOT_SHOW ) continue; if ( color & ITEM_NOT_SHOW ) continue;
SetGLColor(color); SetGLColor(color);
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer]; zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
...@@ -574,14 +574,14 @@ int color; ...@@ -574,14 +574,14 @@ int color;
f_hole_coord[ii][1] += drilly; f_hole_coord[ii][1] += drilly;
} }
for ( layer = CUIVRE_N; layer <= CMP_N; layer ++) for ( layer = COPPER_LAYER_N; layer <= CMP_N; layer ++)
{ {
if (layer && (layer == nlmax) ) layer = CMP_N; if (layer && (layer == nlmax) ) layer = CMP_N;
if ( (layer == CMP_N) && ! Oncmp ) continue; if ( (layer == CMP_N) && ! Oncmp ) continue;
if ( (layer == CUIVRE_N) && ! Oncu ) continue; if ( (layer == COPPER_LAYER_N) && ! Oncu ) continue;
if ( (layer > CUIVRE_N) && (layer < CMP_N) && !Both) continue; if ( (layer > COPPER_LAYER_N) && (layer < CMP_N) && !Both) continue;
color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer]; color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
glNormal3f( 0.0, 0.0, (layer == CUIVRE_N) ? -1.0 : 1.0); glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0);
if ( color & ITEM_NOT_SHOW ) continue; if ( color & ITEM_NOT_SHOW ) continue;
SetGLColor(color); SetGLColor(color);
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer]; zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
......
...@@ -4,6 +4,21 @@ Started 2007-June-11 ...@@ -4,6 +4,21 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2007-Oct-7 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ eeschema
create new file cross-probing.cpp
move RemoteCommand() to cross-probing.cpp and create SendMessageToPCBNEW()
+ pcbnew
bug in move pad fixed (could crash pcbnew)
Small change in selection clarification (side effect removed):
- Escape or click on title does not show the next popup menu.
- the title is displayed under linux
- definition CUIVRE_N translated into COPPER_LAYER_N
2007-Oct-07 UPDATE Geoff Harland <gharlandau@yahoo.com.au> 2007-Oct-07 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
================================================================================ ================================================================================
+ all + all
......
...@@ -192,7 +192,7 @@ public: ...@@ -192,7 +192,7 @@ public:
void RecreateMenuBar(); void RecreateMenuBar();
void OnLeftClick(wxDC * DC, const wxPoint& MousePos); void OnLeftClick(wxDC * DC, const wxPoint& MousePos);
void OnLeftDClick(wxDC * DC, const wxPoint& MousePos); void OnLeftDClick(wxDC * DC, const wxPoint& MousePos);
void OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu); bool OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu);
void SetToolbars(); void SetToolbars();
void InstallOptionsDisplay(wxCommandEvent& event); void InstallOptionsDisplay(wxCommandEvent& event);
MODULE * Get_Module(const wxString & CmpName); MODULE * Get_Module(const wxString & CmpName);
......
...@@ -144,18 +144,25 @@ void WinEDA_DisplayFrame::SetToolbars() ...@@ -144,18 +144,25 @@ void WinEDA_DisplayFrame::SetToolbars()
} }
/*************************************************************************/
void WinEDA_DisplayFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) void WinEDA_DisplayFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
/*************************************************************************/
{ {
} }
/*************************************************************************/
void WinEDA_DisplayFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) void WinEDA_DisplayFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
/*************************************************************************/
{ {
} }
void WinEDA_DisplayFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) /*********************************************************************************/
bool WinEDA_DisplayFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
/*********************************************************************************/
{ {
return true;
} }
......
...@@ -17,79 +17,6 @@ ...@@ -17,79 +17,6 @@
#include "protos.h" #include "protos.h"
/* Routines locales */
/* variables externes */
/***************************************************************/
void RemoteCommand( const char* cmdline )
/***************************************************************/
/** Read a remote command sent by pcbnew (via a socket connection) , so when user selects a module
* or pin in pcbnew, eeschema shows that same component or pin.
* The cursor is put on the item
* @param cmdline = received command from pcbnew
* commands are:
* $PART: "reference" put cursor on component
* $PART: "reference" $REF: "ref" put cursor on reference component
* $PART: "reference" $VAL: "value" put cursor on value component
* $PART: "reference" $PAD: "pin name" put cursor on the component pin
*/
{
char line[1024];
char* idcmd;
char* text;
WinEDA_SchematicFrame* frame = EDA_Appl->m_SchematicFrame;
wxString part_ref, msg;
strncpy( line, cmdline, sizeof(line) - 1 );
idcmd = strtok( line, " \n\r" );
text = strtok( NULL, "\"\n\r" );
if( (idcmd == NULL) || (text == NULL) )
return;
if( strcmp( idcmd, "$PART:" ) != 0 )
return;
part_ref = CONV_FROM_UTF8( text );
/* look for a complement */
idcmd = strtok( NULL, " \n\r" );
if( idcmd == NULL ) // component only
{
frame->FindComponentAndItem( part_ref, true, 0, wxEmptyString, false );
return;
}
text = strtok( NULL, "\"\n\r" );
if( text == NULL )
return;
msg = CONV_FROM_UTF8( text );
if( strcmp( idcmd, "$REF:" ) == 0 )
{
frame->FindComponentAndItem( part_ref, true, 2, msg, false );
}
else if( strcmp( idcmd, "$VAL:" ) == 0 )
{
frame->FindComponentAndItem( part_ref, true, 3, msg, false );
}
else if( strcmp( idcmd, "$PAD:" ) == 0 )
{
frame->FindComponentAndItem( part_ref, true, 1, msg, false );
}
else
frame->FindComponentAndItem( part_ref, true, 0, wxEmptyString, false );
}
/**************************************************************/ /**************************************************************/
EDA_BaseStruct* WinEDA_SchematicFrame:: EDA_BaseStruct* WinEDA_SchematicFrame::
SchematicGeneralLocateAndDisplay( bool IncludePin ) SchematicGeneralLocateAndDisplay( bool IncludePin )
...@@ -114,7 +41,6 @@ SchematicGeneralLocateAndDisplay( bool IncludePin ) ...@@ -114,7 +41,6 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
wxPoint mouse_position = GetScreen()->m_MousePosition; wxPoint mouse_position = GetScreen()->m_MousePosition;
LibDrawPin* Pin = NULL; LibDrawPin* Pin = NULL;
EDA_SchComponentStruct* LibItem = NULL; EDA_SchComponentStruct* LibItem = NULL;
char Line[1024];
DrawStruct = SchematicGeneralLocateAndDisplay( mouse_position, IncludePin ); DrawStruct = SchematicGeneralLocateAndDisplay( mouse_position, IncludePin );
if( !DrawStruct && ( mouse_position != GetScreen()->m_Curseur) ) if( !DrawStruct && ( mouse_position != GetScreen()->m_Curseur) )
...@@ -128,21 +54,14 @@ SchematicGeneralLocateAndDisplay( bool IncludePin ) ...@@ -128,21 +54,14 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
switch( DrawStruct->Type() ) switch( DrawStruct->Type() )
{ {
case COMPONENT_FIELD_DRAW_TYPE: case COMPONENT_FIELD_DRAW_TYPE:
{ SendMessageToPCBNEW( DrawStruct );
PartTextStruct* Field = (PartTextStruct*) DrawStruct;
LibItem = (EDA_SchComponentStruct*) Field->m_Parent;
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
SendCommand( MSG_TO_PCB, Line );
}
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case DRAW_LIB_ITEM_STRUCT_TYPE:
Pin = LocateAnyPin( m_CurrentScreen->EEDrawList, GetScreen()->m_Curseur, &LibItem ); Pin = LocateAnyPin( m_CurrentScreen->EEDrawList, GetScreen()->m_Curseur, &LibItem );
if( Pin ) if( Pin )
break; // Priority is probing a pin first break; // Priority is probing a pin first
LibItem = (EDA_SchComponentStruct*) DrawStruct; SendMessageToPCBNEW( DrawStruct );
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
SendCommand( MSG_TO_PCB, Line );
break; break;
default: default:
...@@ -165,14 +84,7 @@ SchematicGeneralLocateAndDisplay( bool IncludePin ) ...@@ -165,14 +84,7 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
CYAN ); CYAN );
// Cross probing:2 - pin found, and send a locate pin command to pcbnew (hightlight net) // Cross probing:2 - pin found, and send a locate pin command to pcbnew (hightlight net)
if( Pin->m_PinNum ) SendMessageToPCBNEW( Pin );
{
wxString pinnum;
Pin->ReturnPinStringNum( pinnum );
sprintf( Line, "$PIN: %s $PART: %s", CONV_TO_UTF8( pinnum ),
CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
SendCommand( MSG_TO_PCB, Line );
}
} }
return DrawStruct; return DrawStruct;
} }
......
/*********************/
/* cross-probing.cpp */
/*********************/
#include "fctsys.h"
#include "common.h"
#include "program.h"
#include "libcmp.h"
#include "general.h"
#include "eda_dde.h"
#include "id.h"
#include "protos.h"
/***************************************************************/
void RemoteCommand( const char* cmdline )
/***************************************************************/
/** Read a remote command sent by pcbnew (via a socket connection) ,
* so when user selects a module or pin in pcbnew,
* eeschema shows that same component or pin.
* The cursor is put on the item
* port KICAD_SCH_PORT_SERVICE_NUMBER (currently 4243)
* @param cmdline = received command from pcbnew
* commands are:
* $PART: "reference" put cursor on component
* $PART: "reference" $REF: "ref" put cursor on reference component
* $PART: "reference" $VAL: "value" put cursor on value component
* $PART: "reference" $PAD: "pin name" put cursor on the component pin
*/
{
char line[1024];
char* idcmd;
char* text;
WinEDA_SchematicFrame* frame = EDA_Appl->m_SchematicFrame;
wxString part_ref, msg;
strncpy( line, cmdline, sizeof(line) - 1 );
idcmd = strtok( line, " \n\r" );
text = strtok( NULL, "\"\n\r" );
if( (idcmd == NULL) || (text == NULL) )
return;
if( strcmp( idcmd, "$PART:" ) != 0 )
return;
part_ref = CONV_FROM_UTF8( text );
/* look for a complement */
idcmd = strtok( NULL, " \n\r" );
if( idcmd == NULL ) // component only
{
frame->FindComponentAndItem( part_ref, true, 0, wxEmptyString, false );
return;
}
text = strtok( NULL, "\"\n\r" );
if( text == NULL )
return;
msg = CONV_FROM_UTF8( text );
if( strcmp( idcmd, "$REF:" ) == 0 )
{
frame->FindComponentAndItem( part_ref, true, 2, msg, false );
}
else if( strcmp( idcmd, "$VAL:" ) == 0 )
{
frame->FindComponentAndItem( part_ref, true, 3, msg, false );
}
else if( strcmp( idcmd, "$PAD:" ) == 0 )
{
frame->FindComponentAndItem( part_ref, true, 1, msg, false );
}
else
frame->FindComponentAndItem( part_ref, true, 0, wxEmptyString, false );
}
/*****************************************************************************/
void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync )
/*****************************************************************************/
/** Send a remote command to eeschema via a socket,
* @param objectToSync = item to be located on board (footprint, pad or text)
* Commands are
* $PART: reference put cursor on footprint anchor
* $PIN: number $PART: reference put cursor on the footprint pad
*/
{
if ( objectToSync == NULL )return;
LibDrawPin* Pin = NULL;
EDA_SchComponentStruct* LibItem = NULL;
char Line[1024];
/* Cross probing to pcbnew if a pin or a component is found */
switch( objectToSync->Type() )
{
case COMPONENT_FIELD_DRAW_TYPE:
{
PartTextStruct* Field = (PartTextStruct*) objectToSync;
LibItem = (EDA_SchComponentStruct*) Field->m_Parent;
if( LibItem == NULL ) break;
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
SendCommand( MSG_TO_PCB, Line );
}
break;
case DRAW_LIB_ITEM_STRUCT_TYPE:
LibItem = (EDA_SchComponentStruct*) objectToSync;
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
SendCommand( MSG_TO_PCB, Line );
break;
case COMPONENT_PIN_DRAW_TYPE:
Pin = (LibDrawPin*) objectToSync;
LibItem = (EDA_SchComponentStruct *) Pin->m_Parent;
if( LibItem == NULL ) break;
if ( Pin->m_PinNum )
{
wxString pinnum;
Pin->ReturnPinStringNum( pinnum );
sprintf( Line, "$PIN: %s $PART: %s", CONV_TO_UTF8( pinnum ),
CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
}
else
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
SendCommand( MSG_TO_PCB, Line );
break;
default:
break;
}
}
...@@ -30,13 +30,13 @@ static void AddMenusForPin(wxMenu * PopMenu, LibDrawPin* Pin, WinEDA_LibeditFram ...@@ -30,13 +30,13 @@ static void AddMenusForPin(wxMenu * PopMenu, LibDrawPin* Pin, WinEDA_LibeditFram
/********************************************************************************/ /********************************************************************************/
void WinEDA_LibeditFrame::OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu) bool WinEDA_LibeditFrame::OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu)
/********************************************************************************/ /********************************************************************************/
{ {
LibEDA_BaseStruct* DrawEntry = CurrentDrawItem; LibEDA_BaseStruct* DrawEntry = CurrentDrawItem;
bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE); bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE);
if ( CurrentLibEntry == NULL ) return; if ( CurrentLibEntry == NULL ) return true;
if ( (DrawEntry == NULL) || (DrawEntry->m_Flags == 0) ) if ( (DrawEntry == NULL) || (DrawEntry->m_Flags == 0) )
{ // Simple localisation des elements { // Simple localisation des elements
...@@ -86,7 +86,7 @@ bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE); ...@@ -86,7 +86,7 @@ bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE);
} }
if ( DrawEntry ) DrawEntry->Display_Infos_DrawEntry(this); if ( DrawEntry ) DrawEntry->Display_Infos_DrawEntry(this);
else return; else return true;
CurrentDrawItem = DrawEntry; CurrentDrawItem = DrawEntry;
...@@ -208,6 +208,7 @@ bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE); ...@@ -208,6 +208,7 @@ bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE);
break; break;
} }
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
return true;
} }
/**********************************************************************************/ /**********************************************************************************/
......
...@@ -17,6 +17,7 @@ OBJECTS = eeschema.o\ ...@@ -17,6 +17,7 @@ OBJECTS = eeschema.o\
libedit_onrightclick.o\ libedit_onrightclick.o\
libedit_onleftclick.o\ libedit_onleftclick.o\
dangling_ends.o\ dangling_ends.o\
cross-probing.o\
setpage.o\ setpage.o\
cmpclass.o\ cmpclass.o\
class_hierarchy_sheet.o\ class_hierarchy_sheet.o\
......
...@@ -77,7 +77,7 @@ void WinEDA_SchematicFrame::ToolOnRightClick( wxCommandEvent& event ) ...@@ -77,7 +77,7 @@ void WinEDA_SchematicFrame::ToolOnRightClick( wxCommandEvent& event )
/*****************************************************************/ /*****************************************************************/
void WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
wxMenu* PopMenu ) wxMenu* PopMenu )
/*****************************************************************/ /*****************************************************************/
...@@ -96,7 +96,7 @@ void WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -96,7 +96,7 @@ void WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
{ {
AddMenusForBlock( PopMenu, this ); AddMenusForBlock( PopMenu, this );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
return; return true;
} }
// Simple localisation des elements si possible // Simple localisation des elements si possible
...@@ -142,7 +142,7 @@ void WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -142,7 +142,7 @@ void WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_LEAVE_SHEET, _( "Leave Sheet" ), leave_sheet_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_SCH_LEAVE_SHEET, _( "Leave Sheet" ), leave_sheet_xpm );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
} }
return; return true;
} }
m_CurrentScreen->SetCurItem( DrawStruct ); m_CurrentScreen->SetCurItem( DrawStruct );
...@@ -251,6 +251,7 @@ void WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -251,6 +251,7 @@ void WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
} }
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
return true;
} }
......
...@@ -99,9 +99,10 @@ void WinEDA_ViewlibFrame::OnLeftClick(wxDC * DC, const wxPoint& MousePos) ...@@ -99,9 +99,10 @@ void WinEDA_ViewlibFrame::OnLeftClick(wxDC * DC, const wxPoint& MousePos)
} }
/********************************************************************************/ /********************************************************************************/
void WinEDA_ViewlibFrame::OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu) bool WinEDA_ViewlibFrame::OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu)
/********************************************************************************/ /********************************************************************************/
{ {
return true;
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "protos.h" #include "protos.h"
/********************************************************************************/ /********************************************************************************/
void WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
/********************************************************************************/ /********************************************************************************/
/* Prepare le menu PullUp affich par un click sur le bouton droit /* Prepare le menu PullUp affich par un click sur le bouton droit
...@@ -62,12 +62,12 @@ void WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ...@@ -62,12 +62,12 @@ void WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
} }
if( BlockActive ) if( BlockActive )
return; return true;
PopMenu->Append( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, _( "Delete Dcode items" ) ); PopMenu->Append( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, _( "Delete Dcode items" ) );
if( DrawStruct == NULL ) if( DrawStruct == NULL )
return; return true;
GetScreen()->SetCurItem( DrawStruct ); GetScreen()->SetCurItem( DrawStruct );
...@@ -90,4 +90,5 @@ void WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ...@@ -90,4 +90,5 @@ void WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
} }
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
return true;
} }
...@@ -90,7 +90,7 @@ public: ...@@ -90,7 +90,7 @@ public:
wxSize GetGrid(); wxSize GetGrid();
void AddMenuZoom( wxMenu* MasterMenu ); void AddMenuZoom( wxMenu* MasterMenu );
void OnRightClick( wxMouseEvent& event ); bool OnRightClick( wxMouseEvent& event );
void Process_Popup_Zoom( wxCommandEvent& event ); void Process_Popup_Zoom( wxCommandEvent& event );
void Process_Special_Functions( wxCommandEvent& event ); void Process_Special_Functions( wxCommandEvent& event );
wxPoint CursorRealPosition( const wxPoint& ScreenPos ); wxPoint CursorRealPosition( const wxPoint& ScreenPos );
......
...@@ -34,10 +34,8 @@ ...@@ -34,10 +34,8 @@
#define CHAIN 0x01 /* segment marque */ #define CHAIN 0x01 /* segment marque */
/* Flags pour les couches cuivres */ /* Layer identification (layer number) */
/* numero des couches particulieres */ #define COPPER_LAYER_N 0
#define LAYER_CUIVRE_N 0
#define CUIVRE_N 0
#define LAYER_N_2 1 /* Numero layer 2 */ #define LAYER_N_2 1 /* Numero layer 2 */
#define LAYER_N_3 2 /* Numero layer 3 */ #define LAYER_N_3 2 /* Numero layer 3 */
#define LAYER_N_4 3 /* Numero layer 4 */ #define LAYER_N_4 3 /* Numero layer 4 */
...@@ -79,7 +77,7 @@ ...@@ -79,7 +77,7 @@
/*************************************/ /*************************************/
/* constantes de gestion des couches */ /* constantes de gestion des couches */
/*************************************/ /*************************************/
#define CUIVRE_LAYER (1<<LAYER_CUIVRE_N) ///< bit mask for copper layer #define CUIVRE_LAYER (1<<COPPER_LAYER_N) ///< bit mask for copper layer
#define LAYER_2 (1<<LAYER_N_2) ///< bit mask for layer 2 #define LAYER_2 (1<<LAYER_N_2) ///< bit mask for layer 2
#define LAYER_3 (1<<LAYER_N_3) ///< bit mask for layer 3 #define LAYER_3 (1<<LAYER_N_3) ///< bit mask for layer 3
#define LAYER_4 (1<<LAYER_N_4) ///< bit mask for layer 4 #define LAYER_4 (1<<LAYER_N_4) ///< bit mask for layer 4
......
...@@ -300,7 +300,7 @@ public: ...@@ -300,7 +300,7 @@ public:
virtual void Process_Special_Functions( wxCommandEvent& event ) = 0; virtual void Process_Special_Functions( wxCommandEvent& event ) = 0;
virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0; virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
virtual void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0; virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
virtual void ToolOnRightClick( wxCommandEvent& event ); virtual void ToolOnRightClick( wxCommandEvent& event );
void AdjustScrollBars(); void AdjustScrollBars();
void Affiche_Status_Box(); /* Affichage des coord curseur, zoom .. */ void Affiche_Status_Box(); /* Affichage des coord curseur, zoom .. */
...@@ -363,7 +363,7 @@ public: ...@@ -363,7 +363,7 @@ public:
virtual void ReCreateVToolbar() = 0; virtual void ReCreateVToolbar() = 0;
virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0; virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) = 0; virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) = 0;
virtual void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0; virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
virtual void ReCreateMenuBar(); virtual void ReCreateMenuBar();
PCB_SCREEN* GetScreen() { return (PCB_SCREEN*) m_CurrentScreen; } PCB_SCREEN* GetScreen() { return (PCB_SCREEN*) m_CurrentScreen; }
...@@ -614,7 +614,7 @@ public: ...@@ -614,7 +614,7 @@ public:
* @param aMousePos The current mouse position * @param aMousePos The current mouse position
* @param aPopMenu The menu to add to. * @param aPopMenu The menu to add to.
*/ */
void OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ); bool OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu );
void OnSelectOptionToolbar( wxCommandEvent& event ); void OnSelectOptionToolbar( wxCommandEvent& event );
void ToolOnRightClick( wxCommandEvent& event ); void ToolOnRightClick( wxCommandEvent& event );
...@@ -822,7 +822,7 @@ public: ...@@ -822,7 +822,7 @@ public:
void ReCreateMenuBar(); void ReCreateMenuBar();
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
int BestZoom(); // Retourne le meilleur zoom int BestZoom(); // Retourne le meilleur zoom
void OnSelectOptionToolbar( wxCommandEvent& event ); void OnSelectOptionToolbar( wxCommandEvent& event );
void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ); void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
...@@ -928,7 +928,7 @@ public: ...@@ -928,7 +928,7 @@ public:
void ReCreateAuxiliaryToolbar(); void ReCreateAuxiliaryToolbar();
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
void SetToolbars(); void SetToolbars();
void ReCreateMenuBar(); void ReCreateMenuBar();
void ToolOnRightClick( wxCommandEvent& event ); void ToolOnRightClick( wxCommandEvent& event );
...@@ -1033,7 +1033,7 @@ public: ...@@ -1033,7 +1033,7 @@ public:
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
void OnSelectOptionToolbar( wxCommandEvent& event ); void OnSelectOptionToolbar( wxCommandEvent& event );
void ToolOnRightClick( wxCommandEvent& event ); void ToolOnRightClick( wxCommandEvent& event );
int BestZoom(); // Retourne le meilleur zoom int BestZoom(); // Retourne le meilleur zoom
...@@ -1043,13 +1043,16 @@ public: ...@@ -1043,13 +1043,16 @@ public:
EDA_BaseStruct* SchematicGeneralLocateAndDisplay( EDA_BaseStruct* SchematicGeneralLocateAndDisplay(
const wxPoint& refpoint, const wxPoint& refpoint,
bool IncludePin ); bool IncludePin );
EDA_BaseStruct* FindComponentAndItem( EDA_BaseStruct* FindComponentAndItem(
const wxString& component_reference, bool Find_in_hierarchy, const wxString& component_reference, bool Find_in_hierarchy,
int SearchType, int SearchType,
const wxString& text_to_find, const wxString& text_to_find,
bool mouseWarp ); bool mouseWarp );
/* Cross probing with pcbnew */
void SendMessageToPCBNEW( EDA_BaseStruct* objectToSync );
/* netlist generation */ /* netlist generation */
void* BuildNetListBase(); void* BuildNetListBase();
...@@ -1223,7 +1226,7 @@ public: ...@@ -1223,7 +1226,7 @@ public:
void ReCreateHToolbar(); void ReCreateHToolbar();
void ReCreateVToolbar(); void ReCreateVToolbar();
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
int BestZoom(); // Retourne le meilleur zoom int BestZoom(); // Retourne le meilleur zoom
void SetToolbars(); void SetToolbars();
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
...@@ -1344,7 +1347,7 @@ private: ...@@ -1344,7 +1347,7 @@ private:
void SelectAndViewLibraryPart( int option ); void SelectAndViewLibraryPart( int option );
void ExportToSchematicLibraryPart( wxCommandEvent& event ); void ExportToSchematicLibraryPart( wxCommandEvent& event );
void ViewOneLibraryContent( LibraryStruct* Lib, int Flag ); void ViewOneLibraryContent( LibraryStruct* Lib, int Flag );
void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
......
...@@ -441,7 +441,7 @@ int WinEDA_PcbFrame::GenPlaceBoard() ...@@ -441,7 +441,7 @@ int WinEDA_PcbFrame::GenPlaceBoard()
Route_Layer_BOTTOM = CMP_N; Route_Layer_BOTTOM = CMP_N;
if( Nb_Sides == TWO_SIDES ) if( Nb_Sides == TWO_SIDES )
Route_Layer_BOTTOM = CUIVRE_N; Route_Layer_BOTTOM = COPPER_LAYER_N;
Route_Layer_TOP = CMP_N; Route_Layer_TOP = CMP_N;
/* Place the edge layer segments */ /* Place the edge layer segments */
...@@ -538,7 +538,7 @@ void WinEDA_PcbFrame::GenModuleOnBoard( MODULE* Module ) ...@@ -538,7 +538,7 @@ void WinEDA_PcbFrame::GenModuleOnBoard( MODULE* Module )
masque_layer = 0; masque_layer = 0;
if( Module->GetLayer() == CMP_N ) if( Module->GetLayer() == CMP_N )
masque_layer = CMP_LAYER; masque_layer = CMP_LAYER;
if( Module->GetLayer() == CUIVRE_N ) if( Module->GetLayer() == COPPER_LAYER_N )
masque_layer = CUIVRE_LAYER; masque_layer = CUIVRE_LAYER;
TraceFilledRectangle( m_Pcb, ox, oy, fx, fy, masque_layer, TraceFilledRectangle( m_Pcb, ox, oy, fx, fy, masque_layer,
...@@ -615,7 +615,7 @@ int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC ) ...@@ -615,7 +615,7 @@ int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC )
{ {
D_PAD* Pad; int masque_otherlayer; D_PAD* Pad; int masque_otherlayer;
masque_otherlayer = CUIVRE_LAYER; masque_otherlayer = CUIVRE_LAYER;
if( Module->GetLayer() == CUIVRE_N ) if( Module->GetLayer() == COPPER_LAYER_N )
masque_otherlayer = CMP_LAYER; masque_otherlayer = CMP_LAYER;
for( Pad = Module->m_Pads; Pad != NULL; Pad = (D_PAD*) Pad->Pnext ) for( Pad = Module->m_Pads; Pad != NULL; Pad = (D_PAD*) Pad->Pnext )
...@@ -823,7 +823,7 @@ int TstModuleOnBoard( BOARD* Pcb, MODULE* Module, bool TstOtherSide ) ...@@ -823,7 +823,7 @@ int TstModuleOnBoard( BOARD* Pcb, MODULE* Module, bool TstOtherSide )
int error, Penalite, marge, side, otherside; int error, Penalite, marge, side, otherside;
side = TOP; otherside = BOTTOM; side = TOP; otherside = BOTTOM;
if( Module->GetLayer() == CUIVRE_N ) if( Module->GetLayer() == COPPER_LAYER_N )
{ {
side = BOTTOM; otherside = TOP; side = BOTTOM; otherside = TOP;
} }
......
...@@ -27,9 +27,16 @@ D_PAD * Pad = NULL; ...@@ -27,9 +27,16 @@ D_PAD * Pad = NULL;
int autoroute_net_code = -1; int autoroute_net_code = -1;
wxString msg; wxString msg;
if ( g_DesignSettings.m_CopperLayerCount > 1 )
Route_Layer_TOP = GetScreen()->m_Route_Layer_TOP; {
Route_Layer_BOTTOM = GetScreen()->m_Route_Layer_BOTTOM; Route_Layer_TOP = GetScreen()->m_Route_Layer_TOP;
Route_Layer_BOTTOM = GetScreen()->m_Route_Layer_BOTTOM;
}
else
{
Route_Layer_TOP =
Route_Layer_BOTTOM = COPPER_LAYER_N;
}
switch ( mode ) switch ( mode )
{ {
......
...@@ -24,25 +24,23 @@ ...@@ -24,25 +24,23 @@
BEGIN_EVENT_TABLE( WinEDA_BasePcbFrame, WinEDA_DrawFrame ) BEGIN_EVENT_TABLE( WinEDA_BasePcbFrame, WinEDA_DrawFrame )
COMMON_EVENTS_DRAWFRAME COMMON_EVENTS_DRAWFRAME EVT_MENU_RANGE( ID_POPUP_PCB_ITEM_SELECTION_START,
ID_POPUP_PCB_ITEM_SELECTION_END,
EVT_MENU_RANGE( ID_POPUP_PCB_ITEM_SELECTION_START, ID_POPUP_PCB_ITEM_SELECTION_END, WinEDA_BasePcbFrame::ProcessItemSelection )
WinEDA_BasePcbFrame::ProcessItemSelection )
END_EVENT_TABLE()
END_EVENT_TABLE()
/****************/ /****************/
/* Constructeur */ /* Constructeur */
/****************/ /****************/
WinEDA_BasePcbFrame::WinEDA_BasePcbFrame( wxWindow* father, WinEDA_BasePcbFrame::WinEDA_BasePcbFrame( wxWindow* father,
WinEDA_App* parent, WinEDA_App* parent,
int idtype, int idtype,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size ) : const wxSize& size ) :
WinEDA_DrawFrame( father, idtype, parent, title, pos, size ) WinEDA_DrawFrame( father, idtype, parent, title, pos, size )
{ {
m_InternalUnits = 10000; // Internal unit = 1/10000 inch m_InternalUnits = 10000; // Internal unit = 1/10000 inch
...@@ -56,8 +54,8 @@ WinEDA_BasePcbFrame::WinEDA_BasePcbFrame( wxWindow* father, ...@@ -56,8 +54,8 @@ WinEDA_BasePcbFrame::WinEDA_BasePcbFrame( wxWindow* father,
m_DisplayModText = FILLED; // How to show module texts m_DisplayModText = FILLED; // How to show module texts
m_DisplayPcbTrackFill = TRUE; /* FALSE = sketch , TRUE = filled */ m_DisplayPcbTrackFill = TRUE; /* FALSE = sketch , TRUE = filled */
m_Draw3DFrame = NULL; // Display Window in 3D mode (OpenGL) m_Draw3DFrame = NULL; // Display Window in 3D mode (OpenGL)
m_Collector = new GENERAL_COLLECTOR(); m_Collector = new GENERAL_COLLECTOR();
} }
...@@ -98,6 +96,7 @@ int WinEDA_BasePcbFrame::BestZoom( void ) ...@@ -98,6 +96,7 @@ int WinEDA_BasePcbFrame::BestZoom( void )
/*************************************************/ /*************************************************/
void WinEDA_BasePcbFrame::ReCreateMenuBar( void ) void WinEDA_BasePcbFrame::ReCreateMenuBar( void )
/*************************************************/ /*************************************************/
// Virtual function // Virtual function
{ {
} }
...@@ -154,18 +153,19 @@ void WinEDA_BasePcbFrame::GetComponentFromRedoList( void ) ...@@ -154,18 +153,19 @@ void WinEDA_BasePcbFrame::GetComponentFromRedoList( void )
/****************************************************************/ /****************************************************************/
void WinEDA_BasePcbFrame::SwitchLayer( wxDC* DC, int layer ) void WinEDA_BasePcbFrame::SwitchLayer( wxDC* DC, int layer )
/*****************************************************************/ /*****************************************************************/
//Note: virtual, overridden in WinEDA_PcbFrame; //Note: virtual, overridden in WinEDA_PcbFrame;
{ {
int preslayer = GetScreen()->m_Active_Layer; int preslayer = GetScreen()->m_Active_Layer;
//if there is only one layer, don't switch. //if there is only one layer, don't switch.
if( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1 ) if( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1 )
layer = LAYER_CUIVRE_N; // Of course we select the copper layer layer = COPPER_LAYER_N; // Of course we select the copper layer
//otherwise, we select the requested layer only if it is possible //otherwise, we select the requested layer only if it is possible
if( layer != LAYER_CMP_N && layer >= m_Pcb->m_BoardSettings->m_CopperLayerCount - 1 ) if( layer != LAYER_CMP_N && layer >= m_Pcb->m_BoardSettings->m_CopperLayerCount - 1 )
return; return;
if( preslayer == layer ) if( preslayer == layer )
return; return;
...@@ -176,23 +176,27 @@ void WinEDA_BasePcbFrame::SwitchLayer( wxDC* DC, int layer ) ...@@ -176,23 +176,27 @@ void WinEDA_BasePcbFrame::SwitchLayer( wxDC* DC, int layer )
} }
/**********************************************************************/ /**********************************************************************/
void WinEDA_BasePcbFrame::ProcessItemSelection( wxCommandEvent& event ) void WinEDA_BasePcbFrame::ProcessItemSelection( wxCommandEvent& event )
/**********************************************************************/ /**********************************************************************/
{ {
int id = event.GetId(); int id = event.GetId();
// index into the collector list: // index into the collector list:
int itemNdx = id - ID_POPUP_PCB_ITEM_SELECTION_START; int itemNdx = id - ID_POPUP_PCB_ITEM_SELECTION_START;
BOARD_ITEM* item = (*m_Collector)[itemNdx]; if( (id >= ID_POPUP_PCB_ITEM_SELECTION_START)
&& (id <= ID_POPUP_PCB_ITEM_SELECTION_END) )
{
BOARD_ITEM* item = (*m_Collector)[itemNdx];
DrawPanel->m_AbortRequest = false;
#if defined(DEBUG) #if defined (DEBUG)
item->Show( 0, std::cout ); item->Show( 0, std::cout );
#endif #endif
SetCurItem( item ); SetCurItem( item );
}
} }
...@@ -202,12 +206,12 @@ void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem ) ...@@ -202,12 +206,12 @@ void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem )
{ {
m_CurrentScreen->SetCurItem( aItem ); m_CurrentScreen->SetCurItem( aItem );
if( aItem ) if( aItem )
aItem->Display_Infos(this); aItem->Display_Infos( this );
else else
{ {
// we can use either of these: // we can use either of these:
//MsgPanel->EraseMsgBox(); //MsgPanel->EraseMsgBox();
m_Pcb->Display_Infos(this); m_Pcb->Display_Infos( this );
} }
} }
...@@ -215,8 +219,8 @@ void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem ) ...@@ -215,8 +219,8 @@ void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem )
/*****************************************************************/ /*****************************************************************/
BOARD_ITEM* WinEDA_BasePcbFrame::GetCurItem() BOARD_ITEM* WinEDA_BasePcbFrame::GetCurItem()
/*****************************************************************/ /*****************************************************************/
{ {
return (BOARD_ITEM*) m_CurrentScreen->GetCurItem(); return (BOARD_ITEM*) m_CurrentScreen->GetCurItem();
} }
...@@ -224,8 +228,8 @@ BOARD_ITEM* WinEDA_BasePcbFrame::GetCurItem() ...@@ -224,8 +228,8 @@ BOARD_ITEM* WinEDA_BasePcbFrame::GetCurItem()
GENERAL_COLLECTORS_GUIDE WinEDA_BasePcbFrame::GetCollectorsGuide() GENERAL_COLLECTORS_GUIDE WinEDA_BasePcbFrame::GetCollectorsGuide()
/****************************************************************/ /****************************************************************/
{ {
GENERAL_COLLECTORS_GUIDE guide( m_Pcb->m_BoardSettings->GetVisibleLayers(), GENERAL_COLLECTORS_GUIDE guide( m_Pcb->m_BoardSettings->GetVisibleLayers(),
GetScreen()->m_Active_Layer ); GetScreen()->m_Active_Layer );
// account for the globals // account for the globals
guide.SetIgnoreMTextsMarkedNoShow( g_ModuleTextNOVColor & ITEM_NOT_SHOW ); guide.SetIgnoreMTextsMarkedNoShow( g_ModuleTextNOVColor & ITEM_NOT_SHOW );
......
...@@ -940,7 +940,7 @@ void WinEDA_BasePcbFrame::Block_Invert( wxDC* DC ) ...@@ -940,7 +940,7 @@ void WinEDA_BasePcbFrame::Block_Invert( wxDC* DC )
/* Redessin du Texte */ /* Redessin du Texte */
INVERT( STRUCT->m_Pos.y ); INVERT( STRUCT->m_Pos.y );
INVERT_ANGLE( STRUCT->m_Orient ); INVERT_ANGLE( STRUCT->m_Orient );
if( (STRUCT->GetLayer() == CUIVRE_N) || (STRUCT->GetLayer() == CMP_N) ) if( (STRUCT->GetLayer() == COPPER_LAYER_N) || (STRUCT->GetLayer() == CMP_N) )
{ {
STRUCT->m_Miroir ^= 1; /* inverse miroir */ STRUCT->m_Miroir ^= 1; /* inverse miroir */
} }
......
...@@ -646,7 +646,7 @@ const char* BOARD::ShowLayer( int aLayer ) ...@@ -646,7 +646,7 @@ const char* BOARD::ShowLayer( int aLayer )
switch( aLayer ) switch( aLayer )
{ {
case LAYER_CUIVRE_N: rs = "cu"; break; case LAYER_COPPER_LAYER_N: rs = "cu"; break;
case LAYER_N_2: rs = "layer2"; break; case LAYER_N_2: rs = "layer2"; break;
case LAYER_N_3: rs = "layer3"; break; case LAYER_N_3: rs = "layer3"; break;
case LAYER_N_4: rs = "layer4"; break; case LAYER_N_4: rs = "layer4"; break;
......
...@@ -750,7 +750,7 @@ int MODULE::ReadDescr( FILE* File, int* LineNum ) ...@@ -750,7 +750,7 @@ int MODULE::ReadDescr( FILE* File, int* LineNum )
else else
DrawText->m_NoShow = 0; DrawText->m_NoShow = 0;
if( layer == CUIVRE_N ) if( layer == COPPER_LAYER_N )
layer = SILKSCREEN_N_CU; layer = SILKSCREEN_N_CU;
else if( layer == CMP_N ) else if( layer == CMP_N )
layer = SILKSCREEN_N_CMP; layer = SILKSCREEN_N_CMP;
......
...@@ -99,8 +99,8 @@ int TEXTE_PCB::ReadTextePcbDescr( FILE* File, int* LineNum ) ...@@ -99,8 +99,8 @@ int TEXTE_PCB::ReadTextePcbDescr( FILE* File, int* LineNum )
{ {
sscanf( Line + 2, " %d %d %lX %d\n", &m_Layer, &m_Miroir, sscanf( Line + 2, " %d %d %lX %d\n", &m_Layer, &m_Miroir,
&m_TimeStamp, &dummy ); &m_TimeStamp, &dummy );
if( m_Layer < LAYER_CUIVRE_N ) if( m_Layer < COPPER_LAYER_N )
m_Layer = LAYER_CUIVRE_N; m_Layer = COPPER_LAYER_N;
if( m_Layer > LAST_NO_COPPER_LAYER ) if( m_Layer > LAST_NO_COPPER_LAYER )
m_Layer = LAST_NO_COPPER_LAYER; m_Layer = LAST_NO_COPPER_LAYER;
......
...@@ -49,7 +49,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) : ...@@ -49,7 +49,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
int moduleLayer = Module->GetLayer(); int moduleLayer = Module->GetLayer();
if( moduleLayer == CUIVRE_N ) if( moduleLayer == COPPER_LAYER_N )
SetLayer( SILKSCREEN_N_CU ); SetLayer( SILKSCREEN_N_CU );
else if( moduleLayer == CMP_N ) else if( moduleLayer == CMP_N )
SetLayer( SILKSCREEN_N_CMP ); SetLayer( SILKSCREEN_N_CMP );
...@@ -58,7 +58,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) : ...@@ -58,7 +58,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
if( moduleLayer == SILKSCREEN_N_CU if( moduleLayer == SILKSCREEN_N_CU
|| moduleLayer == ADHESIVE_N_CU || moduleLayer == ADHESIVE_N_CU
|| moduleLayer == CUIVRE_N ) || moduleLayer == COPPER_LAYER_N )
{ {
m_Miroir = 0; m_Miroir = 0;
} }
...@@ -257,7 +257,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int ...@@ -257,7 +257,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int
color = g_DesignSettings.m_LayerColor[Module->GetLayer()]; color = g_DesignSettings.m_LayerColor[Module->GetLayer()];
if( Module && Module->GetLayer() == CUIVRE_N ) if( Module && Module->GetLayer() == COPPER_LAYER_N )
color = g_ModuleTextCUColor; color = g_ModuleTextCUColor;
else if( Module && Module->GetLayer() == CMP_N ) else if( Module && Module->GetLayer() == CMP_N )
...@@ -381,7 +381,7 @@ bool TEXTE_MODULE::IsOnLayer( int aLayer ) const ...@@ -381,7 +381,7 @@ bool TEXTE_MODULE::IsOnLayer( int aLayer ) const
if( aLayer == GetParent()->GetLayer() ) if( aLayer == GetParent()->GetLayer() )
return true; return true;
if( aLayer == CUIVRE_N ) if( aLayer == COPPER_LAYER_N )
{ {
if( m_Layer==ADHESIVE_N_CU || m_Layer==SILKSCREEN_N_CU ) if( m_Layer==ADHESIVE_N_CU || m_Layer==SILKSCREEN_N_CU )
return true; return true;
......
...@@ -253,7 +253,7 @@ void SEGVIA::SetLayerPair( int top_layer, int bottom_layer ) ...@@ -253,7 +253,7 @@ void SEGVIA::SetLayerPair( int top_layer, int bottom_layer )
if( via_type == VIA_NORMALE ) if( via_type == VIA_NORMALE )
{ {
top_layer = LAYER_CMP_N; top_layer = LAYER_CMP_N;
bottom_layer = LAYER_CUIVRE_N; bottom_layer = COPPER_LAYER_N;
} }
if( bottom_layer > top_layer ) if( bottom_layer > top_layer )
...@@ -263,9 +263,9 @@ void SEGVIA::SetLayerPair( int top_layer, int bottom_layer ) ...@@ -263,9 +263,9 @@ void SEGVIA::SetLayerPair( int top_layer, int bottom_layer )
} }
/***************************************************************/ /*********************************************************************/
void SEGVIA::ReturnLayerPair( int* top_layer, int* bottom_layer ) const void SEGVIA::ReturnLayerPair( int* top_layer, int* bottom_layer ) const
/***************************************************************/ /*********************************************************************/
/* Retourne les 2 couches limitant la via /* Retourne les 2 couches limitant la via
* les pointeurs top_layer et bottom_layer peuvent etre NULLs * les pointeurs top_layer et bottom_layer peuvent etre NULLs
......
...@@ -360,9 +360,9 @@ void PCB_SCREEN::Init() ...@@ -360,9 +360,9 @@ void PCB_SCREEN::Init()
/*************************/ /*************************/
{ {
InitDatas(); InitDatas();
m_Active_Layer = CUIVRE_N; /* ref couche active 0.. 31 */ m_Active_Layer = COPPER_LAYER_N; /* ref couche active 0.. 31 */
m_Route_Layer_TOP = CMP_N; /* ref couches par defaut pour vias (Cu.. Cmp) */ m_Route_Layer_TOP = CMP_N; /* ref couches par defaut pour vias (Cu.. Cmp) */
m_Route_Layer_BOTTOM = CUIVRE_N; m_Route_Layer_BOTTOM = COPPER_LAYER_N;
m_Zoom = 128; /* valeur */ m_Zoom = 128; /* valeur */
m_Grid = wxSize( 500, 500 ); /* pas de la grille en 1/10000 "*/ m_Grid = wxSize( 500, 500 ); /* pas de la grille en 1/10000 "*/
} }
......
...@@ -82,7 +82,7 @@ void SEGVIA::SetLayerPair( int top_layer, int bottom_layer ) ...@@ -82,7 +82,7 @@ void SEGVIA::SetLayerPair( int top_layer, int bottom_layer )
if( via_type == VIA_NORMALE ) if( via_type == VIA_NORMALE )
{ {
top_layer = LAYER_CMP_N; bottom_layer = LAYER_CUIVRE_N; top_layer = LAYER_CMP_N; bottom_layer = LAYER_COPPER_LAYER_N;
} }
if( bottom_layer > top_layer ) if( bottom_layer > top_layer )
......
...@@ -205,7 +205,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* ...@@ -205,7 +205,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
if( module ) if( module )
{ {
if( m_Guide->IgnoreMTextsOnCopper() && module->GetLayer()==LAYER_CUIVRE_N ) if( m_Guide->IgnoreMTextsOnCopper() && module->GetLayer()==COPPER_LAYER_N )
goto exit; goto exit;
if( m_Guide->IgnoreMTextsOnCmp() && module->GetLayer()==LAYER_CMP_N ) if( m_Guide->IgnoreMTextsOnCmp() && module->GetLayer()==LAYER_CMP_N )
...@@ -225,7 +225,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* ...@@ -225,7 +225,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
if( module ) // true from case TYPEPAD, TYPETEXTEMODULE, or TYPEMODULE if( module ) // true from case TYPEPAD, TYPETEXTEMODULE, or TYPEMODULE
{ {
if( m_Guide->IgnoreModulesOnCu() && module->GetLayer()==LAYER_CUIVRE_N ) if( m_Guide->IgnoreModulesOnCu() && module->GetLayer()==COPPER_LAYER_N )
goto exit; goto exit;
if( m_Guide->IgnoreModulesOnCmp() && module->GetLayer()==LAYER_CMP_N ) if( m_Guide->IgnoreModulesOnCmp() && module->GetLayer()==LAYER_CMP_N )
......
...@@ -70,7 +70,7 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode ) ...@@ -70,7 +70,7 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode )
// Assign to scanList the proper item types desired based on tool type // Assign to scanList the proper item types desired based on tool type
// or hotkey that is in play. // or hotkey that is in play.
const KICAD_T* scanList; const KICAD_T* scanList = NULL;
if( aHotKeyCode ) if( aHotKeyCode )
{ {
...@@ -170,7 +170,16 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode ) ...@@ -170,7 +170,16 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode )
{ {
wxMenu itemMenu; wxMenu itemMenu;
itemMenu.SetTitle( _( "Selection Clarification" ) ); // does this work? not under Linux! /* Give a title to the selection menu. This is also a cancel menu item */
wxMenuItem * item_title = new wxMenuItem(&itemMenu, -1, _( "Selection Clarification" ) );
#ifdef __WINDOWS__
wxFont bold_font(*wxNORMAL_FONT);
bold_font.SetWeight(wxFONTWEIGHT_BOLD);
bold_font.SetStyle( wxFONTSTYLE_ITALIC);
item_title->SetFont(bold_font);
#endif
itemMenu.Append(item_title);
itemMenu.AppendSeparator();
int limit = MIN( MAX_ITEMS_IN_PICKER, m_Collector->GetCount() ); int limit = MIN( MAX_ITEMS_IN_PICKER, m_Collector->GetCount() );
...@@ -197,7 +206,8 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode ) ...@@ -197,7 +206,8 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode )
// this menu's handler is void WinEDA_BasePcbFrame::ProcessItemSelection() // this menu's handler is void WinEDA_BasePcbFrame::ProcessItemSelection()
// and it calls SetCurItem() which in turn calls Display_Infos() on the item. // and it calls SetCurItem() which in turn calls Display_Infos() on the item.
PopupMenu( &itemMenu ); DrawPanel->m_AbortRequest = true; // changed in false if an item
PopupMenu( &itemMenu ); // m_AbortRequest = false if an item is selected
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
......
...@@ -25,7 +25,7 @@ void RemoteCommand( const char* cmdline ) ...@@ -25,7 +25,7 @@ void RemoteCommand( const char* cmdline )
* @param cmdline = received command from eeschema * @param cmdline = received command from eeschema
* Commands are * Commands are
* $PART: "reference" put cursor on component * $PART: "reference" put cursor on component
* $PIN: "pin name" $PART: "reference" put cursor on the footprint pin * $PIN: "pin name" $PART: "reference" put cursor on the footprint pin
*/ */
{ {
char line[1024]; char line[1024];
...@@ -119,11 +119,12 @@ void RemoteCommand( const char* cmdline ) ...@@ -119,11 +119,12 @@ void RemoteCommand( const char* cmdline )
/**************************************************************************/ /**************************************************************************/
void WinEDA_PcbFrame::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync ) void WinEDA_PcbFrame::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync )
/**************************************************************************/ /**************************************************************************/
/** Send a remote command to eeschema via a socket, /** Send a remote command to eeschema via a socket,
* @param objectToSync = item to be located on schematic (module, pin or text) * @param objectToSync = item to be located on schematic (module, pin or text)
* Commands are * Commands are
* $PART: "reference" put cursor on component anchor * $PART: "reference" put cursor on component anchor
* $PART: "reference" $PAD: "pad number" put cursor on the component pin * $PART: "reference" $PAD: "pad number" put cursor on the component pin
* $PART: "reference" $REF: "reference" put cursor on the component ref * $PART: "reference" $REF: "reference" put cursor on the component ref
* $PART: "reference" $VAL: "value" put cursor on the component value * $PART: "reference" $VAL: "value" put cursor on the component value
*/ */
...@@ -182,4 +183,3 @@ void WinEDA_PcbFrame::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync ) ...@@ -182,4 +183,3 @@ void WinEDA_PcbFrame::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync )
SendCommand( MSG_TO_SCH, cmd ); SendCommand( MSG_TO_SCH, cmd );
} }
} }
...@@ -233,7 +233,7 @@ void WinEDA_ModulePropertiesFrame::BuildPanelModuleProperties( bool FullOptions ...@@ -233,7 +233,7 @@ void WinEDA_ModulePropertiesFrame::BuildPanelModuleProperties( bool FullOptions
wxString layer_list[2] = { _( "Component" ), _( "Copper" ) }; wxString layer_list[2] = { _( "Component" ), _( "Copper" ) };
m_LayerCtrl = new wxRadioBox( m_PanelProperties, -1, _( "Layer" ), wxDefaultPosition, m_LayerCtrl = new wxRadioBox( m_PanelProperties, -1, _( "Layer" ), wxDefaultPosition,
wxSize( -1, -1 ), 2, layer_list, 1 ); wxSize( -1, -1 ), 2, layer_list, 1 );
m_LayerCtrl->SetSelection( (m_CurrentModule->GetLayer() == CUIVRE_N) ? 1 : 0 ); m_LayerCtrl->SetSelection( (m_CurrentModule->GetLayer() == COPPER_LAYER_N) ? 1 : 0 );
PropLeftSizer->Add( m_LayerCtrl, 0, wxGROW | wxALL, 5 ); PropLeftSizer->Add( m_LayerCtrl, 0, wxGROW | wxALL, 5 );
bool select = FALSE; bool select = FALSE;
...@@ -515,7 +515,7 @@ void WinEDA_ModulePropertiesFrame::OnOkClick( wxCommandEvent& event ) ...@@ -515,7 +515,7 @@ void WinEDA_ModulePropertiesFrame::OnOkClick( wxCommandEvent& event )
{ {
if( m_LayerCtrl->GetSelection() == 0 ) // layer req = COMPONENT if( m_LayerCtrl->GetSelection() == 0 ) // layer req = COMPONENT
{ {
if( m_CurrentModule->GetLayer() == CUIVRE_N ) if( m_CurrentModule->GetLayer() == COPPER_LAYER_N )
change_layer = TRUE; change_layer = TRUE;
} }
else if( m_CurrentModule->GetLayer() == CMP_N ) else if( m_CurrentModule->GetLayer() == CMP_N )
......
...@@ -194,11 +194,11 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Layer( EDGE_MODULE* Edge, wxDC* DC ) ...@@ -194,11 +194,11 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Layer( EDGE_MODULE* Edge, wxDC* DC )
/* Ask for the new layer */ /* Ask for the new layer */
new_layer = SelectLayer( new_layer, LAYER_CUIVRE_N, LAST_NO_COPPER_LAYER ); new_layer = SelectLayer( new_layer, COPPER_LAYER_N, LAST_NO_COPPER_LAYER );
if( new_layer < 0 ) if( new_layer < 0 )
return; return;
if ( new_layer >= LAYER_CUIVRE_N && new_layer <= LAYER_CMP_N ) if ( new_layer >= COPPER_LAYER_N && new_layer <= LAYER_CMP_N )
/* an edge is put on a copper layer, and it is very dangerous. a confirmation is requested */ /* an edge is put on a copper layer, and it is very dangerous. a confirmation is requested */
{ {
if ( ! IsOK(this, _("The graphic item will be on a copper layer.It is very dangerous. Are you sure") ) ) if ( ! IsOK(this, _("The graphic item will be on a copper layer.It is very dangerous. Are you sure") ) )
...@@ -364,7 +364,7 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge, ...@@ -364,7 +364,7 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge,
Edge->SetLayer( Module->GetLayer() ); Edge->SetLayer( Module->GetLayer() );
if( Module->GetLayer() == CMP_N ) if( Module->GetLayer() == CMP_N )
Edge->SetLayer( SILKSCREEN_N_CMP ); Edge->SetLayer( SILKSCREEN_N_CMP );
if( Module->GetLayer() == CUIVRE_N ) if( Module->GetLayer() == COPPER_LAYER_N )
Edge->SetLayer( SILKSCREEN_N_CU ); Edge->SetLayer( SILKSCREEN_N_CU );
/* Initialise the starting point of the new segment or arc */ /* Initialise the starting point of the new segment or arc */
Edge->m_Start = GetScreen()->m_Curseur; Edge->m_Start = GetScreen()->m_Curseur;
......
...@@ -551,8 +551,12 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -551,8 +551,12 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_DRAG_PAD_REQUEST: case ID_POPUP_PCB_DRAG_PAD_REQUEST:
g_Drag_Pistes_On = TRUE; g_Drag_Pistes_On = TRUE;
DrawPanel->MouseToCursorSchema();
StartMovePad( (D_PAD*) GetCurItem(), &dc );
break;
case ID_POPUP_PCB_MOVE_PAD_REQUEST: case ID_POPUP_PCB_MOVE_PAD_REQUEST:
g_Drag_Pistes_On = false;
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
StartMovePad( (D_PAD*) GetCurItem(), &dc ); StartMovePad( (D_PAD*) GetCurItem(), &dc );
break; break;
...@@ -982,8 +986,8 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer ) ...@@ -982,8 +986,8 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
if( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1 ) if( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1 )
return; return;
//otherwise, must be at least 2 layers..see if it is possible. //otherwise, must be at least 2 layers. see if it is possible.
if( layer == LAYER_CUIVRE_N || layer == LAYER_CMP_N if( layer == COPPER_LAYER_N || layer == LAYER_CMP_N
|| layer < m_Pcb->m_BoardSettings->m_CopperLayerCount - 1 ) || layer < m_Pcb->m_BoardSettings->m_CopperLayerCount - 1 )
{ {
if( preslayer == layer ) if( preslayer == layer )
......
...@@ -246,7 +246,7 @@ void WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC ) ...@@ -246,7 +246,7 @@ void WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
else else
{ {
// Usual via is from copper to component; layer pair is 0 and 0x0F. // Usual via is from copper to component; layer pair is 0 and 0x0F.
Via->SetLayerPair( LAYER_CUIVRE_N, LAYER_CMP_N ); Via->SetLayerPair( COPPER_LAYER_N, LAYER_CMP_N );
} }
if( Drc_On &&( Drc( this, DC, Via, m_Pcb->m_Track, 1 ) == BAD_DRC ) ) if( Drc_On &&( Drc( this, DC, Via, m_Pcb->m_Track, 1 ) == BAD_DRC ) )
......
...@@ -101,7 +101,7 @@ void WinEDA_PcbFrame::ExportToGenCAD( wxCommandEvent& event ) ...@@ -101,7 +101,7 @@ void WinEDA_PcbFrame::ExportToGenCAD( wxCommandEvent& event )
for( module = m_Pcb->m_Modules; module != NULL; module = module->Next() ) for( module = m_Pcb->m_Modules; module != NULL; module = module->Next() )
{ {
module->flag = 0; module->flag = 0;
if( module->GetLayer() == CUIVRE_N ) if( module->GetLayer() == COPPER_LAYER_N )
{ {
Change_Side_Module( module, NULL ); Change_Side_Module( module, NULL );
module->flag = 1; module->flag = 1;
......
...@@ -66,7 +66,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event ) ...@@ -66,7 +66,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
continue; continue;
if( (Module->m_Attributs & MOD_CMS) == 0 ) if( (Module->m_Attributs & MOD_CMS) == 0 )
continue; continue;
if( Module->GetLayer() == CUIVRE_N ) if( Module->GetLayer() == COPPER_LAYER_N )
GenCu = TRUE; GenCu = TRUE;
NbMod++; NbMod++;
} }
...@@ -193,7 +193,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event ) ...@@ -193,7 +193,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
strcat( Line, "Cmp.\n" ); strcat( Line, "Cmp.\n" );
fputs( Line, LayerCmp ); fputs( Line, LayerCmp );
} }
else if( Liste[ii].m_Module->GetLayer() == CUIVRE_N ) else if( Liste[ii].m_Module->GetLayer() == COPPER_LAYER_N )
{ {
strcat( Line, "Cu\n" ); strcat( Line, "Cu\n" );
fputs( Line, LayerCu ); fputs( Line, LayerCu );
...@@ -317,7 +317,7 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event ) ...@@ -317,7 +317,7 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
sprintf( Line, "orientation %.2f\n", (float) Module->m_Orient / 10 ); sprintf( Line, "orientation %.2f\n", (float) Module->m_Orient / 10 );
if( Module->GetLayer() == CMP_N ) if( Module->GetLayer() == CMP_N )
strcat( Line, "layer component\n" ); strcat( Line, "layer component\n" );
else if( Module->GetLayer() == CUIVRE_N ) else if( Module->GetLayer() == COPPER_LAYER_N )
strcat( Line, "layer copper\n" ); strcat( Line, "layer copper\n" );
else else
strcat( Line, "layer other\n" ); strcat( Line, "layer other\n" );
......
...@@ -204,13 +204,13 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -204,13 +204,13 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
ll = GetScreen()->m_Active_Layer; ll = GetScreen()->m_Active_Layer;
if( ll > CMP_N ) if( ll > CMP_N )
break; break;
if( ll <= CUIVRE_N ) if( ll <= COPPER_LAYER_N )
break; break;
if( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1 ) // Single layer if( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1 ) // Single layer
ll = CUIVRE_N; ll = COPPER_LAYER_N;
if( ll == CMP_N ) if( ll == CMP_N )
ll = MAX( CUIVRE_N, m_Pcb->m_BoardSettings->m_CopperLayerCount - 2 ); ll = MAX( COPPER_LAYER_N, m_Pcb->m_BoardSettings->m_CopperLayerCount - 2 );
else if( ll > CUIVRE_N ) else if( ll > COPPER_LAYER_N )
ll--; ll--;
SwitchLayer( DC, ll ); SwitchLayer( DC, ll );
break; break;
...@@ -223,7 +223,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -223,7 +223,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
if( ll >= m_Pcb->m_BoardSettings->m_CopperLayerCount - 1 ) if( ll >= m_Pcb->m_BoardSettings->m_CopperLayerCount - 1 )
ll = CMP_N; ll = CMP_N;
if( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1 ) // Single layer if( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1 ) // Single layer
ll = CUIVRE_N; ll = COPPER_LAYER_N;
SwitchLayer( DC, ll ); SwitchLayer( DC, ll );
break; break;
...@@ -232,7 +232,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -232,7 +232,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_SWITCH_LAYER_TO_COPPER: case HK_SWITCH_LAYER_TO_COPPER:
SwitchLayer( DC, CUIVRE_N ); SwitchLayer( DC, COPPER_LAYER_N );
break; break;
case HK_SWITCH_LAYER_TO_INNER1: case HK_SWITCH_LAYER_TO_INNER1:
......
...@@ -176,7 +176,7 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -176,7 +176,7 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC,
/* draw footprint graphic shapes */ /* draw footprint graphic shapes */
PtStruct = Module->m_Drawings; PtStruct = Module->m_Drawings;
mlayer = g_TabOneLayerMask[Module->GetLayer()]; mlayer = g_TabOneLayerMask[Module->GetLayer()];
if( Module->GetLayer() == CUIVRE_N ) if( Module->GetLayer() == COPPER_LAYER_N )
mlayer = SILKSCREEN_LAYER_CU; mlayer = SILKSCREEN_LAYER_CU;
else if( Module->GetLayer() == CMP_N ) else if( Module->GetLayer() == CMP_N )
mlayer = SILKSCREEN_LAYER_CMP; mlayer = SILKSCREEN_LAYER_CMP;
......
...@@ -164,7 +164,7 @@ BOARD_ITEM* WinEDA_BasePcbFrame::Locate( int typeloc, int LayerSearch ) ...@@ -164,7 +164,7 @@ BOARD_ITEM* WinEDA_BasePcbFrame::Locate( int typeloc, int LayerSearch )
// Priority to the active layer (component or copper). // Priority to the active layer (component or copper).
// This is useful for small smd components when 2 texts overlap but are not // This is useful for small smd components when 2 texts overlap but are not
// on the same layer // on the same layer
if( LayerSearch == LAYER_CUIVRE_N || LayerSearch == CMP_N ) if( LayerSearch == COPPER_LAYER_N || LayerSearch == LAYER_CMP_N )
{ {
MODULE* module = m_Pcb->m_Modules; MODULE* module = m_Pcb->m_Modules;
for( ; module != NULL; module = (MODULE*) module->Pnext ) for( ; module != NULL; module = (MODULE*) module->Pnext )
...@@ -525,7 +525,7 @@ MODULE* Locate_Prefered_Module( BOARD* Pcb, int typeloc ) ...@@ -525,7 +525,7 @@ MODULE* Locate_Prefered_Module( BOARD* Pcb, int typeloc )
layer = pt_module->GetLayer(); layer = pt_module->GetLayer();
if( layer==ADHESIVE_N_CU || layer==SILKSCREEN_N_CU ) if( layer==ADHESIVE_N_CU || layer==SILKSCREEN_N_CU )
layer = CUIVRE_N; layer = COPPER_LAYER_N;
else if( layer==ADHESIVE_N_CMP || layer==SILKSCREEN_N_CMP ) else if( layer==ADHESIVE_N_CMP || layer==SILKSCREEN_N_CMP )
layer = CMP_N; layer = CMP_N;
...@@ -605,7 +605,7 @@ TEXTE_MODULE* LocateTexteModule( BOARD* Pcb, MODULE** PtModule, int typeloc ) ...@@ -605,7 +605,7 @@ TEXTE_MODULE* LocateTexteModule( BOARD* Pcb, MODULE** PtModule, int typeloc )
{ {
int layer = module->GetLayer(); int layer = module->GetLayer();
if( layer==ADHESIVE_N_CU || layer==SILKSCREEN_N_CU ) if( layer==ADHESIVE_N_CU || layer==SILKSCREEN_N_CU )
layer = CUIVRE_N; layer = COPPER_LAYER_N;
else if( layer==ADHESIVE_N_CMP || layer==SILKSCREEN_N_CMP ) else if( layer==ADHESIVE_N_CMP || layer==SILKSCREEN_N_CMP )
layer = CMP_N; layer = CMP_N;
......
...@@ -173,7 +173,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -173,7 +173,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
/*********************************************************************/ /*********************************************************************/
void WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
wxMenu* PopMenu ) wxMenu* PopMenu )
/*********************************************************************/ /*********************************************************************/
...@@ -238,7 +238,7 @@ void WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, ...@@ -238,7 +238,7 @@ void WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
} }
if( DrawStruct == NULL ) if( DrawStruct == NULL )
return; return true;
int flags = DrawStruct->m_Flags; int flags = DrawStruct->m_Flags;
...@@ -367,6 +367,8 @@ void WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, ...@@ -367,6 +367,8 @@ void WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
_( "Set Width" ), width_segment_xpm ); _( "Set Width" ), width_segment_xpm );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
} }
return true;
} }
......
...@@ -337,7 +337,7 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC ) ...@@ -337,7 +337,7 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC )
if( Module == NULL ) if( Module == NULL )
return; return;
if( (Module->GetLayer() != CMP_N) && (Module->GetLayer() != CUIVRE_N) ) if( (Module->GetLayer() != CMP_N) && (Module->GetLayer() != COPPER_LAYER_N) )
return; return;
m_CurrentScreen->SetModify(); m_CurrentScreen->SetModify();
...@@ -400,14 +400,14 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC ) ...@@ -400,14 +400,14 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC )
pt_texte->SetLayer( Module->GetLayer() ); pt_texte->SetLayer( Module->GetLayer() );
pt_texte->SetLayer( ChangeSideNumLayer( pt_texte->GetLayer() ) ); pt_texte->SetLayer( ChangeSideNumLayer( pt_texte->GetLayer() ) );
if( Module->GetLayer() == CUIVRE_N ) if( Module->GetLayer() == COPPER_LAYER_N )
pt_texte->SetLayer( SILKSCREEN_N_CU ); pt_texte->SetLayer( SILKSCREEN_N_CU );
if( Module->GetLayer() == CMP_N ) if( Module->GetLayer() == CMP_N )
pt_texte->SetLayer( SILKSCREEN_N_CMP ); pt_texte->SetLayer( SILKSCREEN_N_CMP );
if( (Module->GetLayer() == SILKSCREEN_N_CU) if( (Module->GetLayer() == SILKSCREEN_N_CU)
|| (Module->GetLayer() == ADHESIVE_N_CU) || (Module->GetLayer() == CUIVRE_N) ) || (Module->GetLayer() == ADHESIVE_N_CU) || (Module->GetLayer() == COPPER_LAYER_N) )
pt_texte->m_Miroir = 0; pt_texte->m_Miroir = 0;
/* Inversion miroir de la Valeur et mise en miroir : */ /* Inversion miroir de la Valeur et mise en miroir : */
...@@ -421,14 +421,14 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC ) ...@@ -421,14 +421,14 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC )
pt_texte->SetLayer( Module->GetLayer() ); pt_texte->SetLayer( Module->GetLayer() );
pt_texte->SetLayer( ChangeSideNumLayer( pt_texte->GetLayer() ) ); pt_texte->SetLayer( ChangeSideNumLayer( pt_texte->GetLayer() ) );
if( Module->GetLayer() == CUIVRE_N ) if( Module->GetLayer() == COPPER_LAYER_N )
pt_texte->SetLayer( SILKSCREEN_N_CU ); pt_texte->SetLayer( SILKSCREEN_N_CU );
if( Module->GetLayer() == CMP_N ) if( Module->GetLayer() == CMP_N )
pt_texte->SetLayer( SILKSCREEN_N_CMP ); pt_texte->SetLayer( SILKSCREEN_N_CMP );
if( (Module->GetLayer() == SILKSCREEN_N_CU) if( (Module->GetLayer() == SILKSCREEN_N_CU)
|| (Module->GetLayer() == ADHESIVE_N_CU) || (Module->GetLayer() == CUIVRE_N) ) || (Module->GetLayer() == ADHESIVE_N_CU) || (Module->GetLayer() == COPPER_LAYER_N) )
pt_texte->m_Miroir = 0; pt_texte->m_Miroir = 0;
/* Inversion miroir des dessins de l'empreinte : */ /* Inversion miroir des dessins de l'empreinte : */
...@@ -469,7 +469,7 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC ) ...@@ -469,7 +469,7 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC )
pt_texte->SetLayer( Module->GetLayer() ); pt_texte->SetLayer( Module->GetLayer() );
pt_texte->SetLayer( ChangeSideNumLayer( pt_texte->GetLayer() ) ); pt_texte->SetLayer( ChangeSideNumLayer( pt_texte->GetLayer() ) );
if( Module->GetLayer() == CUIVRE_N ) if( Module->GetLayer() == COPPER_LAYER_N )
pt_texte->SetLayer( SILKSCREEN_N_CU ); pt_texte->SetLayer( SILKSCREEN_N_CU );
if( Module->GetLayer() == CMP_N ) if( Module->GetLayer() == CMP_N )
...@@ -477,7 +477,7 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC ) ...@@ -477,7 +477,7 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC )
if( Module->GetLayer() == SILKSCREEN_N_CU if( Module->GetLayer() == SILKSCREEN_N_CU
|| Module->GetLayer() == ADHESIVE_N_CU || Module->GetLayer() == ADHESIVE_N_CU
|| Module->GetLayer() == CUIVRE_N ) || Module->GetLayer() == COPPER_LAYER_N )
{ {
pt_texte->m_Miroir = 0; pt_texte->m_Miroir = 0;
} }
...@@ -580,11 +580,11 @@ int ChangeSideNumLayer( int oldlayer ) ...@@ -580,11 +580,11 @@ int ChangeSideNumLayer( int oldlayer )
switch( oldlayer ) switch( oldlayer )
{ {
case CUIVRE_N: case COPPER_LAYER_N:
newlayer = CMP_N; break; newlayer = CMP_N; break;
case CMP_N: case CMP_N:
newlayer = CUIVRE_N; break; newlayer = COPPER_LAYER_N; break;
case SILKSCREEN_N_CU: case SILKSCREEN_N_CU:
newlayer = SILKSCREEN_N_CMP; break; newlayer = SILKSCREEN_N_CMP; break;
......
...@@ -287,8 +287,11 @@ MODULE * Module; ...@@ -287,8 +287,11 @@ MODULE * Module;
Pad->m_Flags |= IS_MOVED; Pad->m_Flags |= IS_MOVED;
Pad->Draw(DrawPanel, DC, wxPoint(0,0),GR_XOR); Pad->Draw(DrawPanel, DC, wxPoint(0,0),GR_XOR);
/* Build the list of track segments to drag */ /* Build the list of track segments to drag if the command is a drag pad*/
Build_1_Pad_SegmentsToDrag(DrawPanel, DC, Pad); if ( g_Drag_Pistes_On )
Build_1_Pad_SegmentsToDrag(DrawPanel, DC, Pad);
else EraseDragListe();
} }
......
...@@ -108,13 +108,13 @@ static wxMenu* Append_Track_Width_List() ...@@ -108,13 +108,13 @@ static wxMenu* Append_Track_Width_List()
/******************************************************************************/ /******************************************************************************/
void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
/******************************************************************************/ /******************************************************************************/
{ {
wxString msg; wxString msg;
int flags = 0; int flags = 0;
bool locate_track = FALSE; bool locate_track = FALSE;
bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE); bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE);
wxClientDC dc( DrawPanel ); wxClientDC dc( DrawPanel );
...@@ -122,15 +122,16 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -122,15 +122,16 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
DrawPanel->m_CanStartBlock = -1; // Avoid to start a block coomand when clicking on menu DrawPanel->m_CanStartBlock = -1; // Avoid to start a block coomand when clicking on menu
// If command or block in progress: Put the Cancel command (if needed) and the End command
if( BlockActive ) // If a command or a block is in progress:
{ // Put the Cancel command (if needed) and the End command
createPopUpBlockMenu( aPopMenu );
if( BlockActive )
{
createPopUpBlockMenu( aPopMenu );
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
return; return true;
} }
DrawPanel->CursorOff( &dc ); DrawPanel->CursorOff( &dc );
...@@ -152,8 +153,8 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -152,8 +153,8 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{ {
if( item && item->m_Flags ) if( item && item->m_Flags )
{ {
ADD_MENUITEM( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, ADD_MENUITEM( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel" ), cancel_xpm ); _( "Cancel" ), cancel_xpm );
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
} }
} }
...@@ -162,7 +163,14 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -162,7 +163,14 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
/* Select a proper item */ /* Select a proper item */
if( !item || !item->m_Flags ) if( !item || !item->m_Flags )
{ {
DrawPanel->m_AbortRequest = false;
item = PcbGeneralLocateAndDisplay(); item = PcbGeneralLocateAndDisplay();
if( DrawPanel->m_AbortRequest )
{
DrawPanel->CursorOn( &dc );
return false;
}
SetCurItem( item ); SetCurItem( item );
} }
...@@ -182,20 +190,24 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -182,20 +190,24 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOPLACE ) if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOPLACE )
{ {
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
if( !((MODULE*)item)->IsLocked() ) if( !( (MODULE*) item )->IsLocked() )
{ {
msg = AddHotkeyName( _( "Lock Module" ), s_Board_Editor_Hokeys_Descr, HK_LOCK_UNLOCK_FOOTPRINT ); msg = AddHotkeyName( _(
"Lock Module" ), s_Board_Editor_Hokeys_Descr,
HK_LOCK_UNLOCK_FOOTPRINT );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, msg, ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, msg,
Locked_xpm ); Locked_xpm );
} }
else else
{ {
msg = AddHotkeyName( _( "Unlock Module" ), s_Board_Editor_Hokeys_Descr, HK_LOCK_UNLOCK_FOOTPRINT ); msg = AddHotkeyName( _(
"Unlock Module" ), s_Board_Editor_Hokeys_Descr,
HK_LOCK_UNLOCK_FOOTPRINT );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FREE_MODULE, msg, ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FREE_MODULE, msg,
Unlocked_xpm ); Unlocked_xpm );
} }
if( !flags ) if( !flags )
aPopMenu->Append( ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE, aPopMenu->Append( ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE,
_( "Auto place Module" ) ); _( "Auto place Module" ) );
...@@ -430,6 +442,7 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -430,6 +442,7 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
} }
DrawPanel->CursorOn( &dc ); DrawPanel->CursorOn( &dc );
return true;
} }
......
...@@ -147,7 +147,7 @@ bool inline IsModuleLayerVisible( int layer ) ...@@ -147,7 +147,7 @@ bool inline IsModuleLayerVisible( int layer )
if( layer==CMP_N ) if( layer==CMP_N )
return DisplayOpt.Show_Modules_Cmp; return DisplayOpt.Show_Modules_Cmp;
else if( layer==CUIVRE_N ) else if( layer==COPPER_LAYER_N )
return DisplayOpt.Show_Modules_Cu; return DisplayOpt.Show_Modules_Cu;
else else
......
...@@ -351,7 +351,7 @@ TEXTE_PCB* WinEDA_PcbFrame::Create_Texte_Pcb( wxDC* DC ) ...@@ -351,7 +351,7 @@ TEXTE_PCB* WinEDA_PcbFrame::Create_Texte_Pcb( wxDC* DC )
TextePcb->m_Flags = IS_NEW; TextePcb->m_Flags = IS_NEW;
TextePcb->SetLayer( GetScreen()->m_Active_Layer ); TextePcb->SetLayer( GetScreen()->m_Active_Layer );
TextePcb->m_Miroir = 1; TextePcb->m_Miroir = 1;
if( TextePcb->GetLayer() == CUIVRE_N ) if( TextePcb->GetLayer() == COPPER_LAYER_N )
TextePcb->m_Miroir = 0; TextePcb->m_Miroir = 0;
TextePcb->m_Size = g_DesignSettings.m_PcbTextSize; TextePcb->m_Size = g_DesignSettings.m_PcbTextSize;
......
...@@ -94,7 +94,7 @@ int tracevia = 1; ...@@ -94,7 +94,7 @@ int tracevia = 1;
switch(Layer) switch(Layer)
{ {
case CUIVRE_N : case COPPER_LAYER_N :
case LAYER_N_2 : case LAYER_N_2 :
case LAYER_N_3 : case LAYER_N_3 :
case LAYER_N_4 : case LAYER_N_4 :
......
...@@ -136,7 +136,7 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer ) ...@@ -136,7 +136,7 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer )
switch( Layer ) switch( Layer )
{ {
case CUIVRE_N: case COPPER_LAYER_N:
case LAYER_N_2: case LAYER_N_2:
case LAYER_N_3: case LAYER_N_3:
case LAYER_N_4: case LAYER_N_4:
......
...@@ -178,7 +178,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer ) ...@@ -178,7 +178,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer )
Plot_Layer_PS( dest, layer_mask, 0, 1, modetrace ); Plot_Layer_PS( dest, layer_mask, 0, 1, modetrace );
break; break;
case CUIVRE_N: case COPPER_LAYER_N:
case LAYER_N_2: case LAYER_N_2:
case LAYER_N_3: case LAYER_N_3:
case LAYER_N_4: case LAYER_N_4:
......
...@@ -392,7 +392,7 @@ static void GenExistantTracks( BOARD* Pcb, FILE* outfile, ...@@ -392,7 +392,7 @@ static void GenExistantTracks( BOARD* Pcb, FILE* outfile,
else else
via_max_layer++; via_max_layer++;
if( via_min_layer == CUIVRE_N ) if( via_min_layer == COPPER_LAYER_N )
via_min_layer = min_layer; via_min_layer = min_layer;
else else
via_min_layer++; via_min_layer++;
...@@ -615,7 +615,7 @@ void WinEDA_PcbFrame::ReadAutoroutedTracks( wxDC* DC ) ...@@ -615,7 +615,7 @@ void WinEDA_PcbFrame::ReadAutoroutedTracks( wxDC* DC )
case 'T': // Track list start: fmt = T image layer t_count case 'T': // Track list start: fmt = T image layer t_count
sscanf( Line + 2, "%d %d %d", &image, &track_layer, &track_count ); sscanf( Line + 2, "%d %d %d", &image, &track_layer, &track_count );
track_layer--; track_layer--;
if( (track_layer != CUIVRE_N) && (track_layer == max_layer - 1) ) if( (track_layer != COPPER_LAYER_N) && (track_layer == max_layer - 1) )
track_layer = CMP_N; track_layer = CMP_N;
// Read corners: fmt = C x_pos y_pos // Read corners: fmt = C x_pos y_pos
......
...@@ -53,8 +53,8 @@ static ColorButton Msg_Layers_Cu = ...@@ -53,8 +53,8 @@ static ColorButton Msg_Layers_Cu =
static ColorButton Layer_1_Butt = static ColorButton Layer_1_Butt =
{ {
wxEmptyString, wxEmptyString,
CUIVRE_N, /* Title */ COPPER_LAYER_N, /* Title */
ADR( CUIVRE_N ), /* adr du parametre optionnel */ ADR( COPPER_LAYER_N ), /* adr du parametre optionnel */
TRUE // toggle bit ITEM_NOT_SHOW of the color variable TRUE // toggle bit ITEM_NOT_SHOW of the color variable
}; };
......
...@@ -129,7 +129,7 @@ void WinEDA_PcbFrame::Trace_Pcb( wxDC* DC, int mode ) ...@@ -129,7 +129,7 @@ void WinEDA_PcbFrame::Trace_Pcb( wxDC* DC, int mode )
} }
if( !DisplayOpt.Show_Modules_Cu ) if( !DisplayOpt.Show_Modules_Cu )
{ {
if( Module->GetLayer() == CUIVRE_N ) if( Module->GetLayer() == COPPER_LAYER_N )
display = FALSE; display = FALSE;
MaskLay &= ~CUIVRE_LAYER; MaskLay &= ~CUIVRE_LAYER;
} }
......
...@@ -688,10 +688,11 @@ void WinEDA_DrawPanel::m_Draw_Auxiliary_Axis( wxDC* DC, int drawmode ) ...@@ -688,10 +688,11 @@ void WinEDA_DrawPanel::m_Draw_Auxiliary_Axis( wxDC* DC, int drawmode )
/*******************************************************/ /*******************************************************/
void WinEDA_DrawPanel::OnRightClick( wxMouseEvent& event ) bool WinEDA_DrawPanel::OnRightClick( wxMouseEvent& event )
/*******************************************************/ /*******************************************************/
/* Build and display a Popup menu on a right mouse button click /** Build and display a Popup menu on a right mouse button click
* @return true if a popup menu is shown, or false
*/ */
{ {
wxPoint pos; wxPoint pos;
...@@ -700,7 +701,8 @@ void WinEDA_DrawPanel::OnRightClick( wxMouseEvent& event ) ...@@ -700,7 +701,8 @@ void WinEDA_DrawPanel::OnRightClick( wxMouseEvent& event )
pos.x = event.GetX(); pos.x = event.GetX();
pos.y = event.GetY(); pos.y = event.GetY();
m_Parent->OnRightClick( pos, &MasterMenu ); if ( ! m_Parent->OnRightClick( pos, &MasterMenu ) )
return false;
AddMenuZoom( &MasterMenu ); AddMenuZoom( &MasterMenu );
...@@ -708,6 +710,8 @@ void WinEDA_DrawPanel::OnRightClick( wxMouseEvent& event ) ...@@ -708,6 +710,8 @@ void WinEDA_DrawPanel::OnRightClick( wxMouseEvent& event )
PopupMenu( &MasterMenu, pos ); PopupMenu( &MasterMenu, pos );
MouseToCursorSchema(); MouseToCursorSchema();
m_IgnoreMouseEvents = FALSE; m_IgnoreMouseEvents = FALSE;
return true;
} }
......
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