Commit 1a4d2389 authored by stambaughw's avatar stambaughw
Browse files

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
Loading
Loading
Loading
Loading
+42 −40
Original line number Diff line number Diff line
@@ -13,34 +13,35 @@

#include "general.h"

/* Variables Locales */

/*******************************************************************************************/
bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
    const wxString& aReference,
    const wxString& aFootPrint,
    bool            aSetVisible )
/********************************************************************************************/

{
/** function FillFootprintFieldForAllInstancesofComponent
 * 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 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
 * 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)
 * 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;
    SCH_ITEM*      DrawList = NULL;
    EDA_SheetList  SheetList;
    SCH_COMPONENT* Cmp;
    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();
        for( ; (DrawList != NULL); DrawList = DrawList->Next() )
@@ -52,19 +53,24 @@ bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
            if( aReference.CmpNoCase( Cmp->GetRef( sheet ) ) == 0 )
            {
                // 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
                 * it is probably not yet initialized
                 */
                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_Pos    = Cmp->GetField(VALUE)->m_Pos;
                    Cmp->GetField( FOOTPRINT )->m_Orient = Cmp->GetField(
                        VALUE )->m_Orient;
                    Cmp->GetField( FOOTPRINT )->m_Pos    = Cmp->GetField(
                        VALUE )->m_Pos;
                    Cmp->GetField( FOOTPRINT )->m_Pos.y -= 100;
                }
                Cmp->GetField( FOOTPRINT )->m_Text = aFootPrint;
                if( aSetVisible )
                    Cmp->GetField(FOOTPRINT)->m_Attributs &= ~TEXT_NO_VISIBLE;
                    Cmp->GetField( FOOTPRINT )->m_Attributs &=
                        ~TEXT_NO_VISIBLE;
                else
                    Cmp->GetField( FOOTPRINT )->m_Attributs |= TEXT_NO_VISIBLE;
                found = true;
@@ -76,11 +82,9 @@ bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
}


/***************************************************************************/
bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
                                              aSetFielsAttributeToVisible  )
/***************************************************************************/

