Added text justification for graphic texts in libedit and more(see changelog)

This commit is contained in:
charras 2009-06-11 14:26:17 +00:00
parent a56c02e94b
commit f43d1aaa54
45 changed files with 1652 additions and 1170 deletions

View File

@ -4,6 +4,15 @@ KiCad ChangeLog 2009
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.
2009-june-11 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++Eeschema:
Added text justification for graphic texts in libedit
Minor bug 2803506 fixed (error when mirroring bus entries)
Some code cleaning.
Better locating algo for arcs in libedit
2009-may-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> 2009-may-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================ ================================================================================
++Eeschema: ++Eeschema:

View File

@ -250,8 +250,8 @@ EDA_Rect EDA_TextStruct::GetTextBox( int aLine )
rect.SetSize( textsize ); rect.SetSize( textsize );
/* Now, calculate the rect origin, according to text justification /* Now, calculate the rect origin, according to text justification
* At this point the area origin is the text origin (m_Pos). * At this point the rectangle origin is the text origin (m_Pos).
* This is true only for left and top text justified texts. * This is true only for left and top text justified texts (using top to bottom Y axis orientation).
* and must be recalculated for others justifications * and must be recalculated for others justifications
* also, note the V justification is relative to the first line * also, note the V justification is relative to the first line
*/ */
@ -290,13 +290,14 @@ EDA_Rect EDA_TextStruct::GetTextBox( int aLine )
/*************************************************/ /*************************************************/
bool EDA_TextStruct::HitTest( const wxPoint& posref ) bool EDA_TextStruct::TextHitTest( const wxPoint& posref )
/*************************************************/ /*************************************************/
/* locate function /**
* return: * Function TextHitTest (overlayed)
* true if posref is inside the text area. * tests if the given point is inside this object.
* false else. * @param posref point to test
* @return bool - true if a hit, else false
*/ */
{ {
EDA_Rect rect = GetTextBox( -1 ); // Get the full text area. EDA_Rect rect = GetTextBox( -1 ); // Get the full text area.
@ -310,13 +311,13 @@ bool EDA_TextStruct::HitTest( const wxPoint& posref )
/** /**
* Function HitTest (overlayed) * Function TextHitTest (overlayed)
* tests if the given EDA_Rect intersect this object. * tests if the given EDA_Rect intersect this object.
* @param refArea the given EDA_Rect to test * @param refArea the given EDA_Rect to test
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
/*********************************************************/ /*********************************************************/
bool EDA_TextStruct::HitTest( EDA_Rect& refArea ) bool EDA_TextStruct::TextHitTest( EDA_Rect& refArea )
/*********************************************************/ /*********************************************************/
{ {
if( refArea.Inside( m_Pos ) ) if( refArea.Inside( m_Pos ) )

View File

@ -620,7 +620,7 @@ bool MoveStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM* DrawStruct )
static void MirrorYPoint( wxPoint& point, wxPoint& Center ) static void MirrorYPoint( wxPoint& point, wxPoint& Center )
{ {
point.x -= Center.x; point.x -= Center.x;
point.x = -point.x; NEGATE(point.x);
point.x += Center.x; point.x += Center.x;
} }
@ -683,6 +683,7 @@ void MirrorOneStruct( SCH_ITEM* DrawStruct, wxPoint& Center )
case DRAW_BUSENTRY_STRUCT_TYPE: case DRAW_BUSENTRY_STRUCT_TYPE:
DrawRaccord = (DrawBusEntryStruct*) DrawStruct; DrawRaccord = (DrawBusEntryStruct*) DrawStruct;
MirrorYPoint( DrawRaccord->m_Pos, Center ); MirrorYPoint( DrawRaccord->m_Pos, Center );
NEGATE(DrawRaccord->m_Size.x);
break; break;
case DRAW_JUNCTION_STRUCT_TYPE: case DRAW_JUNCTION_STRUCT_TYPE:

View File

@ -254,44 +254,24 @@ void LibDrawField::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
*/ */
bool LibDrawField::HitTest( const wxPoint& refPos ) bool LibDrawField::HitTest( const wxPoint& refPos )
{ {
EDA_Rect bbox; // bounding box for the text
int dx; // X size for the full text
bbox.SetOrigin( m_Pos );
dx = m_Size.x * m_Text.Len();
// Reference designator text has one additional character (displays U?) // Reference designator text has one additional character (displays U?)
if( m_FieldId == REFERENCE ) if( m_FieldId == REFERENCE )
dx += m_Size.x; m_Text.Append('?');
// if using TextHitTest() remember this function uses top to bottom y axis convention
// and for lib items we are using bottom to top convention
// so for non center Y justification we use a trick.
GRTextVertJustifyType vJustify = m_VJustify;
if ( m_VJustify == GR_TEXT_VJUSTIFY_TOP )
m_VJustify = GR_TEXT_VJUSTIFY_BOTTOM;
else if ( m_VJustify == GR_TEXT_VJUSTIFY_BOTTOM )
m_VJustify = GR_TEXT_VJUSTIFY_TOP;
// spacing between characters is 0.1 the character size bool hit = TextHitTest(refPos);
dx = (int) ( (double) dx * 10.0 / 9 ); m_VJustify = vJustify;
int dy = m_Size.y;
if( m_Orient ) if( m_FieldId == REFERENCE )
EXCHG( dx, dy ); // Swap X and Y size for a vertical text m_Text.RemoveLast( );
return hit;
// adjust position of the left bottom corner according to the justification
// pos is at this point correct for a left and top justified text
// Horizontal justification
if( m_HJustify == GR_TEXT_HJUSTIFY_CENTER )
bbox.Offset( -dx / 2, 0 );
else if( m_HJustify == GR_TEXT_HJUSTIFY_RIGHT )
bbox.Offset( -dx, 0 );
// Vertical justification
if( m_VJustify == GR_TEXT_VJUSTIFY_CENTER )
bbox.Offset( 0, -dy / 2 );
else if( m_VJustify == GR_TEXT_VJUSTIFY_TOP )
bbox.Offset( 0, -dy );
bbox.SetSize( dx, dy );
if( bbox.Inside( refPos ) )
return true;
return false;
} }

View File

@ -59,7 +59,16 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) m_Parent; SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) m_Parent;
GRTextHorizJustifyType hjustify; GRTextHorizJustifyType hjustify;
GRTextVertJustifyType vjustify; GRTextVertJustifyType vjustify;
int LineWidth = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width; int LineWidth = m_Width;
if (LineWidth == 0) // Use default values for pen size
{
if ( m_Bold )
LineWidth = GetPenSizeForBold( m_Size.x );
else
LineWidth = g_DrawDefaultLineThickness;
}
// Clip pen size for small texts: // Clip pen size for small texts:
LineWidth = Clamp_Text_PenSize( LineWidth, m_Size, m_Bold ); LineWidth = Clamp_Text_PenSize( LineWidth, m_Size, m_Bold );
@ -153,7 +162,7 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
DrawGraphicText( panel, DC, pos, color, m_Text, DrawGraphicText( panel, DC, pos, color, m_Text,
orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
m_Size, hjustify, vjustify, LineWidth, m_Italic, m_Bold, false ); m_Size, hjustify, vjustify, LineWidth, m_Italic, m_Bold );
} }
else else
{ {

View File

@ -95,7 +95,7 @@ SCH_TEXT::SCH_TEXT( const wxPoint& pos, const wxString& text, KICAD_T aType ) :
*/ */
bool SCH_TEXT::HitTest( const wxPoint& aPosRef ) bool SCH_TEXT::HitTest( const wxPoint& aPosRef )
{ {
return EDA_TextStruct::HitTest( aPosRef ); return TextHitTest( aPosRef );
} }

View File

@ -83,6 +83,11 @@ void LibEDA_BaseStruct::DisplayInfo( WinEDA_DrawFrame* frame )
} }
/**********************/
/** class LibDrawArc **/
/**********************/
LibDrawArc::LibDrawArc() : LibEDA_BaseStruct( COMPONENT_ARC_DRAW_TYPE ) LibDrawArc::LibDrawArc() : LibEDA_BaseStruct( COMPONENT_ARC_DRAW_TYPE )
{ {
m_Rayon = 0; m_Rayon = 0;
@ -169,6 +174,39 @@ bool LibDrawArc::Load( char* line, wxString& errorMsg )
return true; return true;
} }
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPos A wxPoint to test
* @return bool - true if a hit, else false
*/
bool LibDrawArc::HitTest( const wxPoint& aRefPos )
{
wxPoint relpos = aRefPos - m_Pos;
int dist = wxRound( sqrt( ( (double) relpos.x * relpos.x ) + ( (double) relpos.y * relpos.y ) ) );
int mindist = m_Width ? m_Width /2 : g_DrawDefaultLineThickness / 2;
// Have a minimal tolerance for hit test
if ( mindist < 3 )
mindist = 3; // = 3 mils
if( abs( dist - m_Rayon ) > mindist )
return false;
// We are on the circle, ensure we are on the arc, between m_ArcStart and m_ArcEnd
int astart = t1; // arc starting point ( in 0.1 degree)
int aend = t2; // arc ending point ( in 0.1 degree)
int atest = wxRound( atan2(relpos.y, relpos.x) * 1800.0 / M_PI );
NORMALIZE_ANGLE_180(atest);
NORMALIZE_ANGLE_180(astart);
NORMALIZE_ANGLE_180(aend);
if ( astart > aend )
EXCHG(astart, aend);
if( atest >= astart && atest <= aend )
return true;
return false;
}
LibDrawArc* LibDrawArc::GenCopy() LibDrawArc* LibDrawArc::GenCopy()
{ {
@ -268,7 +306,8 @@ EDA_Rect LibDrawArc::GetBoundingBox()
if( ( normStart == nullPoint ) || ( normEnd == nullPoint ) if( ( normStart == nullPoint ) || ( normEnd == nullPoint )
|| ( m_Rayon == 0 ) ) || ( m_Rayon == 0 ) )
{ {
wxLogDebug( wxT("Invalid arc drawing definition, center(%d, %d) \ wxLogDebug( wxT(
"Invalid arc drawing definition, center(%d, %d) \
start(%d, %d), end(%d, %d), radius %d" ), start(%d, %d), end(%d, %d), radius %d" ),
m_Pos.x, m_Pos.y, m_ArcStart.x, m_ArcStart.y, m_ArcEnd.x, m_Pos.x, m_Pos.y, m_ArcStart.x, m_ArcStart.y, m_ArcEnd.x,
m_ArcEnd.y, m_Rayon ); m_ArcEnd.y, m_Rayon );
@ -360,6 +399,7 @@ bool LibDrawCircle::Load( char* line, wxString& errorMsg )
int cnt = sscanf( &line[2], "%d %d %d %d %d %d %s", &m_Pos.x, &m_Pos.y, int cnt = sscanf( &line[2], "%d %d %d %d %d %d %s", &m_Pos.x, &m_Pos.y,
&m_Rayon, &m_Unit, &m_Convert, &m_Width, tmp ); &m_Rayon, &m_Unit, &m_Convert, &m_Width, tmp );
if( cnt < 6 ) if( cnt < 6 )
{ {
errorMsg.Printf( _( "circle only had %d parameters of the required 6" ), errorMsg.Printf( _( "circle only had %d parameters of the required 6" ),
@ -375,6 +415,25 @@ bool LibDrawCircle::Load( char* line, wxString& errorMsg )
return true; return true;
} }
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPos A wxPoint to test
* @return bool - true if a hit, else false
*/
bool LibDrawCircle::HitTest( const wxPoint& aRefPos )
{
wxPoint relpos = aRefPos - m_Pos;
int dist = wxRound( sqrt( ( (double) relpos.x * relpos.x ) + ( (double) relpos.y * relpos.y ) ) );
int mindist = m_Width ? m_Width /2 : g_DrawDefaultLineThickness / 2;
// Have a minimal tolerance for hit test
if ( mindist < 3 )
mindist = 3; // = 3 mils
if( abs( dist - m_Rayon ) > mindist )
return false;
return false;
}
LibDrawCircle* LibDrawCircle::GenCopy() LibDrawCircle* LibDrawCircle::GenCopy()
{ {
@ -431,9 +490,11 @@ void LibDrawCircle::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
EDA_Rect LibDrawCircle::GetBoundingBox() EDA_Rect LibDrawCircle::GetBoundingBox()
{ {
EDA_Rect rect; EDA_Rect rect;
rect.SetOrigin( m_Pos.x - m_Rayon, ( m_Pos.y - m_Rayon ) * -1 ); rect.SetOrigin( m_Pos.x - m_Rayon, ( m_Pos.y - m_Rayon ) * -1 );
rect.SetEnd( m_Pos.x + m_Rayon, ( m_Pos.y + m_Rayon ) * -1 ); rect.SetEnd( m_Pos.x + m_Rayon, ( m_Pos.y + m_Rayon ) * -1 );
rect.Inflate( m_Width / 2, m_Width / 2 ); rect.Inflate( m_Width / 2, m_Width / 2 );
return rect; return rect;
} }
@ -461,6 +522,10 @@ void LibDrawCircle::DisplayInfo( WinEDA_DrawFrame* frame )
} }
/***********************/
/** class LibDrawText **/
/***********************/
LibDrawText::LibDrawText() : LibDrawText::LibDrawText() :
LibEDA_BaseStruct( COMPONENT_GRAPHIC_TEXT_DRAW_TYPE ), EDA_TextStruct() LibEDA_BaseStruct( COMPONENT_GRAPHIC_TEXT_DRAW_TYPE ), EDA_TextStruct()
{ {
@ -472,15 +537,31 @@ LibDrawText::LibDrawText() :
bool LibDrawText::Save( FILE* ExportFile ) const bool LibDrawText::Save( FILE* ExportFile ) const
{ {
wxString text = m_Text; wxString text = m_Text;
// Spaces are not allowed in text because it is not double quoted: // Spaces are not allowed in text because it is not double quoted:
// changed to '~' // changed to '~'
text.Replace( wxT( " " ), wxT( "~" ) ); text.Replace( wxT( " " ), wxT( "~" ) );
fprintf( ExportFile, "T %d %d %d %d %d %d %d %s ", m_Orient, fprintf( ExportFile, "T %d %d %d %d %d %d %d %s ", m_Orient,
m_Pos.x, m_Pos.y, m_Size.x, m_Attributs, m_Unit, m_Convert, m_Pos.x, m_Pos.y, m_Size.x, m_Attributs, m_Unit, m_Convert,
CONV_TO_UTF8( text )); CONV_TO_UTF8( text ) );
fprintf( ExportFile, " %s %d", m_Italic ? "Italic" : "Normal", (m_Bold>0)?1:0 ); fprintf( ExportFile, " %s %d", m_Italic ? "Italic" : "Normal", (m_Bold>0) ? 1 : 0 );
fprintf( ExportFile, "\n");
char hjustify = 'C';
if( m_HJustify == GR_TEXT_HJUSTIFY_LEFT )
hjustify = 'L';
else if( m_HJustify == GR_TEXT_HJUSTIFY_RIGHT )
hjustify = 'R';
char vjustify = 'C';
if( m_VJustify == GR_TEXT_VJUSTIFY_BOTTOM )
vjustify = 'B';
else if( m_VJustify == GR_TEXT_VJUSTIFY_TOP )
vjustify = 'T';
fprintf( ExportFile, "%c %c", hjustify, vjustify );
fprintf( ExportFile, "\n" );
return true; return true;
} }
@ -489,15 +570,16 @@ bool LibDrawText::Save( FILE* ExportFile ) const
bool LibDrawText::Load( char* line, wxString& errorMsg ) bool LibDrawText::Load( char* line, wxString& errorMsg )
{ {
int cnt, thickness; int cnt, thickness;
char hjustify = 'C', vjustify = 'C';
char buf[256]; char buf[256];
char tmp[256]; char tmp[256];
buf[0] = 0; buf[0] = 0;
tmp[0] = 0; // For italic option, Not in old versions tmp[0] = 0; // For italic option, Not in old versions
cnt = sscanf( &line[2], "%d %d %d %d %d %d %d %s %s %d", cnt = sscanf( &line[2], "%d %d %d %d %d %d %d %s %s %d %c %c",
&m_Orient, &m_Pos.x, &m_Pos.y, &m_Size.x, &m_Attributs, &m_Orient, &m_Pos.x, &m_Pos.y, &m_Size.x, &m_Attributs,
&m_Unit, &m_Convert, buf, tmp, &thickness ); &m_Unit, &m_Convert, buf, tmp, &thickness, &hjustify, &vjustify );
if( cnt < 8 ) if( cnt < 8 )
{ {
@ -508,12 +590,43 @@ bool LibDrawText::Load( char* line, wxString& errorMsg )
m_Size.y = m_Size.x; m_Size.y = m_Size.x;
if ( strnicmp( tmp, "Italic", 6 ) == 0 ) if( strnicmp( tmp, "Italic", 6 ) == 0 )
m_Italic = true; m_Italic = true;
if (thickness > 0) { if( thickness > 0 )
{
m_Bold = true; m_Bold = true;
} }
switch( hjustify )
{
case 'L':
m_HJustify = GR_TEXT_HJUSTIFY_LEFT;
break;
case 'C':
m_HJustify = GR_TEXT_HJUSTIFY_CENTER;
break;
case 'R':
m_HJustify = GR_TEXT_HJUSTIFY_RIGHT;
break;
}
switch( vjustify )
{
case 'T':
m_VJustify = GR_TEXT_VJUSTIFY_TOP;
break;
case 'C':
m_VJustify = GR_TEXT_VJUSTIFY_CENTER;
break;
case 'B':
m_VJustify = GR_TEXT_VJUSTIFY_BOTTOM;
break;
}
/* Convert '~' to spaces. */ /* Convert '~' to spaces. */
m_Text = CONV_FROM_UTF8( buf ); m_Text = CONV_FROM_UTF8( buf );
m_Text.Replace( wxT( "~" ), wxT( " " ) ); m_Text.Replace( wxT( "~" ), wxT( " " ) );
@ -521,6 +634,29 @@ bool LibDrawText::Load( char* line, wxString& errorMsg )
return true; return true;
} }
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param refPos A wxPoint to test
* @return bool - true if a hit, else false
*/
bool LibDrawText::HitTest( const wxPoint& refPos )
{
// if using TextHitTest() remember this function uses top to bottom y axis convention
// and for lib items we are using bottom to top convention
// so for non center Y justification we use a trick.
GRTextVertJustifyType vJustify = m_VJustify;
if ( m_VJustify == GR_TEXT_VJUSTIFY_TOP )
m_VJustify = GR_TEXT_VJUSTIFY_BOTTOM;
else if ( m_VJustify == GR_TEXT_VJUSTIFY_BOTTOM )
m_VJustify = GR_TEXT_VJUSTIFY_TOP;
bool hit = TextHitTest(refPos);
m_VJustify = vJustify;
return hit;
}
LibDrawText* LibDrawText::GenCopy() LibDrawText* LibDrawText::GenCopy()
{ {
@ -550,7 +686,16 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
wxPoint pos1, pos2; wxPoint pos1, pos2;
int color = ReturnLayerColor( LAYER_DEVICE ); int color = ReturnLayerColor( LAYER_DEVICE );
int linewidth = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width; int linewidth = m_Width;
if( linewidth == 0 ) // Use default values for pen size
{
if( m_Bold )
linewidth = GetPenSizeForBold( m_Size.x );
else
linewidth = g_DrawDefaultLineThickness;
}
// Clip pen size for small texts: // Clip pen size for small texts:
linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold ); linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold );
@ -570,7 +715,7 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
DrawGraphicText( aPanel, aDC, pos1, (EDA_Colors) color, m_Text, DrawGraphicText( aPanel, aDC, pos1, (EDA_Colors) color, m_Text,
t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT, t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
m_Size, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, m_Size, m_HJustify, m_VJustify,
linewidth, m_Italic, m_Bold ); linewidth, m_Italic, m_Bold );
} }
@ -588,6 +733,10 @@ void LibDrawText::DisplayInfo( WinEDA_DrawFrame* frame )
} }
/*************************/
/** class LibDrawSquare **/
/*************************/
LibDrawSquare::LibDrawSquare() : LibEDA_BaseStruct( COMPONENT_RECT_DRAW_TYPE ) LibDrawSquare::LibDrawSquare() : LibEDA_BaseStruct( COMPONENT_RECT_DRAW_TYPE )
{ {
m_Width = 0; m_Width = 0;
@ -697,6 +846,7 @@ void LibDrawSquare::DisplayInfo( WinEDA_DrawFrame* frame )
EDA_Rect LibDrawSquare::GetBoundingBox() EDA_Rect LibDrawSquare::GetBoundingBox()
{ {
EDA_Rect rect; EDA_Rect rect;
rect.SetOrigin( m_Pos.x, m_Pos.y * -1 ); rect.SetOrigin( m_Pos.x, m_Pos.y * -1 );
rect.SetEnd( m_End.x, m_End.y * -1 ); rect.SetEnd( m_End.x, m_End.y * -1 );
rect.Inflate( m_Width / 2, m_Width / 2 ); rect.Inflate( m_Width / 2, m_Width / 2 );
@ -823,7 +973,7 @@ bool LibDrawPolyline::Load( char* line, wxString& errorMsg )
errorMsg.Printf( _( "polyline only had %d parameters of the required 4" ), i ); errorMsg.Printf( _( "polyline only had %d parameters of the required 4" ), i );
return false; return false;
} }
if ( ccount <= 0 ) if( ccount <= 0 )
{ {
errorMsg.Printf( _( "polyline count parameter %d is invalid" ), errorMsg.Printf( _( "polyline count parameter %d is invalid" ),
ccount ); ccount );
@ -852,7 +1002,7 @@ bool LibDrawPolyline::Load( char* line, wxString& errorMsg )
i ); i );
return false; return false;
} }
AddPoint(pt); AddPoint( pt );
} }
m_Fill = NO_FILL; m_Fill = NO_FILL;
@ -961,7 +1111,7 @@ bool LibDrawPolyline::HitTest( wxPoint aPosRef, int aThreshold,
for( unsigned ii = 1; ii < GetCornerCount(); ii++ ) for( unsigned ii = 1; ii < GetCornerCount(); ii++ )
{ {
start = TransformCoordinate( aTransMat, m_PolyPoints[ii-1] ); start = TransformCoordinate( aTransMat, m_PolyPoints[ii - 1] );
end = TransformCoordinate( aTransMat, m_PolyPoints[ii] ); end = TransformCoordinate( aTransMat, m_PolyPoints[ii] );
ref = aPosRef - start; ref = aPosRef - start;
end -= start; end -= start;

View File

@ -281,6 +281,15 @@ public:
virtual bool Save( FILE* aFile ) const; virtual bool Save( FILE* aFile ) const;
virtual bool Load( char* line, wxString& errorMsg ); virtual bool Load( char* line, wxString& errorMsg );
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPos A wxPoint to test
* @return bool - true if a hit, else false
*/
virtual bool HitTest( const wxPoint& aRefPos );
LibDrawArc* GenCopy(); LibDrawArc* GenCopy();
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset,
@ -322,6 +331,14 @@ public:
virtual bool Save( FILE* aFile ) const; virtual bool Save( FILE* aFile ) const;
virtual bool Load( char* line, wxString& errorMsg ); virtual bool Load( char* line, wxString& errorMsg );
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPos A wxPoint to test
* @return bool - true if a hit, else false
*/
virtual bool HitTest( const wxPoint& aRefPos );
LibDrawCircle* GenCopy(); LibDrawCircle* GenCopy();
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset,
@ -360,6 +377,26 @@ public:
virtual bool Save( FILE* aFile ) const; virtual bool Save( FILE* aFile ) const;
virtual bool Load( char* line, wxString& errorMsg ); virtual bool Load( char* line, wxString& errorMsg );
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param refPos A wxPoint to test
* @return bool - true if a hit, else false
*/
virtual bool HitTest( const wxPoint& refPos );
/**
* Function HitTest (overlayed)
* tests if the given EDA_Rect intersect this object.
* For now, an ending point must be inside this rect.
* @param refArea : the given EDA_Rect
* @return bool - true if a hit, else false
*/
virtual bool HitTest( EDA_Rect& refArea )
{
return TextHitTest( refArea );
}
LibDrawText* GenCopy(); LibDrawText* GenCopy();
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset,

View File

@ -16,71 +16,105 @@ Dialog_BodyGraphicText_Properties_base::Dialog_BodyGraphicText_Properties_base(
wxBoxSizer* bMainSizer; wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxHORIZONTAL ); bMainSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bLeftSizer; wxBoxSizer* bPropertiesSizer;
bLeftSizer = new wxBoxSizer( wxVERTICAL ); bPropertiesSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bUpperBoxSizer;
bUpperBoxSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bTextValueBoxSizer;
bTextValueBoxSizer = new wxBoxSizer( wxVERTICAL );
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText1 = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 ); m_staticText1->Wrap( -1 );
bLeftSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bTextValueBoxSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_TextValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_TextValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_TextValue->SetMinSize( wxSize( 200,-1 ) ); m_TextValue->SetMinSize( wxSize( 200,-1 ) );
bLeftSizer->Add( m_TextValue, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); bTextValueBoxSizer->Add( m_TextValue, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bUpperBoxSizer->Add( bTextValueBoxSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bTextSizeSizer;
bTextSizeSizer = new wxBoxSizer( wxVERTICAL );
m_TextSizeText = new wxStaticText( this, wxID_ANY, _("Size"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextSizeText->Wrap( -1 );
bTextSizeSizer->Add( m_TextSizeText, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_TextSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bTextSizeSizer->Add( m_TextSize, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bUpperBoxSizer->Add( bTextSizeSizer, 0, 0, 5 );
bPropertiesSizer->Add( bUpperBoxSizer, 0, wxEXPAND, 5 );
wxBoxSizer* bBottomtBoxSizer;
bBottomtBoxSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sOptionsSizer; wxStaticBoxSizer* sOptionsSizer;
sOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _(" Text Options : ") ), wxVERTICAL ); sOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _(" Text Options : ") ), wxVERTICAL );
m_Orient = new wxCheckBox( this, wxID_ANY, _("Vertical"), wxDefaultPosition, wxDefaultSize, 0 );
sOptionsSizer->Add( m_Orient, 0, wxALL, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
sOptionsSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_CommonUnit = new wxCheckBox( this, wxID_ANY, _("Common to Units"), wxDefaultPosition, wxDefaultSize, 0 ); m_CommonUnit = new wxCheckBox( this, wxID_ANY, _("Common to Units"), wxDefaultPosition, wxDefaultSize, 0 );
sOptionsSizer->Add( m_CommonUnit, 0, wxALL, 5 ); sOptionsSizer->Add( m_CommonUnit, 0, wxALL, 5 );
m_CommonConvert = new wxCheckBox( this, wxID_ANY, _("Common to convert"), wxDefaultPosition, wxDefaultSize, 0 ); m_CommonConvert = new wxCheckBox( this, wxID_ANY, _("Common to convert"), wxDefaultPosition, wxDefaultSize, 0 );
sOptionsSizer->Add( m_CommonConvert, 0, wxALL, 5 ); sOptionsSizer->Add( m_CommonConvert, 0, wxALL|wxEXPAND, 5 );
m_Orient = new wxCheckBox( this, wxID_ANY, _("Vertical"), wxDefaultPosition, wxDefaultSize, 0 ); bBottomtBoxSizer->Add( sOptionsSizer, 0, 0, 5 );
sOptionsSizer->Add( m_Orient, 0, wxALL, 5 );
bLeftSizer->Add( sOptionsSizer, 0, 0, 5 );
bMainSizer->Add( bLeftSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bRightSizer;
bRightSizer = new wxBoxSizer( wxVERTICAL );
m_TextSizeText = new wxStaticText( this, wxID_ANY, _("Size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextSizeText->Wrap( -1 );
bRightSizer->Add( m_TextSizeText, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_TextSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bRightSizer->Add( m_TextSize, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxString m_TextShapeOptChoices[] = { _("Normal"), _("Italic"), _("Bold"), _("Bold Italic") }; wxString m_TextShapeOptChoices[] = { _("Normal"), _("Italic"), _("Bold"), _("Bold Italic") };
int m_TextShapeOptNChoices = sizeof( m_TextShapeOptChoices ) / sizeof( wxString ); int m_TextShapeOptNChoices = sizeof( m_TextShapeOptChoices ) / sizeof( wxString );
m_TextShapeOpt = new wxRadioBox( this, wxID_ANY, _("Text Shape:"), wxDefaultPosition, wxDefaultSize, m_TextShapeOptNChoices, m_TextShapeOptChoices, 1, wxRA_SPECIFY_COLS ); m_TextShapeOpt = new wxRadioBox( this, wxID_ANY, _("Text Shape:"), wxDefaultPosition, wxDefaultSize, m_TextShapeOptNChoices, m_TextShapeOptChoices, 1, wxRA_SPECIFY_COLS );
m_TextShapeOpt->SetSelection( 3 ); m_TextShapeOpt->SetSelection( 0 );
bRightSizer->Add( m_TextShapeOpt, 0, wxALL|wxEXPAND, 5 ); bBottomtBoxSizer->Add( m_TextShapeOpt, 0, wxALL|wxEXPAND, 5 );
bMainSizer->Add( bRightSizer, 0, wxEXPAND, 5 ); wxString m_TextHJustificationOptChoices[] = { _("Align left"), _("Align center"), _("Align right") };
int m_TextHJustificationOptNChoices = sizeof( m_TextHJustificationOptChoices ) / sizeof( wxString );
m_TextHJustificationOpt = new wxRadioBox( this, wxID_ANY, _("Horiz. Justify"), wxDefaultPosition, wxDefaultSize, m_TextHJustificationOptNChoices, m_TextHJustificationOptChoices, 1, wxRA_SPECIFY_COLS );
m_TextHJustificationOpt->SetSelection( 1 );
bBottomtBoxSizer->Add( m_TextHJustificationOpt, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizer4; wxString m_TextVJustificationOptChoices[] = { _("Align bottom"), _("Align center"), _("Align top") };
bSizer4 = new wxBoxSizer( wxVERTICAL ); int m_TextVJustificationOptNChoices = sizeof( m_TextVJustificationOptChoices ) / sizeof( wxString );
m_TextVJustificationOpt = new wxRadioBox( this, wxID_ANY, _("Vert. Justify"), wxDefaultPosition, wxDefaultSize, m_TextVJustificationOptNChoices, m_TextVJustificationOptChoices, 1, wxRA_SPECIFY_COLS );
m_TextVJustificationOpt->SetSelection( 1 );
bBottomtBoxSizer->Add( m_TextVJustificationOpt, 0, wxALL|wxEXPAND, 5 );
bPropertiesSizer->Add( bBottomtBoxSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bRightSizer;
bRightSizer = new wxBoxSizer( wxVERTICAL );
bPropertiesSizer->Add( bRightSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( bPropertiesSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bButtonsBoxSizer;
bButtonsBoxSizer = new wxBoxSizer( wxVERTICAL );
m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer4->Add( m_buttonOK, 0, wxALL, 5 ); bButtonsBoxSizer->Add( m_buttonOK, 0, wxALL, 5 );
m_buttonCANCEL = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonCANCEL = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer4->Add( m_buttonCANCEL, 0, wxALL, 5 ); bButtonsBoxSizer->Add( m_buttonCANCEL, 0, wxALL, 5 );
bMainSizer->Add( bSizer4, 0, wxALIGN_CENTER_VERTICAL, 5 ); bMainSizer->Add( bButtonsBoxSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
this->SetSizer( bMainSizer ); this->SetSizer( bMainSizer );
this->Layout(); this->Layout();
// Connect Events // Connect Events
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( Dialog_BodyGraphicText_Properties_base::OnInitDialog ) );
m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnOkClick ), NULL, this ); m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnOkClick ), NULL, this );
m_buttonCANCEL->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnCancelClick ), NULL, this ); m_buttonCANCEL->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnCancelClick ), NULL, this );
} }
@ -88,7 +122,6 @@ Dialog_BodyGraphicText_Properties_base::Dialog_BodyGraphicText_Properties_base(
Dialog_BodyGraphicText_Properties_base::~Dialog_BodyGraphicText_Properties_base() Dialog_BodyGraphicText_Properties_base::~Dialog_BodyGraphicText_Properties_base()
{ {
// Disconnect Events // Disconnect Events
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( Dialog_BodyGraphicText_Properties_base::OnInitDialog ) );
m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnOkClick ), NULL, this ); m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnOkClick ), NULL, this );
m_buttonCANCEL->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnCancelClick ), NULL, this ); m_buttonCANCEL->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnCancelClick ), NULL, this );
} }

