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
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>
================================================================================
++Eeschema:

View File

@ -250,8 +250,8 @@ EDA_Rect EDA_TextStruct::GetTextBox( int aLine )
rect.SetSize( textsize );
/* Now, calculate the rect origin, according to text justification
* At this point the area origin is the text origin (m_Pos).
* This is true only for left and top text justified texts.
* At this point the rectangle origin is the text origin (m_Pos).
* 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
* 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:
* true if posref is inside the text area.
* false else.
/**
* Function TextHitTest (overlayed)
* tests if the given point is inside this object.
* @param posref point to test
* @return bool - true if a hit, else false
*/
{
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.
* @param refArea the given EDA_Rect to test
* @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 ) )

View File

@ -620,7 +620,7 @@ bool MoveStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM* DrawStruct )
static void MirrorYPoint( wxPoint& point, wxPoint& Center )
{
point.x -= Center.x;
point.x = -point.x;
NEGATE(point.x);
point.x += Center.x;
}
@ -683,6 +683,7 @@ void MirrorOneStruct( SCH_ITEM* DrawStruct, wxPoint& Center )
case DRAW_BUSENTRY_STRUCT_TYPE:
DrawRaccord = (DrawBusEntryStruct*) DrawStruct;
MirrorYPoint( DrawRaccord->m_Pos, Center );
NEGATE(DrawRaccord->m_Size.x);
break;
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 )
{
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?)
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
dx = (int) ( (double) dx * 10.0 / 9 );
int dy = m_Size.y;
bool hit = TextHitTest(refPos);
m_VJustify = vJustify;
if( m_Orient )
EXCHG( dx, dy ); // Swap X and Y size for a vertical text
// 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;
if( m_FieldId == REFERENCE )
m_Text.RemoveLast( );
return hit;
}

View File