{
/** Function ProcessStuffFile
 * Read a "stuff" file created by cvpcb.
 * That file has lines like:
@@ -91,10 +95,10 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
 * "module =" gives the footprint name
 *
 * @param aStuffFile = file (*.stf) to Read.
 * @param aSetFielsAttributeToVisible = true to set the footprint field flag to visible
 * @return true if ok.
 * @param aSetFielsAttributeToVisible = true to set the footprint field flag to
 * visible
 * @return true if OK.
 */
{
    int   LineNum = 0;
    char* cp, Ref[256], FootPrint[256], Line[1024];

@@ -112,7 +116,8 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool

            wxString reference = CONV_FROM_UTF8( Ref );
            wxString Footprint = CONV_FROM_UTF8( FootPrint );
            FillFootprintFieldForAllInstancesofComponent( reference,
            FillFootprintFieldForAllInstancesofComponent(
                reference,
                Footprint,
                aSetFielsAttributeToVisible );
        }
@@ -122,23 +127,20 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
}


/**************************************************************/
bool WinEDA_SchematicFrame::ReadInputStuffFile()
/**************************************************************/

{
/* Backann footprint info to schematic.
 */
{
    wxString Line, filename;
    FILE*    StuffFile;
    wxString msg;
    bool     SetFieldToVisible = true;

    filename = EDA_FileSelector( _( "Load Stuff File" ),
                                 wxEmptyString,             /* Chemin par defaut */
                                 wxEmptyString,             /* nom fichier par defaut */
                                 wxT( ".stf" ),             /* extension par defaut */
                                 wxT( "*.stf" ),            /* Masque d'affichage */
                                 wxEmptyString,
                                 wxEmptyString,
                                 wxT( ".stf" ),
                                 wxT( "*.stf" ),
                                 this,
                                 wxFD_OPEN,
                                 FALSE
+141 −121
Original line number Diff line number Diff line
/****************************************************/
/*	BLOCK.CPP										*/
/* Gestion des Operations sur Blocks et Effacements */
/****************************************************/

#include "fctsys.h"
@@ -18,8 +17,6 @@
#include "protos.h"


/* Variables Locales */

// Imported functions:
void            MoveItemsInList( PICKED_ITEMS_LIST& aItemsList,
                                 const wxPoint      aMoveVector );
@@ -31,9 +28,6 @@ void DuplicateItemsInList( SCH_SCREEN* screen,
                                      PICKED_ITEMS_LIST& aItemsList,
                                      const wxPoint      aMoveVector  );

/* Fonctions exportees */

/* Fonctions Locales */
static void     CollectStructsToDrag( SCH_SCREEN* screen );
static void     AddPickedItem( SCH_SCREEN* screen, wxPoint aPosition );
static LIB_PIN* GetNextPinPosition( SCH_COMPONENT* aDrawLibItem,
@@ -47,12 +41,11 @@ static void SaveStructListForPaste( PICKED_ITEMS_LIST& aItemsList );

/*************************************************************************/
int WinEDA_SchematicFrame::ReturnBlockCommand( int key )
{
/*************************************************************************/

/* Return the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to
 *  the key (ALT, SHIFT ALT ..)
 */
{
    int cmd;

    switch( key )
@@ -89,11 +82,10 @@ int WinEDA_SchematicFrame::ReturnBlockCommand( int key )

/*************************************************/
void WinEDA_SchematicFrame::InitBlockPasteInfos()
{
/*************************************************/

/* Init the parameters used by the block paste command
 */
{
    BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;

    block->m_ItemsSelection.CopyList( g_BlockSaveDataList.m_ItemsSelection );
@@ -103,14 +95,13 @@ void WinEDA_SchematicFrame::InitBlockPasteInfos()

/******************************************************/
void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
{
/******************************************************/

/* Routine to handle the BLOCK PLACE commande
/* Routine to handle the BLOCK PLACE command
 *  Last routine for block operation for:
 *  - block move & drag
 *  - block copie & paste
 *  - block copy & paste
 */
{
    bool            err   = FALSE;
    BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;

@@ -124,7 +115,8 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
    {
        wxString msg;
        err = TRUE;
        msg.Printf( wxT( "HandleBlockPLace() error : no items to place (cmd %d, state %d)" ),
        msg.Printf( wxT( "HandleBlockPLace() error : no items to place (cmd \
%d, state %d)" ),
                    block->m_Command, block->m_State );
        DisplayError( this, msg );
    }
@@ -142,7 +134,9 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
        if( DrawPanel->ManageCurseur )
            DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );

        SaveCopyInUndoList( block->m_ItemsSelection, UR_MOVED, block->m_MoveVector );
        SaveCopyInUndoList( block->m_ItemsSelection,
                            UR_MOVED,
                            block->m_MoveVector );

        MoveItemsInList( block->m_ItemsSelection, block->m_MoveVector );
        block->ClearItemsList();
@@ -153,15 +147,18 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
        if( DrawPanel->ManageCurseur )
            DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );

        DuplicateItemsInList( GetScreen(), block->m_ItemsSelection, block->m_MoveVector );
        DuplicateItemsInList(
            GetScreen(), block->m_ItemsSelection, block->m_MoveVector );

        SaveCopyInUndoList(  block->m_ItemsSelection,
                             (block->m_Command == BLOCK_PRESELECT_MOVE) ? UR_CHANGED : UR_NEW );
        SaveCopyInUndoList(
            block->m_ItemsSelection,
            (block->m_Command ==
             BLOCK_PRESELECT_MOVE) ? UR_CHANGED : UR_NEW );

        block->ClearItemsList();
        break;

    case BLOCK_PASTE:     /* Paste (recopie du dernier bloc sauve */
    case BLOCK_PASTE:
        if( DrawPanel->ManageCurseur )
            DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
        PasteListOfItems( DC );
@@ -184,7 +181,9 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )

    /* clear struct.m_Flags  */
    SCH_ITEM* Struct;
    for( Struct = GetScreen()->EEDrawList; Struct != NULL; Struct = Struct->Next() )
    for( Struct = GetScreen()->EEDrawList;
        Struct != NULL;
        Struct = Struct->Next() )
        Struct->m_Flags = 0;

    DrawPanel->ManageCurseur = NULL;
@@ -198,7 +197,8 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )

    if( block->GetCount() )
    {
        DisplayError( this, wxT( "HandleBlockPLace() error: some items left in buffer" ) );
        DisplayError( this,
                      wxT( "HandleBlockPLace() error: some items left in buffer" ) );
        block->ClearItemsList();
    }

@@ -210,15 +210,14 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )

/****************************************************/
int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC )
{
/****************************************************/

/* Routine de gestion de la commande BLOCK END
 *  retourne :
 *  0 si aucun composant selectionne
 *  1 sinon
 *  -1 si commande terminee et composants trouves (block delete, block save)
/* Manage end block command
 * Returns:
 * 0 if no features selected
 * 1 otherwise
 * -1 If control ended and components selection (block delete, block save)
 */
{
    int             ii = 0;
    bool            zoom_command = FALSE;
    BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
@@ -247,6 +246,7 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC )

        case BLOCK_DRAG: /* Drag */
            BreakSegmentOnJunction( (SCH_SCREEN*) GetScreen() );

        case BLOCK_MOVE:    /* Move */
        case BLOCK_COPY:    /* Copy */
            PickItemsInBlock( GetScreen()->m_BlockLocate, GetScreen() );
@@ -288,9 +288,11 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC )
            DrawAndSizingBlockOutlines( DrawPanel, DC, FALSE );
            if( block->GetCount() )
            {
                wxPoint move_vector =  -GetScreen()->m_BlockLocate.m_BlockLastCursorPosition;
                wxPoint move_vector =
                    -GetScreen()->m_BlockLocate.m_BlockLastCursorPosition;
                SaveStructListForPaste( block->m_ItemsSelection );
                MoveItemsInList( g_BlockSaveDataList.m_ItemsSelection, move_vector);
                MoveItemsInList( g_BlockSaveDataList.m_ItemsSelection,
                                 move_vector );
                ii = -1;
            }
            block->ClearItemsList();
@@ -321,7 +323,9 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC )
    {
        /* clear struct.m_Flags  */
        EDA_BaseStruct* Struct;
        for( Struct = GetScreen()->EEDrawList; Struct != NULL; Struct = Struct->Next() )
        for( Struct = GetScreen()->EEDrawList;
            Struct != NULL;
            Struct = Struct->Next() )
            Struct->m_Flags = 0;
    }

@@ -333,7 +337,9 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC )
        DrawPanel->ManageCurseur = NULL;
        DrawPanel->ForceCloseManageCurseur = NULL;
        GetScreen()->SetCurItem( NULL );
        SetToolID( m_ID_current_state, DrawPanel->m_PanelDefaultCursor, wxEmptyString );
        SetToolID( m_ID_current_state,
                   DrawPanel->m_PanelDefaultCursor,
                   wxEmptyString );
    }

    if( zoom_command )
@@ -345,13 +351,12 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC )

/***********************************************************************/
void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
{
/***********************************************************************/

/* Routine de gestion de la commande BLOCK END by PopUp
 *  Appelee apres HandleBlockEnd.
 *  A partir de la commande bloc move, peut executer une commande autre que bloc move.
/* Manage end block command from context menu.
 * Called after HandleBlockEnd.
 * From the command block move can execute a command other than block move.
 */
{
    int             ii    = 0;
    BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;

@@ -372,8 +377,10 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )

    case BLOCK_DRAG:     /* move to Drag */

        /* Effacement de la liste des structures de pointage,
         *  qui est devenue erronnee */
        /* *JP translate*
         * Effacement de la liste des structures de pointage,
         * qui est devenue erronnee
         */
        if( DrawPanel->ManageCurseur )
            DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
        block->ClearItemsList();
@@ -410,7 +417,8 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
            DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
        if( block->GetCount() )
        {
            wxPoint move_vector =  -GetScreen()->m_BlockLocate.m_BlockLastCursorPosition;
            wxPoint move_vector =
                -GetScreen()->m_BlockLocate.m_BlockLastCursorPosition;
            SaveStructListForPaste( block->m_ItemsSelection );
            MoveItemsInList( g_BlockSaveDataList.m_ItemsSelection, move_vector );
            ii = -1;
@@ -435,10 +443,12 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
        if( block->GetCount() )
        {
            ii = -1;
            /* Compute the mirror centre and put it on grid */
            /* Compute the mirror center and put it on grid */
            wxPoint mirrorPoint = block->Centre();
            PutOnGrid( &mirrorPoint );
            SaveCopyInUndoList( block->m_ItemsSelection, UR_MIRRORED_Y, mirrorPoint );
            SaveCopyInUndoList( block->m_ItemsSelection,
                                UR_MIRRORED_Y,
                                mirrorPoint );
            MirrorListOfItems( block->m_ItemsSelection, mirrorPoint );
            GetScreen()->SetModify();
        }
@@ -459,7 +469,9 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
        DrawPanel->ManageCurseur = NULL;
        DrawPanel->ForceCloseManageCurseur = NULL;
        GetScreen()->SetCurItem( NULL );
        SetToolID( m_ID_current_state, DrawPanel->m_PanelDefaultCursor, wxEmptyString );
        SetToolID( m_ID_current_state,
                   DrawPanel->m_PanelDefaultCursor,
                   wxEmptyString );
    }
}

@@ -467,18 +479,17 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
/************************************************************************/
static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
                                     bool erase )
{
/************************************************************************/

/* Retrace le contour du block de recherche de structures
 *  L'ensemble du block suit le curseur
/* Traces the outline of the search block structures
 * The entire block follows the cursor
 */
{
    BLOCK_SELECTOR* block = &panel->GetScreen()->m_BlockLocate;;

    BASE_SCREEN*    screen = panel->GetScreen();
    SCH_ITEM*       schitem;

    /* Effacement ancien cadre */
    /* Erase old block contents. */
    if( erase )
    {
        block->Draw( panel, DC, block->m_MoveVector, g_XorMode, block->m_Color );
@@ -489,8 +500,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
        }
    }

    /* Redessin nouvel affichage */

    /* Repaint new view. */
    block->m_MoveVector = screen->m_Curseur - block->m_BlockLastCursorPosition;

    block->Draw( panel, DC, block->m_MoveVector, g_XorMode, block->m_Color );
@@ -505,22 +515,24 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,

/*****************************************************************/
void SaveStructListForPaste( PICKED_ITEMS_LIST& aItemsList )
{
/*****************************************************************/

/* Routine to Save an object from global drawing object list.
 *  This routine is the same as delete but:
 *  - the original list is NOT removed.
 *  - List is saved in g_BlockSaveDataList
 */
{
    g_BlockSaveDataList.ClearListAndDeleteItems();      // delete previous saved list, if exists
    g_BlockSaveDataList.ClearListAndDeleteItems();      // delete previous
                                                        // saved list, if
                                                        // exists

    /* save the new list: */
    ITEM_PICKER item;
    for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ )
    {
        /* Make a copy of the original picked item. */
        SCH_ITEM* DrawStructCopy = DuplicateStruct( (SCH_ITEM*) aItemsList.GetPickedItem( ii ) );
        SCH_ITEM* DrawStructCopy = DuplicateStruct(
             (SCH_ITEM*) aItemsList.GetPickedItem( ii ) );
        DrawStructCopy->SetParent( NULL );
        item.m_PickedItem = DrawStructCopy;
        g_BlockSaveDataList.PushItem( item );
@@ -548,7 +560,9 @@ void WinEDA_SchematicFrame::PasteListOfItems( wxDC* DC )
    ITEM_PICKER       picker( NULL, UR_NEW );
    for( unsigned ii = 0; ii < g_BlockSaveDataList.GetCount(); ii++ )
    {
        Struct = DuplicateStruct( (SCH_ITEM*) g_BlockSaveDataList.m_ItemsSelection.GetPickedItem( ii ) );
        Struct = DuplicateStruct(
             (SCH_ITEM*) g_BlockSaveDataList.m_ItemsSelection.GetPickedItem(
                ii ) );
        picker.m_PickedItem = Struct;
        picklist.PushItem( picker );

@@ -569,7 +583,9 @@ void WinEDA_SchematicFrame::PasteListOfItems( wxDC* DC )
    MoveItemsInList( picklist, GetScreen()->m_BlockLocate.m_MoveVector );

    /* clear .m_Flags member for all items */
    for( Struct = GetScreen()->EEDrawList; Struct != NULL; Struct = Struct->Next() )
    for( Struct = GetScreen()->EEDrawList;
        Struct != NULL;
        Struct = Struct->Next() )
        Struct->m_Flags = 0;

    GetScreen()->SetModify();
@@ -580,13 +596,12 @@ void WinEDA_SchematicFrame::PasteListOfItems( wxDC* DC )

/****************************************************/
static void CollectStructsToDrag( SCH_SCREEN* screen )
{
/****************************************************/

/* creates the list of items found when a drag block is initiated.
 * items are those selected in window block an some items outside this area but connected
 * to a selected item (connected wires to a component or an entry )
 * items are those selected in window block an some items outside this area but
 * connected to a selected item (connected wires to a component or an entry )
 */
{
    SCH_ITEM*           Struct;
    EDA_DrawLineStruct* SegmStruct;

@@ -601,14 +616,16 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
    for( Struct = screen->EEDrawList; Struct != NULL; Struct = Struct->Next() )
        Struct->m_Flags = 0;

    // Sel .m_Flags to selected for a wire or bus in selected area if there is only one item:
    // Sel .m_Flags to selected for a wire or bus in selected area if there is
    // only one item:
    if( pickedlist->GetCount() == 1 )
    {
        Struct = (SCH_ITEM*) pickedlist->GetPickedItem( 0 );
        if( Struct->Type() == DRAW_SEGMENT_STRUCT_TYPE )
            Struct->m_Flags = SELECTED;
    }
    // Sel .m_Flags to selected for a wire or bus in selected area for a list of items:
    // Sel .m_Flags to selected for a wire or bus in selected area for a list
    // of items:
    else
    {
        for( unsigned ii = 0; ii < pickedlist->GetCount(); ii++ )
@@ -622,8 +639,7 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
        return;


    /* Suppression du deplacement des extremites de segments hors cadre
     *  de selection */
    /* Remove the displacement of segment and undo the selection. */
    for( unsigned ii = 0; ii < pickedlist->GetCount(); ii++ )
    {
        Struct = (SCH_ITEM*) (SCH_ITEM*) pickedlist->GetPickedItem( ii );
@@ -638,11 +654,11 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )

            // Save m_Flags for Undo/redo drag operations:
            pickedlist->SetPickerFlags( SegmStruct->m_Flags, ii );

        }
    }

    /* Search for other items to drag. They are end wires connected to selected items
    /* Search for other items to drag. They are end wires connected to selected
     * items
     */

    for( unsigned ii = 0; ii < pickedlist->GetCount(); ii++ )
@@ -693,17 +709,17 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )

/******************************************************************/
static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
{
/******************************************************************/

/** AddPickedItem
 * add to the picked list in screen->m_BlockLocate items found at location position
 * add to the picked list in screen->m_BlockLocate items found at location
 * position
 * @param screen = the screen to consider
 * @param position = the wxPoint where items must be located to be select
 */
{
    SCH_ITEM*          Struct;

    /* Examen de la liste des elements deja selectionnes */
    /* Review the list of already selected elements. */
    PICKED_ITEMS_LIST* pickedlist = &screen->m_BlockLocate.m_ItemsSelection;

    for( unsigned ii = 0; ii < pickedlist->GetCount(); ii++ )
@@ -730,7 +746,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
        }
    }

    /* Examen de la liste des elements non selectionnes */
    /* Review the list of elements not selected. */

    ITEM_PICKER picker;
    Struct = screen->EEDrawList;
@@ -745,14 +761,14 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )

        case DRAW_POLYLINE_STRUCT_TYPE:
            if( Struct->m_Flags & SELECTED )
                break; /* Deja en liste */
                break;
            break;

        case DRAW_JUNCTION_STRUCT_TYPE:
                #undef STRUCT
                #define STRUCT ( (DrawJunctionStruct*) Struct )
            if( Struct->m_Flags & SELECTED )
                break; /* Deja en liste */
                break;
            if( STRUCT->m_Pos != position )
                break;
            pickedlist->PushItem( picker );
@@ -762,11 +778,12 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
                #undef STRUCT
                #define STRUCT ( (EDA_DrawLineStruct*) Struct )
            if( Struct->m_Flags & SELECTED )
                break; /* Deja en liste */
                break;
            if( STRUCT->m_Start == position )
            {
                Struct->m_Flags  = SELECTED | ENDPOINT | STARTPOINT;
                Struct->m_Flags &= ~STARTPOINT;

                // Save m_Flags for Undo/redo drag operations:
                picker.m_PickerFlags = Struct->m_Flags;
                pickedlist->PushItem( picker );
@@ -775,6 +792,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
            {
                Struct->m_Flags  = SELECTED | ENDPOINT | STARTPOINT;
                Struct->m_Flags &= ~ENDPOINT;

                // Save m_Flags for Undo/redo drag operations:
                picker.m_PickerFlags = Struct->m_Flags;
                pickedlist->PushItem( picker );
@@ -845,20 +863,20 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
}


/*********************************************************************************/
/****************************************************************************/
static LIB_PIN* GetNextPinPosition( SCH_COMPONENT* aDrawLibItem,
                                    wxPoint&       aPosition,
                                    bool           aSearchFirst )
/*********************************************************************************/

{
/****************************************************************************/
/** GetNextPinPosition()
 * calculate position of the "next" pin of the aDrawLibItem component
 * @param aDrawLibItem = component to test.
 * @param aPosition = the calculated pin position, according to the component orientation and position
 * @param aPosition = the calculated pin position, according to the component
 * orientation and position
 * @param aSearchFirst = if true, search for the first pin
 * @return a pointer to the pin
 */
{
    static LIB_COMPONENT* Entry;
    static int Multi, convert, TransMat[2][2];
    static wxPoint CmpPosition;
@@ -890,9 +908,11 @@ static LIB_PIN* GetNextPinPosition( SCH_COMPONENT* aDrawLibItem,
        if( convert && Pin->m_Convert && ( Pin->m_Convert != convert ) )
            continue;

        /* Calculate the pin position (according to the component orientation) */
        /* Calculate the pin position (according to the component orientation)
         **/
        aPosition = TransformCoordinate( TransMat, Pin->m_Pos ) + CmpPosition;
        return Pin;
    }

    return NULL;
}
Loading