View File

@ -32,7 +32,7 @@
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">Dialog_BodyGraphicText_Properties_base</property> <property name="name">Dialog_BodyGraphicText_Properties_base</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">360,180</property> <property name="size">511,193</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property> <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="title">Graphic text properties:</property> <property name="title">Graphic text properties:</property>
@ -49,7 +49,7 @@
<event name="OnHibernate"></event> <event name="OnHibernate"></event>
<event name="OnIconize"></event> <event name="OnIconize"></event>
<event name="OnIdle"></event> <event name="OnIdle"></event>
<event name="OnInitDialog">OnInitDialog</event> <event name="OnInitDialog"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
<event name="OnKeyUp"></event> <event name="OnKeyUp"></event>
<event name="OnKillFocus"></event> <event name="OnKillFocus"></event>
@ -81,7 +81,25 @@
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bLeftSizer</property> <property name="name">bPropertiesSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bUpperBoxSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bTextValueBoxSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
@ -138,7 +156,7 @@
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property> <property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">1</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
@ -190,185 +208,15 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag"></property> <property name="flag"></property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label"> Text Options : </property>
<property name="minimum_size"></property>
<property name="name">sOptionsSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Common to Units</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_CommonUnit</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Common to convert</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_CommonConvert</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Vertical</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_Orient</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bRightSizer</property> <property name="name">bTextSizeSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
@ -383,7 +231,7 @@
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Size:</property> <property name="label">Size</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_TextSizeText</property> <property name="name">m_TextSizeText</property>
@ -477,6 +325,238 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bBottomtBoxSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag"></property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label"> Text Options : </property>
<property name="minimum_size"></property>
<property name="name">sOptionsSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Vertical</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_Orient</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_staticline1</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxLI_HORIZONTAL</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Common to Units</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_CommonUnit</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Common to convert</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_CommonConvert</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
@ -497,7 +577,115 @@
<property name="name">m_TextShapeOpt</property> <property name="name">m_TextShapeOpt</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="selection">3</property> <property name="selection">0</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioBox"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxRadioBox" expanded="1">
<property name="bg"></property>
<property name="choices">&quot;Align left&quot; &quot;Align center&quot; &quot;Align right&quot;</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Horiz. Justify</property>
<property name="majorDimension">1</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_TextHJustificationOpt</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="selection">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioBox"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxRadioBox" expanded="1">
<property name="bg"></property>
<property name="choices">&quot;Align bottom&quot; &quot;Align center&quot; &quot;Align top&quot;</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Vert. Justify</property>
<property name="majorDimension">1</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_TextVJustificationOpt</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="selection">1</property>
<property name="size"></property> <property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property> <property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property> <property name="subclass"></property>
@ -533,13 +721,26 @@
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bRightSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property> <property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="0"> <object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizer4</property> <property name="name">bButtonsBoxSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">

View File

@ -17,8 +17,9 @@
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/checkbox.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/checkbox.h>
#include <wx/statline.h>
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/radiobox.h> #include <wx/radiobox.h>
#include <wx/button.h> #include <wx/button.h>
@ -36,23 +37,25 @@ class Dialog_BodyGraphicText_Properties_base : public wxDialog
protected: protected:
wxStaticText* m_staticText1; wxStaticText* m_staticText1;
wxTextCtrl* m_TextValue; wxTextCtrl* m_TextValue;
wxCheckBox* m_CommonUnit;
wxCheckBox* m_CommonConvert;
wxCheckBox* m_Orient;
wxStaticText* m_TextSizeText; wxStaticText* m_TextSizeText;
wxTextCtrl* m_TextSize; wxTextCtrl* m_TextSize;
wxCheckBox* m_Orient;
wxStaticLine* m_staticline1;
wxCheckBox* m_CommonUnit;
wxCheckBox* m_CommonConvert;
wxRadioBox* m_TextShapeOpt; wxRadioBox* m_TextShapeOpt;
wxRadioBox* m_TextHJustificationOpt;
wxRadioBox* m_TextVJustificationOpt;
wxButton* m_buttonOK; wxButton* m_buttonOK;
wxButton* m_buttonCANCEL; wxButton* m_buttonCANCEL;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
public: public:
Dialog_BodyGraphicText_Properties_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Graphic text properties:"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 360,180 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); Dialog_BodyGraphicText_Properties_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Graphic text properties:"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 511,193 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~Dialog_BodyGraphicText_Properties_base(); ~Dialog_BodyGraphicText_Properties_base();
}; };

View File

@ -66,7 +66,7 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE
wxString m_FieldVJustifyCtrlChoices[] = { _("Align bottom"), _("Align center"), _("Align top") }; wxString m_FieldVJustifyCtrlChoices[] = { _("Align bottom"), _("Align center"), _("Align top") };
int m_FieldVJustifyCtrlNChoices = sizeof( m_FieldVJustifyCtrlChoices ) / sizeof( wxString ); int m_FieldVJustifyCtrlNChoices = sizeof( m_FieldVJustifyCtrlChoices ) / sizeof( wxString );
m_FieldVJustifyCtrl = new wxRadioBox( this, wxID_ANY, _("Vert Justify"), wxDefaultPosition, wxDefaultSize, m_FieldVJustifyCtrlNChoices, m_FieldVJustifyCtrlChoices, 1, wxRA_SPECIFY_COLS ); m_FieldVJustifyCtrl = new wxRadioBox( this, wxID_ANY, _("Vert. Justify"), wxDefaultPosition, wxDefaultSize, m_FieldVJustifyCtrlNChoices, m_FieldVJustifyCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_FieldVJustifyCtrl->SetSelection( 1 ); m_FieldVJustifyCtrl->SetSelection( 1 );
m_FieldVJustifyCtrl->SetToolTip( _("Pick the graphical transformation to be used when displaying the component, if any") ); m_FieldVJustifyCtrl->SetToolTip( _("Pick the graphical transformation to be used when displaying the component, if any") );

View File

@ -434,7 +434,7 @@
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Vert Justify</property> <property name="label">Vert. Justify</property>
<property name="majorDimension">1</property> <property name="majorDimension">1</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
@ -900,7 +900,7 @@
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="0"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">textSizeBoxSizer</property> <property name="name">textSizeBoxSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>

View File

@ -32,7 +32,7 @@ public:
~Dialog_BodyGraphicText_Properties() {}; ~Dialog_BodyGraphicText_Properties() {};
private: private:
void OnInitDialog( wxInitDialogEvent& event ); void InitDialog( );
void OnOkClick( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
}; };
@ -43,12 +43,13 @@ Dialog_BodyGraphicText_Properties::Dialog_BodyGraphicText_Properties( WinEDA_Li
{ {
m_Parent = aParent; m_Parent = aParent;
m_GraphicText = aGraphicText; m_GraphicText = aGraphicText;
InitDialog( );
} }
/********************************************************************************/ /*****************************************************/
void Dialog_BodyGraphicText_Properties::OnInitDialog( wxInitDialogEvent& event ) void Dialog_BodyGraphicText_Properties::InitDialog( )
/********************************************************************************/ /*****************************************************/
{ {
wxString msg; wxString msg;
@ -69,6 +70,38 @@ wxString msg;
shape |= 2; shape |= 2;
m_TextShapeOpt->SetSelection(shape); m_TextShapeOpt->SetSelection(shape);
switch ( m_GraphicText->m_HJustify )
{
case GR_TEXT_HJUSTIFY_LEFT:
m_TextHJustificationOpt->SetSelection(0);
break;
case GR_TEXT_HJUSTIFY_CENTER:
m_TextHJustificationOpt->SetSelection(1);
break;
case GR_TEXT_HJUSTIFY_RIGHT:
m_TextHJustificationOpt->SetSelection(2);
break;
}
switch ( m_GraphicText->m_VJustify )
{
case GR_TEXT_VJUSTIFY_BOTTOM:
m_TextVJustificationOpt->SetSelection(0);
break;
case GR_TEXT_VJUSTIFY_CENTER:
m_TextVJustificationOpt->SetSelection(1);
break;
case GR_TEXT_VJUSTIFY_TOP:
m_TextVJustificationOpt->SetSelection(2);
break;
}
} }
else else
{ {
@ -130,6 +163,37 @@ wxString Line;
else else
m_GraphicText->m_Bold = false; m_GraphicText->m_Bold = false;
switch ( m_TextHJustificationOpt->GetSelection() )
{
case 0:
m_GraphicText->m_HJustify = GR_TEXT_HJUSTIFY_LEFT;
break;
case 1:
m_GraphicText->m_HJustify = GR_TEXT_HJUSTIFY_CENTER;
break;
case 2:
m_GraphicText->m_HJustify = GR_TEXT_HJUSTIFY_RIGHT;
break;
}
switch ( m_TextVJustificationOpt->GetSelection() )
{
case 0:
m_GraphicText->m_VJustify = GR_TEXT_VJUSTIFY_BOTTOM;
break;
case 1:
m_GraphicText->m_VJustify = GR_TEXT_VJUSTIFY_CENTER;
break;
case 2:
m_GraphicText->m_VJustify = GR_TEXT_VJUSTIFY_TOP;
break;
}
} }
Close(); Close();

View File

@ -25,7 +25,7 @@ static bool IsBox1InBox2( int StartX1, int StartY1, int EndX1, int EndY1,
int StartX2, int StartY2, int EndX2, int EndY2 ); int StartX2, int StartY2, int EndX2, int EndY2 );
static bool IsPointOnSegment( wxPoint aPosRef, wxPoint aSegmStart, wxPoint aSegmEnd, int aDist = 0 ); static bool IsPointOnSegment( wxPoint aPosRef, wxPoint aSegmStart, wxPoint aSegmEnd, int aDist = 0 );
static bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, static bool SnapPoint2( const wxPoint& aPosRef, int SearchMask,
SCH_ITEM* DrawList, DrawPickedStruct* DontSnapList, double aScaleFactor); SCH_ITEM* DrawList, DrawPickedStruct* DontSnapList, double aScaleFactor );
/*********************************************************************/ /*********************************************************************/
@ -109,6 +109,7 @@ SCH_ITEM* PickStruct( const wxPoint& refpos, BASE_SCREEN* screen, int SearchMask
*/ */
{ {
bool Snapped; bool Snapped;
if( screen == NULL || screen->EEDrawList == NULL ) if( screen == NULL || screen->EEDrawList == NULL )
return NULL; return NULL;
@ -215,9 +216,10 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask,
if( !( SearchMask & (DRAWITEM | WIREITEM | BUSITEM) ) ) if( !( SearchMask & (DRAWITEM | WIREITEM | BUSITEM) ) )
break; break;
for( unsigned i = 0; i < STRUCT->GetCornerCount() - 1; i ++ ) for( unsigned i = 0; i < STRUCT->GetCornerCount() - 1; i++ )
{ {
if( IsPointOnSegment( aPosRef, STRUCT->m_PolyPoints[i], STRUCT->m_PolyPoints[i+1] ) ) if( IsPointOnSegment( aPosRef, STRUCT->m_PolyPoints[i],
STRUCT->m_PolyPoints[i + 1] ) )
{ {
LastSnappedStruct = DrawList; LastSnappedStruct = DrawList;
return TRUE; return TRUE;
@ -276,7 +278,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask,
#define STRUCT ( (DrawJunctionStruct*) DrawList ) #define STRUCT ( (DrawJunctionStruct*) DrawList )
if( !(SearchMask & JUNCTIONITEM) ) if( !(SearchMask & JUNCTIONITEM) )
break; break;
if( STRUCT->HitTest(aPosRef) ) if( STRUCT->HitTest( aPosRef ) )
{ {
LastSnappedStruct = DrawList; LastSnappedStruct = DrawList;
return TRUE; return TRUE;
@ -288,7 +290,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask,
#define STRUCT ( (DrawNoConnectStruct*) DrawList ) #define STRUCT ( (DrawNoConnectStruct*) DrawList )
if( !(SearchMask & NOCONNECTITEM) ) if( !(SearchMask & NOCONNECTITEM) )
break; break;
if( STRUCT->HitTest(aPosRef) ) if( STRUCT->HitTest( aPosRef ) )
{ {
LastSnappedStruct = DrawList; LastSnappedStruct = DrawList;
return TRUE; return TRUE;
@ -301,9 +303,9 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask,
#define STRUCT ( (DrawMarkerStruct*) DrawList ) #define STRUCT ( (DrawMarkerStruct*) DrawList )
if( !(SearchMask & MARKERITEM) ) if( !(SearchMask & MARKERITEM) )
break; break;
int size = (int)((DRAWMARKER_SIZE / aScaleFactor) / 2); int size = (int) ( (DRAWMARKER_SIZE / aScaleFactor) / 2 );
wxPoint dist = aPosRef - STRUCT->m_Pos; wxPoint dist = aPosRef - STRUCT->m_Pos;
if( (abs(dist.x ) <= size) && (abs(dist.y ) <= size) ) if( (abs( dist.x ) <= size) && (abs( dist.y ) <= size) )
{ {
LastSnappedStruct = DrawList; LastSnappedStruct = DrawList;
return TRUE; return TRUE;
@ -347,7 +349,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask,
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) DrawList; SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) DrawList;
for( int i = REFERENCE; i < DrawLibItem->GetFieldCount(); i++ ) for( int i = REFERENCE; i < DrawLibItem->GetFieldCount(); i++ )
{ {
SCH_CMP_FIELD* field = DrawLibItem->GetField(i); SCH_CMP_FIELD* field = DrawLibItem->GetField( i );
if( field->m_Attributs & TEXT_NO_VISIBLE ) if( field->m_Attributs & TEXT_NO_VISIBLE )
continue; continue;
@ -422,7 +424,7 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2, SCH_ITEM* DrawStruct )
case DRAW_POLYLINE_STRUCT_TYPE: case DRAW_POLYLINE_STRUCT_TYPE:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawPolylineStruct*) DrawStruct ) #define STRUCT ( (DrawPolylineStruct*) DrawStruct )
for( unsigned i = 0; i < STRUCT->GetCornerCount(); i ++ ) for( unsigned i = 0; i < STRUCT->GetCornerCount(); i++ )
{ {
if( STRUCT->m_PolyPoints[i].x >= x1 && STRUCT->m_PolyPoints[i].x <= x2 if( STRUCT->m_PolyPoints[i].x >= x1 && STRUCT->m_PolyPoints[i].x <= x2
&& STRUCT->m_PolyPoints[i].y >= y1 && STRUCT->m_PolyPoints[i].y <=y2 ) && STRUCT->m_PolyPoints[i].y >= y1 && STRUCT->m_PolyPoints[i].y <=y2 )
@ -687,9 +689,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
* remember the Y axis is from bottom to top in library entries for graphic items. * remember the Y axis is from bottom to top in library entries for graphic items.
*/ */
{ {
int dx, dy;
LibEDA_BaseStruct* DrawItem; LibEDA_BaseStruct* DrawItem;
int seuil;
if( LibEntry == NULL ) if( LibEntry == NULL )
return NULL; return NULL;
@ -702,7 +702,14 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
DrawItem = LibEntry->m_Drawings; DrawItem = LibEntry->m_Drawings;
seuil = 3; /* Tolerance: 1/2 pas de petite grille */ int seuil = 3; /* Tolerance: 1/2 pas de petite grille */
// Calculates aRefPoint according to library components Y axis convention:
// Y axis is bottom to top
// RefPoint Y is top to bottom
// so negate the aRefPoint Y coordinate value does the trick
wxPoint pointInLibitemsSpace = aRefPoint;
NEGATE( pointInLibitemsSpace.y );
for( ; DrawItem != NULL; DrawItem = DrawItem->Next() ) for( ; DrawItem != NULL; DrawItem = DrawItem->Next() )
{ {
@ -718,10 +725,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
LibDrawArc* Arc = (LibDrawArc*) DrawItem; LibDrawArc* Arc = (LibDrawArc*) DrawItem;
if( (masque & LOCATE_COMPONENT_ARC_DRAW_TYPE) == 0 ) if( (masque & LOCATE_COMPONENT_ARC_DRAW_TYPE) == 0 )
break; break;
dx = aRefPoint.x - Arc->m_Pos.x; if( Arc->HitTest( pointInLibitemsSpace ) )
dy = aRefPoint.y + Arc->m_Pos.y;
int dist = (int) sqrt( ((double)dx * dx) + ((double)dy * dy) );
if( abs( dist - Arc->m_Rayon ) <= seuil )
return DrawItem; return DrawItem;
} }
break; break;
@ -731,10 +735,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
LibDrawCircle* Circle = (LibDrawCircle*) DrawItem; LibDrawCircle* Circle = (LibDrawCircle*) DrawItem;
if( (masque & LOCATE_COMPONENT_CIRCLE_DRAW_TYPE) == 0 ) if( (masque & LOCATE_COMPONENT_CIRCLE_DRAW_TYPE) == 0 )
break; break;
dx = aRefPoint.x - Circle->m_Pos.x; if( Circle->HitTest( pointInLibitemsSpace ) )
dy = aRefPoint.y + Circle->m_Pos.y;
int dist = (int) sqrt( (double)( dx * dx + dy * dy ) );
if( abs( dist - Circle->m_Rayon ) <= seuil )
return DrawItem; return DrawItem;
} }
break; break;
@ -749,23 +750,27 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
start.y = -Square->m_Pos.y; start.y = -Square->m_Pos.y;
end.x = Square->m_End.x; end.x = Square->m_End.x;
end.y = -Square->m_Pos.y; end.y = -Square->m_Pos.y;
// locate lower segment // locate lower segment
if( IsPointOnSegment( aRefPoint, start, end , seuil ) ) if( IsPointOnSegment( aRefPoint, start, end, seuil ) )
return DrawItem; return DrawItem;
// locate right segment // locate right segment
start.x = Square->m_End.x; start.x = Square->m_End.x;
end.y = -Square->m_End.y; end.y = -Square->m_End.y;
if( IsPointOnSegment( aRefPoint, start,end , seuil ) ) if( IsPointOnSegment( aRefPoint, start, end, seuil ) )
return DrawItem; return DrawItem;
// locate upper segment // locate upper segment
start.y = -Square->m_End.y; start.y = -Square->m_End.y;
end.x = Square->m_Pos.x; end.x = Square->m_Pos.x;
if( IsPointOnSegment( aRefPoint, start, end, seuil ) ) if( IsPointOnSegment( aRefPoint, start, end, seuil ) )
return DrawItem; return DrawItem;
// locate left segment // locate left segment
start.x = Square->m_Pos.x; start.x = Square->m_Pos.x;
end.x = -Square->m_Pos.y; end.x = -Square->m_Pos.y;
if( IsPointOnSegment( aRefPoint,start, end, seuil ) ) if( IsPointOnSegment( aRefPoint, start, end, seuil ) )
return DrawItem; return DrawItem;
} }
break; break;
@ -775,7 +780,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
LibDrawPolyline* polyline = (LibDrawPolyline*) DrawItem; LibDrawPolyline* polyline = (LibDrawPolyline*) DrawItem;
if( (masque & LOCATE_COMPONENT_POLYLINE_DRAW_TYPE) == 0 ) if( (masque & LOCATE_COMPONENT_POLYLINE_DRAW_TYPE) == 0 )
break; break;
if ( polyline->HitTest(aRefPoint, seuil, DefaultTransformMatrix) ) if( polyline->HitTest( aRefPoint, seuil, DefaultTransformMatrix ) )
return DrawItem; return DrawItem;
} }
break; break;
@ -785,9 +790,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
LibDrawSegment* Segment = (LibDrawSegment*) DrawItem; LibDrawSegment* Segment = (LibDrawSegment*) DrawItem;
if( (masque & LOCATE_COMPONENT_LINE_DRAW_TYPE) == 0 ) if( (masque & LOCATE_COMPONENT_LINE_DRAW_TYPE) == 0 )
break; break;
wxPoint ref = aRefPoint; if( IsPointOnSegment( pointInLibitemsSpace, Segment->m_Pos, Segment->m_End, seuil ) )
NEGATE ( ref.y);
if( IsPointOnSegment( ref, Segment->m_Pos, Segment->m_End, seuil ) )
return DrawItem; return DrawItem;
} }
break; break;
@ -797,19 +800,8 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
LibDrawText* Text = (LibDrawText*) DrawItem; LibDrawText* Text = (LibDrawText*) DrawItem;
if( (masque & LOCATE_COMPONENT_GRAPHIC_TEXT_DRAW_TYPE) == 0 ) if( (masque & LOCATE_COMPONENT_GRAPHIC_TEXT_DRAW_TYPE) == 0 )
break; break;
int len = Text->m_Text.Len(); if( Text->HitTest( pointInLibitemsSpace ) )
if( len < 2 ) return DrawItem; /* Found! */
len = 2;
dx = (Text->m_Size.x * len) / 2;
dy = Text->m_Size.y / 2;
if( Text->m_Orient == TEXT_ORIENT_VERT )
{
EXCHG( dx, dy );
}
int x = aRefPoint.x - Text->m_Pos.x;
int y = aRefPoint.y + Text->m_Pos.y;
if( (abs( x ) <= dx) && (abs( y ) <= dy) )
return DrawItem; /* Texte trouve */
} }
break; break;
@ -904,7 +896,7 @@ int distance( int dx, int dy, int spot_cX, int spot_cY, int seuil )
* de piste soit horizontal dans le nouveau repere */ * de piste soit horizontal dans le nouveau repere */
int angle; int angle;
angle = (int) ( atan2( (double) segY, (double) segX ) * 1800 / M_PI); angle = (int) ( atan2( (double) segY, (double) segX ) * 1800 / M_PI );
cXrot = pointX; cYrot = pointY; cXrot = pointX; cYrot = pointY;
RotatePoint( &cXrot, &cYrot, angle ); /* Rotation du point a tester */ RotatePoint( &cXrot, &cYrot, angle ); /* Rotation du point a tester */
RotatePoint( &segX, &segY, angle ); /* Rotation du segment */ RotatePoint( &segX, &segY, angle ); /* Rotation du segment */
@ -1035,15 +1027,15 @@ LibEDA_BaseStruct* LocatePin( const wxPoint& RefPos,
else else
{ {
int x = x1, y = y1; int x = x1, y = y1;
x1 = DrawLibItem->m_Pos.x + DrawLibItem->m_Transform[0][0] * x x1 = DrawLibItem->m_Pos.x + DrawLibItem->m_Transform[0][0] *x
+ DrawLibItem->m_Transform[0][1] * y; + DrawLibItem->m_Transform[0][1] *y;
y1 = DrawLibItem->m_Pos.y + DrawLibItem->m_Transform[1][0] * x y1 = DrawLibItem->m_Pos.y + DrawLibItem->m_Transform[1][0] *x
+ DrawLibItem->m_Transform[1][1] * y; + DrawLibItem->m_Transform[1][1] *y;
x = x2; y = y2; x = x2; y = y2;
x2 = DrawLibItem->m_Pos.x + DrawLibItem->m_Transform[0][0] * x x2 = DrawLibItem->m_Pos.x + DrawLibItem->m_Transform[0][0] *x
+ DrawLibItem->m_Transform[0][1] * y; + DrawLibItem->m_Transform[0][1] *y;
y2 = DrawLibItem->m_Pos.y + DrawLibItem->m_Transform[1][0] * x y2 = DrawLibItem->m_Pos.y + DrawLibItem->m_Transform[1][0] *x
+ DrawLibItem->m_Transform[1][1] * y; + DrawLibItem->m_Transform[1][1] *y;
} }
if( x1 > x2 ) if( x1 > x2 )

View File

@ -58,9 +58,9 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_SheetPropertiesFrame, wxDialog )
BEGIN_EVENT_TABLE( WinEDA_SheetPropertiesFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_SheetPropertiesFrame, wxDialog )
////@begin WinEDA_SheetPropertiesFrame event table entries ////@begin WinEDA_SheetPropertiesFrame event table entries
EVT_BUTTON( wxID_CANCEL, WinEDA_SheetPropertiesFrame::OnCancelClick ) EVT_BUTTON( wxID_CANCEL, WinEDA_SheetPropertiesFrame::OnCancelClick )
EVT_BUTTON( wxID_OK, WinEDA_SheetPropertiesFrame::OnOkClick ) EVT_BUTTON( wxID_OK, WinEDA_SheetPropertiesFrame::OnOkClick )
////@end WinEDA_SheetPropertiesFrame event table entries ////@end WinEDA_SheetPropertiesFrame event table entries
@ -112,18 +112,20 @@ bool WinEDA_SheetPropertiesFrame::Create( wxWindow* parent, wxWindowID id, const
m_SheetNameTextSize = NULL; m_SheetNameTextSize = NULL;
m_SheetNameSize = NULL; m_SheetNameSize = NULL;
m_btClose = NULL; m_btClose = NULL;
////@end WinEDA_SheetPropertiesFrame member initialisation ////@end WinEDA_SheetPropertiesFrame member initialisation
////@begin WinEDA_SheetPropertiesFrame creation ////@begin WinEDA_SheetPropertiesFrame creation
SetExtraStyle(wxWS_EX_BLOCK_EVENTS); SetExtraStyle( wxWS_EX_BLOCK_EVENTS );
wxDialog::Create( parent, id, caption, pos, size, style ); wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls(); CreateControls();
if (GetSizer()) if( GetSizer() )
{ {
GetSizer()->SetSizeHints(this); GetSizer()->SetSizeHints( this );
} }
Centre(); Centre();
////@end WinEDA_SheetPropertiesFrame creation ////@end WinEDA_SheetPropertiesFrame creation
return true; return true;
} }
@ -140,56 +142,85 @@ void WinEDA_SheetPropertiesFrame::CreateControls()
WinEDA_SheetPropertiesFrame* itemDialog1 = this; WinEDA_SheetPropertiesFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxVERTICAL );
itemDialog1->SetSizer(itemBoxSizer2);
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL); itemDialog1->SetSizer( itemBoxSizer2 );
itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* itemBoxSizer3 = new wxBoxSizer( wxHORIZONTAL );
itemBoxSizer3->Add(itemBoxSizer4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); itemBoxSizer2->Add( itemBoxSizer3, 0, wxGROW | wxALL, 5 );
wxStaticText* itemStaticText5 = new wxStaticText( itemDialog1, wxID_STATIC, _("Filename:"), wxDefaultPosition, wxDefaultSize, 0 ); wxBoxSizer* itemBoxSizer4 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); itemBoxSizer3->Add( itemBoxSizer4, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
m_FileNameWin = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxSize(300, -1), wxTE_PROCESS_ENTER ); wxStaticText* itemStaticText5 = new wxStaticText( itemDialog1, wxID_STATIC, _(
itemBoxSizer4->Add(m_FileNameWin, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5); "Filename:" ), wxDefaultPosition,
wxDefaultSize, 0 );
itemBoxSizer4->Add( itemStaticText5,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
wxStaticText* itemStaticText7 = new wxStaticText( itemDialog1, wxID_STATIC, _("Sheetname:"), wxDefaultPosition, wxDefaultSize, 0 ); m_FileNameWin =
itemBoxSizer4->Add(itemStaticText7, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T( "" ), wxDefaultPosition, wxSize( 300,
-1 ),
wxTE_PROCESS_ENTER );
itemBoxSizer4->Add( m_FileNameWin, 0, wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
m_SheetNameWin = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxSize(300, -1), 0 ); wxStaticText* itemStaticText7 = new wxStaticText( itemDialog1, wxID_STATIC, _(
itemBoxSizer4->Add(m_SheetNameWin, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5); "Sheetname:" ), wxDefaultPosition,
wxDefaultSize, 0 );
itemBoxSizer4->Add( itemStaticText7,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); m_SheetNameWin =
itemBoxSizer3->Add(itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T( "" ), wxDefaultPosition, wxSize( 300,
-1 ), 0 );
itemBoxSizer4->Add( m_SheetNameWin, 0, wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
m_FileNameTextSize = new wxStaticText( itemDialog1, wxID_STATIC, _("Size"), wxDefaultPosition, wxDefaultSize, 0 ); wxBoxSizer* itemBoxSizer9 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer9->Add(m_FileNameTextSize, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); itemBoxSizer3->Add( itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
m_FileNameSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL2, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); m_FileNameTextSize = new wxStaticText( itemDialog1, wxID_STATIC, _(
itemBoxSizer9->Add(m_FileNameSize, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5); "Size" ), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add( m_FileNameTextSize,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_SheetNameTextSize = new wxStaticText( itemDialog1, wxID_STATIC, _("Size"), wxDefaultPosition, wxDefaultSize, 0 ); m_FileNameSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL2, _T(
itemBoxSizer9->Add(m_SheetNameTextSize, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); "" ), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add( m_FileNameSize, 0, wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
m_SheetNameSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL3, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); m_SheetNameTextSize = new wxStaticText( itemDialog1, wxID_STATIC, _(
itemBoxSizer9->Add(m_SheetNameSize, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5); "Size" ), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add( m_SheetNameTextSize,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
itemBoxSizer2->Add(5, 5, 1, wxGROW|wxALL, 5); m_SheetNameSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL3, _T(
"" ), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add( m_SheetNameSize, 0, wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer2->Add( 5, 5, 1, wxGROW | wxALL, 5 );
itemBoxSizer2->Add(itemBoxSizer15, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_btClose = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); wxBoxSizer* itemBoxSizer15 = new wxBoxSizer( wxHORIZONTAL );
itemBoxSizer15->Add(m_btClose, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); itemBoxSizer2->Add( itemBoxSizer15, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
wxButton* itemButton17 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 ); m_btClose = new wxButton( itemDialog1, wxID_CANCEL, _(
"&Cancel" ), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer15->Add( m_btClose, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
wxButton* itemButton17 = new wxButton( itemDialog1, wxID_OK, _(
"&OK" ), wxDefaultPosition, wxDefaultSize, 0 );
itemButton17->SetDefault(); itemButton17->SetDefault();
itemBoxSizer15->Add(itemButton17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); itemBoxSizer15->Add( itemButton17, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
// Set validators // Set validators
m_SheetNameWin->SetValidator( wxTextValidator(wxFILTER_NONE, & m_CurrentSheet->m_SheetName) ); m_SheetNameWin->SetValidator( wxTextValidator( wxFILTER_NONE, &m_CurrentSheet->m_SheetName ) );
////@end WinEDA_SheetPropertiesFrame content construction ////@end WinEDA_SheetPropertiesFrame content construction
m_btClose->SetFocus(); m_btClose->SetFocus();
@ -215,8 +246,9 @@ wxBitmap WinEDA_SheetPropertiesFrame::GetBitmapResource( const wxString& name )
{ {
// Bitmap retrieval // Bitmap retrieval
////@begin WinEDA_SheetPropertiesFrame bitmap retrieval ////@begin WinEDA_SheetPropertiesFrame bitmap retrieval
wxUnusedVar(name); wxUnusedVar( name );
return wxNullBitmap; return wxNullBitmap;
////@end WinEDA_SheetPropertiesFrame bitmap retrieval ////@end WinEDA_SheetPropertiesFrame bitmap retrieval
} }
@ -229,8 +261,9 @@ wxIcon WinEDA_SheetPropertiesFrame::GetIconResource( const wxString& name )
{ {
// Icon retrieval // Icon retrieval
////@begin WinEDA_SheetPropertiesFrame icon retrieval ////@begin WinEDA_SheetPropertiesFrame icon retrieval
wxUnusedVar(name); wxUnusedVar( name );
return wxNullIcon; return wxNullIcon;
////@end WinEDA_SheetPropertiesFrame icon retrieval ////@end WinEDA_SheetPropertiesFrame icon retrieval
} }
@ -266,8 +299,9 @@ void WinEDA_SheetPropertiesFrame::SheetPropertiesAccept( wxCommandEvent& event )
if( ( fn.GetFullPath() != m_CurrentSheet->GetFileName() ) if( ( fn.GetFullPath() != m_CurrentSheet->GetFileName() )
|| ( m_CurrentSheet->m_AssociatedScreen == NULL) ) || ( m_CurrentSheet->m_AssociatedScreen == NULL) )
{ {
msg = _( "Changing a Filename can change all the schematic \ msg = _(
structures and cannot be undone.\nOk to continue renaming?" ); "Changing a Filename can change all the schematic \
structures and cannot be undone.\nOk to continue renaming?" );
if( m_CurrentSheet->m_AssociatedScreen == NULL || IsOK( NULL, msg ) ) if( m_CurrentSheet->m_AssociatedScreen == NULL || IsOK( NULL, msg ) )
{ //do not prompt on a new sheet. in fact, we should not allow a sheet to be created { //do not prompt on a new sheet. in fact, we should not allow a sheet to be created

View File

@ -543,21 +543,21 @@ private:
wxPoint aPos ); wxPoint aPos );
public: public:
/** /**
* Function HitTest * Function TextHitTest
* tests if the given wxPoint is within the bounds of this object. * tests if the given wxPoint is within the bounds of this object.
* @param ref_pos A wxPoint to test * @param ref_pos A wxPoint to test
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool HitTest( const wxPoint& ref_pos ); bool TextHitTest( const wxPoint& ref_pos );
/** /**
* Function HitTest (overlayed) * Function TextHitTest (overlayed)
* tests if the given EDA_Rect intersect this object. * tests if the given EDA_Rect intersect this object.
* For now, the anchor must be inside this rect. * For now, the anchor must be inside this rect.
* @param refArea : the given EDA_Rect * @param refArea : the given EDA_Rect
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool HitTest( EDA_Rect& refArea ); bool TextHitTest( EDA_Rect& refArea );
/** /**
* Function LenSize * Function LenSize

View File

@ -69,6 +69,11 @@ static inline const wxChar* GetChars( wxString s )
while( Angle > 900 ) \ while( Angle > 900 ) \
Angle -= 1800; } Angle -= 1800; }
/* Normalize angle to be in the -180.0 .. 180.0 range */
#define NORMALIZE_ANGLE_180( Angle ) { while( Angle <= -1800 ) \
Angle += 3600;\
while( Angle > 1800 ) \
Angle -= 3600; }
/*****************************/ /*****************************/
/* macro to exchange 2 items */ /* macro to exchange 2 items */

View File

@ -279,7 +279,6 @@ public:
// ratsnest functions // ratsnest functions
void Compile_Ratsnest( wxDC* DC, bool affiche ); /* Recalcul complet du chevelu */ void Compile_Ratsnest( wxDC* DC, bool affiche ); /* Recalcul complet du chevelu */
void ReCompile_Ratsnest_After_Changes( wxDC* DC );
int Test_1_Net_Ratsnest( wxDC* DC, int net_code ); int Test_1_Net_Ratsnest( wxDC* DC, int net_code );
void build_ratsnest_module( wxDC* DC, MODULE* Module ); void build_ratsnest_module( wxDC* DC, MODULE* Module );
void trace_ratsnest_module( wxDC* DC ); void trace_ratsnest_module( wxDC* DC );
@ -1011,7 +1010,7 @@ public:
// loading Footprint // loading Footprint
MODULE* Import_Module( wxDC* DC ); MODULE* Import_Module( wxDC* DC );
void Export_Module( MODULE* ptmod, bool createlib ); void Export_Module( MODULE* ptmod, bool createlib );
void Load_Module_Module_From_BOARD( MODULE* Module ); void Load_Module_From_BOARD( MODULE* Module );
// functions to edit footprint edges // functions to edit footprint edges
void Edit_Edge_Width( EDGE_MODULE* Edge ); void Edit_Edge_Width( EDGE_MODULE* Edge );

Binary file not shown.

View File

@ -2,8 +2,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: kicad\n" "Project-Id-Version: kicad\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-02 10:18+0100\n" "POT-Creation-Date: 2009-06-11 14:39+0100\n"
"PO-Revision-Date: 2009-06-02 10:21+0100\n" "PO-Revision-Date: 2009-06-11 14:40+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\n" "Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -73,38 +73,38 @@ msgstr " fichier %s non trouvé"
msgid "Unable to create file %s" msgid "Unable to create file %s"
msgstr "Impossible de créer fichier <%s>" msgstr "Impossible de créer fichier <%s>"
#: pcbnew/xchgmod.cpp:349 #: pcbnew/xchgmod.cpp:348
#, c-format #, c-format
msgid "Change modules <%s> -> <%s> (val = %s)?" msgid "Change modules <%s> -> <%s> (val = %s)?"
msgstr "Change modules <%s> -> <%s> (val = %s)?" msgstr "Change modules <%s> -> <%s> (val = %s)?"
#: pcbnew/xchgmod.cpp:356 #: pcbnew/xchgmod.cpp:355
#, c-format #, c-format
msgid "Change modules <%s> -> <%s> ?" msgid "Change modules <%s> -> <%s> ?"
msgstr "Change modules <%s> -> <%s> ?" msgstr "Change modules <%s> -> <%s> ?"
#: pcbnew/xchgmod.cpp:420 #: pcbnew/xchgmod.cpp:418
msgid "Change ALL modules ?" msgid "Change ALL modules ?"
msgstr "Change TOUS les modules ?" msgstr "Change TOUS les modules ?"
#: pcbnew/xchgmod.cpp:483 #: pcbnew/xchgmod.cpp:480
#, c-format #, c-format
msgid "Change module %s (%s) " msgid "Change module %s (%s) "
msgstr "Change module %s (%s) " msgstr "Change module %s (%s) "
#: pcbnew/xchgmod.cpp:629 #: pcbnew/xchgmod.cpp:628
msgid "No Modules!" msgid "No Modules!"
msgstr "Pas de Modules!" msgstr "Pas de Modules!"
#: pcbnew/xchgmod.cpp:636 #: pcbnew/xchgmod.cpp:635
msgid "Component files (." msgid "Component files (."
msgstr "Fichiers de composant (." msgstr "Fichiers de composant (."
#: pcbnew/xchgmod.cpp:639 #: pcbnew/xchgmod.cpp:638
msgid "Save Component Files" msgid "Save Component Files"
msgstr "Sauver Fichier Composant" msgstr "Sauver Fichier Composant"
#: pcbnew/xchgmod.cpp:651 #: pcbnew/xchgmod.cpp:650
msgid "Unable to create file " msgid "Unable to create file "
msgstr "Impossible de créer le fichier " msgstr "Impossible de créer le fichier "
@ -553,11 +553,11 @@ msgstr "Nom:"
msgid "Search footprint" msgid "Search footprint"
msgstr "Cherche Module" msgstr "Cherche Module"
#: pcbnew/modules.cpp:310 #: pcbnew/modules.cpp:306
msgid "Delete Module" msgid "Delete Module"
msgstr "Supprimer Module" msgstr "Supprimer Module"
#: pcbnew/modules.cpp:311 #: pcbnew/modules.cpp:307
msgid "Value " msgid "Value "
msgstr "Valeur " msgstr "Valeur "
@ -707,11 +707,11 @@ msgstr "Visu 3D"
msgid "Module Editor" msgid "Module Editor"
msgstr "Ouvrir Editeur de modules" msgstr "Ouvrir Editeur de modules"
#: pcbnew/editmod.cpp:138 #: pcbnew/editmod.cpp:137
msgid "Text is REFERENCE!" msgid "Text is REFERENCE!"
msgstr "Le texte est la REFERENCE!" msgstr "Le texte est la REFERENCE!"
#: pcbnew/editmod.cpp:143 #: pcbnew/editmod.cpp:142
msgid "Text is VALUE!" msgid "Text is VALUE!"
msgstr "Le texte est la VALEUR!" msgstr "Le texte est la VALEUR!"
@ -1274,23 +1274,23 @@ msgstr "Effacer Bloc"
msgid "Delete zones" msgid "Delete zones"
msgstr "SuppressionZones" msgstr "SuppressionZones"
#: pcbnew/block.cpp:603 #: pcbnew/block.cpp:596
msgid "Rotate Block" msgid "Rotate Block"
msgstr "Rotation Bloc" msgstr "Rotation Bloc"
#: pcbnew/block.cpp:660 #: pcbnew/block.cpp:653
msgid "Zone rotation" msgid "Zone rotation"
msgstr "Rotation Zones" msgstr "Rotation Zones"
#: pcbnew/block.cpp:766 #: pcbnew/block.cpp:758
msgid "Block mirroring" msgid "Block mirroring"
msgstr "Bloc Miroir" msgstr "Bloc Miroir"
#: pcbnew/block.cpp:951 #: pcbnew/block.cpp:942
msgid "Move Block" msgid "Move Block"
msgstr "Déplacer Bloc" msgstr "Déplacer Bloc"
#: pcbnew/block.cpp:1097 #: pcbnew/block.cpp:1087
msgid "Copy Block" msgid "Copy Block"
msgstr "Copie Bloc" msgstr "Copie Bloc"
@ -1298,51 +1298,51 @@ msgstr "Copie Bloc"
msgid "Place module" msgid "Place module"
msgstr "Place module" msgstr "Place module"
#: pcbnew/loadcmp.cpp:210 #: pcbnew/loadcmp.cpp:217
#: pcbnew/loadcmp.cpp:361 #: pcbnew/loadcmp.cpp:368
#, c-format #, c-format
msgid "PCB footprint library file <%s> not found in search paths." msgid "PCB footprint library file <%s> not found in search paths."
msgstr "Librairie modules PCB %s non trouvée dans les chemins de recherche" msgstr "Librairie modules PCB %s non trouvée dans les chemins de recherche"
#: pcbnew/loadcmp.cpp:212 #: pcbnew/loadcmp.cpp:219
#: pcbnew/loadcmp.cpp:223 #: pcbnew/loadcmp.cpp:230
#: pcbnew/loadcmp.cpp:239 #: pcbnew/loadcmp.cpp:246
#: pcbnew/loadcmp.cpp:363 #: pcbnew/loadcmp.cpp:370
#: pcbnew/loadcmp.cpp:399 #: pcbnew/loadcmp.cpp:406
msgid "Library Load Error" msgid "Library Load Error"
msgstr "Erreur en Chargement de librairie" msgstr "Erreur en Chargement de librairie"
#: pcbnew/loadcmp.cpp:221 #: pcbnew/loadcmp.cpp:228
#, c-format #, c-format
msgid "Could not open PCB footprint library file <%s>." msgid "Could not open PCB footprint library file <%s>."
msgstr "Ne peut ouvrir le fichier librairie de modules PCB <%s>." msgstr "Ne peut ouvrir le fichier librairie de modules PCB <%s>."
#: pcbnew/loadcmp.cpp:228 #: pcbnew/loadcmp.cpp:235
#, c-format #, c-format
msgid "Scan Lib: %s" msgid "Scan Lib: %s"
msgstr "Examen Lib: %s" msgstr "Examen Lib: %s"
#: pcbnew/loadcmp.cpp:237 #: pcbnew/loadcmp.cpp:244
#: pcbnew/loadcmp.cpp:397 #: pcbnew/loadcmp.cpp:404
#, c-format #, c-format
msgid "<%s> is not a valid Kicad PCB footprint library file." msgid "<%s> is not a valid Kicad PCB footprint library file."
msgstr "<%s> n'est pas un fichier librarire de modules Kicad PCB valide." msgstr "<%s> n'est pas un fichier librarire de modules Kicad PCB valide."
#: pcbnew/loadcmp.cpp:304 #: pcbnew/loadcmp.cpp:311
#, c-format #, c-format
msgid "Module <%s> not found" msgid "Module <%s> not found"
msgstr "Module <%s> non trouvé" msgstr "Module <%s> non trouvé"
#: pcbnew/loadcmp.cpp:388 #: pcbnew/loadcmp.cpp:395
msgid "Library " msgid "Library "
msgstr "Librairie " msgstr "Librairie "
#: pcbnew/loadcmp.cpp:388 #: pcbnew/loadcmp.cpp:395
msgid " loaded" msgid " loaded"
msgstr " chargé" msgstr " chargé"
#: pcbnew/loadcmp.cpp:459 #: pcbnew/loadcmp.cpp:466
#: pcbnew/loadcmp.cpp:611 #: pcbnew/loadcmp.cpp:618
#, c-format #, c-format
msgid "Modules [%d items]" msgid "Modules [%d items]"
msgstr "Modules [%d éléments]" msgstr "Modules [%d éléments]"
@ -1529,11 +1529,11 @@ msgstr "Impossible de créer le fichier temporaire "
msgid "Create temporary file " msgid "Create temporary file "
msgstr "Création fichier temporaire " msgstr "Création fichier temporaire "
#: pcbnew/router.cpp:573 #: pcbnew/router.cpp:572
msgid "Unable to find data file " msgid "Unable to find data file "
msgstr "Impossible de trouver le fichier de données " msgstr "Impossible de trouver le fichier de données "
#: pcbnew/router.cpp:579 #: pcbnew/router.cpp:578
msgid "Reading autorouter data file " msgid "Reading autorouter data file "
msgstr "Lecture fichier données de l'autorouteur" msgstr "Lecture fichier données de l'autorouteur"
@ -1823,24 +1823,24 @@ msgstr "Pas de mémoire pour autoroutage"
msgid "Place Cells" msgid "Place Cells"
msgstr "Place Cells" msgstr "Place Cells"
#: pcbnew/set_color.cpp:258 #: pcbnew/set_color.cpp:263
#: pcbnew/set_color.cpp:284 #: pcbnew/set_color.cpp:289
msgid "Show None" msgid "Show None"
msgstr "Rien Afficher" msgstr "Rien Afficher"
#: pcbnew/set_color.cpp:267 #: pcbnew/set_color.cpp:272
msgid "Show All" msgid "Show All"
msgstr "Tout Afficher" msgstr "Tout Afficher"
#: pcbnew/set_color.cpp:279 #: pcbnew/set_color.cpp:284
msgid "Switch on all of the copper layers" msgid "Switch on all of the copper layers"
msgstr "Affiche toutes les couches cuivre" msgstr "Affiche toutes les couches cuivre"
#: pcbnew/set_color.cpp:287 #: pcbnew/set_color.cpp:292
msgid "Switch off all of the copper layers" msgid "Switch off all of the copper layers"
msgstr "N'affiche pas les couches cuivre" msgstr "N'affiche pas les couches cuivre"
#: pcbnew/set_color.cpp:346 #: pcbnew/set_color.cpp:351
msgid "Apply" msgid "Apply"
msgstr "Appliquer" msgstr "Appliquer"
@ -2406,7 +2406,7 @@ msgstr "Effacer Pistes ?"
msgid "Delete Modules?" msgid "Delete Modules?"
msgstr "Effacement des Modules?" msgstr "Effacement des Modules?"
#: pcbnew/initpcb.cpp:299 #: pcbnew/initpcb.cpp:298
msgid "Delete Pcb Texts" msgid "Delete Pcb Texts"
msgstr "Effacer Textes Pcb" msgstr "Effacer Textes Pcb"
@ -2493,35 +2493,35 @@ msgstr "Angle"
msgid "Segment" msgid "Segment"
msgstr "Segment" msgstr "Segment"
#: pcbnew/autoplac.cpp:105 #: pcbnew/autoplac.cpp:104
msgid "Footprints NOT LOCKED will be moved" msgid "Footprints NOT LOCKED will be moved"
msgstr "Les modules NON FIXES vont être déplacés" msgstr "Les modules NON FIXES vont être déplacés"
#: pcbnew/autoplac.cpp:110 #: pcbnew/autoplac.cpp:109
msgid "Footprints NOT PLACED will be moved" msgid "Footprints NOT PLACED will be moved"
msgstr "Les modules NON PLACES vont être déplacés" msgstr "Les modules NON PLACES vont être déplacés"
#: pcbnew/autoplac.cpp:403 #: pcbnew/autoplac.cpp:400
msgid "No edge PCB, Unknown board size!" msgid "No edge PCB, Unknown board size!"
msgstr "Pas de contour PCB, la taille du PCB est inconnue!" msgstr "Pas de contour PCB, la taille du PCB est inconnue!"
#: pcbnew/autoplac.cpp:424 #: pcbnew/autoplac.cpp:421
msgid "Cols" msgid "Cols"
msgstr "Cols" msgstr "Cols"
#: pcbnew/autoplac.cpp:426 #: pcbnew/autoplac.cpp:423
msgid "Lines" msgid "Lines"
msgstr "Lignes" msgstr "Lignes"
#: pcbnew/autoplac.cpp:428 #: pcbnew/autoplac.cpp:425
msgid "Cells." msgid "Cells."
msgstr "Cells." msgstr "Cells."
#: pcbnew/autoplac.cpp:489 #: pcbnew/autoplac.cpp:486
msgid "Loop" msgid "Loop"
msgstr "Itération" msgstr "Itération"
#: pcbnew/autoplac.cpp:643 #: pcbnew/autoplac.cpp:638
msgid "Ok to abort ?" msgid "Ok to abort ?"
msgstr "Ok pour arrêter ?" msgstr "Ok pour arrêter ?"
@ -2704,7 +2704,7 @@ msgstr "Lire Fichier Projet"
msgid "File %s not found" msgid "File %s not found"
msgstr "Fichier %s non trouvé" msgstr "Fichier %s non trouvé"
#: pcbnew/pcbcfg.cpp:209 #: pcbnew/pcbcfg.cpp:229
msgid "Save Project File" msgid "Save Project File"
msgstr "Sauver Fichier Projet" msgstr "Sauver Fichier Projet"
@ -3097,22 +3097,22 @@ msgstr "Pour une liste de pads non connecté, clic droit pour ouvrir un menu"
msgid "Unconnected" msgid "Unconnected"
msgstr "Non connecté" msgstr "Non connecté"
#: pcbnew/dialog_drc.cpp:660 #: pcbnew/dialog_drc.cpp:655
#: pcbnew/dialog_drc.cpp:738 #: pcbnew/dialog_drc.cpp:733
#, c-format #, c-format
msgid "Report file \"%s\" created" msgid "Report file \"%s\" created"
msgstr "Fichier rapport \"%s\" créé" msgstr "Fichier rapport \"%s\" créé"
#: pcbnew/dialog_drc.cpp:662 #: pcbnew/dialog_drc.cpp:657
#: pcbnew/dialog_drc.cpp:740 #: pcbnew/dialog_drc.cpp:735
msgid "Disk File Report Completed" msgid "Disk File Report Completed"
msgstr "Fichier rapport terminé" msgstr "Fichier rapport terminé"
#: pcbnew/dialog_drc.cpp:761 #: pcbnew/dialog_drc.cpp:756
msgid "DRC report files (.rpt)|*.rpt" msgid "DRC report files (.rpt)|*.rpt"
msgstr "Fichier rapport DRC (.rpt)|*.rpt" msgstr "Fichier rapport DRC (.rpt)|*.rpt"
#: pcbnew/dialog_drc.cpp:767 #: pcbnew/dialog_drc.cpp:762
msgid "Save DRC Report File" msgid "Save DRC Report File"
msgstr "Sauver Fichier Rapport DRC:" msgstr "Sauver Fichier Rapport DRC:"
@ -4696,19 +4696,19 @@ msgstr ""
msgid "Messages:" msgid "Messages:"
msgstr "Messages:" msgstr "Messages:"
#: pcbnew/class_netinfo_item.cpp:134 #: pcbnew/class_netinfo_item.cpp:136
msgid "Net Name" msgid "Net Name"
msgstr "Nom Equipot" msgstr "Nom Equipot"
#: pcbnew/class_netinfo_item.cpp:137 #: pcbnew/class_netinfo_item.cpp:139
msgid "Net Code" msgid "Net Code"
msgstr "Net Code" msgstr "Net Code"
#: pcbnew/class_netinfo_item.cpp:166 #: pcbnew/class_netinfo_item.cpp:168
msgid "Vias" msgid "Vias"
msgstr "Vias" msgstr "Vias"
#: pcbnew/class_netinfo_item.cpp:169 #: pcbnew/class_netinfo_item.cpp:171
msgid "Net Length" msgid "Net Length"
msgstr "Long. Net" msgstr "Long. Net"
@ -5246,23 +5246,23 @@ msgstr "Recalculer le chevelu complet ( utile après une édition manuelle de no
msgid "Netlist File:" msgid "Netlist File:"
msgstr "Fichier Netliste:" msgstr "Fichier Netliste:"
#: pcbnew/class_board.cpp:529 #: pcbnew/class_board.cpp:532
msgid "Nodes" msgid "Nodes"
msgstr "Nodes" msgstr "Nodes"
#: pcbnew/class_board.cpp:532 #: pcbnew/class_board.cpp:535
msgid "Nets" msgid "Nets"
msgstr "Nets" msgstr "Nets"
#: pcbnew/class_board.cpp:540 #: pcbnew/class_board.cpp:543
msgid "Links" msgid "Links"
msgstr "Liens" msgstr "Liens"
#: pcbnew/class_board.cpp:543 #: pcbnew/class_board.cpp:546
msgid "Connect" msgid "Connect"
msgstr "Connect" msgstr "Connect"
#: pcbnew/class_board.cpp:546 #: pcbnew/class_board.cpp:549
msgid "NoConn" msgid "NoConn"
msgstr "Non Conn" msgstr "Non Conn"
@ -6030,15 +6030,15 @@ msgid "Bad Bus Label: "
msgstr "Mauvais label de Bus: " msgstr "Mauvais label de Bus: "
#: eeschema/selpart.cpp:39 #: eeschema/selpart.cpp:39
#: eeschema/find.cpp:649 #: eeschema/find.cpp:648
msgid "No libraries are loaded" msgid "No libraries are loaded"
msgstr "Pas de librairies chargées" msgstr "Pas de librairies chargées"
#: eeschema/selpart.cpp:44 #: eeschema/selpart.cpp:43
msgid "Select Lib" msgid "Select Lib"
msgstr "Sélection librairie" msgstr "Sélection librairie"
#: eeschema/selpart.cpp:94 #: eeschema/selpart.cpp:112
#, c-format #, c-format
msgid "Select component (%d items)" msgid "Select component (%d items)"
msgstr "Sélection composant (%d items)" msgstr "Sélection composant (%d items)"
@ -6077,23 +6077,23 @@ msgstr " Trouvé en "
msgid " Not Found" msgid " Not Found"
msgstr " Non trouvé" msgstr " Non trouvé"
#: eeschema/find.cpp:676 #: eeschema/find.cpp:666
#: eeschema/find.cpp:744 #: eeschema/find.cpp:732
#: eeschema/find.cpp:760 #: eeschema/find.cpp:748
msgid "Found " msgid "Found "
msgstr "Trouvé " msgstr "Trouvé "
#: eeschema/find.cpp:678 #: eeschema/find.cpp:668
#: eeschema/find.cpp:745 #: eeschema/find.cpp:733
#: eeschema/find.cpp:761 #: eeschema/find.cpp:749
msgid " in lib " msgid " in lib "
msgstr " en libr. " msgstr " en libr. "
#: eeschema/find.cpp:689 #: eeschema/find.cpp:677
msgid " found only in cache" msgid " found only in cache"
msgstr "trouvé seulement en cache" msgstr "trouvé seulement en cache"
#: eeschema/find.cpp:692 #: eeschema/find.cpp:680
msgid "" msgid ""
"\n" "\n"
"Explore All Libraries?" "Explore All Libraries?"
@ -6101,7 +6101,7 @@ msgstr ""
"\n" "\n"
"Explorer toutes les Librairies?" "Explorer toutes les Librairies?"
#: eeschema/find.cpp:698 #: eeschema/find.cpp:686
msgid "Nothing found" msgid "Nothing found"
msgstr " Rien trouvé" msgstr " Rien trouvé"
@ -6322,31 +6322,31 @@ msgstr "Pas de nouveau texte: pas de changements"
msgid "Schematic modified, Save before exit ?" msgid "Schematic modified, Save before exit ?"
msgstr "Schématique modifiée, Sauver avant de quitter ?" msgstr "Schématique modifiée, Sauver avant de quitter ?"
#: eeschema/schframe.cpp:442 #: eeschema/schframe.cpp:444
msgid "Draw wires and busses in any direction" msgid "Draw wires and busses in any direction"
msgstr "Tracer les fils et bus de n'importe quelle direction" msgstr "Tracer les fils et bus de n'importe quelle direction"
#: eeschema/schframe.cpp:443 #: eeschema/schframe.cpp:445
msgid "Draw horizontal and vertical wires and busses only" msgid "Draw horizontal and vertical wires and busses only"
msgstr "Autoriser fils et bus verticaux et horizontaux seulement" msgstr "Autoriser fils et bus verticaux et horizontaux seulement"
#: eeschema/schframe.cpp:451 #: eeschema/schframe.cpp:453
msgid "Do not show hidden pins" msgid "Do not show hidden pins"
msgstr "Ne pas affichager les pins invisibles" msgstr "Ne pas affichager les pins invisibles"
#: eeschema/schframe.cpp:452 #: eeschema/schframe.cpp:454
msgid "Show hidden pins" msgid "Show hidden pins"
msgstr "Force affichage des pins invisibles" msgstr "Force affichage des pins invisibles"
#: eeschema/schframe.cpp:472 #: eeschema/schframe.cpp:474
msgid "Hide grid" msgid "Hide grid"
msgstr "Ne pas afficher la grille" msgstr "Ne pas afficher la grille"
#: eeschema/schframe.cpp:472 #: eeschema/schframe.cpp:474
msgid "Show grid" msgid "Show grid"
msgstr "Afficher grille" msgstr "Afficher grille"
#: eeschema/schframe.cpp:549 #: eeschema/schframe.cpp:551
msgid "Schematic" msgid "Schematic"
msgstr "Schématique" msgstr "Schématique"
@ -6488,19 +6488,39 @@ msgstr "Valeurs différentes pour %s%d%c (%s) et %s%d%c (%s)"
msgid "duplicate time stamp (%s) for %s%d and %s%d" msgid "duplicate time stamp (%s) for %s%d and %s%d"
msgstr "signature temporelle dupliquée (%s) pour %s%d et %s%d" msgstr "signature temporelle dupliquée (%s) pour %s%d et %s%d"
#: eeschema/sheetlab.cpp:74 #: eeschema/sheetlab.cpp:69
msgid "PinSheet Properties:" msgid "PinSheet Properties:"
msgstr "Propriétés des Pins de Hiérarchie" msgstr "Propriétés des Pins de Hiérarchie"
#: eeschema/sheetlab.cpp:105
msgid "Input"
msgstr "Entrée"
#: eeschema/sheetlab.cpp:105
msgid "Output"
msgstr "Sortie"
#: eeschema/sheetlab.cpp:105
msgid "Bidi"
msgstr "Bidi"
#: eeschema/sheetlab.cpp:105
msgid "TriState"
msgstr "3 états"
#: eeschema/sheetlab.cpp:105
msgid "Passive"
msgstr "Passive"
#: eeschema/sheetlab.cpp:107 #: eeschema/sheetlab.cpp:107
msgid "PinSheet Shape:" msgid "PinSheet Shape:"
msgstr "Forme Pin de hiérarchie:" msgstr "Forme Pin de hiérarchie:"
#: eeschema/sheetlab.cpp:328 #: eeschema/sheetlab.cpp:325
msgid "PinSheet" msgid "PinSheet"
msgstr "Pin de Feuille de Hiérarchie" msgstr "Pin de Feuille de Hiérarchie"
#: eeschema/sheetlab.cpp:388 #: eeschema/sheetlab.cpp:385
msgid "No New Hierarchal Label found" msgid "No New Hierarchal Label found"
msgstr "Pas de nouveau Label Hiérarchique trouvé" msgstr "Pas de nouveau Label Hiérarchique trouvé"
@ -7390,20 +7410,21 @@ msgstr "Epaiss. ligne par défaut"
msgid "Plot: %s\n" msgid "Plot: %s\n"
msgstr "Trace: %s\n" msgstr "Trace: %s\n"
#: eeschema/sheet.cpp:158 #: eeschema/sheet.cpp:170
msgid "Sheetname:" msgid "Sheetname:"
msgstr "Nom feuille" msgstr "Nom feuille"
#: eeschema/sheet.cpp:254 #: eeschema/sheet.cpp:287
msgid "No Filename! Aborted" msgid "No Filename! Aborted"
msgstr "Pas de Nom de Fichier! Abandon" msgstr "Pas de Nom de Fichier! Abandon"
#: eeschema/sheet.cpp:269 #: eeschema/sheet.cpp:303
#, fuzzy
msgid "" msgid ""
"Changing a Filename can change all the schematic structures and cannot be undone.\n" "Changing a Filename can change all the schematic structures and cannot be undone.\n"
"Ok to continue renaming?" "Ok to continue renaming?"
msgstr "Changer un nom de fichier peut changer toute la structure schématique et ne pourra être annulée." msgstr ""
"Changer un nom de fichier peut changer toute la structure schématique et ne pourra être annulée.\n"
"Ok pour renommer?"
#: eeschema/dialog_edit_component_in_schematic_fbp.cpp:28 #: eeschema/dialog_edit_component_in_schematic_fbp.cpp:28
msgid "3" msgid "3"
@ -7919,26 +7940,6 @@ msgstr "Enter le texte qui doit être utilisé dans la schématique"
msgid "Direction" msgid "Direction"
msgstr "Direction" msgstr "Direction"
#: eeschema/dialog_edit_label_base.cpp:49
msgid "Input"
msgstr "Entrée"
#: eeschema/dialog_edit_label_base.cpp:49
msgid "Output"
msgstr "Sortie"
#: eeschema/dialog_edit_label_base.cpp:49
msgid "Bidi"
msgstr "Bidi"
#: eeschema/dialog_edit_label_base.cpp:49
msgid "TriState"
msgstr "3 états"
#: eeschema/dialog_edit_label_base.cpp:49
msgid "Passive"
msgstr "Passive"
#: eeschema/dialog_edit_label_base.cpp:51 #: eeschema/dialog_edit_label_base.cpp:51
msgid "Glabel Shape" msgid "Glabel Shape"
msgstr "Forme GLabel" msgstr "Forme GLabel"
@ -8075,65 +8076,65 @@ msgstr "Tout"
msgid "arc only had %d parameters of the required 8" msgid "arc only had %d parameters of the required 8"
msgstr "l'arc a seulement %d paramètres sur les 8 requis" msgstr "l'arc a seulement %d paramètres sur les 8 requis"
#: eeschema/classes_body_items.cpp:331 #: eeschema/classes_body_items.cpp:332
#: eeschema/classes_body_items.cpp:451 #: eeschema/classes_body_items.cpp:455
#: eeschema/classes_body_items.cpp:587 #: eeschema/classes_body_items.cpp:675
#: eeschema/classes_body_items.cpp:693 #: eeschema/classes_body_items.cpp:785
#: eeschema/classes_body_items.cpp:777 #: eeschema/classes_body_items.cpp:870
#: eeschema/classes_body_items.cpp:1014 #: eeschema/classes_body_items.cpp:1107
msgid "Line width" msgid "Line width"
msgstr "Epaisseur ligne" msgstr "Epaisseur ligne"
#: eeschema/classes_body_items.cpp:336 #: eeschema/classes_body_items.cpp:337
#: eeschema/classes_body_items.cpp:460 #: eeschema/classes_body_items.cpp:464
#: eeschema/classes_body_items.cpp:782 #: eeschema/classes_body_items.cpp:875
#: eeschema/classes_body_items.cpp:1019 #: eeschema/classes_body_items.cpp:1112
msgid "Bounding box" msgid "Bounding box"
msgstr "Rectange dencadrement" msgstr "Rectange dencadrement"
#: eeschema/classes_body_items.cpp:365 #: eeschema/classes_body_items.cpp:367
#, c-format #, c-format
msgid "circle only had %d parameters of the required 6" msgid "circle only had %d parameters of the required 6"
msgstr "le cercle a seulement %d paramètres sur les 6 requis" msgstr "le cercle a seulement %d paramètres sur les 6 requis"
#: eeschema/classes_body_items.cpp:455 #: eeschema/classes_body_items.cpp:459
msgid "Radius" msgid "Radius"
msgstr "Rayon" msgstr "Rayon"
#: eeschema/classes_body_items.cpp:504 #: eeschema/classes_body_items.cpp:529
#, c-format #, c-format
msgid "text only had %d parameters of the required 8" msgid "text only had %d parameters of the required 8"
msgstr "le texte a seulement %d paramètres sur les 8 requis" msgstr "le texte a seulement %d paramètres sur les 8 requis"
#: eeschema/classes_body_items.cpp:595 #: eeschema/classes_body_items.cpp:687
msgid "Rectangle" msgid "Rectangle"
msgstr "Rectangle" msgstr "Rectangle"
#: eeschema/classes_body_items.cpp:618 #: eeschema/classes_body_items.cpp:710
#, c-format #, c-format
msgid "rectangle only had %d parameters of the required 7" msgid "rectangle only had %d parameters of the required 7"
msgstr "le rectangle a seulement %d paramètres sur les 7 requis" msgstr "le rectangle a seulement %d paramètres sur les 7 requis"
#: eeschema/classes_body_items.cpp:791 #: eeschema/classes_body_items.cpp:884
msgid "PolyLine" msgid "PolyLine"
msgstr "PolyLigne" msgstr "PolyLigne"
#: eeschema/classes_body_items.cpp:823 #: eeschema/classes_body_items.cpp:916
#, c-format #, c-format
msgid "polyline only had %d parameters of the required 4" msgid "polyline only had %d parameters of the required 4"
msgstr "la polyligne a seulement %d paramètres sur les 4 requis" msgstr "la polyligne a seulement %d paramètres sur les 4 requis"
#: eeschema/classes_body_items.cpp:828 #: eeschema/classes_body_items.cpp:921
#, c-format #, c-format
msgid "polyline count parameter %d is invalid" msgid "polyline count parameter %d is invalid"
msgstr "le nombre de paramètes (%d) de la polyligne est mauvais" msgstr "le nombre de paramètes (%d) de la polyligne est mauvais"
#: eeschema/classes_body_items.cpp:844 #: eeschema/classes_body_items.cpp:937
#, c-format #, c-format
msgid "polyline point %d X position not defined" msgid "polyline point %d X position not defined"
msgstr "la position X du point %d de la polyligne n'est pas définie" msgstr "la position X du point %d de la polyligne n'est pas définie"
#: eeschema/classes_body_items.cpp:851 #: eeschema/classes_body_items.cpp:944
#, c-format #, c-format
msgid "polyline point %d Y position not defined" msgid "polyline point %d Y position not defined"
msgstr "la position Y du point %d de la polyligne n'est pas définie" msgstr "la position Y du point %d de la polyligne n'est pas définie"
@ -8365,13 +8366,13 @@ msgstr "Options :"
#: eeschema/dialog_cmp_graphic_properties.cpp:154 #: eeschema/dialog_cmp_graphic_properties.cpp:154
#: eeschema/pinedit-dialog.cpp:180 #: eeschema/pinedit-dialog.cpp:180
#: eeschema/dialog_bodygraphictext_properties_base.cpp:34 #: eeschema/dialog_bodygraphictext_properties_base.cpp:66
msgid "Common to Units" msgid "Common to Units"
msgstr "Commun aux Unités" msgstr "Commun aux Unités"
#: eeschema/dialog_cmp_graphic_properties.cpp:158 #: eeschema/dialog_cmp_graphic_properties.cpp:158
#: eeschema/pinedit-dialog.cpp:184 #: eeschema/pinedit-dialog.cpp:184
#: eeschema/dialog_bodygraphictext_properties_base.cpp:38 #: eeschema/dialog_bodygraphictext_properties_base.cpp:70
msgid "Common to convert" msgid "Common to convert"
msgstr "Commun à converti" msgstr "Commun à converti"
@ -8489,7 +8490,7 @@ msgstr ""
msgid "User defined search path" msgid "User defined search path"
msgstr "Chemin de recherche défini par l'utilisateur" msgstr "Chemin de recherche défini par l'utilisateur"
#: eeschema/class_libentry_fields.cpp:345 #: eeschema/class_libentry_fields.cpp:325
msgid "Datasheet" msgid "Datasheet"
msgstr "Documentation" msgstr "Documentation"
@ -8549,50 +8550,54 @@ msgstr "Emetteur ouv."
msgid "Electrical Type:" msgid "Electrical Type:"
msgstr "Type électrique:" msgstr "Type électrique:"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:32 #: eeschema/dialog_bodygraphictext_properties_base.cpp:57
msgid " Text Options : " msgid " Text Options : "
msgstr "Options du Texte: " msgstr "Options du Texte: "
#: eeschema/dialog_bodygraphictext_properties_base.cpp:42 #: eeschema/dialog_bodygraphictext_properties_base.cpp:59
msgid "Vertical" msgid "Vertical"
msgstr "Vertical" msgstr "Vertical"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:53 #: eeschema/dialog_bodygraphictext_properties_base.cpp:78
msgid "Size:"
msgstr "Taille:"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:62
msgid "Text Shape:" msgid "Text Shape:"
msgstr "Aspect Texte:" msgstr "Aspect Texte:"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:82
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:54 #: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:54
msgid "Align left" msgid "Align left"
msgstr "Alignement à gauche" msgstr "Alignement à gauche"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:82
#: eeschema/dialog_bodygraphictext_properties_base.cpp:88
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:54 #: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:54
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:67 #: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:67
msgid "Align center" msgid "Align center"
msgstr "Alignement au centre" msgstr "Alignement au centre"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:82
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:54 #: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:54
msgid "Align right" msgid "Align right"
msgstr "Alignement à droite" msgstr "Alignement à droite"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:84
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:56 #: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:56
msgid "Horiz. Justify" msgid "Horiz. Justify"
msgstr "Justification Horiz." msgstr "Justification Horiz."
#: eeschema/dialog_bodygraphictext_properties_base.cpp:88
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:67 #: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:67
msgid "Align bottom" msgid "Align bottom"
msgstr "Alignement en bas" msgstr "Alignement en bas"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:88
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:67 #: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:67
msgid "Align top" msgid "Align top"
msgstr "Alignement au sommet" msgstr "Alignement au sommet"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:90
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:69 #: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:69
msgid "Vert Justify" msgid "Vert. Justify"
msgstr "Justifié Vert." msgstr "Vert. Justifié"
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:143 #: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:143
msgid "The vertical height of the currently selected field's text in the schematic" msgid "The vertical height of the currently selected field's text in the schematic"
@ -8931,24 +8936,24 @@ msgstr "Fichier librairie <%s> non trouvé."
msgid " error!" msgid " error!"
msgstr " erreur!" msgstr " erreur!"
#: eeschema/eelibs_read_libraryfiles.cpp:313 #: eeschema/eelibs_read_libraryfiles.cpp:289
#: eeschema/eelibs_read_libraryfiles.cpp:320 #: eeschema/eelibs_read_libraryfiles.cpp:296
msgid "File <" msgid "File <"
msgstr "Fichier <" msgstr "Fichier <"
#: eeschema/eelibs_read_libraryfiles.cpp:313 #: eeschema/eelibs_read_libraryfiles.cpp:289
msgid "> is empty!" msgid "> is empty!"
msgstr "> est vide" msgstr "> est vide"
#: eeschema/eelibs_read_libraryfiles.cpp:321 #: eeschema/eelibs_read_libraryfiles.cpp:297
msgid "> is NOT EESCHEMA library!" msgid "> is NOT EESCHEMA library!"
msgstr "> n'est PAS une librairie EESCHEMA !" msgstr "> n'est PAS une librairie EESCHEMA !"
#: eeschema/eelibs_read_libraryfiles.cpp:338 #: eeschema/eelibs_read_libraryfiles.cpp:314
msgid "Library <" msgid "Library <"
msgstr "Librairie <" msgstr "Librairie <"
#: eeschema/eelibs_read_libraryfiles.cpp:339 #: eeschema/eelibs_read_libraryfiles.cpp:315
msgid "> header read error" msgid "> header read error"
msgstr "> erreur lecture entête" msgstr "> erreur lecture entête"
@ -10032,7 +10037,7 @@ msgstr ""
#: gerbview/files.cpp:151 #: gerbview/files.cpp:151
msgid "Mechanical layers (*.GMx)|*.GM1;*.gm1;*.GM2;*.gm2;*.GM3;*.gm3|" msgid "Mechanical layers (*.GMx)|*.GM1;*.gm1;*.GM2;*.gm2;*.GM3;*.gm3|"
msgstr "" msgstr "Couches mécaniques (*.GMx)|*.GM1;*.gm1;*.GM2;*.gm2;*.GM3;*.gm3|"
#: gerbview/files.cpp:152 #: gerbview/files.cpp:152
msgid "Top Pad Master (*.GPT)|*.GPT;*.gpt|" msgid "Top Pad Master (*.GPT)|*.GPT;*.gpt|"
@ -10361,11 +10366,11 @@ msgstr "Afficher Polygones en Mode Contour"
msgid "Show dcode number" msgid "Show dcode number"
msgstr "Afficher le n° de DCode" msgstr "Afficher le n° de DCode"
#: gerbview/set_color.cpp:267 #: gerbview/set_color.cpp:271
msgid "Switch on all of the Gerber layers" msgid "Switch on all of the Gerber layers"
msgstr "Affiche toutes les couches Gerber" msgstr "Affiche toutes les couches Gerber"
#: gerbview/set_color.cpp:275 #: gerbview/set_color.cpp:279
msgid "Switch off all of the Gerber layers" msgid "Switch off all of the Gerber layers"
msgstr "N'affiche pas les couches Gerber" msgstr "N'affiche pas les couches Gerber"
@ -10837,7 +10842,7 @@ msgstr "??? Via"
msgid "Blind/Buried Via" msgid "Blind/Buried Via"
msgstr "Via Aveugle/Enterrée" msgstr "Via Aveugle/Enterrée"
#: common/pcbcommon.cpp:86 #: common/pcbcommon.cpp:85
msgid "Kicad footprint library files (*.mod)|*.mod" msgid "Kicad footprint library files (*.mod)|*.mod"
msgstr "Fichiers Modules Kicad (*.mod)|*.mod" msgstr "Fichiers Modules Kicad (*.mod)|*.mod"
@ -11148,59 +11153,59 @@ msgstr "Propriétés du Pad"
msgid "Drill Files Generation" msgid "Drill Files Generation"
msgstr "Génération Fichiers de Perçage" msgstr "Génération Fichiers de Perçage"
#: pcbnew/set_color.h:38 #: pcbnew/set_color.h:40
msgid "Pcbnew Layer Colors:" msgid "Pcbnew Layer Colors:"
msgstr "Pcbnew: Couleur des Couches" msgstr "Pcbnew: Couleur des Couches"
#: pcbnew/set_color.h:81 #: pcbnew/set_color.h:83
msgid "Copper Layers" msgid "Copper Layers"
msgstr "Couches Cuivre." msgstr "Couches Cuivre."
#: pcbnew/set_color.h:216 #: pcbnew/set_color.h:218
msgid "Tech Layers" msgid "Tech Layers"
msgstr "Couches Tech." msgstr "Couches Tech."
#: pcbnew/set_color.h:327 #: pcbnew/set_color.h:329
msgid "Others" msgid "Others"
msgstr "Autres" msgstr "Autres"
#: pcbnew/set_color.h:357 #: pcbnew/set_color.h:359
msgid "Ratsnest" msgid "Ratsnest"
msgstr "Chevelu" msgstr "Chevelu"
#: pcbnew/set_color.h:366 #: pcbnew/set_color.h:368
msgid "Pad Cu" msgid "Pad Cu"
msgstr "Pad Cu" msgstr "Pad Cu"
#: pcbnew/set_color.h:374 #: pcbnew/set_color.h:376
msgid "Pad Cmp" msgid "Pad Cmp"
msgstr "Pad Cmp" msgstr "Pad Cmp"
#: pcbnew/set_color.h:382 #: pcbnew/set_color.h:384
msgid "Text Module Cu" msgid "Text Module Cu"
msgstr "Texte Module Cu" msgstr "Texte Module Cu"
#: pcbnew/set_color.h:390 #: pcbnew/set_color.h:392
msgid "Text Module Cmp" msgid "Text Module Cmp"
msgstr "Texte Module Cmp" msgstr "Texte Module Cmp"
#: pcbnew/set_color.h:398 #: pcbnew/set_color.h:400
msgid "Text Module invisible" msgid "Text Module invisible"
msgstr "Texte Module invisible" msgstr "Texte Module invisible"
#: pcbnew/set_color.h:406 #: pcbnew/set_color.h:408
msgid "Anchors" msgid "Anchors"
msgstr "Ancres" msgstr "Ancres"
#: pcbnew/set_color.h:423 #: pcbnew/set_color.h:425
msgid "Show Noconnect" msgid "Show Noconnect"
msgstr "Montrer Non Conn" msgstr "Montrer Non Conn"
#: pcbnew/set_color.h:432 #: pcbnew/set_color.h:434
msgid "Show Modules Cmp" msgid "Show Modules Cmp"
msgstr "Afficher Modules Cmp" msgstr "Afficher Modules Cmp"
#: pcbnew/set_color.h:441 #: pcbnew/set_color.h:443
msgid "Show Modules Cu" msgid "Show Modules Cu"
msgstr "Afficher Modules Cu" msgstr "Afficher Modules Cu"
@ -11336,7 +11341,7 @@ msgstr "Propriétés des Pins"
msgid "EESchema Plot PS" msgid "EESchema Plot PS"
msgstr "EESchema Tracé PS" msgstr "EESchema Tracé PS"
#: eeschema/dialog_bodygraphictext_properties_base.h:55 #: eeschema/dialog_bodygraphictext_properties_base.h:58
msgid "Graphic text properties:" msgid "Graphic text properties:"
msgstr "Propriétés du texte graphique:" msgstr "Propriétés du texte graphique:"
@ -11500,3 +11505,6 @@ msgstr "DCodes id."
msgid "Page Settings" msgid "Page Settings"
msgstr "Ajustage opt Page" msgstr "Ajustage opt Page"
#~ msgid "Size:"
#~ msgstr "Taille:"

View File

@ -179,7 +179,7 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event )
} }
GetBoard()->m_Status_Pcb &= ~DO_NOT_SHOW_GENERAL_RASTNEST; GetBoard()->m_Status_Pcb &= ~DO_NOT_SHOW_GENERAL_RASTNEST;
ReCompile_Ratsnest_After_Changes( &dc ); Compile_Ratsnest( &dc, true );
SetToolbars(); SetToolbars();
} }

View File

@ -54,7 +54,6 @@ float MinCout;
/* Fonctions locales */ /* Fonctions locales */
static int TstModuleOnBoard( BOARD* Pcb, MODULE* Module, bool TstOtherSide ); static int TstModuleOnBoard( BOARD* Pcb, MODULE* Module, bool TstOtherSide );
static void Build_PlacedPads_List( BOARD* Pcb );
static int Tri_PlaceModules( MODULE** pt_ref, MODULE** pt_compare ); static int Tri_PlaceModules( MODULE** pt_ref, MODULE** pt_compare );
static void TracePenaliteRectangle( BOARD* Pcb, int ux0, int uy0, int ux1, int uy1, static void TracePenaliteRectangle( BOARD* Pcb, int ux0, int uy0, int ux1, int uy1,
@ -309,10 +308,8 @@ end_of_tst:
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
} }
/* Recalcul de la liste des pads, detruite par les calculs precedents */
GetBoard()->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
GetBoard()->Build_Pads_Full_List(); Compile_Ratsnest( DC, true );
DrawPanel->ReDraw( DC, TRUE ); DrawPanel->ReDraw( DC, TRUE );
DrawPanel->m_AbortEnable = FALSE; DrawPanel->m_AbortEnable = FALSE;
@ -585,8 +582,6 @@ int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC )
Module->DisplayInfo( this ); Module->DisplayInfo( this );
Build_PlacedPads_List( GetBoard() );
LastPosOK.x = GetBoard()->m_BoundaryBox.m_Pos.x; LastPosOK.x = GetBoard()->m_BoundaryBox.m_Pos.x;
LastPosOK.y = GetBoard()->m_BoundaryBox.m_Pos.y; LastPosOK.y = GetBoard()->m_BoundaryBox.m_Pos.y;
@ -912,51 +907,6 @@ float WinEDA_PcbFrame::Compute_Ratsnest_PlaceModule( wxDC* DC )
} }
/********************************************/
void Build_PlacedPads_List( BOARD* aPcb )
/********************************************/
/*
* construction de la liste ( sous forme d'une liste de stucture )
* des caract utiles des pads du PCB pour Placement Automatique )
* Cette liste est restreinte a la liste des pads des modules deja places sur
* la carte.
*
* parametres:
* adresse du buffer de classement = Pcb->ptr_pads;
*
* Variables globales mise a jour:
* pointeur ptr_pads (adr de classement de la liste des pads)
* nb_pads = nombre utile de pastilles classes
* m_Status_Pcb |= LISTE_PAD_OK
*/
{
aPcb->m_Pads.clear();
aPcb->m_NbNodes = 0;
// Initialisation du buffer et des variables de travail
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
{
if( module->m_ModuleStatus & MODULE_to_PLACE )
continue;
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
{
aPcb->m_Pads.push_back( pad );
pad->SetSubNet( 0 );
pad->SetSubRatsnest( 0 );
pad->SetParent( module );
if( pad->GetNet() )
aPcb->m_NbNodes++;
}
}
aPcb->m_Status_Pcb |= LISTE_PAD_OK;
aPcb->m_Status_Pcb &= ~(LISTE_RATSNEST_ITEM_OK | RATSNEST_ITEM_LOCAL_OK);
}
/*****************************************************************/ /*****************************************************************/
/* Construction de la zone de penalite ( rectangle ) d'un module */ /* Construction de la zone de penalite ( rectangle ) d'un module */
/*****************************************************************/ /*****************************************************************/
@ -1099,8 +1049,6 @@ static MODULE* PickModule( WinEDA_PcbFrame* pcbframe, wxDC* DC )
if( BaseListeModules == NULL ) if( BaseListeModules == NULL )
return NULL; return NULL;
Build_PlacedPads_List( pcbframe->GetBoard() );
/* Tri par surface decroissante des modules /* Tri par surface decroissante des modules
* (on place les plus gros en 1er), surface ponderee par le nombre de pads */ * (on place les plus gros en 1er), surface ponderee par le nombre de pads */

View File

@ -189,9 +189,9 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
// Placement des PADS sur le board // // Placement des PADS sur le board //
///////////////////////////////////// /////////////////////////////////////
for( unsigned i=0; i<aPcb->GetPadsCount(); ++i ) for( unsigned i=0; i < aPcb->GetPadsCount(); ++i )
{ {
D_PAD* pad = aPcb->m_Pads[i]; D_PAD* pad = aPcb->m_NetInfo->GetPad(i);
if( net_code != pad->GetNet() || (flag & FORCE_PADS) ) if( net_code != pad->GetNet() || (flag & FORCE_PADS) )
{ {

View File

@ -18,8 +18,7 @@ class EDA_BoardDesignSettings;
* Enum LAYER_T * Enum LAYER_T
* gives the allowed types of layers, same as Specctra DSN spec. * gives the allowed types of layers, same as Specctra DSN spec.
*/ */
enum LAYER_T enum LAYER_T {
{
LT_SIGNAL, LT_SIGNAL,
LT_POWER, LT_POWER,
LT_MIXED, LT_MIXED,
@ -92,12 +91,11 @@ public:
DLIST<TRACK> m_Track; // linked list of TRACKs and SEGVIAs DLIST<TRACK> m_Track; // linked list of TRACKs and SEGVIAs
DLIST<SEGZONE> m_Zone; // linked list of SEGZONEs DLIST<SEGZONE> m_Zone; // linked list of SEGZONEs
std::vector<D_PAD*> m_Pads; // Entry for a sorted pad list (used in ratsnest calculations)
NETINFO_LIST* m_NetInfo; // nets info list (name, design constraints .. NETINFO_LIST* m_NetInfo; // nets info list (name, design constraints ..
std::vector<RATSNEST_ITEM> m_FullRatsnest; // Rastnest list for the BOARD std::vector<RATSNEST_ITEM> m_FullRatsnest; // Rastnest list for the BOARD
std::vector<RATSNEST_ITEM> m_LocalRatsnest; /* Rastnest list relative to a given footprint std::vector<RATSNEST_ITEM> m_LocalRatsnest; /* Rastnest list relative to a given footprint
(used while moving a footprint) */ * (used while moving a footprint) */
ZONE_CONTAINER* m_CurrentZoneContour; // zone contour currently in progress ZONE_CONTAINER* m_CurrentZoneContour; // zone contour currently in progress
@ -120,6 +118,7 @@ public:
* @param aControl An int which can vary how the item is added. * @param aControl An int which can vary how the item is added.
*/ */
void Add( BOARD_ITEM* aBoardItem, int aControl = 0 ); void Add( BOARD_ITEM* aBoardItem, int aControl = 0 );
#define ADD_APPEND 1 ///< aControl flag for Add( aControl ), appends not inserts #define ADD_APPEND 1 ///< aControl flag for Add( aControl ), appends not inserts
@ -172,6 +171,7 @@ public:
return NULL; return NULL;
} }
/** /**
* Function GetMARKERCount * Function GetMARKERCount
* @return int - The number of MARKERS. * @return int - The number of MARKERS.
@ -181,6 +181,7 @@ public:
return (int) m_markers.size(); return (int) m_markers.size();
} }
/** /**
* Function GetCopperLayerCount * Function GetCopperLayerCount
* @return int - The number of copper layers in the BOARD. * @return int - The number of copper layers in the BOARD.
@ -242,6 +243,7 @@ public:
return m_FullRatsnest.size(); return m_FullRatsnest.size();
} }
/** Function GetNodesCount /** Function GetNodesCount
* @return the number of pads members of nets (i.e. with netcode > 0) * @return the number of pads members of nets (i.e. with netcode > 0)
*/ */
@ -252,19 +254,9 @@ public:
*/ */
unsigned GetPadsCount() unsigned GetPadsCount()
{ {
return m_Pads.size(); return m_NetInfo->GetPadsCount();
} }
/** Function Build_Pads_Full_List
* Create the pad list
* initialise:
* m_Pads (list of pads)
* set m_Status_Pcb = LISTE_PAD_OK;
* and clear for all pads in list the m_SubRatsnest member;
* clear m_Pcb->m_FullRatsnest
*/
void Build_Pads_Full_List();
// Calcul du rectangle d'encadrement: // Calcul du rectangle d'encadrement:
bool ComputeBoundaryBox(); bool ComputeBoundaryBox();
@ -322,7 +314,7 @@ public:
* @param aNetname A Netname to search for. * @param aNetname A Netname to search for.
* @return NETINFO_ITEM* - the net or NULL if not found. * @return NETINFO_ITEM* - the net or NULL if not found.
*/ */
NETINFO_ITEM* FindNet( const wxString & aNetname ) const; NETINFO_ITEM* FindNet( const wxString& aNetname ) const;
/** /**
* Function FindModuleByReference * Function FindModuleByReference
@ -341,7 +333,7 @@ public:
* @param aSortbyPadsCount : true = sort by active pads count, false = no sort (i.e. leave the sort by net names) * @param aSortbyPadsCount : true = sort by active pads count, false = no sort (i.e. leave the sort by net names)
* @return int - net names count. * @return int - net names count.
*/ */
int ReturnSortedNetnamesList( wxArrayString & aNames, bool aSortbyPadsCount); int ReturnSortedNetnamesList( wxArrayString& aNames, bool aSortbyPadsCount );
/** /**
* Function Save * Function Save
@ -364,6 +356,7 @@ public:
#if defined(DEBUG) #if defined(DEBUG)
/** /**
* Function Show * Function Show
* is used to output the object tree, currently for debugging only. * is used to output the object tree, currently for debugging only.
@ -383,6 +376,7 @@ public:
/*************************/ /*************************/
/* Copper Areas handling */ /* Copper Areas handling */
/*************************/ /*************************/
/** /**
* Function HitTestForAnyFilledArea * Function HitTestForAnyFilledArea
* tests if the given wxPoint is within the bounds of a filled area of this zone. * tests if the given wxPoint is within the bounds of a filled area of this zone.
@ -393,19 +387,27 @@ public:
* @param aEndLayer the last layer (-1 to ignore it) to test * @param aEndLayer the last layer (-1 to ignore it) to test
* @return ZONE_CONTAINER* return a pointer to the ZONE_CONTAINER found, else NULL * @return ZONE_CONTAINER* return a pointer to the ZONE_CONTAINER found, else NULL
*/ */
ZONE_CONTAINER* HitTestForAnyFilledArea( const wxPoint& aRefPos, int aStartLayer, int aEndLayer = -1 ); ZONE_CONTAINER* HitTestForAnyFilledArea( const wxPoint& aRefPos,
int aStartLayer,
int aEndLayer = -1 );
/** /**
* Function RedrawAreasOutlines * Function RedrawAreasOutlines
* Redraw all areas outlines on layer aLayer ( redraw all if aLayer < 0 ) * Redraw all areas outlines on layer aLayer ( redraw all if aLayer < 0 )
*/ */
void RedrawAreasOutlines(WinEDA_DrawPanel* panel, wxDC * aDC, int aDrawMode, int aLayer); void RedrawAreasOutlines( WinEDA_DrawPanel* panel,
wxDC* aDC,
int aDrawMode,
int aLayer );
/** /**
* Function RedrawFilledAreas * Function RedrawFilledAreas
* Redraw all filled areas on layer aLayer ( redraw all if aLayer < 0 ) * Redraw all filled areas on layer aLayer ( redraw all if aLayer < 0 )
*/ */
void RedrawFilledAreas(WinEDA_DrawPanel* panel, wxDC * aDC, int aDrawMode, int aLayer); void RedrawFilledAreas( WinEDA_DrawPanel* panel,
wxDC* aDC,
int aDrawMode,
int aLayer );
/** /**
* Function SetAreasNetCodesFromNetNames * Function SetAreasNetCodesFromNetNames
@ -417,7 +419,7 @@ public:
* @return : error count * @return : error count
* For non copper areas, netcode is set to 0 * For non copper areas, netcode is set to 0
*/ */
int SetAreasNetCodesFromNetNames(void); int SetAreasNetCodesFromNetNames( void );
/** /**
* Function GetArea * Function GetArea
@ -432,22 +434,25 @@ public:
return NULL; return NULL;
} }
/** /**
* Function GetAreaIndex * Function GetAreaIndex
* returns the Area Index for the given Zone Container. * returns the Area Index for the given Zone Container.
* @param aArea :The ZONE_CONTAINER to find. * @param aArea :The ZONE_CONTAINER to find.
* @return an Area Index in m_ZoneDescriptorList or -1 if non found. * @return an Area Index in m_ZoneDescriptorList or -1 if non found.
*/ */
int GetAreaIndex( const ZONE_CONTAINER* aArea) const int GetAreaIndex( const ZONE_CONTAINER* aArea ) const
{ {
for( int ii = 0; ii < GetAreaCount(); ii++ ) // Search for aArea in list for( int ii = 0; ii < GetAreaCount(); ii++ ) // Search for aArea in list
{ {
if ( aArea == GetArea( ii ) ) // Found ! if( aArea == GetArea( ii ) ) // Found !
return ii; return ii;
} }
return -1; return -1;
} }
/** /**
* Function GetAreaCount * Function GetAreaCount
* @return int - The number of Areas or ZONE_CONTAINER. * @return int - The number of Areas or ZONE_CONTAINER.
@ -457,7 +462,9 @@ public:
return (int) m_ZoneDescriptorList.size(); return (int) m_ZoneDescriptorList.size();
} }
/* Functions used in test, merge and cut outlines */ /* Functions used in test, merge and cut outlines */
/** /**
* Function AddArea * Function AddArea
* add empty copper area to net * add empty copper area to net
@ -480,7 +487,7 @@ public:
ZONE_CONTAINER* InsertArea( int netcode, int iarea, int layer, int x, int y, int hatch ); ZONE_CONTAINER* InsertArea( int netcode, int iarea, int layer, int x, int y, int hatch );
/** /**
Function CompleteArea * Function CompleteArea
* complete copper area contour by adding a line from last to first corner * complete copper area contour by adding a line from last to first corner
* if there is only 1 or 2 corners, remove (delete) the area * if there is only 1 or 2 corners, remove (delete) the area
* @param area_to_complete = area to complete or remove * @param area_to_complete = area to complete or remove
@ -515,7 +522,9 @@ public:
* Also sets areas->utility1 flags if areas are modified * Also sets areas->utility1 flags if areas are modified
*/ */
int ClipAreaPolygon( ZONE_CONTAINER* CurrArea, int ClipAreaPolygon( ZONE_CONTAINER* CurrArea,
bool bMessageBoxArc, bool bMessageBoxInt, bool bRetainArcs = TRUE ); bool bMessageBoxArc,
bool bMessageBoxInt,
bool bRetainArcs = TRUE );
/** /**
* Process an area that has been modified, by clipping its polygon against * Process an area that has been modified, by clipping its polygon against
@ -582,7 +591,8 @@ public:
* @param aCreate_Markers: if true create DRC markers. False: do not creates anything * @param aCreate_Markers: if true create DRC markers. False: do not creates anything
* @return errors count * @return errors count
*/ */
int Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_Examine,bool aCreate_Markers ); int Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_Examine,
bool aCreate_Markers );
/****** function relative to ratsnest calculations: */ /****** function relative to ratsnest calculations: */
@ -592,7 +602,6 @@ public:
* @param aNetcode = netcode to analyse. if -1, analyse all nets * @param aNetcode = netcode to analyse. if -1, analyse all nets
*/ */
void Test_Connections_To_Copper_Areas( int aNetcode = -1 ); void Test_Connections_To_Copper_Areas( int aNetcode = -1 );
}; };
#endif // #ifndef CLASS_BOARD_H #endif // #ifndef CLASS_BOARD_H

View File

@ -479,14 +479,8 @@ bool COTATION::HitTest( const wxPoint& ref_pos )
int ux0, uy0; int ux0, uy0;
int dx, dy, spot_cX, spot_cY; int dx, dy, spot_cX, spot_cY;
if( m_Text ) if( m_Text && m_Text->TextHitTest( ref_pos ) )
{
// because HitTest() is present in both base classes of TEXTE_PCB
// use a clarifying cast to tell compiler which HitTest()
// to call.
if( static_cast<EDA_TextStruct*>(m_Text)->HitTest( ref_pos ) )
return true; return true;
}
/* Localisation des SEGMENTS ?) */ /* Localisation des SEGMENTS ?) */
ux0 = Barre_ox; ux0 = Barre_ox;

View File

@ -53,10 +53,10 @@ public:
m_NetCode = aNetCode; m_NetCode = aNetCode;
} }
/** function Draw /** function Draw
*/ */
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset ); void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset );
}; };
/***************************************************************/ /***************************************************************/
@ -71,6 +71,9 @@ private:
// boost::ptr_vector<NETINFO_ITEM*> m_NetBuffer; // nets buffer list (name, design constraints .. // boost::ptr_vector<NETINFO_ITEM*> m_NetBuffer; // nets buffer list (name, design constraints ..
std::vector<NETINFO_ITEM*> m_NetBuffer; // nets buffer list (name, design constraints .. std::vector<NETINFO_ITEM*> m_NetBuffer; // nets buffer list (name, design constraints ..
public:
std::vector<D_PAD*> m_PadsFullList; // Entry for a sorted pad list (used in ratsnest calculations)
public: public:
NETINFO_LIST( BOARD* aParent ); NETINFO_LIST( BOARD* aParent );
~NETINFO_LIST(); ~NETINFO_LIST();
@ -103,6 +106,37 @@ public:
* The list is sorted by names. * The list is sorted by names.
*/ */
void BuildListOfNets(); void BuildListOfNets();
/** Function GetPadsCount
* @return the number of pads in board
*/
unsigned GetPadsCount()
{
return m_PadsFullList.size();
}
/** Function GetPad
* @return the pad idx from m_PadsFullList
*/
D_PAD* GetPad( unsigned aIdx)
{
if (aIdx < m_PadsFullList.size() )
return m_PadsFullList[aIdx];
else
return NULL;
}
private:
/** Function Build_Pads_Full_List
* Create the pad list
* initialise:
* m_Pads (list of pads)
* set m_Status_Pcb = LISTE_PAD_OK;
* and clear for all pads in list the m_SubRatsnest member;
* clear m_Pcb->m_FullRatsnest
*/
void Build_Pads_Full_List();
}; };
/** class NETINFO_ITEM /** class NETINFO_ITEM
@ -188,8 +222,6 @@ public:
}; };
/****************************************************************/ /****************************************************************/
/* description d'un point de piste pour le suivi des connexions */ /* description d'un point de piste pour le suivi des connexions */
/****************************************************************/ /****************************************************************/

