Commit bb8ee329 authored by charras's avatar charras

Bug in get online help: kicad.pdf was always called instead of the suitable...

Bug in get online help: kicad.pdf was always called instead of the suitable help file. thanks to the guy who did not test its changes
eeschema: code cleaning
switch to wxWidgets 2.8.9
parent 7470a3bd
...@@ -5,6 +5,13 @@ Started 2007-June-11 ...@@ -5,6 +5,13 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2008-Sep-17 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+eeschema:
code cleaning
PartTextStruct class name changed to a name : SCH_CMP_FIELD
2008-Sep-14 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2008-Sep-14 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================ ================================================================================
+pcbnew: +pcbnew:
......
...@@ -245,7 +245,7 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) ...@@ -245,7 +245,7 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
DisplayError( this, msg ); DisplayError( this, msg );
} }
#elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF #elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF
wxString fullfilename = FindKicadHelpPath() + _T("kicad.pdf"); wxString fullfilename = FindKicadHelpPath() + m_Parent->m_HelpFileName;
if ( wxFileExists(fullfilename) ) if ( wxFileExists(fullfilename) )
GetAssociatedDocument( this, wxEmptyString, fullfilename ); GetAssociatedDocument( this, wxEmptyString, fullfilename );
else // Try to find file in English format: else // Try to find file in English format:
......
...@@ -229,11 +229,12 @@ void WinEDA_App::InitEDA_Appl( const wxString& name ) ...@@ -229,11 +229,12 @@ void WinEDA_App::InitEDA_Appl( const wxString& name )
m_KicadEnv += UNIX_STRING_DIR_SEP; m_KicadEnv += UNIX_STRING_DIR_SEP;
} }
/* Prepare On Line Help */ /* Prepare On Line Help. Use only lower case for help filenames,
* in order to avoid problems with upper/lower case filenames under windows and unix */
#if defined ONLINE_HELP_FILES_FORMAT_IS_HTML #if defined ONLINE_HELP_FILES_FORMAT_IS_HTML
m_HelpFileName = name + wxT( ".html" ); m_HelpFileName = name.Lower() + wxT( ".html" );
#elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF #elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF
m_HelpFileName = name + wxT( ".pdf" ); m_HelpFileName = name.Lower() + wxT( ".pdf" );
#else #else
#error Help files format not defined #error Help files format not defined
#endif #endif
......
...@@ -25,7 +25,7 @@ LibEDA_BaseStruct::LibEDA_BaseStruct( KICAD_T struct_type ) : ...@@ -25,7 +25,7 @@ LibEDA_BaseStruct::LibEDA_BaseStruct( KICAD_T struct_type ) :
* 0 if the item is common to all shapes */ * 0 if the item is common to all shapes */
m_Width = 0; /* Default value to draw lines or arc ... */ m_Width = 0; /* Default value to draw lines or arc ... */
m_Fill = NO_FILL; /* NO_FILL, FILLED_SHAPE or FILLED_WITH_BG_BODYCOLOR. m_Fill = NO_FILL; /* NO_FILL, FILLED_SHAPE or FILLED_WITH_BG_BODYCOLOR.
* has meaning only for some items */ * has meaning only for some items */
} }
...@@ -47,7 +47,7 @@ void LibDrawArc::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffs ...@@ -47,7 +47,7 @@ void LibDrawArc::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffs
wxPoint pos1, pos2, posc; wxPoint pos1, pos2, posc;
int color = ReturnLayerColor( LAYER_DEVICE ); int color = ReturnLayerColor( LAYER_DEVICE );
int LineWidth = MAX( m_Width, g_DrawMinimunLineWidth ); int linewidth = MAX( m_Width, g_DrawMinimunLineWidth );
if( aColor < 0 ) // Used normal color or selected color if( aColor < 0 ) // Used normal color or selected color
{ {
...@@ -76,7 +76,7 @@ void LibDrawArc::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffs ...@@ -76,7 +76,7 @@ void LibDrawArc::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffs
if( fill == FILLED_WITH_BG_BODYCOLOR ) if( fill == FILLED_WITH_BG_BODYCOLOR )
GRFilledArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2, GRFilledArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2,
m_Rayon, LineWidth, color, m_Rayon, linewidth, color,
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( fill == FILLED_SHAPE && !aData ) else if( fill == FILLED_SHAPE && !aData )
GRFilledArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2, GRFilledArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2,
...@@ -87,13 +87,13 @@ void LibDrawArc::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffs ...@@ -87,13 +87,13 @@ void LibDrawArc::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffs
GRArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2, GRArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2,
m_Rayon, LineWidth, color ); m_Rayon, linewidth, color );
#else #else
GRArc1( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GRArc1( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
posc.x, posc.y, LineWidth, color ); posc.x, posc.y, linewidth, color );
#endif #endif
} }
...@@ -106,7 +106,7 @@ void LibDrawCircle::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aO ...@@ -106,7 +106,7 @@ void LibDrawCircle::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aO
wxPoint pos1; wxPoint pos1;
int color = ReturnLayerColor( LAYER_DEVICE ); int color = ReturnLayerColor( LAYER_DEVICE );
int LineWidth = MAX( m_Width, g_DrawMinimunLineWidth ); int linewidth = MAX( m_Width, g_DrawMinimunLineWidth );
if( aColor < 0 ) // Used normal color or selected color if( aColor < 0 ) // Used normal color or selected color
{ {
...@@ -125,14 +125,14 @@ void LibDrawCircle::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aO ...@@ -125,14 +125,14 @@ void LibDrawCircle::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aO
if( fill == FILLED_WITH_BG_BODYCOLOR ) if( fill == FILLED_WITH_BG_BODYCOLOR )
GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y,
m_Rayon, LineWidth, color, m_Rayon, linewidth, color,
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( fill == FILLED_SHAPE ) else if( fill == FILLED_SHAPE )
GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y,
m_Rayon, 0, color, color ); m_Rayon, 0, color, color );
else else
GRCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, GRCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y,
m_Rayon, LineWidth, color ); m_Rayon, linewidth, color );
} }
...@@ -144,7 +144,7 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOff ...@@ -144,7 +144,7 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOff
wxPoint pos1, pos2; wxPoint pos1, pos2;
int color = ReturnLayerColor( LAYER_DEVICE ); int color = ReturnLayerColor( LAYER_DEVICE );
int LineWidth = MAX( m_Width, g_DrawMinimunLineWidth ); int linewidth = MAX( m_Width, g_DrawMinimunLineWidth );
if( aColor < 0 ) // Used normal color or selected color if( aColor < 0 ) // Used normal color or selected color
{ {
...@@ -163,7 +163,7 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOff ...@@ -163,7 +163,7 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOff
DrawGraphicText( aPanel, aDC, pos1, color, m_Text, DrawGraphicText( aPanel, aDC, pos1, color, m_Text,
t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT, t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
m_Size, m_Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, LineWidth ); GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, linewidth );
} }
...@@ -175,7 +175,7 @@ void LibDrawSquare::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aO ...@@ -175,7 +175,7 @@ void LibDrawSquare::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aO
wxPoint pos1, pos2; wxPoint pos1, pos2;
int color = ReturnLayerColor( LAYER_DEVICE ); int color = ReturnLayerColor( LAYER_DEVICE );
int LineWidth = MAX( m_Width, g_DrawMinimunLineWidth ); int linewidth = MAX( m_Width, g_DrawMinimunLineWidth );
if( aColor < 0 ) // Used normal color or selected color if( aColor < 0 ) // Used normal color or selected color
{ {
...@@ -194,14 +194,14 @@ void LibDrawSquare::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aO ...@@ -194,14 +194,14 @@ void LibDrawSquare::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aO
if( fill == FILLED_WITH_BG_BODYCOLOR && !aData ) if( fill == FILLED_WITH_BG_BODYCOLOR && !aData )
GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
color, LineWidth, color, linewidth,
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( m_Fill == FILLED_SHAPE && !aData ) else if( m_Fill == FILLED_SHAPE && !aData )
GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
color, color ); color, color );
else else
GRRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GRRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
LineWidth, color ); linewidth, color );
} }
...@@ -213,7 +213,7 @@ void LibDrawSegment::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& a ...@@ -213,7 +213,7 @@ void LibDrawSegment::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& a
wxPoint pos1, pos2; wxPoint pos1, pos2;
int color = ReturnLayerColor( LAYER_DEVICE ); int color = ReturnLayerColor( LAYER_DEVICE );
int LineWidth = MAX( m_Width, g_DrawMinimunLineWidth ); int linewidth = MAX( m_Width, g_DrawMinimunLineWidth );
if( aColor < 0 ) // Used normal color or selected color if( aColor < 0 ) // Used normal color or selected color
{ {
...@@ -226,7 +226,7 @@ void LibDrawSegment::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& a ...@@ -226,7 +226,7 @@ void LibDrawSegment::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& a
pos1 = TransformCoordinate( aTransformMatrix, m_Pos ) + aOffset; pos1 = TransformCoordinate( aTransformMatrix, m_Pos ) + aOffset;
pos2 = TransformCoordinate( aTransformMatrix, m_End ) + aOffset; pos2 = TransformCoordinate( aTransformMatrix, m_End ) + aOffset;
GRLine( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, LineWidth, color ); GRLine( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, linewidth, color );
} }
...@@ -240,7 +240,7 @@ void LibDrawPolyline::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -240,7 +240,7 @@ void LibDrawPolyline::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
wxPoint pos1; wxPoint pos1;
int color = ReturnLayerColor( LAYER_DEVICE ); int color = ReturnLayerColor( LAYER_DEVICE );
int LineWidth = MAX( m_Width, g_DrawMinimunLineWidth ); int linewidth = MAX( m_Width, g_DrawMinimunLineWidth );
static int* Buf_Poly_Drawings = NULL; // Buffer used to store current corners coordinates for drawings static int* Buf_Poly_Drawings = NULL; // Buffer used to store current corners coordinates for drawings
static int Buf_Poly_Size = 0; // Buffer used to store current corners coordinates for drawings static int Buf_Poly_Size = 0; // Buffer used to store current corners coordinates for drawings
...@@ -282,14 +282,14 @@ void LibDrawPolyline::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -282,14 +282,14 @@ void LibDrawPolyline::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
if( fill == FILLED_WITH_BG_BODYCOLOR ) if( fill == FILLED_WITH_BG_BODYCOLOR )
GRPoly( &aPanel->m_ClipBox, aDC, m_CornersCount, GRPoly( &aPanel->m_ClipBox, aDC, m_CornersCount,
Buf_Poly_Drawings, 1, LineWidth, color, Buf_Poly_Drawings, 1, linewidth, color,
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( fill == FILLED_SHAPE ) else if( fill == FILLED_SHAPE )
GRPoly( &aPanel->m_ClipBox, aDC, m_CornersCount, GRPoly( &aPanel->m_ClipBox, aDC, m_CornersCount,
Buf_Poly_Drawings, 1, LineWidth, color, color ); Buf_Poly_Drawings, 1, linewidth, color, color );
else else
GRPoly( &aPanel->m_ClipBox, aDC, m_CornersCount, GRPoly( &aPanel->m_ClipBox, aDC, m_CornersCount,
Buf_Poly_Drawings, 0, LineWidth, color, color ); Buf_Poly_Drawings, 0, linewidth, color, color );
} }
...@@ -297,5 +297,46 @@ void LibDrawPolyline::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -297,5 +297,46 @@ void LibDrawPolyline::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
void LibDrawField::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset, int aColor, void LibDrawField::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset, int aColor,
int aDrawMode, void* aData, int aTransformMatrix[2][2] ) int aDrawMode, void* aData, int aTransformMatrix[2][2] )
/*************************************************************************************************/ /*************************************************************************************************/
/* if aData not NULL, adat must point a wxString which is used instead of the m_Text
*/
{ {
wxPoint text_pos;
int color = aColor;
int linewidth = MAX( m_Width, g_DrawMinimunLineWidth );
if( aColor < 0 ) // Used normal color or selected color
{
if( (m_Selected & IS_SELECTED) )
color = g_ItemSelectetColor;
}
else
color = aColor;
if( color < 0 )
{
switch( m_FieldId )
{
case REFERENCE:
color = ReturnLayerColor( LAYER_REFERENCEPART );
break;
case VALUE:
color = ReturnLayerColor( LAYER_VALUEPART );
break;
default:
color = ReturnLayerColor( LAYER_FIELDS );
break;
}
}
text_pos = TransformCoordinate( aTransformMatrix, m_Pos ) + aOffset;
wxString * text = aData ? (wxString *) aData : &m_Text;
GRSetDrawMode( aDC, aDrawMode );
DrawGraphicText( aPanel, aDC, text_pos,
color, text->GetData(),
m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
m_Size,
m_HJustify, m_VJustify, linewidth );
} }
...@@ -381,18 +381,21 @@ public: ...@@ -381,18 +381,21 @@ public:
/* Fields , same as component fields. /* Fields , same as component fields.
* can be defined in libraries (mandatory for ref and value, ca be useful for footprints) * can be defined in libraries (mandatory for ref and value, ca be useful for footprints)
* 2 Fields are always defined : * 2 Fields are always defined :
* Prefix (U, IC..) with gives the reference in scxhematic) * Prefix (U, IC..) with gives the reference in schematic)
* Name (74LS00..) used to find the component in libraries, and give the default value in schematic * Name (74LS00..) used to find the component in libraries, and give the default value in schematic
*/ */
class LibDrawField : public LibEDA_BaseStruct class LibDrawField : public LibEDA_BaseStruct
{ {
public: public:
int m_FieldId; // 0 a 11 int m_FieldId; /* 0 a 11
// 0 = Name; 1 = Valeur; 2 .. 11 other fields * 0 = Reference; 1 = Value
* 2 = Default footprint, 3 = subsheet (not used, reserved)
* .. 11 other fields
*/
wxSize m_Size; wxSize m_Size;
int m_Orient; /* Orientation */ int m_Orient; /* Orientation */
int m_Attributs; /* Attributes (Non visible ...) */ int m_Attributs; /* Attributes (Non visible ...) */
int m_HJustify, m_VJustify; /* Horiz an Vert Texte Justifications */ int m_HJustify, m_VJustify; /* Horiz and Vert Text Justifications */
wxString m_Text; /* Field Data */ wxString m_Text; /* Field Data */
wxString m_Name; /* Field Name */ wxString m_Name; /* Field Name */
......
...@@ -368,7 +368,7 @@ EDA_Rect SCH_COMPONENT::GetBoundaryBox() const ...@@ -368,7 +368,7 @@ EDA_Rect SCH_COMPONENT::GetBoundaryBox() const
/**************************************************************************/ /**************************************************************************/
void PartTextStruct::SwapData( PartTextStruct* copyitem ) void SCH_CMP_FIELD::SwapData( SCH_CMP_FIELD* copyitem )
/**************************************************************************/ /**************************************************************************/
/* Used if undo / redo command: /* Used if undo / redo command:
...@@ -800,7 +800,7 @@ void SCH_COMPONENT::Show( int nestLevel, std::ostream& os ) ...@@ -800,7 +800,7 @@ void SCH_COMPONENT::Show( int nestLevel, std::ostream& os )
/***************************************************************************/ /***************************************************************************/
PartTextStruct::PartTextStruct( const wxPoint& pos, const wxString& text ) : SCH_CMP_FIELD::SCH_CMP_FIELD( const wxPoint& pos, const wxString& text ) :
SCH_ITEM( NULL, DRAW_PART_TEXT_STRUCT_TYPE ), SCH_ITEM( NULL, DRAW_PART_TEXT_STRUCT_TYPE ),
EDA_TextStruct( text ) EDA_TextStruct( text )
/***************************************************************************/ /***************************************************************************/
...@@ -812,14 +812,14 @@ PartTextStruct::PartTextStruct( const wxPoint& pos, const wxString& text ) : ...@@ -812,14 +812,14 @@ PartTextStruct::PartTextStruct( const wxPoint& pos, const wxString& text ) :
/************************************/ /************************************/
PartTextStruct::~PartTextStruct() SCH_CMP_FIELD::~SCH_CMP_FIELD()
/************************************/ /************************************/
{ {
} }
/***********************************************************/ /***********************************************************/
void PartTextStruct::PartTextCopy( PartTextStruct* target ) void SCH_CMP_FIELD::PartTextCopy( SCH_CMP_FIELD* target )
/***********************************************************/ /***********************************************************/
{ {
target->m_Text = m_Text; target->m_Text = m_Text;
...@@ -838,7 +838,7 @@ void PartTextStruct::PartTextCopy( PartTextStruct* target ) ...@@ -838,7 +838,7 @@ void PartTextStruct::PartTextCopy( PartTextStruct* target )
/*********************************/ /*********************************/
bool PartTextStruct::IsVoid() bool SCH_CMP_FIELD::IsVoid()
/*********************************/ /*********************************/
/* return True if The field is void, i.e.: /* return True if The field is void, i.e.:
...@@ -852,7 +852,7 @@ bool PartTextStruct::IsVoid() ...@@ -852,7 +852,7 @@ bool PartTextStruct::IsVoid()
/********************************************/ /********************************************/
EDA_Rect PartTextStruct::GetBoundaryBox() const EDA_Rect SCH_CMP_FIELD::GetBoundaryBox() const
/********************************************/ /********************************************/
/* return /* return
...@@ -966,7 +966,7 @@ EDA_Rect PartTextStruct::GetBoundaryBox() const ...@@ -966,7 +966,7 @@ EDA_Rect PartTextStruct::GetBoundaryBox() const
* @param aFile The FILE to write to. * @param aFile The FILE to write to.
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
*/ */
bool PartTextStruct::Save( FILE* aFile ) const bool SCH_CMP_FIELD::Save( FILE* aFile ) const
{ {
char hjustify = 'C'; char hjustify = 'C';
...@@ -1113,7 +1113,7 @@ bool SCH_COMPONENT::Save( FILE* f ) const ...@@ -1113,7 +1113,7 @@ bool SCH_COMPONENT::Save( FILE* f ) const
for( ii = 0; ii < NUMBER_OF_FIELDS; ii++ ) for( ii = 0; ii < NUMBER_OF_FIELDS; ii++ )
{ {
const PartTextStruct* field = &m_Field[ii]; const SCH_CMP_FIELD* field = &m_Field[ii];
if( field->m_Text.IsEmpty() ) if( field->m_Text.IsEmpty() )
continue; continue;
if( !field->Save( f ) ) if( !field->Save( f ) )
......
...@@ -37,7 +37,7 @@ enum NumFieldType { ...@@ -37,7 +37,7 @@ enum NumFieldType {
* component fields are texts attached to the component (not the graphic texts) * component fields are texts attached to the component (not the graphic texts)
* There are 2 major fields : Reference and Value * There are 2 major fields : Reference and Value
*/ */
class PartTextStruct : public SCH_ITEM, class SCH_CMP_FIELD : public SCH_ITEM,
public EDA_TextStruct public EDA_TextStruct
{ {
public: public:
...@@ -47,21 +47,21 @@ public: ...@@ -47,21 +47,21 @@ public:
bool m_AddExtraText; // Mainly for REFERENCE, add extar info (for REFERENCE: add part selection text bool m_AddExtraText; // Mainly for REFERENCE, add extar info (for REFERENCE: add part selection text
public: public:
PartTextStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString ); SCH_CMP_FIELD( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
~PartTextStruct(); ~SCH_CMP_FIELD();
virtual wxString GetClass() const virtual wxString GetClass() const
{ {
return wxT( "PartTextStruct" ); return wxT( "SCH_CMP_FIELD" );
} }
void PartTextCopy( PartTextStruct* target ); void PartTextCopy( SCH_CMP_FIELD* target );
void Place( WinEDA_SchematicFrame* frame, wxDC* DC ); void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
EDA_Rect GetBoundaryBox() const; EDA_Rect GetBoundaryBox() const;
bool IsVoid(); bool IsVoid();
void SwapData( PartTextStruct* copyitem ); void SwapData( SCH_CMP_FIELD* copyitem );
/** /**
* Function Draw * Function Draw
...@@ -98,7 +98,7 @@ public: ...@@ -98,7 +98,7 @@ public:
wxString m_PrefixString; /* C, R, U, Q etc - the first character which typically indicates what the component is. wxString m_PrefixString; /* C, R, U, Q etc - the first character which typically indicates what the component is.
* determined, upon placement, from the library component. * determined, upon placement, from the library component.
* determined, upon file load, by the first non-digits in the reference fields. */ * determined, upon file load, by the first non-digits in the reference fields. */
PartTextStruct m_Field[NUMBER_OF_FIELDS]; SCH_CMP_FIELD m_Field[NUMBER_OF_FIELDS];
int m_Convert; /* Gestion (management) des mutiples representations (ex: conversion De Morgan) */ int m_Convert; /* Gestion (management) des mutiples representations (ex: conversion De Morgan) */
int m_Transform[2][2]; /* The rotation/mirror transformation matrix. */ int m_Transform[2][2]; /* The rotation/mirror transformation matrix. */
......
...@@ -167,7 +167,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin ...@@ -167,7 +167,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin
DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), FIELDCMPITEM ); DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), FIELDCMPITEM );
if( DrawStruct ) if( DrawStruct )
{ {
PartTextStruct* Field = (PartTextStruct*) DrawStruct; SCH_CMP_FIELD* Field = (SCH_CMP_FIELD*) DrawStruct;
LibItem = (SCH_COMPONENT*) Field->m_Parent; LibItem = (SCH_COMPONENT*) Field->m_Parent;
LibItem->Display_Infos( this ); LibItem->Display_Infos( this );
......
...@@ -22,7 +22,7 @@ static void AbortMoveCmpField( WinEDA_DrawPanel* Panel, wxDC* DC ); ...@@ -22,7 +22,7 @@ static void AbortMoveCmpField( WinEDA_DrawPanel* Panel, wxDC* DC );
static void MoveCmpField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); static void MoveCmpField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
/* variables locales */ /* variables locales */
static PartTextStruct* CurrentField; static SCH_CMP_FIELD* CurrentField;
static int Multiflag; static int Multiflag;
static int TextFieldSize = DEFAULT_SIZE_TEXT; static int TextFieldSize = DEFAULT_SIZE_TEXT;
static wxPoint OldPos; static wxPoint OldPos;
...@@ -439,7 +439,7 @@ void WinEDA_ComponentPropertiesFrame::ComponentPropertiesAccept( wxCommandEvent& ...@@ -439,7 +439,7 @@ void WinEDA_ComponentPropertiesFrame::ComponentPropertiesAccept( wxCommandEvent&
/************************************************************************************/ /************************************************************************************/
void WinEDA_SchematicFrame::StartMoveCmpField( PartTextStruct* Field, wxDC* DC ) void WinEDA_SchematicFrame::StartMoveCmpField( SCH_CMP_FIELD* Field, wxDC* DC )
/************************************************************************************/ /************************************************************************************/
/* Prepare le deplacement du texte en cours d'edition /* Prepare le deplacement du texte en cours d'edition
...@@ -508,7 +508,7 @@ void WinEDA_SchematicFrame::StartMoveCmpField( PartTextStruct* Field, wxDC* DC ) ...@@ -508,7 +508,7 @@ void WinEDA_SchematicFrame::StartMoveCmpField( PartTextStruct* Field, wxDC* DC )
/**********************************************************************************/ /**********************************************************************************/
void WinEDA_SchematicFrame::EditCmpFieldText( PartTextStruct* Field, wxDC* DC ) void WinEDA_SchematicFrame::EditCmpFieldText( SCH_CMP_FIELD* Field, wxDC* DC )
/**********************************************************************************/ /**********************************************************************************/
/* Edit the field Field (text, size) */ /* Edit the field Field (text, size) */
{ {
...@@ -654,7 +654,7 @@ static void AbortMoveCmpField( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -654,7 +654,7 @@ static void AbortMoveCmpField( WinEDA_DrawPanel* Panel, wxDC* DC )
/*********************************************************************************/ /*********************************************************************************/
void WinEDA_SchematicFrame::RotateCmpField( PartTextStruct* Field, wxDC* DC ) void WinEDA_SchematicFrame::RotateCmpField( SCH_CMP_FIELD* Field, wxDC* DC )
/*********************************************************************************/ /*********************************************************************************/
{ {
int FieldNumber, flag; int FieldNumber, flag;
...@@ -698,7 +698,7 @@ void WinEDA_SchematicFrame::RotateCmpField( PartTextStruct* Field, wxDC* DC ) ...@@ -698,7 +698,7 @@ void WinEDA_SchematicFrame::RotateCmpField( PartTextStruct* Field, wxDC* DC )
/*********************************************************************/ /*********************************************************************/
void PartTextStruct::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) void SCH_CMP_FIELD::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
/*********************************************************************/ /*********************************************************************/
{ {
int FieldNumber; int FieldNumber;
...@@ -790,7 +790,7 @@ void WinEDA_SchematicFrame::EditComponentValue( SCH_COMPONENT* Cmp, wxDC* DC ) ...@@ -790,7 +790,7 @@ void WinEDA_SchematicFrame::EditComponentValue( SCH_COMPONENT* Cmp, wxDC* DC )
if( Entry == NULL ) if( Entry == NULL )
return; return;
PartTextStruct* TextField = &Cmp->m_Field[VALUE]; SCH_CMP_FIELD* TextField = &Cmp->m_Field[VALUE];
msg = TextField->m_Text; msg = TextField->m_Text;
if( Get_Message( _( "Value" ), msg, this ) ) if( Get_Message( _( "Value" ), msg, this ) )
...@@ -827,7 +827,7 @@ void WinEDA_SchematicFrame::EditComponentFootprint( SCH_COMPONENT* Cmp, wxDC* DC ...@@ -827,7 +827,7 @@ void WinEDA_SchematicFrame::EditComponentFootprint( SCH_COMPONENT* Cmp, wxDC* DC
if( Entry == NULL ) if( Entry == NULL )
return; return;
PartTextStruct* TextField = &Cmp->m_Field[FOOTPRINT]; SCH_CMP_FIELD* TextField = &Cmp->m_Field[FOOTPRINT];
msg = TextField->m_Text; msg = TextField->m_Text;
if(msg.IsEmpty() ) if(msg.IsEmpty() )
......
...@@ -90,7 +90,7 @@ static void CreateDummyCmp() ...@@ -90,7 +90,7 @@ static void CreateDummyCmp()
/*************************************************************/ /*************************************************************/
void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC, void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC,
EDA_LibComponentStruct* LibEntry, EDA_LibComponentStruct* LibEntry,
int posX, int posY, const wxPoint & aOffset,
int Multi, int convert, int Multi, int convert,
int DrawMode, int Color ) int DrawMode, int Color )
/**************************************************************/ /**************************************************************/
...@@ -116,7 +116,7 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -116,7 +116,7 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC,
TransMat[0][0] = 1; TransMat[1][1] = -1; TransMat[0][0] = 1; TransMat[1][1] = -1;
TransMat[1][0] = TransMat[0][1] = 0; TransMat[1][0] = TransMat[0][1] = 0;
DrawLibPartAux( panel, DC, NULL, LibEntry, wxPoint( posX, posY ), DrawLibPartAux( panel, DC, NULL, LibEntry, aOffset,
TransMat, Multi, TransMat, Multi,
convert, DrawMode, Color ); convert, DrawMode, Color );
...@@ -132,28 +132,15 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -132,28 +132,15 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC,
else else
color = UNVISIBLE_COLOR; color = UNVISIBLE_COLOR;
} }
else else color = Color;
{
if( Color >= 0 )
color = Color;
else
color = ReturnLayerColor( LAYER_REFERENCEPART );
}
if( LibEntry->m_UnitCount > 1 ) if( LibEntry->m_UnitCount > 1 )
Prefix.Printf( wxT( "%s?%c" ), LibEntry->m_Prefix.m_Text.GetData(), Multi + 'A' - 1 ); Prefix.Printf( wxT( "%s?%c" ), LibEntry->m_Prefix.m_Text.GetData(), Multi + 'A' - 1 );
else else
Prefix = LibEntry->m_Prefix.m_Text + wxT( "?" ); Prefix = LibEntry->m_Prefix.m_Text + wxT( "?" );
text_pos.x = LibEntry->m_Prefix.m_Pos.x + posX;
text_pos.y = posY - LibEntry->m_Prefix.m_Pos.y;
int LineWidth = MAX( LibEntry->m_Prefix.m_Width, g_DrawMinimunLineWidth );
if( (LibEntry->m_Prefix.m_Flags & IS_MOVED) == 0 ) if( (LibEntry->m_Prefix.m_Flags & IS_MOVED) == 0 )
DrawGraphicText( panel, DC, text_pos, LibEntry->m_Prefix.Draw( panel, DC, aOffset, color, DrawMode, &Prefix, TransMat );
color, LibEntry->m_Prefix.m_Text.GetData(),
LibEntry->m_Prefix.m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
LibEntry->m_Prefix.m_Size,
LibEntry->m_Prefix.m_HJustify, LibEntry->m_Prefix.m_VJustify, LineWidth );
if( LibEntry->m_Name.m_Attributs & TEXT_NO_VISIBLE ) if( LibEntry->m_Name.m_Attributs & TEXT_NO_VISIBLE )
{ {
...@@ -162,23 +149,10 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -162,23 +149,10 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC,
else else
color = UNVISIBLE_COLOR; color = UNVISIBLE_COLOR;
} }
else else color = Color;
{
if( Color >= 0 )
color = Color;
else
color = ReturnLayerColor( LAYER_VALUEPART );
}
text_pos.x = LibEntry->m_Name.m_Pos.x + posX;
text_pos.y = posY - LibEntry->m_Name.m_Pos.y;
LineWidth = MAX( LibEntry->m_Name.m_Width, g_DrawMinimunLineWidth );
if( (LibEntry->m_Name.m_Flags & IS_MOVED) == 0 ) if( (LibEntry->m_Name.m_Flags & IS_MOVED) == 0 )
DrawGraphicText( panel, DC, text_pos, LibEntry->m_Name.Draw( panel, DC, aOffset, color, DrawMode, NULL, TransMat );
color, LibEntry->m_Name.m_Text.GetData(),
LibEntry->m_Name.m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
LibEntry->m_Name.m_Size,
LibEntry->m_Name.m_HJustify, LibEntry->m_Name.m_VJustify, LineWidth );
for( Field = LibEntry->Fields; Field != NULL; Field = (LibDrawField*) Field->Pnext ) for( Field = LibEntry->Fields; Field != NULL; Field = (LibDrawField*) Field->Pnext )
{ {
...@@ -193,28 +167,14 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -193,28 +167,14 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC,
else else
color = UNVISIBLE_COLOR; color = UNVISIBLE_COLOR;
} }
else else color = Color;
{ Field->Draw( panel, DC, aOffset, color, DrawMode, NULL, TransMat );
if( Color >= 0 )
color = Color;
else
color = ReturnLayerColor( LAYER_FIELDS );
}
text_pos.x = Field->m_Pos.x + posX;
text_pos.y = posY - Field->m_Pos.y;
LineWidth = MAX( Field->m_Width, g_DrawMinimunLineWidth );
DrawGraphicText( panel, DC, text_pos,
color, Field->m_Text,
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
Field->m_HJustify, Field->m_VJustify, LineWidth );
} }
// Trace de l'ancre // Trace de l'ancre
int len = 3 * panel->GetZoom(); int len = 3 * panel->GetZoom();
GRLine( &panel->m_ClipBox, DC, posX, posY - len, posX, posY + len, 0, color ); GRLine( &panel->m_ClipBox, DC, aOffset.x, aOffset.y - len, aOffset.x, aOffset.y + len, 0, color );
GRLine( &panel->m_ClipBox, DC, posX - len, posY, posX + len, posY, 0, color ); GRLine( &panel->m_ClipBox, DC, aOffset.x - len, aOffset.y, aOffset.x + len, aOffset.y, 0, color );
} }
...@@ -272,7 +232,7 @@ void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -272,7 +232,7 @@ void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
/***********************************************************/ /***********************************************************/
void PartTextStruct::Draw( WinEDA_DrawPanel* panel, void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel,
wxDC* DC, wxDC* DC,
const wxPoint& offset, const wxPoint& offset,
int DrawMode, int DrawMode,
......
...@@ -198,7 +198,7 @@ void WinEDA_LibeditFrame::RedrawActiveWindow(wxDC * DC, bool EraseBg) ...@@ -198,7 +198,7 @@ void WinEDA_LibeditFrame::RedrawActiveWindow(wxDC * DC, bool EraseBg)
DrawPanel->DrawBackGround(DC); DrawPanel->DrawBackGround(DC);
if( CurrentLibEntry) if( CurrentLibEntry)
DrawLibEntry(DrawPanel, DC, CurrentLibEntry, 0, 0, DrawLibEntry(DrawPanel, DC, CurrentLibEntry, wxPoint(0, 0),
CurrentUnit, CurrentConvert, GR_DEFAULT_DRAWMODE); CurrentUnit, CurrentConvert, GR_DEFAULT_DRAWMODE);
DrawPanel->CursorOn(DC); // reaffichage curseur DrawPanel->CursorOn(DC); // reaffichage curseur
...@@ -362,7 +362,7 @@ void WinEDA_LibeditFrame::CreateNewLibraryPart() ...@@ -362,7 +362,7 @@ void WinEDA_LibeditFrame::CreateNewLibraryPart()
/****************************************************/ /****************************************************/
/* Routine to create a new library component /* Routine to create a new library component
If an old component is currently in edit, it is deleted. If an old component is currently in edit, it is deleted.
*/ */
{ {
wxString msg; wxString msg;
EDA_LibComponentStruct * NewStruct; EDA_LibComponentStruct * NewStruct;
......
...@@ -422,7 +422,7 @@ bool SnapPoint2( const wxPoint& PosRef, int SearchMask, ...@@ -422,7 +422,7 @@ bool SnapPoint2( const wxPoint& PosRef, int SearchMask,
if( SearchMask & FIELDCMPITEM ) if( SearchMask & FIELDCMPITEM )
{ {
PartTextStruct* Field; SCH_CMP_FIELD* Field;
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) DrawList; SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) DrawList;
for( i = REFERENCE; i < NUMBER_OF_FIELDS; i++ ) for( i = REFERENCE; i < NUMBER_OF_FIELDS; i++ )
{ {
......
...@@ -365,7 +365,7 @@ void WinEDA_SchematicFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -365,7 +365,7 @@ void WinEDA_SchematicFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
break; break;
case DRAW_PART_TEXT_STRUCT_TYPE: case DRAW_PART_TEXT_STRUCT_TYPE:
EditCmpFieldText( (PartTextStruct*) DrawStruct, DC ); EditCmpFieldText( (SCH_CMP_FIELD*) DrawStruct, DC );
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
break; break;
......
...@@ -33,7 +33,7 @@ static void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label ); ...@@ -33,7 +33,7 @@ static void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label );
static void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel ); static void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel );
static void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* GLabel ); static void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* GLabel );
static void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component ); static void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component );
static void AddMenusForComponentField( wxMenu* PopMenu, PartTextStruct* Field ); static void AddMenusForComponentField( wxMenu* PopMenu, SCH_CMP_FIELD* Field );
static void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction, static void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction,
WinEDA_SchematicFrame* frame ); WinEDA_SchematicFrame* frame );
...@@ -173,7 +173,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -173,7 +173,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
case DRAW_PART_TEXT_STRUCT_TYPE: case DRAW_PART_TEXT_STRUCT_TYPE:
{ {
AddMenusForComponentField( PopMenu, (PartTextStruct*) DrawStruct ); AddMenusForComponentField( PopMenu, (SCH_CMP_FIELD*) DrawStruct );
if( flags ) if( flags )
break; break;
...@@ -236,7 +236,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -236,7 +236,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
/*************************************************************************/ /*************************************************************************/
void AddMenusForComponentField( wxMenu* PopMenu, PartTextStruct* Field ) void AddMenusForComponentField( wxMenu* PopMenu, SCH_CMP_FIELD* Field )
/*************************************************************************/ /*************************************************************************/
/* Add menu commands for a component field (like value, reference) /* Add menu commands for a component field (like value, reference)
......
...@@ -375,7 +375,7 @@ static void PlotTextField( SCH_COMPONENT* DrawLibItem, ...@@ -375,7 +375,7 @@ static void PlotTextField( SCH_COMPONENT* DrawLibItem,
{ {
wxPoint textpos; /* Position des textes */ wxPoint textpos; /* Position des textes */
PartTextStruct* Field = &DrawLibItem->m_Field[FieldNumber]; SCH_CMP_FIELD* Field = &DrawLibItem->m_Field[FieldNumber];
int hjustify, vjustify; int hjustify, vjustify;
int orient, color = -1; int orient, color = -1;
......
...@@ -35,11 +35,9 @@ void InstallCmpeditFrame(WinEDA_SchematicFrame * parent, wxPoint & pos, ...@@ -35,11 +35,9 @@ void InstallCmpeditFrame(WinEDA_SchematicFrame * parent, wxPoint & pos,
SCH_COMPONENT * m_Cmp); SCH_COMPONENT * m_Cmp);
/**************/ /******************************/
/* EELIBS_.CPP */ /* EELIBS_DRAW_COMPONENTS.CPP */
/**************/ /******************************/
/* Functions common to all EELibs?.c modules: */
int LibraryEntryCompare(EDA_LibComponentStruct *LE1, EDA_LibComponentStruct *LE2); int LibraryEntryCompare(EDA_LibComponentStruct *LE1, EDA_LibComponentStruct *LE2);
int NumOfLibraries(); int NumOfLibraries();
EDA_LibComponentStruct *FindLibPart(const wxChar *Name, const wxString & LibName, int Alias); EDA_LibComponentStruct *FindLibPart(const wxChar *Name, const wxString & LibName, int Alias);
...@@ -50,7 +48,7 @@ void DrawingLibInGhost(WinEDA_DrawPanel * panel, wxDC * DC, EDA_LibComponentStru ...@@ -50,7 +48,7 @@ void DrawingLibInGhost(WinEDA_DrawPanel * panel, wxDC * DC, EDA_LibComponentStru
int Color, bool DrawPinText); int Color, bool DrawPinText);
void DrawLibEntry(WinEDA_DrawPanel * panel, wxDC * DC, void DrawLibEntry(WinEDA_DrawPanel * panel, wxDC * DC,
EDA_LibComponentStruct *LibEntry, int posX, int posY, EDA_LibComponentStruct *LibEntry, const wxPoint & aOffset,
int Multi, int convert, int Multi, int convert,
int DrawMode, int Color = -1); int DrawMode, int Color = -1);
......
...@@ -311,11 +311,11 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -311,11 +311,11 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_SCH_ROTATE_FIELD: case ID_POPUP_SCH_ROTATE_FIELD:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
RotateCmpField( (PartTextStruct*) screen->GetCurItem(), &dc ); RotateCmpField( (SCH_CMP_FIELD*) screen->GetCurItem(), &dc );
break; break;
case ID_POPUP_SCH_EDIT_FIELD: case ID_POPUP_SCH_EDIT_FIELD:
EditCmpFieldText( (PartTextStruct*) screen->GetCurItem(), &dc ); EditCmpFieldText( (SCH_CMP_FIELD*) screen->GetCurItem(), &dc );
break; break;
case ID_POPUP_SCH_DELETE_NODE: case ID_POPUP_SCH_DELETE_NODE:
...@@ -770,7 +770,7 @@ void WinEDA_SchematicFrame::Process_Move_Item( SCH_ITEM* DrawStruct, wxDC* DC ) ...@@ -770,7 +770,7 @@ void WinEDA_SchematicFrame::Process_Move_Item( SCH_ITEM* DrawStruct, wxDC* DC )
break; break;
case DRAW_PART_TEXT_STRUCT_TYPE: case DRAW_PART_TEXT_STRUCT_TYPE:
StartMoveCmpField( (PartTextStruct*) DrawStruct, DC ); StartMoveCmpField( (SCH_CMP_FIELD*) DrawStruct, DC );
break; break;
case DRAW_MARKER_STRUCT_TYPE: case DRAW_MARKER_STRUCT_TYPE:
......
...@@ -710,7 +710,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC ) ...@@ -710,7 +710,7 @@ void WinEDA_LibeditFrame::EndDrawGraphicItem( wxDC* DC )
MoveLibDrawItemAt( CurrentDrawItem, pos ); MoveLibDrawItemAt( CurrentDrawItem, pos );
} }
DrawLibEntry( DrawPanel, DC, CurrentLibEntry, 0, 0, CurrentUnit, DrawLibEntry( DrawPanel, DC, CurrentLibEntry, wxPoint(0, 0), CurrentUnit,
CurrentConvert, GR_DEFAULT_DRAWMODE ); CurrentConvert, GR_DEFAULT_DRAWMODE );
CurrentDrawItem->m_Flags = 0; CurrentDrawItem->m_Flags = 0;
......
...@@ -321,7 +321,7 @@ wxString Msg; ...@@ -321,7 +321,7 @@ wxString Msg;
LibEntry->m_Name.m_Text = CmpName; LibEntry->m_Name.m_Text = CmpName;
if ( g_ViewUnit < 1 ) g_ViewUnit = 1; if ( g_ViewUnit < 1 ) g_ViewUnit = 1;
if ( g_ViewConvert < 1 ) g_ViewConvert = 1; if ( g_ViewConvert < 1 ) g_ViewConvert = 1;
DrawLibEntry(DrawPanel, DC, LibEntry, 0, 0, DrawLibEntry(DrawPanel, DC, LibEntry, wxPoint(0, 0),
g_ViewUnit, g_ViewConvert, GR_DEFAULT_DRAWMODE); g_ViewUnit, g_ViewConvert, GR_DEFAULT_DRAWMODE);
LibEntry->m_Name.m_Text = RealName; LibEntry->m_Name.m_Text = RealName;
} }
...@@ -330,7 +330,7 @@ wxString Msg; ...@@ -330,7 +330,7 @@ wxString Msg;
else else
{ {
Msg.Printf( _("Current Part: <%s>"), ViewCmpEntry->m_Name.m_Text.GetData()); Msg.Printf( _("Current Part: <%s>"), ViewCmpEntry->m_Name.m_Text.GetData());
DrawLibEntry(DrawPanel, DC, LibEntry, 0, 0, DrawLibEntry(DrawPanel, DC, LibEntry, wxPoint(0, 0),
g_ViewUnit, g_ViewConvert, GR_DEFAULT_DRAWMODE); g_ViewUnit, g_ViewConvert, GR_DEFAULT_DRAWMODE);
} }
AfficheDoc(this, ViewCmpEntry->m_Doc, ViewCmpEntry->m_KeyWord); AfficheDoc(this, ViewCmpEntry->m_Doc, ViewCmpEntry->m_KeyWord);
......
...@@ -10,6 +10,22 @@ ...@@ -10,6 +10,22 @@
class DrawPickedStruct; class DrawPickedStruct;
class SCH_ITEM; class SCH_ITEM;
class DrawNoConnectStruct; class DrawNoConnectStruct;
class LibraryStruct;
class EDA_LibComponentStruct;
class LibEDA_BaseStruct;
class EDA_BaseStruct;
class DrawBusEntryStruct;
class SCH_GLOBALLABEL;
class SCH_TEXT;
class EDA_DrawLineStruct;
class DrawSheetStruct;
class DrawSheetPath;
class Hierarchical_PIN_Sheet_Struct;
class SCH_COMPONENT;
class LibDrawField;
class SCH_CMP_FIELD;
class LibDrawPin;
class DrawJunctionStruct;
/*******************************/ /*******************************/
/* class WinEDA_SchematicFrame */ /* class WinEDA_SchematicFrame */
...@@ -276,9 +292,9 @@ private: ...@@ -276,9 +292,9 @@ private:
void EditComponentValue( SCH_COMPONENT* DrawLibItem, wxDC* DC ); void EditComponentValue( SCH_COMPONENT* DrawLibItem, wxDC* DC );
void EditComponentFootprint( SCH_COMPONENT* DrawLibItem, void EditComponentFootprint( SCH_COMPONENT* DrawLibItem,
wxDC* DC ); wxDC* DC );
void StartMoveCmpField( PartTextStruct* Field, wxDC* DC ); void StartMoveCmpField( SCH_CMP_FIELD* Field, wxDC* DC );
void EditCmpFieldText( PartTextStruct* Field, wxDC* DC ); void EditCmpFieldText( SCH_CMP_FIELD* Field, wxDC* DC );
void RotateCmpField( PartTextStruct* Field, wxDC* DC ); void RotateCmpField( SCH_CMP_FIELD* Field, wxDC* DC );
/* Operations sur bloc */ /* Operations sur bloc */
void PasteStruct( wxDC* DC ); void PasteStruct( wxDC* DC );
......
...@@ -65,22 +65,6 @@ class WinEDAChoiceBox; ...@@ -65,22 +65,6 @@ class WinEDAChoiceBox;
#define WinEDA_MenuItem wxMenuItem #define WinEDA_MenuItem wxMenuItem
// Used but not defined here: // Used but not defined here:
class LibraryStruct;
class EDA_LibComponentStruct;
class LibEDA_BaseStruct;
class EDA_BaseStruct;
class DrawBusEntryStruct;
class SCH_GLOBALLABEL;
class SCH_TEXT;
class EDA_DrawLineStruct;
class DrawSheetStruct;
class DrawSheetPath;
class Hierarchical_PIN_Sheet_Struct;
class SCH_COMPONENT;
class LibDrawField;
class PartTextStruct;
class LibDrawPin;
class DrawJunctionStruct;
class DRAWSEGMENT; class DRAWSEGMENT;
class WinEDA3D_DrawFrame; class WinEDA3D_DrawFrame;
class PARAM_CFG_BASE; class PARAM_CFG_BASE;
......
...@@ -24,7 +24,7 @@ ifndef WXWIN ...@@ -24,7 +24,7 @@ ifndef WXWIN
ifeq ($(DEBUG), 1) ifeq ($(DEBUG), 1)
WXWIN=f:/wxMSW-2.8.9-debug WXWIN=f:/wxMSW-2.8.9-debug
else else
WXWIN=f:/wxMSW-2.8.9-rc1 WXWIN=f:/wxMSW-2.8.9
endif endif
endif endif
LIBVERSION = 2.8 LIBVERSION = 2.8
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment