Commit 1a4d2389 authored by stambaughw's avatar stambaughw

Begin translating comments to English and minor code clean up.

* Translate comments in source files beginning with A-E in eeschema.
* Spell check comments and strings and uncrusified all modified files.
parent d3468dd5
...@@ -13,34 +13,35 @@ ...@@ -13,34 +13,35 @@
#include "general.h" #include "general.h"
/* Variables Locales */
/*******************************************************************************************/
bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent( bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
const wxString& aReference, const wxString& aReference,
const wxString& aFootPrint, const wxString& aFootPrint,
bool aSetVisible ) bool aSetVisible )
/********************************************************************************************/ {
/** function FillFootprintFieldForAllInstancesofComponent /** function FillFootprintFieldForAllInstancesofComponent
* Search for component "aReference", and place a Footprint in Footprint field * Search for component "aReference", and place a Footprint in Footprint field
* @param aReference = reference of the component to initialise * @param aReference = reference of the component to initialize
* @param aFootPrint = new value for the filed Fottprint component * @param aFootPrint = new value for the filed Fottprint component
* @param aSetVisible = true to have the field visible, false to set the invisible flag * @param aSetVisible = true to have the field visible, false to set the
* invisible flag
* @return true if the given component is found * @return true if the given component is found
* Note: * Note:
* the component is searched in the whole schematic, and because some components * the component is searched in the whole schematic, and because some
* components
* have more than one instance (multiple parts per package components) * have more than one instance (multiple parts per package components)
* the search is not stopped when a reference is found (all instances must be found). * the search is not stopped when a reference is found (all instances must be
* found).
*/ */
{
DrawSheetPath* sheet; DrawSheetPath* sheet;
SCH_ITEM* DrawList = NULL; SCH_ITEM* DrawList = NULL;
EDA_SheetList SheetList; EDA_SheetList SheetList;
SCH_COMPONENT* Cmp; SCH_COMPONENT* Cmp;
bool found = false; bool found = false;
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() ) for( sheet = SheetList.GetFirst();
sheet != NULL;
sheet = SheetList.GetNext() )
{ {
DrawList = (SCH_ITEM*) sheet->LastDrawList(); DrawList = (SCH_ITEM*) sheet->LastDrawList();
for( ; (DrawList != NULL); DrawList = DrawList->Next() ) for( ; (DrawList != NULL); DrawList = DrawList->Next() )
...@@ -51,22 +52,27 @@ bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent( ...@@ -51,22 +52,27 @@ bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
Cmp = (SCH_COMPONENT*) DrawList; Cmp = (SCH_COMPONENT*) DrawList;
if( aReference.CmpNoCase( Cmp->GetRef( sheet ) ) == 0 ) if( aReference.CmpNoCase( Cmp->GetRef( sheet ) ) == 0 )
{ {
// Found: Init Footprint Field // Found: Init Footprint Field
/* Give a reasonnable value to the fied position and orientation, if
* the text is empty at position 0, because it is probably not yet initialised /* Give a reasonable value to the field position and
*/ * orientation, if the text is empty at position 0, because
if( Cmp->GetField(FOOTPRINT)->m_Text.IsEmpty() * it is probably not yet initialized
&& ( Cmp->GetField(FOOTPRINT)->m_Pos == wxPoint( 0, 0 ) ) ) */
if( Cmp->GetField( FOOTPRINT )->m_Text.IsEmpty()
&& ( Cmp->GetField( FOOTPRINT )->m_Pos == wxPoint( 0, 0 ) ) )
{ {
Cmp->GetField(FOOTPRINT)->m_Orient = Cmp->GetField(VALUE)->m_Orient; Cmp->GetField( FOOTPRINT )->m_Orient = Cmp->GetField(
Cmp->GetField(FOOTPRINT)->m_Pos = Cmp->GetField(VALUE)->m_Pos; VALUE )->m_Orient;
Cmp->GetField(FOOTPRINT)->m_Pos.y -= 100; Cmp->GetField( FOOTPRINT )->m_Pos = Cmp->GetField(
VALUE )->m_Pos;
Cmp->GetField( FOOTPRINT )->m_Pos.y -= 100;
} }
Cmp->GetField(FOOTPRINT)->m_Text = aFootPrint; Cmp->GetField( FOOTPRINT )->m_Text = aFootPrint;
if( aSetVisible ) if( aSetVisible )
Cmp->GetField(FOOTPRINT)->m_Attributs &= ~TEXT_NO_VISIBLE; Cmp->GetField( FOOTPRINT )->m_Attributs &=
~TEXT_NO_VISIBLE;
else else
Cmp->GetField(FOOTPRINT)->m_Attributs |= TEXT_NO_VISIBLE; Cmp->GetField( FOOTPRINT )->m_Attributs |= TEXT_NO_VISIBLE;
found = true; found = true;
} }
} }
...@@ -76,11 +82,9 @@ bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent( ...@@ -76,11 +82,9 @@ bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
} }
/***************************************************************************/
bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
aSetFielsAttributeToVisible ) aSetFielsAttributeToVisible )
/***************************************************************************/ {
/** Function ProcessStuffFile /** Function ProcessStuffFile
* Read a "stuff" file created by cvpcb. * Read a "stuff" file created by cvpcb.
* That file has lines like: * That file has lines like:
...@@ -91,10 +95,10 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool ...@@ -91,10 +95,10 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
* "module =" gives the footprint name * "module =" gives the footprint name
* *
* @param aStuffFile = file (*.stf) to Read. * @param aStuffFile = file (*.stf) to Read.
* @param aSetFielsAttributeToVisible = true to set the footprint field flag to visible * @param aSetFielsAttributeToVisible = true to set the footprint field flag to
* @return true if ok. * visible
* @return true if OK.
*/ */
{
int LineNum = 0; int LineNum = 0;
char* cp, Ref[256], FootPrint[256], Line[1024]; char* cp, Ref[256], FootPrint[256], Line[1024];
...@@ -112,9 +116,10 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool ...@@ -112,9 +116,10 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
wxString reference = CONV_FROM_UTF8( Ref ); wxString reference = CONV_FROM_UTF8( Ref );
wxString Footprint = CONV_FROM_UTF8( FootPrint ); wxString Footprint = CONV_FROM_UTF8( FootPrint );
FillFootprintFieldForAllInstancesofComponent( reference, FillFootprintFieldForAllInstancesofComponent(
Footprint, reference,
aSetFielsAttributeToVisible ); Footprint,
aSetFielsAttributeToVisible );
} }
} }
...@@ -122,23 +127,20 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool ...@@ -122,23 +127,20 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
} }
/**************************************************************/
bool WinEDA_SchematicFrame::ReadInputStuffFile() bool WinEDA_SchematicFrame::ReadInputStuffFile()
/**************************************************************/ {
/* Backann footprint info to schematic. /* Backann footprint info to schematic.
*/ */
{
wxString Line, filename; wxString Line, filename;
FILE* StuffFile; FILE* StuffFile;
wxString msg; wxString msg;
bool SetFieldToVisible = true; bool SetFieldToVisible = true;
filename = EDA_FileSelector( _( "Load Stuff File" ), filename = EDA_FileSelector( _( "Load Stuff File" ),
wxEmptyString, /* Chemin par defaut */ wxEmptyString,
wxEmptyString, /* nom fichier par defaut */ wxEmptyString,
wxT( ".stf" ), /* extension par defaut */ wxT( ".stf" ),
wxT( "*.stf" ), /* Masque d'affichage */ wxT( "*.stf" ),
this, this,
wxFD_OPEN, wxFD_OPEN,
FALSE FALSE
...@@ -156,7 +158,7 @@ bool WinEDA_SchematicFrame::ReadInputStuffFile() ...@@ -156,7 +158,7 @@ bool WinEDA_SchematicFrame::ReadInputStuffFile()
int diag = wxMessageBox( int diag = wxMessageBox(
_( "Set the Footprint Field to Visible ?" ), _( "Set the Footprint Field to Visible ?" ),
_ ("Field Display Option"), _( "Field Display Option" ),
wxYES_NO | wxICON_QUESTION | wxCANCEL, this ); wxYES_NO | wxICON_QUESTION | wxCANCEL, this );
if( diag == wxCANCEL ) if( diag == wxCANCEL )
......
This diff is collapsed.
/****************************************************/ /****************************************************/
/* block_libedit.cpp */ /* block_libedit.cpp */
/* Gestion des Operations sur Blocks et Effacements */
/****************************************************/ /****************************************************/
#include "fctsys.h" #include "fctsys.h"
...@@ -191,10 +190,10 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) ...@@ -191,10 +190,10 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC )
/* /*
* Routine to handle the BLOCK PLACE commande * Routine to handle the BLOCK PLACE command
* Last routine for block operation for: * Last routine for block operation for:
* - block move & drag * - block move & drag
* - block copie & paste * - block copy & paste
*/ */
void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC ) void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC )
{ {
...@@ -238,7 +237,7 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC ) ...@@ -238,7 +237,7 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC )
m_component->CopySelectedItems( pt ); m_component->CopySelectedItems( pt );
break; break;
case BLOCK_PASTE: /* Paste (recopie du dernier bloc sauve */ case BLOCK_PASTE: /* Paste (recopy the last block saved) */
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
break; break;
...@@ -276,8 +275,8 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC ) ...@@ -276,8 +275,8 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC )
/* /*
* Retrace le contour du block de recherche de structures * Traces the outline of the search block structures
* L'ensemble du block suit le curseur * The entire block follows the cursor
*/ */
void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{ {
...@@ -307,7 +306,7 @@ void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -307,7 +306,7 @@ void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
true, true, true ); true, true, true );
} }
/* Redessin nouvel affichage */ /* Repaint new view */
PtBlock->m_MoveVector.x = PtBlock->m_MoveVector.x =
screen->m_Curseur.x - PtBlock->m_BlockLastCursorPosition.x; screen->m_Curseur.x - PtBlock->m_BlockLastCursorPosition.x;
PtBlock->m_MoveVector.y = PtBlock->m_MoveVector.y =
......
This diff is collapsed.
This diff is collapsed.
/*************************************/ /*****************************************************/
/* Modules de creations de Bus Entry */ /* Code to handle manipulation on bus entry objects. */
/*************************************/ /*****************************************************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
...@@ -13,21 +13,18 @@ ...@@ -13,21 +13,18 @@
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
/* Routines Locales */
/* Variables locales */
static int s_LastShape = '\\'; static int s_LastShape = '\\';
static wxPoint ItemInitialPosition; static wxPoint ItemInitialPosition;
/**************************************************************/ /**************************************************************/
static void ExitBusEntry( WinEDA_DrawPanel* Panel, wxDC* DC ) static void ExitBusEntry( WinEDA_DrawPanel* Panel, wxDC* DC )
/**************************************************************/
/* Routine de sortie des menus de trace */
{ {
/**************************************************************/
/* Exit bus entry mode. */
DrawBusEntryStruct* BusEntry = DrawBusEntryStruct* BusEntry =
(DrawBusEntryStruct*) Panel->GetScreen()->GetCurItem(); (DrawBusEntryStruct*) Panel->GetScreen()->GetCurItem();
if( BusEntry ) /* trace en cours */ if( BusEntry )
{ {
RedrawOneStruct( Panel, DC, BusEntry, g_XorMode ); RedrawOneStruct( Panel, DC, BusEntry, g_XorMode );
if( BusEntry->m_Flags & IS_NEW ) if( BusEntry->m_Flags & IS_NEW )
...@@ -51,36 +48,36 @@ static void ExitBusEntry( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -51,36 +48,36 @@ static void ExitBusEntry( WinEDA_DrawPanel* Panel, wxDC* DC )
/************************************************************************/ /************************************************************************/
static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/************************************************************************/
/* Dessin du Segment "BusEntry" lors des deplacements du curseur
*/
{ {
/************************************************************************/
/* Drawing of the bus entry segment" while moving the cursor. */
BASE_SCREEN* screen = panel->GetScreen(); BASE_SCREEN* screen = panel->GetScreen();
DrawBusEntryStruct* BusEntry = (DrawBusEntryStruct*) screen->GetCurItem(); DrawBusEntryStruct* BusEntry = (DrawBusEntryStruct*) screen->GetCurItem();
if( BusEntry == NULL ) if( BusEntry == NULL )
return; return;
/* effacement apres deplacement curseur */ /* Erase the last segment position. */
if( erase ) if( erase )
RedrawOneStruct( panel, DC, BusEntry, g_XorMode ); RedrawOneStruct( panel, DC, BusEntry, g_XorMode );
/* Reaffichage au bon endroit */ /* Redraw at the new position. */
BusEntry->m_Pos = screen->m_Curseur; BusEntry->m_Pos = screen->m_Curseur;
RedrawOneStruct( panel, DC, BusEntry, g_XorMode ); RedrawOneStruct( panel, DC, BusEntry, g_XorMode );
} }
/**********************************************************************************/ /**********************************************************************************/
DrawBusEntryStruct* WinEDA_SchematicFrame::CreateBusEntry( wxDC* DC, int entry_type ) DrawBusEntryStruct* WinEDA_SchematicFrame::CreateBusEntry( wxDC* DC,
int entry_type )
{
/**********************************************************************************/ /**********************************************************************************/
/* Create a new bus entry, and prepare moving function (for later place it) /* Create a new bus entry, and prepare moving function (for later place it)
*/ */
{ DrawBusEntryStruct* BusEntry = new DrawBusEntryStruct(
DrawBusEntryStruct* BusEntry = new DrawBusEntryStruct( GetScreen()->m_Curseur, GetScreen()->m_Curseur,
s_LastShape, entry_type ); s_LastShape,
entry_type );
BusEntry->m_Flags = IS_NEW; BusEntry->m_Flags = IS_NEW;
...@@ -98,12 +95,13 @@ DrawBusEntryStruct* WinEDA_SchematicFrame::CreateBusEntry( wxDC* DC, int entry_t ...@@ -98,12 +95,13 @@ DrawBusEntryStruct* WinEDA_SchematicFrame::CreateBusEntry( wxDC* DC, int entry_t
/**************************************************************************/ /**************************************************************************/
void WinEDA_SchematicFrame::StartMoveBusEntry( DrawBusEntryStruct* BusEntry, void WinEDA_SchematicFrame::StartMoveBusEntry( DrawBusEntryStruct* BusEntry,
wxDC* DC ) wxDC* DC )
/**************************************************************************/
{ {
/**************************************************************************/
if( BusEntry == NULL ) if( BusEntry == NULL )
return; return;
if( (BusEntry->m_Flags & IS_NEW) == 0 ) // => not already in edit, save shape */ if( (BusEntry->m_Flags & IS_NEW) == 0 ) // => not already in edit, save
// shape */
{ {
delete g_ItemToUndoCopy; delete g_ItemToUndoCopy;
g_ItemToUndoCopy = BusEntry->GenCopy(); g_ItemToUndoCopy = BusEntry->GenCopy();
...@@ -126,13 +124,13 @@ void WinEDA_SchematicFrame::StartMoveBusEntry( DrawBusEntryStruct* BusEntry, ...@@ -126,13 +124,13 @@ void WinEDA_SchematicFrame::StartMoveBusEntry( DrawBusEntryStruct* BusEntry,
/************************************************************/ /************************************************************/
void WinEDA_SchematicFrame::SetBusEntryShape( wxDC* DC, void WinEDA_SchematicFrame::SetBusEntryShape( wxDC* DC,
DrawBusEntryStruct* BusEntry, int entry_shape ) DrawBusEntryStruct* BusEntry,
int entry_shape )
{
/************************************************************/ /************************************************************/
/* set the shape of BusEntry (shape = / or \ ) /* set the shape of BusEntry (shape = / or \ )
*/ */
{
if( BusEntry == NULL ) if( BusEntry == NULL )
return; return;
...@@ -169,8 +167,8 @@ void WinEDA_SchematicFrame::SetBusEntryShape( wxDC* DC, ...@@ -169,8 +167,8 @@ void WinEDA_SchematicFrame::SetBusEntryShape( wxDC* DC,
/************************************************************************/ /************************************************************************/
int WinEDA_SchematicFrame::GetBusEntryShape( DrawBusEntryStruct* BusEntry ) int WinEDA_SchematicFrame::GetBusEntryShape( DrawBusEntryStruct* BusEntry )
/************************************************************************/
{ {
/************************************************************************/
int entry_shape = '\\'; int entry_shape = '\\';
if( BusEntry->m_Size.y < 0 ) if( BusEntry->m_Size.y < 0 )
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: class_hierarchical_PIN_sheet.cpp // Name: class_hierarchical_PIN_sheet.cpp
// Purpose: member functions Hierarchical_PIN_Sheet_Struct // Purpose: member functions Hierarchical_PIN_Sheet_Struct
// header = class_drawsheet.h // header = class_drawsheet.h
// Author: jean-pierre Charras // Author: jean-pierre Charras
// Modified by: // Modified by:
// Created: 08/02/2006 18:37:02 // Created: 08/02/2006 18:37:02
// RCS-ID: // RCS-ID:
// Copyright: License GNU // Copyright: License GNU
// Licence: // License:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#include "fctsys.h" #include "fctsys.h"
...@@ -23,13 +23,14 @@ ...@@ -23,13 +23,14 @@
/*******************************************************************/ /*******************************************************************/
Hierarchical_PIN_Sheet_Struct::Hierarchical_PIN_Sheet_Struct( DrawSheetStruct* parent, Hierarchical_PIN_Sheet_Struct::Hierarchical_PIN_Sheet_Struct(
const wxPoint& pos, DrawSheetStruct* parent,
const wxString& text ) : const wxPoint& pos,
const wxString& text ) :
SCH_ITEM( parent, DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE ), SCH_ITEM( parent, DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE ),
EDA_TextStruct( text ) EDA_TextStruct( text )
/*******************************************************************/
{ {
/*******************************************************************/
wxASSERT( parent ); wxASSERT( parent );
wxASSERT( Pnext == NULL ); wxASSERT( Pnext == NULL );
m_Layer = LAYER_SHEETLABEL; m_Layer = LAYER_SHEETLABEL;
...@@ -43,10 +44,11 @@ Hierarchical_PIN_Sheet_Struct::Hierarchical_PIN_Sheet_Struct( DrawSheetStruct* p ...@@ -43,10 +44,11 @@ Hierarchical_PIN_Sheet_Struct::Hierarchical_PIN_Sheet_Struct( DrawSheetStruct* p
/***********************************************************/ /***********************************************************/
Hierarchical_PIN_Sheet_Struct* Hierarchical_PIN_Sheet_Struct::GenCopy() Hierarchical_PIN_Sheet_Struct* Hierarchical_PIN_Sheet_Struct::GenCopy()
/***********************************************************/
{ {
/***********************************************************/
Hierarchical_PIN_Sheet_Struct* newitem = Hierarchical_PIN_Sheet_Struct* newitem =
new Hierarchical_PIN_Sheet_Struct( (DrawSheetStruct*) m_Parent, m_Pos, m_Text ); new Hierarchical_PIN_Sheet_Struct( (DrawSheetStruct*) m_Parent, m_Pos,
m_Text );
newitem->m_Edge = m_Edge; newitem->m_Edge = m_Edge;
newitem->m_Shape = m_Shape; newitem->m_Shape = m_Shape;
...@@ -59,25 +61,28 @@ Hierarchical_PIN_Sheet_Struct* Hierarchical_PIN_Sheet_Struct::GenCopy() ...@@ -59,25 +61,28 @@ Hierarchical_PIN_Sheet_Struct* Hierarchical_PIN_Sheet_Struct::GenCopy()
/** Function GetPenSize /** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item * @return the size of the "pen" that be used to draw or plot this item
*/ */
int Hierarchical_PIN_Sheet_Struct::GetPenSize( ) int Hierarchical_PIN_Sheet_Struct::GetPenSize()
{ {
return g_DrawDefaultLineThickness; return g_DrawDefaultLineThickness;
} }
/********************************************************************************************/ /*****************************************************************************/
void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel,
int DrawMode, int Color ) wxDC* DC,
/********************************************************************************************/ const wxPoint& offset,
/* Routine de dessin des Labels type hierarchie */ int DrawMode,
int Color )
{ {
GRTextHorizJustifyType side; /*****************************************************************************/
EDA_Colors txtcolor; /* Routine to create hierarchical labels */
GRTextHorizJustifyType side;
EDA_Colors txtcolor;
int posx, tposx, posy; int posx, tposx, posy;
static std::vector <wxPoint> Poly; static std::vector <wxPoint> Poly;
int LineWidth = GetPenSize( ); int LineWidth = GetPenSize();
if( Color >= 0 ) if( Color >= 0 )
txtcolor = (EDA_Colors) Color; txtcolor = (EDA_Colors) Color;
...@@ -85,8 +90,8 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con ...@@ -85,8 +90,8 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
txtcolor = ReturnLayerColor( m_Layer ); txtcolor = ReturnLayerColor( m_Layer );
GRSetDrawMode( DC, DrawMode ); GRSetDrawMode( DC, DrawMode );
posx = m_Pos.x + offset.x; posx = m_Pos.x + offset.x;
posy = m_Pos.y + offset.y; posy = m_Pos.y + offset.y;
wxSize size = m_Size; wxSize size = m_Size;
if( !m_Text.IsEmpty() ) if( !m_Text.IsEmpty() )
...@@ -102,15 +107,15 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con ...@@ -102,15 +107,15 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
side = GR_TEXT_HJUSTIFY_LEFT; side = GR_TEXT_HJUSTIFY_LEFT;
} }
DrawGraphicText( panel, DC, wxPoint( tposx, posy ), txtcolor, DrawGraphicText( panel, DC, wxPoint( tposx, posy ), txtcolor,
m_Text, TEXT_ORIENT_HORIZ, size, m_Text, TEXT_ORIENT_HORIZ, size, side,
side, GR_TEXT_VJUSTIFY_CENTER, LineWidth, false, false ); GR_TEXT_VJUSTIFY_CENTER, LineWidth, false, false );
} }
/* Draw the graphic symbol */ /* Draw the graphic symbol */
CreateGraphicShape( Poly, m_Pos + offset ); CreateGraphicShape( Poly, m_Pos + offset );
int FillShape = false; int FillShape = false;
GRPoly( &panel->m_ClipBox, DC, Poly.size(), &Poly[0], GRPoly( &panel->m_ClipBox, DC, Poly.size(), &Poly[0],
FillShape, LineWidth, txtcolor, txtcolor ); /* Poly Non rempli */ FillShape, LineWidth, txtcolor, txtcolor );
} }
...@@ -119,8 +124,9 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con ...@@ -119,8 +124,9 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
* @param aCorner_list = list to fill with polygon corners coordinates * @param aCorner_list = list to fill with polygon corners coordinates
* @param Pos = Position of the shape * @param Pos = Position of the shape
*/ */
void Hierarchical_PIN_Sheet_Struct::CreateGraphicShape( std::vector <wxPoint>& aCorner_list, void Hierarchical_PIN_Sheet_Struct::CreateGraphicShape(
const wxPoint& Pos ) std::vector <wxPoint>& aCorner_list,
const wxPoint& Pos )
{ {
wxSize size = m_Size; wxSize size = m_Size;
...@@ -206,8 +212,7 @@ bool Hierarchical_PIN_Sheet_Struct::Save( FILE* aFile ) const ...@@ -206,8 +212,7 @@ bool Hierarchical_PIN_Sheet_Struct::Save( FILE* aFile ) const
} }
if( fprintf( aFile, "F%d \"%s\" %c %c %-3d %-3d %-3d\n", m_Number, if( fprintf( aFile, "F%d \"%s\" %c %c %-3d %-3d %-3d\n", m_Number,
CONV_TO_UTF8( m_Text ), type, side, CONV_TO_UTF8( m_Text ), type, side, m_Pos.x, m_Pos.y,
m_Pos.x, m_Pos.y,
m_Size.x ) == EOF ) m_Size.x ) == EOF )
{ {
return false; return false;
...@@ -224,9 +229,8 @@ void Hierarchical_PIN_Sheet_Struct::Show( int nestLevel, std::ostream& os ) ...@@ -224,9 +229,8 @@ void Hierarchical_PIN_Sheet_Struct::Show( int nestLevel, std::ostream& os )
wxString s = GetClass(); wxString s = GetClass();
NestedSpace( nestLevel, os ) << '<' << s.Lower().mb_str() << ">" NestedSpace( nestLevel, os ) << '<' << s.Lower().mb_str() << ">"
<< " pin_name=\"" << CONV_TO_UTF8( m_Text ) << '"' << " pin_name=\"" << CONV_TO_UTF8( m_Text )
<< "/>\n" << '"' << "/>\n" << std::flush;
<< std::flush;
// NestedSpace( nestLevel, os ) << "</" << s.Lower().mb_str() << ">\n"; // NestedSpace( nestLevel, os ) << "</" << s.Lower().mb_str() << ">\n";
} }
......
...@@ -393,7 +393,6 @@ bool LIB_FIELD::HitTest( wxPoint aPosRef, int aThreshold, ...@@ -393,7 +393,6 @@ bool LIB_FIELD::HitTest( wxPoint aPosRef, int aThreshold,
return hit; return hit;
} }
// Creation et Duplication d'un field
LIB_DRAW_ITEM* LIB_FIELD::DoGenCopy() LIB_DRAW_ITEM* LIB_FIELD::DoGenCopy()
{ {
LIB_FIELD* newfield = new LIB_FIELD( m_FieldId ); LIB_FIELD* newfield = new LIB_FIELD( m_FieldId );
......
/**************************************************************/ /**************************************************************/
/* Lib component definitions (libentry) definition of fields */ /* Lib component definitions (libentry) definition of fields */
/**************************************************************/ /**************************************************************/
#ifndef CLASS_LIBENTRY_FIELDS_H #ifndef CLASS_LIBENTRY_FIELDS_H
......
...@@ -76,7 +76,7 @@ bool operator<( const CMP_LIBRARY& item1, const CMP_LIBRARY& item2 ) ...@@ -76,7 +76,7 @@ bool operator<( const CMP_LIBRARY& item1, const CMP_LIBRARY& item2 )
CMP_LIBRARY::CMP_LIBRARY( int type, const wxFileName& fileName ) CMP_LIBRARY::CMP_LIBRARY( int type, const wxFileName& fileName )
{ {
m_Type = type; /* type indicator */ m_Type = type; /* type indicator */
m_IsModified = false; /* flag indicateur d'edition */ m_IsModified = false; /* modified indicator */
m_TimeStamp = 0; m_TimeStamp = 0;
m_Flags = 0; m_Flags = 0;
m_IsCache = false; m_IsCache = false;
...@@ -505,7 +505,7 @@ bool CMP_LIBRARY::Load( wxString& errMsg ) ...@@ -505,7 +505,7 @@ bool CMP_LIBRARY::Load( wxString& errMsg )
* apparently started with EESchema-LIB. Sometime after 2.0, it * apparently started with EESchema-LIB. Sometime after 2.0, it
* was changed to EESchema-LIBRARY. Therefore, the test for * was changed to EESchema-LIBRARY. Therefore, the test for
* EESchema-LIB will work in both cases. Don't change this unless * EESchema-LIB will work in both cases. Don't change this unless
* backwards compatability is no longer required. * backwards compatibility is no longer required.
*/ */
if( !tkn.HasMoreTokens() if( !tkn.HasMoreTokens()
|| !tkn.GetNextToken().Upper().StartsWith(wxT( "EESCHEMA-LIB" ) ) ) || !tkn.GetNextToken().Upper().StartsWith(wxT( "EESCHEMA-LIB" ) ) )
...@@ -559,7 +559,7 @@ the current schematic." ), ...@@ -559,7 +559,7 @@ the current schematic." ),
{ {
if( !LoadHeader( f, &LineNum ) ) if( !LoadHeader( f, &LineNum ) )
{ {
errMsg = _( "An error occured attempting to read the header." ); errMsg = _( "An error occurred attempting to read the header." );
return false; return false;
} }
...@@ -659,14 +659,14 @@ bool CMP_LIBRARY::LoadDocs( wxString& errMsg ) ...@@ -659,14 +659,14 @@ bool CMP_LIBRARY::LoadDocs( wxString& errMsg )
if( f == NULL ) if( f == NULL )
{ {
errMsg.Printf( _( "Could not open component document libray file <%s>." ), errMsg.Printf( _( "Could not open component document library file <%s>." ),
GetChars( fn.GetFullPath() ) ); GetChars( fn.GetFullPath() ) );
return false; return false;
} }
if( GetLine( f, Line, &LineNum, sizeof(Line) ) == NULL ) if( GetLine( f, Line, &LineNum, sizeof(Line) ) == NULL )
{ {
errMsg.Printf( _( "Component document libray file <%s> is empty." ), errMsg.Printf( _( "Component document library file <%s> is empty." ),
GetChars( fn.GetFullPath() ) ); GetChars( fn.GetFullPath() ) );
fclose( f ); fclose( f );
return false; return false;
...@@ -765,7 +765,6 @@ bool CMP_LIBRARY::Save( const wxString& FullFileName, bool oldDocFormat ) ...@@ -765,7 +765,6 @@ bool CMP_LIBRARY::Save( const wxString& FullFileName, bool oldDocFormat )
m_IsModified = false; m_IsModified = false;
/* Creation de l'entete de la librairie */
m_TimeStamp = GetTimeStamp(); m_TimeStamp = GetTimeStamp();
if( !SaveHeader( libfile ) ) if( !SaveHeader( libfile ) )
{ {
......
...@@ -89,8 +89,7 @@ public: ...@@ -89,8 +89,7 @@ public:
* @param oldDocFormat - Save the document information in a separate * @param oldDocFormat - Save the document information in a separate
* file if true. The default is to save as the * file if true. The default is to save as the
* current library file format. * current library file format.
* * @return True if success writing else false.
* @return bool - true if success writing else false.
*/ */
bool Save( const wxString& aFullFileName, bool oldDocFormat = false ); bool Save( const wxString& aFullFileName, bool oldDocFormat = false );
...@@ -101,8 +100,7 @@ public: ...@@ -101,8 +100,7 @@ public:
* file *.bck. * file *.bck.
* *
* @param aFullFileName - The library filename with path. * @param aFullFileName - The library filename with path.
* * @return True if success writing else false.
* @return bool - true if success writing else false.
*/ */
bool SaveDocFile( const wxString& FullFileName ); bool SaveDocFile( const wxString& FullFileName );
...@@ -110,8 +108,7 @@ public: ...@@ -110,8 +108,7 @@ public:
* Load library from file. * Load library from file.
* *
* @param errMsg - Error message if load fails. * @param errMsg - Error message if load fails.
* * @return True if load was successful otherwise false.
* @return bool - True if load was successful otherwise false.
*/ */
bool Load( wxString& errMsg ); bool Load( wxString& errMsg );
...@@ -129,7 +126,7 @@ public: ...@@ -129,7 +126,7 @@ public:
/** /**
* Get library entry status. * Get library entry status.
* *
* @return true if there are no entries in the library. * @return True if there are no entries in the library.
*/ */
bool IsEmpty() const bool IsEmpty() const
{ {
...@@ -151,16 +148,12 @@ public: ...@@ -151,16 +148,12 @@ public:
return m_IsModified; return m_IsModified;
} }
bool IsCache() const { return m_IsCache; } bool IsCache() const { return m_IsCache; }
void SetModified( void ) { m_IsModified = true; } void SetModified( void ) { m_IsModified = true; }
void SetCache( void ) { m_IsCache = true; } void SetCache( void ) { m_IsCache = true; }
/** /**
* Load a string array with the names of all the entries in this library. * Load a string array with the names of all the entries in this library.
* *
...@@ -202,7 +195,6 @@ public: ...@@ -202,7 +195,6 @@ public:
* Find entry by name. * Find entry by name.
* *
* @param name - Name of entry, case insensitive. * @param name - Name of entry, case insensitive.
*
* @return Pointer to entry if found. NULL if not found. * @return Pointer to entry if found. NULL if not found.
*/ */
CMP_LIB_ENTRY* FindEntry( const wxChar* name ); CMP_LIB_ENTRY* FindEntry( const wxChar* name );
...@@ -212,7 +204,6 @@ public: ...@@ -212,7 +204,6 @@ public:
* *
* @param name - Name of entry, case insensitive. * @param name - Name of entry, case insensitive.
* @param type - Type of entry, root or alias. * @param type - Type of entry, root or alias.
*
* @return Pointer to entry if found. NULL if not found. * @return Pointer to entry if found. NULL if not found.
*/ */
CMP_LIB_ENTRY* FindEntry( const wxChar* name, LibrEntryType type ); CMP_LIB_ENTRY* FindEntry( const wxChar* name, LibrEntryType type );
...@@ -226,7 +217,6 @@ public: ...@@ -226,7 +217,6 @@ public:
* @param name - Name of component, case insensitive. * @param name - Name of component, case insensitive.
* @param searchAliases - Searches for component by alias name as well as * @param searchAliases - Searches for component by alias name as well as
* component name if true. * component name if true.
*
* @return Pointer to component if found. NULL if not found. * @return Pointer to component if found. NULL if not found.
*/ */
LIB_COMPONENT* FindComponent( const wxChar* name ); LIB_COMPONENT* FindComponent( const wxChar* name );
...@@ -238,7 +228,6 @@ public: ...@@ -238,7 +228,6 @@ public:
* a LIB_ALIAS pointer is not required. * a LIB_ALIAS pointer is not required.
* *
* @param name - Name of alias, case insensitive. * @param name - Name of alias, case insensitive.
*
* @return Pointer to alias if found. NULL if not found. * @return Pointer to alias if found. NULL if not found.
*/ */
LIB_ALIAS* FindAlias( const wxChar* name ) LIB_ALIAS* FindAlias( const wxChar* name )
...@@ -256,9 +245,7 @@ public: ...@@ -256,9 +245,7 @@ public:
* remove the alias from the library. * remove the alias from the library.
* *
* @param alias - Alias to add to library. * @param alias - Alias to add to library.
* * @return True if alias added to library. False if conflict exists.
* @return bool - True if alias added to library. False if conflict
* exists.
*/ */
bool AddAlias( LIB_ALIAS* alias ); bool AddAlias( LIB_ALIAS* alias );
...@@ -266,7 +253,6 @@ public: ...@@ -266,7 +253,6 @@ public:
* Add component entry to library. * Add component entry to library.
* *
* @param cmp - Component to add. * @param cmp - Component to add.
*
* @return Pointer to added component if successful. * @return Pointer to added component if successful.
*/ */
LIB_COMPONENT* AddComponent( LIB_COMPONENT* cmp ); LIB_COMPONENT* AddComponent( LIB_COMPONENT* cmp );
...@@ -311,9 +297,7 @@ public: ...@@ -311,9 +297,7 @@ public:
* entry in the list is returned. * entry in the list is returned.
* *
* @param name - Name of current entry. * @param name - Name of current entry.
* * @return Pointer to next entry if entry name is found. Otherwise NULL.
* @return CMP_LIB_ENTRY - Pointer to next entry if entry name is found.
* Otherwise NULL.
*/ */
CMP_LIB_ENTRY* GetNextEntry( const wxChar* name ); CMP_LIB_ENTRY* GetNextEntry( const wxChar* name );
...@@ -325,23 +309,21 @@ public: ...@@ -325,23 +309,21 @@ public:
* entry in the list is returned. * entry in the list is returned.
* *
* @param name - Name of current entry. * @param name - Name of current entry.
* * @return Previous entry if entry name is found, otherwise NULL.
* @return CMP_LIB_ENTRY - Pointer to previous entry if entry name is found.
* Otherwise NULL.
*/ */
CMP_LIB_ENTRY* GetPreviousEntry( const wxChar* name ); CMP_LIB_ENTRY* GetPreviousEntry( const wxChar* name );
/** /**
* Return the file name without path or extension. * Return the file name without path or extension.
* *
* @return wxString - Name of library file. * @return Name of library file.
*/ */
wxString GetName() const { return m_fileName.GetName(); } wxString GetName() const { return m_fileName.GetName(); }
/** /**
* Return the full file library name with path and extension. * Return the full file library name with path and extension.
* *
* @return wxString - Full library file name with path and extension. * @return Full library file name with path and extension.
*/ */
wxString GetFullFileName() { return m_fileName.GetFullPath(); } wxString GetFullFileName() { return m_fileName.GetFullPath(); }
...@@ -368,9 +350,8 @@ public: ...@@ -368,9 +350,8 @@ public:
* *
* @param fileName - File name of the component library to load. * @param fileName - File name of the component library to load.
* @param errMsg - Error message if the component library failed to load. * @param errMsg - Error message if the component library failed to load.
* * @return Library object if library file loaded successfully,
* @return Pointer to library object if library file loaded successfully. * otherwise NULL.
* Otherwise NULL.
*/ */
static CMP_LIBRARY* LoadLibrary( const wxFileName& fileName, static CMP_LIBRARY* LoadLibrary( const wxFileName& fileName,
wxString& errMsg ); wxString& errMsg );
...@@ -380,8 +361,7 @@ public: ...@@ -380,8 +361,7 @@ public:
* *
* @param fileName - File name object of component library. * @param fileName - File name object of component library.
* @param errMsg - Error message if the component library failed to load. * @param errMsg - Error message if the component library failed to load.
* * @return True if library loaded properly otherwise false.
* @return bool - True if library loaded properly otherwise false.
*/ */
static bool AddLibrary( const wxFileName& fileName, wxString& errMsg ); static bool AddLibrary( const wxFileName& fileName, wxString& errMsg );
...@@ -391,8 +371,7 @@ public: ...@@ -391,8 +371,7 @@ public:
* @param fileName - File name object of component library. * @param fileName - File name object of component library.
* @param errMsg - Error message if the component library failed to load. * @param errMsg - Error message if the component library failed to load.
* @param i - Iterator to insert library in front of. * @param i - Iterator to insert library in front of.
* * @return True if library loaded properly otherwise false.
* @return bool - True if library loaded properly otherwise false.
*/ */
static bool AddLibrary( const wxFileName& fileName, wxString& errMsg, static bool AddLibrary( const wxFileName& fileName, wxString& errMsg,
CMP_LIBRARY_LIST::iterator& i ); CMP_LIBRARY_LIST::iterator& i );
...@@ -408,9 +387,7 @@ public: ...@@ -408,9 +387,7 @@ public:
* Find component library by name. * Find component library by name.
* *
* @param name - Library file name without path or extension to find. * @param name - Library file name without path or extension to find.
* * @return Pointer to component library if found, otherwise NULL.
* @return CMP_LIBRARY* - Pointer to component library if found,
* otherwise NULL.
*/ */
static CMP_LIBRARY* FindLibrary( const wxString& name ); static CMP_LIBRARY* FindLibrary( const wxString& name );
...@@ -419,8 +396,7 @@ public: ...@@ -419,8 +396,7 @@ public:
* *
* @param sorted - Sort the list of name if true. Otherwise use the * @param sorted - Sort the list of name if true. Otherwise use the
* library load order. * library load order.
* * @return The list of library names.
* @return wxArrayString - The list of library names.
*/ */
static wxArrayString GetLibraryNames( bool sorted = true ); static wxArrayString GetLibraryNames( bool sorted = true );
...@@ -432,8 +408,7 @@ public: ...@@ -432,8 +408,7 @@ public:
* *
* @param name - Name of component to search for. * @param name - Name of component to search for.
* @param libNaem - Name of the library to search for component. * @param libNaem - Name of the library to search for component.
* * @return The component object if found, otherwise NULL.
* @return Pointer to a valid component object if found. Otherwise NULL.
*/ */
static LIB_COMPONENT* FindLibraryComponent( static LIB_COMPONENT* FindLibraryComponent(
const wxString& name, const wxString& libName = wxEmptyString ); const wxString& name, const wxString& libName = wxEmptyString );
...@@ -445,8 +420,7 @@ public: ...@@ -445,8 +420,7 @@ public:
* *
* @param name - Name of component to search for. * @param name - Name of component to search for.
* @param libNaem - Name of the library to search for entry. * @param libNaem - Name of the library to search for entry.
* * @return The entry object if found, otherwise NULL.
* @return Pointer to a valid entry object if found. Otherwise NULL.
*/ */
static CMP_LIB_ENTRY* FindLibraryEntry( static CMP_LIB_ENTRY* FindLibraryEntry(
const wxString& name, const wxString& name,
......
...@@ -66,9 +66,7 @@ int SCH_CMP_FIELD::GetPenSize() ...@@ -66,9 +66,7 @@ int SCH_CMP_FIELD::GetPenSize()
/** /**
* Routine de trace des textes type Field du composant. * Draw schematic component fields.
* entree:
* DrawMode: mode de trace
*/ */
void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int DrawMode, int Color ) const wxPoint& offset, int DrawMode, int Color )
...@@ -98,7 +96,7 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -98,7 +96,7 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
/* Calculate the text orientation, according to the component orientation/mirror */ /* Calculate the text orientation, according to the component orientation/mirror */
orient = m_Orient; orient = m_Orient;
if( parentComponent->m_Transform[0][1] ) // Rotation du composant de 90deg if( parentComponent->m_Transform[0][1] ) // Rotate component 90 degrees.
{ {
if( orient == TEXT_ORIENT_HORIZ ) if( orient == TEXT_ORIENT_HORIZ )
orient = TEXT_ORIENT_VERT; orient = TEXT_ORIENT_VERT;
......
/***********************************************************************/ /*****************************/
/* Methodes de base de gestion des classes des elements de schematique */ /* class_schematic_items.cpp */
/***********************************************************************/ /*****************************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
...@@ -60,7 +60,7 @@ DrawBusEntryStruct* DrawBusEntryStruct::GenCopy() ...@@ -60,7 +60,7 @@ DrawBusEntryStruct* DrawBusEntryStruct::GenCopy()
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.sch" format.
* @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.
*/ */
...@@ -162,7 +162,7 @@ DrawJunctionStruct* DrawJunctionStruct::GenCopy() ...@@ -162,7 +162,7 @@ DrawJunctionStruct* DrawJunctionStruct::GenCopy()
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.sch" format.
* @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.
*/ */
...@@ -202,7 +202,7 @@ bool DrawJunctionStruct::HitTest( const wxPoint& aPosRef ) ...@@ -202,7 +202,7 @@ bool DrawJunctionStruct::HitTest( const wxPoint& aPosRef )
wxPoint dist = aPosRef - m_Pos; wxPoint dist = aPosRef - m_Pos;
return sqrt( ( (double) ( dist.x * dist.x ) ) + return sqrt( ( (double) ( dist.x * dist.x ) ) +
( (double) ( dist.y * dist.y ) ) ) < (DRAWJUNCTION_DIAMETER/2); ( (double) ( dist.y * dist.y ) ) ) < (DRAWJUNCTION_DIAMETER/2);
} }
...@@ -217,7 +217,7 @@ int DrawJunctionStruct::GetPenSize() ...@@ -217,7 +217,7 @@ int DrawJunctionStruct::GetPenSize()
/***************************************************************************** /*****************************************************************************
* Routine to redraw connection struct. * * Routine to redraw connection struct. *
*****************************************************************************/ *****************************************************************************/
void DrawJunctionStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, void DrawJunctionStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int DrawMode, int Color ) const wxPoint& offset, int DrawMode, int Color )
...@@ -231,7 +231,8 @@ void DrawJunctionStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -231,7 +231,8 @@ void DrawJunctionStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
GRSetDrawMode( DC, DrawMode ); GRSetDrawMode( DC, DrawMode );
GRFilledCircle( &panel->m_ClipBox, DC, m_Pos.x + offset.x, GRFilledCircle( &panel->m_ClipBox, DC, m_Pos.x + offset.x,
m_Pos.y + offset.y, (DRAWJUNCTION_DIAMETER/2), 0, color, color ); m_Pos.y + offset.y, (DRAWJUNCTION_DIAMETER/2), 0, color,
color );
} }
...@@ -274,7 +275,7 @@ EDA_Rect DrawNoConnectStruct::GetBoundingBox() ...@@ -274,7 +275,7 @@ EDA_Rect DrawNoConnectStruct::GetBoundingBox()
{ {
const int DELTA = DRAWNOCONNECT_SIZE / 2; const int DELTA = DRAWNOCONNECT_SIZE / 2;
EDA_Rect box( wxPoint( m_Pos.x - DELTA, m_Pos.y - DELTA ), EDA_Rect box( wxPoint( m_Pos.x - DELTA, m_Pos.y - DELTA ),
wxSize( 2 * DELTA, 2 * DELTA ) ); wxSize( 2 * DELTA, 2 * DELTA ) );
box.Normalize(); box.Normalize();
return box; return box;
...@@ -301,7 +302,7 @@ bool DrawNoConnectStruct::HitTest( const wxPoint& aPosRef ) ...@@ -301,7 +302,7 @@ bool DrawNoConnectStruct::HitTest( const wxPoint& aPosRef )
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.sch" format.
* @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.
*/ */
...@@ -364,7 +365,7 @@ EDA_DrawLineStruct::EDA_DrawLineStruct( const wxPoint& pos, int layer ) : ...@@ -364,7 +365,7 @@ EDA_DrawLineStruct::EDA_DrawLineStruct( const wxPoint& pos, int layer ) :
switch( layer ) switch( layer )
{ {
default: default:
m_Layer = LAYER_NOTES; /* Mettre ds Notes */ m_Layer = LAYER_NOTES;
break; break;
case LAYER_WIRE: case LAYER_WIRE:
...@@ -435,7 +436,7 @@ EDA_Rect EDA_DrawLineStruct::GetBoundingBox() ...@@ -435,7 +436,7 @@ EDA_Rect EDA_DrawLineStruct::GetBoundingBox()
// return a rectangle which is [pos,dim) in nature. therefore the +1 // return a rectangle which is [pos,dim) in nature. therefore the +1
EDA_Rect ret( wxPoint( xmin, ymin ), EDA_Rect ret( wxPoint( xmin, ymin ),
wxSize( xmax - xmin + 1, ymax - ymin + 1 ) ); wxSize( xmax - xmin + 1, ymax - ymin + 1 ) );
return ret; return ret;
} }
...@@ -443,7 +444,7 @@ EDA_Rect EDA_DrawLineStruct::GetBoundingBox() ...@@ -443,7 +444,7 @@ EDA_Rect EDA_DrawLineStruct::GetBoundingBox()
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.sch" format.
* @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.
*/ */
...@@ -559,7 +560,7 @@ DrawPolylineStruct* DrawPolylineStruct::GenCopy() ...@@ -559,7 +560,7 @@ DrawPolylineStruct* DrawPolylineStruct::GenCopy()
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.sch" format.
* @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.
*/ */
...@@ -575,7 +576,7 @@ bool DrawPolylineStruct::Save( FILE* aFile ) const ...@@ -575,7 +576,7 @@ bool DrawPolylineStruct::Save( FILE* aFile ) const
if( GetLayer() == LAYER_BUS ) if( GetLayer() == LAYER_BUS )
layer = "Bus"; layer = "Bus";
if( fprintf( aFile, "Poly %s %s %d\n", if( fprintf( aFile, "Poly %s %s %d\n",
width, layer, GetCornerCount() ) == EOF ) width, layer, GetCornerCount() ) == EOF )
{ {
return false; return false;
} }
......
...@@ -5,17 +5,18 @@ ...@@ -5,17 +5,18 @@
#ifndef CLASS_SCHEMATIC_ITEMS_H #ifndef CLASS_SCHEMATIC_ITEMS_H
#define CLASS_SCHEMATIC_ITEMS_H #define CLASS_SCHEMATIC_ITEMS_H
#define DRAWJUNCTION_DIAMETER 32 /* Size (diameter) of junctions between wires */ #define DRAWJUNCTION_DIAMETER 32 /* Diameter of junction symbol between
#define DRAWNOCONNECT_SIZE 48 /* Rayon du symbole No Connexion */ * wires */
#define DRAWNOCONNECT_SIZE 48 /* No symbol connection range. */
/* flags pour BUS ENTRY (bus to bus ou wire to bus */ /* Flags for BUS ENTRY (bus to bus or wire to bus */
#define WIRE_TO_BUS 0 #define WIRE_TO_BUS 0
#define BUS_TO_BUS 1 #define BUS_TO_BUS 1
/** /**
* Class EDA_DrawLineStruct * Class EDA_DrawLineStruct
* is a segment decription base class to describe items which have 2 end * is a segment description base class to describe items which have 2 end
* points (track, wire, draw line ...) * points (track, wire, draw line ...)
*/ */
class EDA_DrawLineStruct : public SCH_ITEM class EDA_DrawLineStruct : public SCH_ITEM
...@@ -26,7 +27,7 @@ public: ...@@ -26,7 +27,7 @@ public:
wxPoint m_End; // Line end point wxPoint m_End; // Line end point
bool m_StartIsDangling; bool m_StartIsDangling;
bool m_EndIsDangling; // TRUE si Start ou End not connected (wires, tracks...) bool m_EndIsDangling; // TRUE if not connected (wires, tracks...)
public: public:
EDA_DrawLineStruct( const wxPoint& pos, int layer ); EDA_DrawLineStruct( const wxPoint& pos, int layer );
...@@ -57,7 +58,7 @@ public: ...@@ -57,7 +58,7 @@ public:
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" * writes the data structures for this object out to a FILE in "*.sch"
* format. * format.
* @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.
...@@ -72,7 +73,7 @@ public: ...@@ -72,7 +73,7 @@ public:
// Geometric transforms (used in block operations): // Geometric transforms (used in block operations):
/** virtual function Move /** virtual function Move
* move item to a new position. * move item to a new position.
* @param aMoveVector = the deplacement vector * @param aMoveVector = the displacement vector
*/ */
virtual void Move(const wxPoint& aMoveVector) virtual void Move(const wxPoint& aMoveVector)
{ {
...@@ -102,7 +103,7 @@ public: ...@@ -102,7 +103,7 @@ public:
}; };
class DrawNoConnectStruct : public SCH_ITEM /* Symboles de non connexion */ class DrawNoConnectStruct : public SCH_ITEM
{ {
public: public:
wxPoint m_Pos; /* XY coordinates of NoConnect. */ wxPoint m_Pos; /* XY coordinates of NoConnect. */
...@@ -129,7 +130,7 @@ public: ...@@ -129,7 +130,7 @@ public:
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" * writes the data structures for this object out to a FILE in "*.sch"
* format. * format.
* @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.
...@@ -146,7 +147,7 @@ public: ...@@ -146,7 +147,7 @@ public:
// Geometric transforms (used in block operations): // Geometric transforms (used in block operations):
/** virtual function Move /** virtual function Move
* move item to a new position. * move item to a new position.
* @param aMoveVector = the deplacement vector * @param aMoveVector = the displacement vector
*/ */
virtual void Move(const wxPoint& aMoveVector) virtual void Move(const wxPoint& aMoveVector)
{ {
...@@ -168,7 +169,8 @@ public: ...@@ -168,7 +169,8 @@ public:
/** /**
* Class DrawBusEntryStruct * Class DrawBusEntryStruct
* Struct de descr 1 raccord a 45 degres de BUS ou WIRE *
* Defines a bus or wire entry.
*/ */
class DrawBusEntryStruct : public SCH_ITEM class DrawBusEntryStruct : public SCH_ITEM
{ {
...@@ -188,14 +190,14 @@ public: ...@@ -188,14 +190,14 @@ public:
DrawBusEntryStruct* GenCopy(); DrawBusEntryStruct* GenCopy();
wxPoint m_End() const; // retourne la coord de fin du raccord wxPoint m_End() const;
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int draw_mode, const wxPoint& offset, int draw_mode,
int Color = -1 ); int Color = -1 );
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" * writes the data structures for this object out to a FILE in "*.sch"
* format. * format.
* @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.
...@@ -212,7 +214,7 @@ public: ...@@ -212,7 +214,7 @@ public:
// Geometric transforms (used in block operations): // Geometric transforms (used in block operations):
/** virtual function Move /** virtual function Move
* move item to a new position. * move item to a new position.
* @param aMoveVector = the deplacement vector * @param aMoveVector = the displacement vector
*/ */
virtual void Move(const wxPoint& aMoveVector) virtual void Move(const wxPoint& aMoveVector)
{ {
...@@ -232,10 +234,10 @@ public: ...@@ -232,10 +234,10 @@ public:
} }
}; };
class DrawPolylineStruct : public SCH_ITEM /* Polyligne (serie de segments) */ class DrawPolylineStruct : public SCH_ITEM
{ {
public: public:
int m_Width; /* Tickness */ int m_Width; /* Thickness */
std::vector<wxPoint> m_PolyPoints; // list of points (>= 2) std::vector<wxPoint> m_PolyPoints; // list of points (>= 2)
public: public:
...@@ -255,7 +257,7 @@ public: ...@@ -255,7 +257,7 @@ public:
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" * writes the data structures for this object out to a FILE in "*.sch"
* format. * format.
* @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.
...@@ -284,7 +286,7 @@ public: ...@@ -284,7 +286,7 @@ public:
// Geometric transforms (used in block operations): // Geometric transforms (used in block operations):
/** virtual function Move /** virtual function Move
* move item to a new position. * move item to a new position.
* @param aMoveVector = the deplacement vector * @param aMoveVector = the displacement vector
*/ */
virtual void Move(const wxPoint& aMoveVector) virtual void Move(const wxPoint& aMoveVector)
{ {
...@@ -342,7 +344,8 @@ public: ...@@ -342,7 +344,8 @@ public:
int Color = -1 ); int Color = -1 );
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.sch"
* format.
* @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.
*/ */
...@@ -351,7 +354,7 @@ public: ...@@ -351,7 +354,7 @@ public:
// Geometric transforms (used in block operations): // Geometric transforms (used in block operations):
/** virtual function Move /** virtual function Move
* move item to a new position. * move item to a new position.
* @param aMoveVector = the deplacement vector * @param aMoveVector = the displacement vector
*/ */
virtual void Move(const wxPoint& aMoveVector) virtual void Move(const wxPoint& aMoveVector)
{ {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
/* EESchema - database.cpp */ /* EESchema - database.cpp */
/****************************/ /****************************/
/* Routine de selection d'un composant en librairie
*/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
...@@ -21,16 +18,16 @@ ...@@ -21,16 +18,16 @@
/* /*
* Routine de selection du nom d'un composant en librairie pour chargement, * Routine name selection of a component library for loading,
* Keys pointe la liste des mots cles de filtrage * Keys leading the list of the keywords filter
* Si Keys = "", recherche des composants qui correspondent * If Keys = "", research components that correspond
* au masque BufName( avec * et ? ) * BufName mask (with * and?)
* *
* Retourne * Returns
* TRUE si composant selectionne * TRUE if the selected component
* FALSE si commande annulee * FALSE canceled order
* place le nom du composant a charger, selectionne a partir d'une liste dans * Place the name of the component has loaded, select from a list in
* BufName * BufName
*/ */
wxString DataBaseGetName( WinEDA_DrawFrame* frame, wxString& Keys, wxString DataBaseGetName( WinEDA_DrawFrame* frame, wxString& Keys,
wxString& BufName ) wxString& BufName )
...@@ -41,7 +38,7 @@ wxString DataBaseGetName( WinEDA_DrawFrame* frame, wxString& Keys, ...@@ -41,7 +38,7 @@ wxString DataBaseGetName( WinEDA_DrawFrame* frame, wxString& Keys,
BufName.MakeUpper(); BufName.MakeUpper();
Keys.MakeUpper(); Keys.MakeUpper();
/* Examen de la liste des librairies pour comptage */ /* Review the list of libraries for counting. */
BOOST_FOREACH( CMP_LIBRARY& lib, CMP_LIBRARY::GetLibraryList() ) BOOST_FOREACH( CMP_LIBRARY& lib, CMP_LIBRARY::GetLibraryList() )
{ {
lib.SearchEntryNames( nameList, BufName, Keys ); lib.SearchEntryNames( nameList, BufName, Keys );
......
This diff is collapsed.
/*******************************************************/ /****************/
/* delsheet.cpp Routine d'effacement d'une hierarchie */ /* delsheet.cpp */
/*******************************************************/ /****************/
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
...@@ -38,7 +38,6 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion ) ...@@ -38,7 +38,6 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
return; return;
} }
/* effacement du sous schema correspondant */
if( FirstSheet->m_AssociatedScreen->IsModify() && confirm_deletion ) if( FirstSheet->m_AssociatedScreen->IsModify() && confirm_deletion )
{ {
msg.Printf( _( "Sheet %s (file %s) modified. Save it?" ), msg.Printf( _( "Sheet %s (file %s) modified. Save it?" ),
...@@ -65,7 +64,6 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion ) ...@@ -65,7 +64,6 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
} }
} }
/* Effacement des elements de la feuille courante */
FirstSheet->m_AssociatedScreen->FreeDrawList(); FirstSheet->m_AssociatedScreen->FreeDrawList();
} }
} }
......
This diff is collapsed.
This diff is collapsed.
/**********************************************/ /**********************************/
/* EESchema - symbtext.cpp for Library Editor */ /* edit_graphic_bodyitem_text.cpp */
/**********************************************/ /**********************************/
/* Menu et routines de creation, modification, suppression de textes /* Code for editing component library text items, not fields. */
du type symbole
(textes autres que Fields)
*/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
...@@ -143,8 +140,7 @@ void Dialog_BodyGraphicText_Properties::OnCancelClick( wxCommandEvent& event ) ...@@ -143,8 +140,7 @@ void Dialog_BodyGraphicText_Properties::OnCancelClick( wxCommandEvent& event )
/***************************************************************************/ /***************************************************************************/
void Dialog_BodyGraphicText_Properties::OnOkClick( wxCommandEvent& event ) void Dialog_BodyGraphicText_Properties::OnOkClick( wxCommandEvent& event )
/***************************************************************************/ /***************************************************************************/
/* Met a jour les differents parametres pour le composant en cours d'edition /* Updates the different parameters for the component being edited */
*/
{ {
wxString Line; wxString Line;
...@@ -234,7 +230,7 @@ void WinEDA_LibeditFrame::EditSymbolText(wxDC* DC, LIB_DRAW_ITEM* DrawItem) ...@@ -234,7 +230,7 @@ void WinEDA_LibeditFrame::EditSymbolText(wxDC* DC, LIB_DRAW_ITEM* DrawItem)
|| ( DrawItem->Type() != COMPONENT_GRAPHIC_TEXT_DRAW_TYPE ) ) || ( DrawItem->Type() != COMPONENT_GRAPHIC_TEXT_DRAW_TYPE ) )
return; return;
/* Effacement ancien texte */ /* Deleting old text. */
if( DC) if( DC)
DrawItem->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, DrawMode, NULL, DrawItem->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, DrawMode, NULL,
DefaultTransformMatrix ); DefaultTransformMatrix );
...@@ -247,7 +243,7 @@ void WinEDA_LibeditFrame::EditSymbolText(wxDC* DC, LIB_DRAW_ITEM* DrawItem) ...@@ -247,7 +243,7 @@ void WinEDA_LibeditFrame::EditSymbolText(wxDC* DC, LIB_DRAW_ITEM* DrawItem)
frame->Destroy(); frame->Destroy();
GetScreen()->SetModify(); GetScreen()->SetModify();
/* Affichage nouveau texte */ /* Display new text. */
if( DC ) if( DC )
{ {
if ( ( DrawItem->m_Flags & IS_MOVED ) == 0 ) if ( ( DrawItem->m_Flags & IS_MOVED ) == 0 )
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/************************************************************/ /*****************/
/** eeconfig.h : configuration: definition des structures **/ /** eeconfig.h **/
/************************************************************/ /*****************/
#include "param_config.h" #include "param_config.h"
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
#define GROUPCOMMON wxT( "/common" ) #define GROUPCOMMON wxT( "/common" )
#define GROUPLIB wxT( "libraries" ) #define GROUPLIB wxT( "libraries" )
#include "netlist.h" /* Definitions generales liees au calcul de netliste */ #include "netlist.h"
/* variables importees */
extern int g_PenMinWidth; extern int g_PenMinWidth;
/* saving parameters option : */ /* saving parameters option : */
#define INSETUP TRUE // used when the parameter is saved in general config #define INSETUP TRUE /* used when the parameter is saved in general config
// if not used, the parameter is saved in the loca config (project config) * if not used, the parameter is saved in the local
* config (project config) */
This diff is collapsed.
This diff is collapsed.
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