View File

@ -44,6 +44,7 @@ void NETINFO_LIST::DeleteData()
delete m_NetBuffer[ii]; delete m_NetBuffer[ii];
m_NetBuffer.clear(); m_NetBuffer.clear();
m_PadsFullList.clear();
} }
@ -90,14 +91,14 @@ void NETINFO_LIST::BuildListOfNets()
AppendNet( net_item ); AppendNet( net_item );
/* Build the PAD list, sorted by net */ /* Build the PAD list, sorted by net */
m_Parent->Build_Pads_Full_List(); Build_Pads_Full_List();
/* Build netnames list, and create a netcode for each netname */ /* Build netnames list, and create a netcode for each netname */
D_PAD* last_pad = NULL; D_PAD* last_pad = NULL;
int netcode = 0; int netcode = 0;
for( unsigned ii = 0; ii < m_Parent->m_Pads.size(); ii++ ) for( unsigned ii = 0; ii < m_PadsFullList.size(); ii++ )
{ {
pad = m_Parent->m_Pads[ii]; pad = m_PadsFullList[ii];
if( pad->GetNetname().IsEmpty() ) // pad not connected if( pad->GetNetname().IsEmpty() ) // pad not connected
{ {
pad->SetNet( 0 ); pad->SetNet( 0 );
@ -130,9 +131,9 @@ void NETINFO_LIST::BuildListOfNets()
} }
/**********************************/ /*****************************************/
void BOARD::Build_Pads_Full_List() void NETINFO_LIST::Build_Pads_Full_List()
/**********************************/ /*****************************************/
/** Function Build_Pads_Full_List /** Function Build_Pads_Full_List
* Create the pad list, sorted by net names * Create the pad list, sorted by net names
@ -143,19 +144,19 @@ void BOARD::Build_Pads_Full_List()
* (m_Pcb->m_FullRatsnest uses pointer to pads) * (m_Pcb->m_FullRatsnest uses pointer to pads)
*/ */
{ {
if( m_Status_Pcb & LISTE_PAD_OK ) if( m_Parent->m_Status_Pcb & LISTE_PAD_OK )
return; return;
// empty the old list // empty the old list
m_Pads.clear(); m_PadsFullList.clear();
m_FullRatsnest.clear(); m_Parent->m_FullRatsnest.clear();
/* Clear variables used in rastnest computation */ /* Clear variables used in rastnest computation */
for( MODULE* module = m_Modules; module; module = module->Next() ) for( MODULE* module = m_Parent->m_Modules; module; module = module->Next() )
{ {
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() ) for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
{ {
m_Pads.push_back( pad ); m_PadsFullList.push_back( pad );
pad->SetSubRatsnest( 0 ); pad->SetSubRatsnest( 0 );
pad->SetParent( module ); pad->SetParent( module );
@ -163,7 +164,7 @@ void BOARD::Build_Pads_Full_List()
} }
// Sort pad list per net // Sort pad list per net
sort( m_Pads.begin(), m_Pads.end(), PadlistSortByNetnames ); sort( m_PadsFullList.begin(), m_PadsFullList.end(), PadlistSortByNetnames );
m_Status_Pcb = LISTE_PAD_OK; m_Parent->m_Status_Pcb = LISTE_PAD_OK;
} }

View File

@ -58,7 +58,7 @@ public:
*/ */
bool HitTest( const wxPoint& refPos ) bool HitTest( const wxPoint& refPos )
{ {
return EDA_TextStruct::HitTest( refPos ); return TextHitTest( refPos );
} }
@ -70,7 +70,7 @@ public:
*/ */
bool HitTest( EDA_Rect& refArea ) bool HitTest( EDA_Rect& refArea )
{ {
return EDA_TextStruct::HitTest( refArea ); return TextHitTest( refArea );
} }
/** /**

View File

@ -278,7 +278,7 @@ void WinEDA_BasePcbFrame::test_connexions( wxDC* DC )
// Clear the cluster identifier for all pads // Clear the cluster identifier for all pads
for( unsigned i = 0; i< m_Pcb->GetPadsCount(); ++i ) for( unsigned i = 0; i< m_Pcb->GetPadsCount(); ++i )
{ {
D_PAD* pad = m_Pcb->m_Pads[i]; D_PAD* pad = m_Pcb->m_NetInfo->GetPad(i);
pad->SetZoneSubNet( 0 ); pad->SetZoneSubNet( 0 );
pad->SetSubNet( 0 ); pad->SetSubNet( 0 );
@ -326,7 +326,7 @@ void WinEDA_BasePcbFrame::test_1_net_connexion( wxDC* DC, int net_code )
for( unsigned i = 0; i<m_Pcb->GetPadsCount(); ++i ) for( unsigned i = 0; i<m_Pcb->GetPadsCount(); ++i )
{ {
D_PAD* pad = m_Pcb->m_Pads[i]; D_PAD* pad = m_Pcb->m_NetInfo->GetPad(i);
int pad_net_code = pad->GetNet(); int pad_net_code = pad->GetNet();
@ -555,7 +555,7 @@ static int SortPadsByXCoord( const void* pt_ref, const void* pt_comp )
void CreateSortedPadListByXCoord( BOARD* aBoard, std::vector<D_PAD*>* aVector ) void CreateSortedPadListByXCoord( BOARD* aBoard, std::vector<D_PAD*>* aVector )
/*****************************************************************************/ /*****************************************************************************/
{ {
aVector->insert( aVector->end(), aBoard->m_Pads.begin(), aBoard->m_Pads.end() ); aVector->insert( aVector->end(), aBoard->m_NetInfo->m_PadsFullList.begin(), aBoard->m_NetInfo->m_PadsFullList.end() );
qsort( &(*aVector)[0], aBoard->GetPadsCount(), sizeof( D_PAD*), SortPadsByXCoord ); qsort( &(*aVector)[0], aBoard->GetPadsCount(), sizeof( D_PAD*), SortPadsByXCoord );
} }

View File

@ -179,7 +179,7 @@ void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_segm )
return; return;
TRACK* trackList = Marque_Une_Piste( this, DC, pt_segm, &nb_segm, 0 ); TRACK* trackList = Marque_Une_Piste( this, DC, pt_segm, &nb_segm, 0 );
int net_code = pt_segm->GetNet();
if( nb_segm ) /* Il y a nb_segm segments de piste a effacer */ if( nb_segm ) /* Il y a nb_segm segments de piste a effacer */
{ {
int ii = 0; int ii = 0;
@ -195,5 +195,7 @@ void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_segm )
} }
SaveItemEfface( trackList, nb_segm ); SaveItemEfface( trackList, nb_segm );
if ( net_code > 0 )
test_1_net_connexion( DC, net_code );
} }
} }

