fixed libedit regression

This commit is contained in:
jean-pierre charras 2010-08-22 19:44:31 +02:00
commit 84ce064e3b
3 changed files with 23 additions and 6 deletions

View File

@ -1005,7 +1005,9 @@ void LIB_COMPONENT::SetFields( const std::vector <LIB_FIELD>& aFields )
drawings.push_back( field );
}
drawings.sort(); // would be nice to know why...
// Reorder drawings: transparent polygons first, pins and text last.
// so texts have priority on sreen.
drawings.sort();
}

View File

@ -263,6 +263,9 @@ An alias %s already exists!\nCannot update this component" ),
// copy all the fields back, fully replacing any previous fields
m_LibEntry->SetFields( m_FieldsBuf );
// We need to keep the name and the value the same at the moment!
SetName(m_LibEntry->GetValueField().m_Text);
m_Parent->OnModify( );
EndModal( 0 );
@ -734,11 +737,11 @@ bool DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copyPanelToSelectedField()
else
field.m_Bold = false;
field.m_Pos.x = ReturnValueFromString( g_UserUnit, posXTextCtrl->GetValue(),
field.m_Pos.x = ReturnValueFromString( g_UserUnit, posXTextCtrl->GetValue(),
EESCHEMA_INTERNAL_UNIT );
field.m_Pos.y = ReturnValueFromString( g_UserUnit, posYTextCtrl->GetValue(),
field.m_Pos.y = ReturnValueFromString( g_UserUnit, posYTextCtrl->GetValue(),
EESCHEMA_INTERNAL_UNIT );
// Note: the Y axis for components in lib is from bottom to top
// and the screen axis is top to bottom: we must change the y coord sign for editing
NEGATE( field.m_Pos.y );

View File

@ -19,20 +19,21 @@
<xsl:text>.HEA&nl;</xsl:text>
<xsl:apply-templates select="design/date"/> <!-- Generate line .TIM <time> -->
<xsl:apply-templates select="design/tool"/> <!-- Generate line .APP <eeschema version> -->
<xsl:text>&nl;</xsl:text>
<xsl:apply-templates select="components/comp"/> <!-- Generate list of components -->
<xsl:text>&nl;&nl;</xsl:text>
<xsl:apply-templates select="nets/net"/> <!-- Generate list of nets and connections -->
<xsl:text>&nl;.END&nl;</xsl:text>
</xsl:template>
<!-- Generate line .TIM 20/08/2010 10:45:33 -->
<!-- Generate line .APP "eeschema (2010-08-17 BZR 2450)-unstable" -->
<xsl:template match="tool">
<xsl:text>.APP "</xsl:text>
<xsl:apply-templates/>
<xsl:text>"&nl;</xsl:text>
</xsl:template>
<!-- Generate line .APP "eeschema (2010-08-17 BZR 2450)-unstable" -->
<!-- Generate line .TIM 20/08/2010 10:45:33 -->
<xsl:template match="date">
<xsl:text>.TIM </xsl:text>
<xsl:apply-templates/>
@ -40,6 +41,10 @@
</xsl:template>
<!-- for each component -->
<!-- create lines like
.ADD_COM U3 "74LS541" (when no footprint name specified)
.ADD_COM JP1 "CONN_8X2" "pin_array_8x2" "pin_array_8x2" (with a specified footprint name)
-->
<xsl:template match="comp">
<xsl:text>.ADD_COM </xsl:text>
<xsl:value-of select="@ref"/>
@ -56,6 +61,13 @@
</xsl:template>
<!-- for each net -->
<!-- create lines like
.ADD_TER U3.9 "/PC-RST"
.TER U3.8
BUS1.2
.ADD_TER BUS1.14 "/PC-IOR"
.TER U3.7
-->
<xsl:template match="net">
<!-- nets are output only if there is more than one pin in net -->
<xsl:if test="count(node)>1">