@ -59,7 +59,16 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) m_Parent;
GRTextHorizJustifyType hjustify;
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:
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,
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
{

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 )
{
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 )
{
m_Rayon = 0;
@ -169,6 +174,39 @@ bool LibDrawArc::Load( char* line, wxString& errorMsg )
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()
{
@ -268,7 +306,8 @@ EDA_Rect LibDrawArc::GetBoundingBox()
if( ( normStart == nullPoint ) || ( normEnd == nullPoint )
|| ( 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" ),
m_Pos.x, m_Pos.y, m_ArcStart.x, m_ArcStart.y, m_ArcEnd.x,
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,
&m_Rayon, &m_Unit, &m_Convert, &m_Width, tmp );
if( cnt < 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;
}
/**
* 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()
{
@ -431,9 +490,11 @@ void LibDrawCircle::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
EDA_Rect LibDrawCircle::GetBoundingBox()
{
EDA_Rect rect;
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.Inflate( m_Width / 2, m_Width / 2 );
return rect;
}
@ -461,6 +522,10 @@ void LibDrawCircle::DisplayInfo( WinEDA_DrawFrame* frame )
}
/***********************/
/** class LibDrawText **/
/***********************/
LibDrawText::LibDrawText() :
LibEDA_BaseStruct( COMPONENT_GRAPHIC_TEXT_DRAW_TYPE ), EDA_TextStruct()
{
@ -472,6 +537,7 @@ LibDrawText::LibDrawText() :
bool LibDrawText::Save( FILE* ExportFile ) const
{
wxString text = m_Text;
// Spaces are not allowed in text because it is not double quoted:
// changed to '~'
text.Replace( wxT( " " ), wxT( "~" ) );
@ -480,6 +546,21 @@ bool LibDrawText::Save( FILE* ExportFile ) const
m_Pos.x, m_Pos.y, m_Size.x, m_Attributs, m_Unit, m_Convert,
CONV_TO_UTF8( text ) );
fprintf( ExportFile, " %s %d", m_Italic ? "Italic" : "Normal", (m_Bold>0) ? 1 : 0 );
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;
@ -489,15 +570,16 @@ bool LibDrawText::Save( FILE* ExportFile ) const
bool LibDrawText::Load( char* line, wxString& errorMsg )
{
int cnt, thickness;
char hjustify = 'C', vjustify = 'C';
char buf[256];
char tmp[256];
buf[0] = 0;
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_Unit, &m_Convert, buf, tmp, &thickness );
&m_Unit, &m_Convert, buf, tmp, &thickness, &hjustify, &vjustify );
if( cnt < 8 )
{
@ -510,10 +592,41 @@ bool LibDrawText::Load( char* line, wxString& errorMsg )
if( strnicmp( tmp, "Italic", 6 ) == 0 )
m_Italic = true;
if (thickness > 0) {
if( thickness > 0 )
{
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. */
m_Text = CONV_FROM_UTF8( buf );
m_Text.Replace( wxT( "~" ), wxT( " " ) );
@ -521,6 +634,29 @@ bool LibDrawText::Load( char* line, wxString& errorMsg )
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()
{
@ -550,7 +686,16 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
wxPoint pos1, pos2;
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:
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,
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 );
}
@ -588,6 +733,10 @@ void LibDrawText::DisplayInfo( WinEDA_DrawFrame* frame )
}
/*************************/
/** class LibDrawSquare **/
/*************************/
LibDrawSquare::LibDrawSquare() : LibEDA_BaseStruct( COMPONENT_RECT_DRAW_TYPE )
{
m_Width = 0;
@ -697,6 +846,7 @@ void LibDrawSquare::DisplayInfo( WinEDA_DrawFrame* frame )
EDA_Rect LibDrawSquare::GetBoundingBox()
{
EDA_Rect rect;
rect.SetOrigin( m_Pos.x, m_Pos.y * -1 );
rect.SetEnd( m_End.x, m_End.y * -1 );
rect.Inflate( m_Width / 2, m_Width / 2 );

View File

@ -281,6 +281,15 @@ public:
virtual bool Save( FILE* aFile ) const;
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();
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset,
@ -322,6 +331,14 @@ public:
virtual bool Save( FILE* aFile ) const;
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();
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset,
@ -360,6 +377,26 @@ public:
virtual bool Save( FILE* aFile ) const;
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();
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;
bMainSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bLeftSizer;
bLeftSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bPropertiesSizer;
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->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->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;
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 );
sOptionsSizer->Add( m_CommonUnit, 0, wxALL, 5 );
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 );
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 );
bBottomtBoxSizer->Add( sOptionsSizer, 0, 0, 5 );
wxString m_TextShapeOptChoices[] = { _("Normal"), _("Italic"), _("Bold"), _("Bold Italic") };
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->SetSelection( 3 );
bRightSizer->Add( m_TextShapeOpt, 0, wxALL|wxEXPAND, 5 );
m_TextShapeOpt->SetSelection( 0 );
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;
bSizer4 = new wxBoxSizer( wxVERTICAL );
wxString m_TextVJustificationOptChoices[] = { _("Align bottom"), _("Align center"), _("Align top") };
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 );
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 );
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->Layout();
// 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_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()
{
// 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_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="name">Dialog_BodyGraphicText_Properties_base</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="subclass"></property>
<property name="title">Graphic text properties:</property>
@ -49,7 +49,7 @@
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog">OnInitDialog</event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
@ -81,7 +81,25 @@
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<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="permission">none</property>
<object class="sizeritem" expanded="1">
@ -138,7 +156,7 @@
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
@ -190,185 +208,15 @@
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<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">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">
<property name="minimum_size"></property>
<property name="name">bRightSizer</property>
<property name="name">bTextSizeSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
@ -383,7 +231,7 @@
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Size:</property>
<property name="label">Size</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_TextSizeText</property>
@ -477,6 +325,238 @@
<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">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">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
@ -497,7 +577,115 @@
<property name="name">m_TextShapeOpt</property>
<property name="permission">protected</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="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
@ -533,13 +721,26 @@
</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">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bSizer4</property>
<property name="name">bButtonsBoxSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">

View File

@ -17,8 +17,9 @@
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/checkbox.h>
#include <wx/statline.h>
#include <wx/statbox.h>
#include <wx/radiobox.h>
#include <wx/button.h>
@ -36,23 +37,25 @@ class Dialog_BodyGraphicText_Properties_base : public wxDialog
protected:
wxStaticText* m_staticText1;
wxTextCtrl* m_TextValue;
wxCheckBox* m_CommonUnit;
wxCheckBox* m_CommonConvert;
wxCheckBox* m_Orient;
wxStaticText* m_TextSizeText;
wxTextCtrl* m_TextSize;
wxCheckBox* m_Orient;
wxStaticLine* m_staticline1;
wxCheckBox* m_CommonUnit;
wxCheckBox* m_CommonConvert;
wxRadioBox* m_TextShapeOpt;
wxRadioBox* m_TextHJustificationOpt;
wxRadioBox* m_TextVJustificationOpt;
wxButton* m_buttonOK;
wxButton* m_buttonCANCEL;
// 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 OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
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();
};

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") };
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->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="hidden">0</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="maximum_size"></property>
<property name="minimum_size"></property>
@ -900,7 +900,7 @@
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="0">
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">textSizeBoxSizer</property>
<property name="orient">wxVERTICAL</property>

View File

@ -32,7 +32,7 @@ public:
~Dialog_BodyGraphicText_Properties() {};
private:
void OnInitDialog( wxInitDialogEvent& event );
void InitDialog( );
void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
};
@ -43,12 +43,13 @@ Dialog_BodyGraphicText_Properties::Dialog_BodyGraphicText_Properties( WinEDA_Li
{
m_Parent = aParent;
m_GraphicText = aGraphicText;
InitDialog( );
}
/********************************************************************************/
void Dialog_BodyGraphicText_Properties::OnInitDialog( wxInitDialogEvent& event )
/********************************************************************************/
/*****************************************************/
void Dialog_BodyGraphicText_Properties::InitDialog( )
/*****************************************************/
{
wxString msg;
@ -69,6 +70,38 @@ wxString msg;
shape |= 2;
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
{
@ -130,6 +163,37 @@ wxString Line;
else
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();

View File

@ -109,6 +109,7 @@ SCH_ITEM* PickStruct( const wxPoint& refpos, BASE_SCREEN* screen, int SearchMask
*/
{
bool Snapped;
if( screen == NULL || screen->EEDrawList == NULL )
return NULL;
@ -217,7 +218,8 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask,
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;
return TRUE;
@ -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.
*/
{
int dx, dy;
LibEDA_BaseStruct* DrawItem;
int seuil;
if( LibEntry == NULL )
return NULL;
@ -702,7 +702,14 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
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() )
{
@ -718,10 +725,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
LibDrawArc* Arc = (LibDrawArc*) DrawItem;
if( (masque & LOCATE_COMPONENT_ARC_DRAW_TYPE) == 0 )
break;
dx = aRefPoint.x - Arc->m_Pos.x;
dy = aRefPoint.y + Arc->m_Pos.y;
int dist = (int) sqrt( ((double)dx * dx) + ((double)dy * dy) );
if( abs( dist - Arc->m_Rayon ) <= seuil )
if( Arc->HitTest( pointInLibitemsSpace ) )
return DrawItem;
}
break;
@ -731,10 +735,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
LibDrawCircle* Circle = (LibDrawCircle*) DrawItem;
if( (masque & LOCATE_COMPONENT_CIRCLE_DRAW_TYPE) == 0 )
break;
dx = aRefPoint.x - Circle->m_Pos.x;
dy = aRefPoint.y + Circle->m_Pos.y;
int dist = (int) sqrt( (double)( dx * dx + dy * dy ) );
if( abs( dist - Circle->m_Rayon ) <= seuil )
if( Circle->HitTest( pointInLibitemsSpace ) )
return DrawItem;
}
break;
@ -749,19 +750,23 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
start.y = -Square->m_Pos.y;
end.x = Square->m_End.x;
end.y = -Square->m_Pos.y;
// locate lower segment
if( IsPointOnSegment( aRefPoint, start, end, seuil ) )
return DrawItem;
// locate right segment
start.x = Square->m_End.x;
end.y = -Square->m_End.y;
if( IsPointOnSegment( aRefPoint, start, end, seuil ) )
return DrawItem;
// locate upper segment
start.y = -Square->m_End.y;
end.x = Square->m_Pos.x;
if( IsPointOnSegment( aRefPoint, start, end, seuil ) )
return DrawItem;
// locate left segment
start.x = Square->m_Pos.x;
end.x = -Square->m_Pos.y;
@ -785,9 +790,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
LibDrawSegment* Segment = (LibDrawSegment*) DrawItem;
if( (masque & LOCATE_COMPONENT_LINE_DRAW_TYPE) == 0 )
break;
wxPoint ref = aRefPoint;
NEGATE ( ref.y);
if( IsPointOnSegment( ref, Segment->m_Pos, Segment->m_End, seuil ) )
if( IsPointOnSegment( pointInLibitemsSpace, Segment->m_Pos, Segment->m_End, seuil ) )
return DrawItem;
}
break;
@ -797,19 +800,8 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
LibDrawText* Text = (LibDrawText*) DrawItem;
if( (masque & LOCATE_COMPONENT_GRAPHIC_TEXT_DRAW_TYPE) == 0 )
break;
int len = Text->m_Text.Len();
if( len < 2 )
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 */
if( Text->HitTest( pointInLibitemsSpace ) )
return DrawItem; /* Found! */
}
break;

View File

@ -112,6 +112,7 @@ bool WinEDA_SheetPropertiesFrame::Create( wxWindow* parent, wxWindowID id, const
m_SheetNameTextSize = NULL;
m_SheetNameSize = NULL;
m_btClose = NULL;
////@end WinEDA_SheetPropertiesFrame member initialisation
////@begin WinEDA_SheetPropertiesFrame creation
@ -124,6 +125,7 @@ bool WinEDA_SheetPropertiesFrame::Create( wxWindow* parent, wxWindowID id, const
GetSizer()->SetSizeHints( this );
}
Centre();
////@end WinEDA_SheetPropertiesFrame creation
return true;
}
@ -141,6 +143,7 @@ void WinEDA_SheetPropertiesFrame::CreateControls()
WinEDA_SheetPropertiesFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxVERTICAL );
itemDialog1->SetSizer( itemBoxSizer2 );
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer( wxHORIZONTAL );
@ -149,31 +152,56 @@ void WinEDA_SheetPropertiesFrame::CreateControls()
wxBoxSizer* itemBoxSizer4 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer3->Add( itemBoxSizer4, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
wxStaticText* itemStaticText5 = new wxStaticText( itemDialog1, wxID_STATIC, _("Filename:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxStaticText* itemStaticText5 = new wxStaticText( itemDialog1, wxID_STATIC, _(
"Filename:" ), wxDefaultPosition,
wxDefaultSize, 0 );
itemBoxSizer4->Add( itemStaticText5,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_FileNameWin = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxSize(300, -1), wxTE_PROCESS_ENTER );
m_FileNameWin =
new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T( "" ), wxDefaultPosition, wxSize( 300,
-1 ),
wxTE_PROCESS_ENTER );
itemBoxSizer4->Add( m_FileNameWin, 0, wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
wxStaticText* itemStaticText7 = new wxStaticText( itemDialog1, wxID_STATIC, _("Sheetname:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer4->Add(itemStaticText7, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxStaticText* itemStaticText7 = new wxStaticText( itemDialog1, wxID_STATIC, _(
"Sheetname:" ), wxDefaultPosition,
wxDefaultSize, 0 );
itemBoxSizer4->Add( itemStaticText7,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_SheetNameWin = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxSize(300, -1), 0 );
m_SheetNameWin =
new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T( "" ), wxDefaultPosition, wxSize( 300,
-1 ), 0 );
itemBoxSizer4->Add( m_SheetNameWin, 0, wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
wxBoxSizer* itemBoxSizer9 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer3->Add( itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
m_FileNameTextSize = new wxStaticText( itemDialog1, wxID_STATIC, _("Size"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add(m_FileNameTextSize, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
m_FileNameTextSize = new wxStaticText( itemDialog1, wxID_STATIC, _(
"Size" ), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add( m_FileNameTextSize,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_FileNameSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL2, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
m_FileNameSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL2, _T(
"" ), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add( m_FileNameSize, 0, wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
m_SheetNameTextSize = new wxStaticText( itemDialog1, wxID_STATIC, _("Size"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add(m_SheetNameTextSize, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
m_SheetNameTextSize = new wxStaticText( itemDialog1, wxID_STATIC, _(
"Size" ), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add( m_SheetNameTextSize,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_SheetNameSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL3, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
m_SheetNameSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL3, _T(
"" ), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add( m_SheetNameSize, 0, wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
itemBoxSizer2->Add( 5, 5, 1, wxGROW | wxALL, 5 );
@ -181,15 +209,18 @@ void WinEDA_SheetPropertiesFrame::CreateControls()
wxBoxSizer* itemBoxSizer15 = new wxBoxSizer( wxHORIZONTAL );
itemBoxSizer2->Add( itemBoxSizer15, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
m_btClose = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), 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 );
wxButton* itemButton17 = new wxButton( itemDialog1, wxID_OK, _(
"&OK" ), wxDefaultPosition, wxDefaultSize, 0 );
itemButton17->SetDefault();
itemBoxSizer15->Add( itemButton17, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
// Set validators
m_SheetNameWin->SetValidator( wxTextValidator( wxFILTER_NONE, &m_CurrentSheet->m_SheetName ) );
////@end WinEDA_SheetPropertiesFrame content construction
m_btClose->SetFocus();
@ -217,6 +248,7 @@ wxBitmap WinEDA_SheetPropertiesFrame::GetBitmapResource( const wxString& name )
////@begin WinEDA_SheetPropertiesFrame bitmap retrieval
wxUnusedVar( name );
return wxNullBitmap;
////@end WinEDA_SheetPropertiesFrame bitmap retrieval
}
@ -231,6 +263,7 @@ wxIcon WinEDA_SheetPropertiesFrame::GetIconResource( const wxString& name )
////@begin WinEDA_SheetPropertiesFrame icon retrieval
wxUnusedVar( name );
return wxNullIcon;
////@end WinEDA_SheetPropertiesFrame icon retrieval
}
@ -266,7 +299,8 @@ void WinEDA_SheetPropertiesFrame::SheetPropertiesAccept( wxCommandEvent& event )
if( ( fn.GetFullPath() != m_CurrentSheet->GetFileName() )
|| ( m_CurrentSheet->m_AssociatedScreen == NULL) )
{
msg = _( "Changing a Filename can change all the schematic \
msg = _(
"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 ) )

View File

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

View File

@ -69,6 +69,11 @@ static inline const wxChar* GetChars( wxString s )
while( Angle > 900 ) \
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 */

View File

@ -279,7 +279,6 @@ public:
// ratsnest functions
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 );
void build_ratsnest_module( wxDC* DC, MODULE* Module );
void trace_ratsnest_module( wxDC* DC );
@ -1011,7 +1010,7 @@ public:
// loading Footprint
MODULE* Import_Module( wxDC* DC );
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
void Edit_Edge_Width( EDGE_MODULE* Edge );

Binary file not shown.

View File

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

View File

@ -54,7 +54,6 @@ float MinCout;
/* Fonctions locales */
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 void TracePenaliteRectangle( BOARD* Pcb, int ux0, int uy0, int ux1, int uy1,
@ -309,10 +308,8 @@ end_of_tst:
Module->Set_Rectangle_Encadrement();
}
/* Recalcul de la liste des pads, detruite par les calculs precedents */
GetBoard()->m_Status_Pcb = 0;
GetBoard()->Build_Pads_Full_List();
Compile_Ratsnest( DC, true );
DrawPanel->ReDraw( DC, TRUE );
DrawPanel->m_AbortEnable = FALSE;
@ -585,8 +582,6 @@ int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC )
Module->DisplayInfo( this );
Build_PlacedPads_List( GetBoard() );
LastPosOK.x = GetBoard()->m_BoundaryBox.m_Pos.x;
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 */
/*****************************************************************/
@ -1099,8 +1049,6 @@ static MODULE* PickModule( WinEDA_PcbFrame* pcbframe, wxDC* DC )
if( BaseListeModules == NULL )
return NULL;
Build_PlacedPads_List( pcbframe->GetBoard() );
/* Tri par surface decroissante des modules
* (on place les plus gros en 1er), surface ponderee par le nombre de pads */

View File

@ -191,7 +191,7 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
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) )
{

View File

@ -18,8 +18,7 @@ class EDA_BoardDesignSettings;
* Enum LAYER_T
* gives the allowed types of layers, same as Specctra DSN spec.
*/
enum LAYER_T
{
enum LAYER_T {
LT_SIGNAL,
LT_POWER,
LT_MIXED,
@ -92,12 +91,11 @@ public:
DLIST<TRACK> m_Track; // linked list of TRACKs and SEGVIAs
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 ..
std::vector<RATSNEST_ITEM> m_FullRatsnest; // Rastnest list for the BOARD
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
@ -120,6 +118,7 @@ public:
* @param aControl An int which can vary how the item is added.
*/
void Add( BOARD_ITEM* aBoardItem, int aControl = 0 );
#define ADD_APPEND 1 ///< aControl flag for Add( aControl ), appends not inserts
@ -172,6 +171,7 @@ public:
return NULL;
}
/**
* Function GetMARKERCount
* @return int - The number of MARKERS.
@ -181,6 +181,7 @@ public:
return (int) m_markers.size();
}
/**
* Function GetCopperLayerCount
* @return int - The number of copper layers in the BOARD.
@ -242,6 +243,7 @@ public:
return m_FullRatsnest.size();
}
/** Function GetNodesCount
* @return the number of pads members of nets (i.e. with netcode > 0)
*/
@ -252,19 +254,9 @@ public:
*/
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:
bool ComputeBoundaryBox();
@ -364,6 +356,7 @@ public:
#if defined(DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
@ -383,6 +376,7 @@ public:
/*************************/
/* Copper Areas handling */
/*************************/
/**
* Function HitTestForAnyFilledArea
* 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
* @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
* 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
* 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
@ -432,6 +434,7 @@ public:
return NULL;
}
/**
* Function GetAreaIndex
* returns the Area Index for the given Zone Container.
@ -445,9 +448,11 @@ public:
if( aArea == GetArea( ii ) ) // Found !
return ii;
}
return -1;
}
/**
* Function GetAreaCount
* @return int - The number of Areas or ZONE_CONTAINER.
@ -457,7 +462,9 @@ public:
return (int) m_ZoneDescriptorList.size();
}
/* Functions used in test, merge and cut outlines */
/**
* Function AddArea
* 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 );
/**
Function CompleteArea
* Function CompleteArea
* 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
* @param area_to_complete = area to complete or remove
@ -515,7 +522,9 @@ public:
* Also sets areas->utility1 flags if areas are modified
*/
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
@ -582,7 +591,8 @@ public:
* @param aCreate_Markers: if true create DRC markers. False: do not creates anything
* @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: */
@ -592,7 +602,6 @@ public:
* @param aNetcode = netcode to analyse. if -1, analyse all nets
*/
void Test_Connections_To_Copper_Areas( int aNetcode = -1 );
};
#endif // #ifndef CLASS_BOARD_H

View File

@ -479,14 +479,8 @@ bool COTATION::HitTest( const wxPoint& ref_pos )
int ux0, uy0;
int dx, dy, spot_cX, spot_cY;
if( m_Text )
{
// 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 ) )
if( m_Text && m_Text->TextHitTest( ref_pos ) )
return true;
}
/* Localisation des SEGMENTS ?) */
ux0 = Barre_ox;

View File

@ -53,10 +53,10 @@ public:
m_NetCode = aNetCode;
}
/** function Draw
*/
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 ..
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:
NETINFO_LIST( BOARD* aParent );
~NETINFO_LIST();
@ -103,6 +106,37 @@ public:
* The list is sorted by names.
*/
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
@ -188,8 +222,6 @@ public:
};
/****************************************************************/
/* 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];
m_NetBuffer.clear();
m_PadsFullList.clear();
}
@ -90,14 +91,14 @@ void NETINFO_LIST::BuildListOfNets()
AppendNet( net_item );
/* 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 */
D_PAD* last_pad = NULL;
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
{
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
* 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)
*/
{
if( m_Status_Pcb & LISTE_PAD_OK )
if( m_Parent->m_Status_Pcb & LISTE_PAD_OK )
return;
// empty the old list
m_Pads.clear();
m_FullRatsnest.clear();
m_PadsFullList.clear();
m_Parent->m_FullRatsnest.clear();
/* 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() )
{
m_Pads.push_back( pad );
m_PadsFullList.push_back( pad );
pad->SetSubRatsnest( 0 );
pad->SetParent( module );
@ -163,7 +164,7 @@ void BOARD::Build_Pads_Full_List()
}
// 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 )
{
return EDA_TextStruct::HitTest( refPos );
return TextHitTest( refPos );
}
@ -70,7 +70,7 @@ public:
*/
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
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->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 )
{
D_PAD* pad = m_Pcb->m_Pads[i];
D_PAD* pad = m_Pcb->m_NetInfo->GetPad(i);
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 )
/*****************************************************************************/
{
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 );
}

View File

@ -179,7 +179,7 @@ void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_segm )
return;
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 */
{
int ii = 0;
@ -195,5 +195,7 @@ void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_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();
// 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.
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 )
{
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,
* 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 ) );
}
m_ModuleEditFrame->Load_Module_Module_From_BOARD(
(MODULE*) GetScreen()->GetCurItem() );
m_ModuleEditFrame->Load_Module_From_BOARD( (MODULE*) GetScreen()->GetCurItem() );
SetCurItem( NULL );
GoToEditor = FALSE;

View File

@ -170,7 +170,7 @@ void CreatePadsShapesSection( FILE* file, BOARD* pcb )
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 );
}

View File

@ -279,7 +279,6 @@ void WinEDA_PcbFrame::Erase_Modules( bool query )
GetBoard()->m_Modules.DeleteAll();
GetBoard()->m_Status_Pcb = 0;
m_Pcb->m_Pads.clear(); // empty the pad list pointers
m_Pcb->m_NetInfo->DeleteData();
m_Pcb->m_FullRatsnest.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 );
Place_Module( module, DC );
GetBoard()->m_Status_Pcb = 0;
GetBoard()->Build_Pads_Full_List();
GetBoard()->m_NetInfo->BuildListOfNets();
return module;
}

View File

@ -44,9 +44,9 @@ static void ReadDocLib( const wxString& ModLibName );
static ModList* MList;
/***************************************************************************/
void WinEDA_ModuleEditFrame::Load_Module_Module_From_BOARD( MODULE* Module )
/***************************************************************************/
/********************************************************************/
void WinEDA_ModuleEditFrame::Load_Module_From_BOARD( MODULE* Module )
/********************************************************************/
{
MODULE* NewModule;
WinEDA_BasePcbFrame* parent = (WinEDA_BasePcbFrame*) GetParent();
@ -77,7 +77,7 @@ void WinEDA_ModuleEditFrame::Load_Module_Module_From_BOARD( MODULE* Module )
Module->m_Flags = 0;
GetBoard()->Build_Pads_Full_List();
GetBoard()->m_NetInfo->BuildListOfNets();
GetScreen()->m_Curseur.x = GetScreen()->m_Curseur.y = 0;
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 )
{
D_PAD* pad = Pcb->m_Pads[i];
D_PAD* pad = Pcb->m_NetInfo->GetPad(i);
if( pad->m_Pos != ref_pos )
continue;

View File

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

View File

@ -189,12 +189,12 @@ void Abort_MoveOrCopyModule( WinEDA_DrawPanel* Panel, wxDC* DC )
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 = NULL;
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->Copy( module );
/* no, Add() below does this
newmodule->SetParent( GetBoard() );
*/
GetBoard()->Add( newmodule, ADD_APPEND );
newmodule->m_Flags = IS_NEW;
GetBoard()->Build_Pads_Full_List();
GetBoard()->m_NetInfo->BuildListOfNets();
newmodule->DisplayInfo( this );
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 */
SaveItemEfface( module, 1 );
GetBoard()->m_Status_Pcb = 0;
GetBoard()->Build_Pads_Full_List();
ReCompile_Ratsnest_After_Changes( DC );
Compile_Ratsnest( DC, true );
// redraw the area where the module was
if( DC )
@ -529,7 +523,7 @@ void BOARD::Change_Side_Module( MODULE* Module, wxDC* DC )
Module->Draw( m_PcbFrame->DrawPanel, DC, GR_OR );
/* affichage chevelu general si necessaire */
m_PcbFrame->ReCompile_Ratsnest_After_Changes( DC );
m_PcbFrame->Compile_Ratsnest( DC, true );
}
}
else
@ -695,7 +689,7 @@ void WinEDA_BasePcbFrame::Place_Module( MODULE* module, wxDC* DC )
}
/* affichage chevelu general si necessaire */
ReCompile_Ratsnest_After_Changes( DC );
Compile_Ratsnest( DC, true );
module->DisplayInfo( this );
@ -765,7 +759,7 @@ void WinEDA_BasePcbFrame::Rotate_Module( wxDC* DC, MODULE* module,
module->Draw( DrawPanel, DC, GR_OR );
/* Reaffichage chevelu general si necessaire */
ReCompile_Ratsnest_After_Changes( DC );
Compile_Ratsnest( DC, true );
}
else
{

View File

@ -428,7 +428,7 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
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 );
}
@ -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 )
@ -776,7 +765,7 @@ void WinEDA_BasePcbFrame::build_ratsnest_module( wxDC* DC, MODULE* Module )
if( (GetBoard()->m_Status_Pcb & LISTE_PAD_OK) == 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)