View File

@ -631,11 +631,6 @@ void DrcDialog::OnStartdrcClick( wxCommandEvent& event )
wxBeginBusyCursor(); wxBeginBusyCursor();
// running the module editor and selecting "Update module in current board"
// causes the list to become obsolete because of the new pads from the
// revised module.
m_Parent->GetBoard()->Build_Pads_Full_List();
// run all the tests, with no UI at this time. // run all the tests, with no UI at this time.
m_tester->RunTests(); m_tester->RunTests();

View File

@ -583,7 +583,7 @@ bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart, bool testPads )
{ {
for( unsigned ii = 0; ii<m_pcb->GetPadsCount(); ++ii ) for( unsigned ii = 0; ii<m_pcb->GetPadsCount(); ++ii )
{ {
D_PAD* pad = m_pcb->m_Pads[ii]; D_PAD* pad = m_pcb->m_NetInfo->GetPad( ii );
/* No problem if pads are on an other layer, /* No problem if pads are on an other layer,
* But if a drill hole exists (a pad on a single layer can have a hole!) * But if a drill hole exists (a pad on a single layer can have a hole!)

View File

@ -45,8 +45,7 @@ void WinEDA_BasePcbFrame::InstallModuleOptionsFrame( MODULE* Module, wxDC * DC )
wxSize( 600, 400 ) ); wxSize( 600, 400 ) );
} }
m_ModuleEditFrame->Load_Module_Module_From_BOARD( m_ModuleEditFrame->Load_Module_From_BOARD( (MODULE*) GetScreen()->GetCurItem() );
(MODULE*) GetScreen()->GetCurItem() );
SetCurItem( NULL ); SetCurItem( NULL );
GoToEditor = FALSE; GoToEditor = FALSE;

View File

@ -170,7 +170,7 @@ void CreatePadsShapesSection( FILE* file, BOARD* pcb )
if( pcb->GetPadsCount() > 0 ) if( pcb->GetPadsCount() > 0 )
{ {
pads.insert( pads.end(), pcb->m_Pads.begin(), pcb->m_Pads.end() ); pads.insert( pads.end(), pcb->m_NetInfo->m_PadsFullList.begin(), pcb->m_NetInfo->m_PadsFullList.end() );
qsort( &pads[0], pcb->GetPadsCount(), sizeof( D_PAD* ), Pad_list_Sort_by_Shapes ); qsort( &pads[0], pcb->GetPadsCount(), sizeof( D_PAD* ), Pad_list_Sort_by_Shapes );
} }

View File

@ -279,7 +279,6 @@ void WinEDA_PcbFrame::Erase_Modules( bool query )
GetBoard()->m_Modules.DeleteAll(); GetBoard()->m_Modules.DeleteAll();
GetBoard()->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
m_Pcb->m_Pads.clear(); // empty the pad list pointers
m_Pcb->m_NetInfo->DeleteData(); m_Pcb->m_NetInfo->DeleteData();
m_Pcb->m_FullRatsnest.clear(); // empty the pad list pointers m_Pcb->m_FullRatsnest.clear(); // empty the pad list pointers
m_Pcb->m_LocalRatsnest.clear(); // empty the pad list pointers m_Pcb->m_LocalRatsnest.clear(); // empty the pad list pointers

View File

@ -131,7 +131,7 @@ MODULE* WinEDA_ModuleEditFrame::Import_Module( wxDC* DC )
module->DisplayInfo( this ); module->DisplayInfo( this );
Place_Module( module, DC ); Place_Module( module, DC );
GetBoard()->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
GetBoard()->Build_Pads_Full_List(); GetBoard()->m_NetInfo->BuildListOfNets();
return module; return module;
} }

View File

@ -44,9 +44,9 @@ static void ReadDocLib( const wxString& ModLibName );
static ModList* MList; static ModList* MList;
/***************************************************************************/ /********************************************************************/
void WinEDA_ModuleEditFrame::Load_Module_Module_From_BOARD( MODULE* Module ) void WinEDA_ModuleEditFrame::Load_Module_From_BOARD( MODULE* Module )
/***************************************************************************/ /********************************************************************/
{ {
MODULE* NewModule; MODULE* NewModule;
WinEDA_BasePcbFrame* parent = (WinEDA_BasePcbFrame*) GetParent(); WinEDA_BasePcbFrame* parent = (WinEDA_BasePcbFrame*) GetParent();
@ -77,7 +77,7 @@ void WinEDA_ModuleEditFrame::Load_Module_Module_From_BOARD( MODULE* Module )
Module->m_Flags = 0; Module->m_Flags = 0;
GetBoard()->Build_Pads_Full_List(); GetBoard()->m_NetInfo->BuildListOfNets();
GetScreen()->m_Curseur.x = GetScreen()->m_Curseur.y = 0; GetScreen()->m_Curseur.x = GetScreen()->m_Curseur.y = 0;
Place_Module( Module, NULL ); Place_Module( Module, NULL );

View File

@ -585,7 +585,7 @@ D_PAD* Fast_Locate_Pad_Connecte( BOARD* Pcb, const wxPoint& ref_pos, int masque_
{ {
for( unsigned i=0; i<Pcb->GetPadsCount(); ++i ) for( unsigned i=0; i<Pcb->GetPadsCount(); ++i )
{ {
D_PAD* pad = Pcb->m_Pads[i]; D_PAD* pad = Pcb->m_NetInfo->GetPad(i);
if( pad->m_Pos != ref_pos ) if( pad->m_Pos != ref_pos )
continue; continue;

View File

@ -125,7 +125,7 @@ BOARD_ITEM* WinEDA_ModuleEditFrame::ModeditLocateAndDisplay( int aHotKeyCode )
void WinEDA_ModuleEditFrame::LoadModuleFromBoard( wxCommandEvent& event ) void WinEDA_ModuleEditFrame::LoadModuleFromBoard( wxCommandEvent& event )
{ {
GetScreen()->ClearUndoRedoList(); GetScreen()->ClearUndoRedoList();
Load_Module_Module_From_BOARD( NULL ); Load_Module_From_BOARD( NULL );
GetScreen()->ClrModify(); GetScreen()->ClrModify();
if( m_Draw3DFrame ) if( m_Draw3DFrame )

View File

@ -189,12 +189,12 @@ void Abort_MoveOrCopyModule( WinEDA_DrawPanel* Panel, wxDC* DC )
module->m_Flags = 0; module->m_Flags = 0;
} }
if( module->m_Flags & IS_NEW ) // Copy command: delete new footprint if( (module->m_Flags & IS_NEW) ) // Copy command: delete new footprint
{ {
module->DeleteStructure(); module->DeleteStructure();
module = NULL; module = NULL;
pcbframe->GetBoard()->m_Status_Pcb = 0; pcbframe->GetBoard()->m_Status_Pcb = 0;
pcbframe->GetBoard()->Build_Pads_Full_List(); pcbframe->GetBoard()->m_NetInfo->BuildListOfNets();
} }
} }
@ -241,15 +241,11 @@ MODULE* WinEDA_BasePcbFrame::Copie_Module( MODULE* module )
newmodule = new MODULE( GetBoard() ); newmodule = new MODULE( GetBoard() );
newmodule->Copy( module ); newmodule->Copy( module );
/* no, Add() below does this
newmodule->SetParent( GetBoard() );
*/
GetBoard()->Add( newmodule, ADD_APPEND ); GetBoard()->Add( newmodule, ADD_APPEND );
newmodule->m_Flags = IS_NEW; newmodule->m_Flags = IS_NEW;
GetBoard()->Build_Pads_Full_List(); GetBoard()->m_NetInfo->BuildListOfNets();
newmodule->DisplayInfo( this ); newmodule->DisplayInfo( this );
GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK; GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK;
@ -327,9 +323,7 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC, bool aAskBeforeDe
/* Sauvegarde en buffer des undelete */ /* Sauvegarde en buffer des undelete */
SaveItemEfface( module, 1 ); SaveItemEfface( module, 1 );
GetBoard()->m_Status_Pcb = 0; Compile_Ratsnest( DC, true );
GetBoard()->Build_Pads_Full_List();
ReCompile_Ratsnest_After_Changes( DC );
// redraw the area where the module was // redraw the area where the module was
if( DC ) if( DC )
@ -529,7 +523,7 @@ void BOARD::Change_Side_Module( MODULE* Module, wxDC* DC )
Module->Draw( m_PcbFrame->DrawPanel, DC, GR_OR ); Module->Draw( m_PcbFrame->DrawPanel, DC, GR_OR );
/* affichage chevelu general si necessaire */ /* affichage chevelu general si necessaire */
m_PcbFrame->ReCompile_Ratsnest_After_Changes( DC ); m_PcbFrame->Compile_Ratsnest( DC, true );
} }
} }
else else
@ -695,7 +689,7 @@ void WinEDA_BasePcbFrame::Place_Module( MODULE* module, wxDC* DC )
} }
/* affichage chevelu general si necessaire */ /* affichage chevelu general si necessaire */
ReCompile_Ratsnest_After_Changes( DC ); Compile_Ratsnest( DC, true );
module->DisplayInfo( this ); module->DisplayInfo( this );
@ -765,7 +759,7 @@ void WinEDA_BasePcbFrame::Rotate_Module( wxDC* DC, MODULE* module,
module->Draw( DrawPanel, DC, GR_OR ); module->Draw( DrawPanel, DC, GR_OR );
/* Reaffichage chevelu general si necessaire */ /* Reaffichage chevelu general si necessaire */
ReCompile_Ratsnest_After_Changes( DC ); Compile_Ratsnest( DC, true );
} }
else else
{ {

View File

@ -428,7 +428,7 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
for( unsigned ii = 0; ii<m_Pcb->GetPadsCount(); ++ii ) for( unsigned ii = 0; ii<m_Pcb->GetPadsCount(); ++ii )
{ {
pad = m_Pcb->m_Pads[ii]; pad = m_Pcb->m_NetInfo->GetPad(ii);
pad->SetSubRatsnest( 0 ); pad->SetSubRatsnest( 0 );
} }
@ -500,17 +500,6 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
} }
/**********************************************************************/
void WinEDA_BasePcbFrame::ReCompile_Ratsnest_After_Changes( wxDC* DC )
/**********************************************************************/
/* recompile rastnest after a module move, delete, ..
*/
{
if( g_Show_Ratsnest && DC )
Compile_Ratsnest( DC, TRUE );
}
/*********************************************************************/ /*********************************************************************/
void WinEDA_BasePcbFrame::DrawGeneralRatsnest( wxDC* DC, int net_code ) void WinEDA_BasePcbFrame::DrawGeneralRatsnest( wxDC* DC, int net_code )
@ -776,7 +765,7 @@ void WinEDA_BasePcbFrame::build_ratsnest_module( wxDC* DC, MODULE* Module )
if( (GetBoard()->m_Status_Pcb & LISTE_PAD_OK) == 0 ) if( (GetBoard()->m_Status_Pcb & LISTE_PAD_OK) == 0 )
{ {
GetBoard()->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
GetBoard()->Build_Pads_Full_List(); GetBoard()->m_NetInfo->BuildListOfNets();
} }
/* Compute the "local" ratsnest if needed (when this footprint starts move) /* Compute the "local" ratsnest if needed (when this footprint starts move)

View File

@ -153,7 +153,6 @@ void Out_Pads( BOARD* Pcb, FILE* outfile )
{ {
D_PAD* pt_pad; D_PAD* pt_pad;
//MODULE * Module;
int netcode, mod_num, nb_pads, plink; int netcode, mod_num, nb_pads, plink;
LISTE_PAD* pt_liste_pad, * pt_start_liste, LISTE_PAD* pt_liste_pad, * pt_start_liste,
* pt_end_liste, * pt_liste_pad_limite; * pt_end_liste, * pt_liste_pad_limite;
@ -161,7 +160,7 @@ void Out_Pads( BOARD* Pcb, FILE* outfile )
int no_conn = Pcb->GetPadsCount() + 1;/* valeur incrementee pour indiquer int no_conn = Pcb->GetPadsCount() + 1;/* valeur incrementee pour indiquer
* que le pad n'est pas deja connecte a une piste*/ * que le pad n'est pas deja connecte a une piste*/
pt_liste_pad = pt_start_liste = &Pcb->m_Pads[0]; pt_liste_pad = pt_start_liste = &Pcb->m_NetInfo->m_PadsFullList[0];
pt_liste_pad_limite = pt_start_liste + Pcb->GetPadsCount(); pt_liste_pad_limite = pt_start_liste + Pcb->GetPadsCount();
if( pt_liste_pad == NULL ) if( pt_liste_pad == NULL )

View File

@ -337,7 +337,6 @@ static int Autoroute_One_Track( WinEDA_PcbFrame* pcbframe, wxDC* DC,
int r, c, side, d, apx_dist, nr, nc; int r, c, side, d, apx_dist, nr, nc;
int result, skip; int result, skip;
int i; int i;
LISTE_PAD* ptr;
long curcell, newcell, buddy, lastopen, lastclos, lastmove; long curcell, newcell, buddy, lastopen, lastclos, lastmove;
int newdist, olddir, _self; int newdist, olddir, _self;
int current_net_code; int current_net_code;
@ -432,13 +431,13 @@ static int Autoroute_One_Track( WinEDA_PcbFrame* pcbframe, wxDC* DC,
/* Regenere les barrieres restantes (qui peuvent empieter sur le placement /* Regenere les barrieres restantes (qui peuvent empieter sur le placement
* des bits precedents) */ * des bits precedents) */
ptr = (LISTE_PAD*) &pcbframe->GetBoard()->m_Pads[0];
i = pcbframe->GetBoard()->GetPadsCount(); i = pcbframe->GetBoard()->GetPadsCount();
for( ; i > 0; i--, ptr++ ) for( unsigned ii = 0; ii < pcbframe->GetBoard()->GetPadsCount(); ii++ )
{ {
if( (pt_cur_ch->m_PadStart != *ptr) && (pt_cur_ch->m_PadEnd != *ptr) ) D_PAD * ptr = pcbframe->GetBoard()->m_NetInfo->GetPad(ii);
if( (pt_cur_ch->m_PadStart != ptr) && (pt_cur_ch->m_PadEnd != ptr) )
{ {
Place_1_Pad_Board( pcbframe->GetBoard(), *ptr, ~CURRENT_PAD, marge, WRITE_AND_CELL ); Place_1_Pad_Board( pcbframe->GetBoard(), ptr, ~CURRENT_PAD, marge, WRITE_AND_CELL );
} }
} }

View File

@ -95,9 +95,7 @@ void WinEDA_BasePcbFrame::UnDeleteItem( wxDC* DC )
item->SetState( DELETED, OFF ); /* Creal DELETED flag */ item->SetState( DELETED, OFF ); /* Creal DELETED flag */
item->m_Flags = 0; item->m_Flags = 0;
GetBoard()->m_Status_Pcb = 0; Compile_Ratsnest( DC, true );
GetBoard()->Build_Pads_Full_List();
ReCompile_Ratsnest_After_Changes( DC );
break; break;
#endif #endif
@ -167,8 +165,6 @@ BOARD_ITEM* WinEDA_BasePcbFrame::SaveItemEfface( BOARD_ITEM* aItem, int nbitems
m_Pcb->m_Modules.Remove( module ); m_Pcb->m_Modules.Remove( module );
module->SetState( DELETED, ON ); module->SetState( DELETED, ON );
g_UnDeleteStack[g_UnDeleteStackPtr++] = module; g_UnDeleteStack[g_UnDeleteStackPtr++] = module;
GetBoard()->m_Status_Pcb = 0;
GetBoard()->Build_Pads_Full_List();
} }
break; break;
#endif #endif