View File

@ -153,7 +153,6 @@ void Out_Pads( BOARD* Pcb, FILE* outfile )
{
D_PAD* pt_pad;
//MODULE * Module;
int netcode, mod_num, nb_pads, plink;
LISTE_PAD* pt_liste_pad, * pt_start_liste,
* 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
* 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();
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 result, skip;
int i;
LISTE_PAD* ptr;
long curcell, newcell, buddy, lastopen, lastclos, lastmove;
int newdist, olddir, _self;
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
* des bits precedents) */
ptr = (LISTE_PAD*) &pcbframe->GetBoard()->m_Pads[0];
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->m_Flags = 0;
GetBoard()->m_Status_Pcb = 0;
GetBoard()->Build_Pads_Full_List();
ReCompile_Ratsnest_After_Changes( DC );
Compile_Ratsnest( DC, true );
break;
#endif
@ -167,8 +165,6 @@ BOARD_ITEM* WinEDA_BasePcbFrame::SaveItemEfface( BOARD_ITEM* aItem, int nbitems
m_Pcb->m_Modules.Remove( module );
module->SetState( DELETED, ON );
g_UnDeleteStack[g_UnDeleteStackPtr++] = module;
GetBoard()->m_Status_Pcb = 0;
GetBoard()->Build_Pads_Full_List();
}
break;
#endif