Commit 25df2772 authored by Dick Hollenbeck's avatar Dick Hollenbeck
Browse files

formatting

parent 6c9244e8
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -78,7 +78,7 @@ public:


    /**
    /**
     * Function InitData
     * Function InitData
     *  Init the initial values of a BLOCK_SELECTOR, before starting a block
     * sets the initial values of a BLOCK_SELECTOR, before starting a block
     * command
     * command
     */
     */
    void InitData( WinEDA_DrawPanel* Panel, const wxPoint& startpos );
    void InitData( WinEDA_DrawPanel* Panel, const wxPoint& startpos );
@@ -96,14 +96,14 @@ public:


    /**
    /**
     * Function PushItem
     * Function PushItem
     * Add aItem to the list of items
     * adds aItem to the list of items
     * @param aItem = an ITEM_PICKER to add to the list
     * @param aItem = an ITEM_PICKER to add to the list
     */
     */
    void PushItem( ITEM_PICKER& aItem );
    void PushItem( ITEM_PICKER& aItem );


    /**
    /**
     * Function ClearListAndDeleteItems
     * Function ClearListAndDeleteItems
     * delete only the list of EDA_BaseStruct * pointers, AND the data printed
     * deletes only the list of EDA_BaseStruct * pointers, AND the data printed
     * by m_Item
     * by m_Item
     */
     */
    void ClearListAndDeleteItems();
    void ClearListAndDeleteItems();
+71 −61
Original line number Original line Diff line number Diff line
@@ -380,8 +380,10 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
            DrawAndSizingBlockOutlines( DrawPanel, DC, FALSE );
            DrawAndSizingBlockOutlines( DrawPanel, DC, FALSE );
            return 0;
            return 0;
        }
        }

        DrawAndSizingBlockOutlines( DrawPanel, DC, FALSE );
        DrawAndSizingBlockOutlines( DrawPanel, DC, FALSE );
        Block_SelectItems();
        Block_SelectItems();

        // Exit if no items found
        // Exit if no items found
        if( !GetScreen()->m_BlockLocate.GetCount() ) {
        if( !GetScreen()->m_BlockLocate.GetCount() ) {
            DrawPanel->ManageCurseur = NULL;
            DrawPanel->ManageCurseur = NULL;
@@ -393,6 +395,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
            DisplayToolMsg( wxEmptyString );
            DisplayToolMsg( wxEmptyString );
            return 0;
            return 0;
        }
        }

        // Move cursor to the center of the smallest rectangle
        // Move cursor to the center of the smallest rectangle
        // containing the centers of all selected items.
        // containing the centers of all selected items.
        // Also set m_BlockLocate to the size of the rectangle.
        // Also set m_BlockLocate to the size of the rectangle.
@@ -401,6 +404,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
        int minX, minY, maxX, maxY;
        int minX, minY, maxX, maxY;
        int tempX, tempY;
        int tempX, tempY;
        BOARD_ITEM* item = (BOARD_ITEM*) itemsList->GetPickedItem( 0 );
        BOARD_ITEM* item = (BOARD_ITEM*) itemsList->GetPickedItem( 0 );

        minX = item->GetPosition().x;
        minX = item->GetPosition().x;
        minY = item->GetPosition().y;
        minY = item->GetPosition().y;
        maxX = minX;
        maxX = minX;
@@ -419,6 +423,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
            if( tempY < minY )
            if( tempY < minY )
                minY = tempY;
                minY = tempY;
        }
        }

        blockCenter.x = ( minX + maxX ) / 2;
        blockCenter.x = ( minX + maxX ) / 2;
        blockCenter.y = ( minY + maxY ) / 2;
        blockCenter.y = ( minY + maxY ) / 2;
        DrawPanel->CursorOff( DC );
        DrawPanel->CursorOff( DC );
@@ -431,6 +436,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
    }
    }


    if( DrawPanel->ManageCurseur )
    if( DrawPanel->ManageCurseur )
    {
        switch( GetScreen()->m_BlockLocate.m_Command )
        switch( GetScreen()->m_BlockLocate.m_Command )
        {
        {
        case BLOCK_IDLE:
        case BLOCK_IDLE:
@@ -469,7 +475,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
            GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
            GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
            if( GetScreen()->m_BlockLocate.GetCount() )
            if( GetScreen()->m_BlockLocate.GetCount() )
            {
            {
// TODO (if useful)         Save_Block( );
                // @todo (if useful)         Save_Block( );
            }
            }
            break;
            break;


@@ -487,6 +493,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
        default:
        default:
            break;
            break;
        }
        }
    }


    if( endcommande == TRUE )
    if( endcommande == TRUE )
    {
    {
@@ -649,6 +656,7 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC,
    PICKED_ITEMS_LIST* itemsList = &aPanel->GetScreen()->m_BlockLocate.m_ItemsSelection;
    PICKED_ITEMS_LIST* itemsList = &aPanel->GetScreen()->m_BlockLocate.m_ItemsSelection;
    WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) aPanel->GetParent();
    WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) aPanel->GetParent();
    g_Offset_Module = -aOffset;
    g_Offset_Module = -aOffset;

    for( unsigned ii = 0; ii < itemsList->GetCount(); ii++ )
    for( unsigned ii = 0; ii < itemsList->GetCount(); ii++ )
    {
    {
        BOARD_ITEM* item = (BOARD_ITEM*) itemsList->GetPickedItem( ii );
        BOARD_ITEM* item = (BOARD_ITEM*) itemsList->GetPickedItem( ii );
@@ -840,6 +848,7 @@ void WinEDA_PcbFrame::Block_Rotate()
        wxASSERT(item);
        wxASSERT(item);
        itemsList->SetPickedItemStatus( UR_ROTATED, ii );
        itemsList->SetPickedItemStatus( UR_ROTATED, ii );
        item->Rotate(centre, rotAngle);
        item->Rotate(centre, rotAngle);

        switch( item->Type() )
        switch( item->Type() )
        {
        {
        case TYPE_MODULE:
        case TYPE_MODULE:
@@ -881,7 +890,7 @@ void WinEDA_PcbFrame::Block_Rotate()


/**
/**
 * Function Block_Flip
 * Function Block_Flip
 * Flip items within the selected block.
 * flips items within the selected block.
 * The flip center is the center of the block
 * The flip center is the center of the block
 * @param none
 * @param none
 */
 */
@@ -906,6 +915,7 @@ void WinEDA_PcbFrame::Block_Flip()
        wxASSERT(item);
        wxASSERT(item);
        itemsList->SetPickedItemStatus( UR_FLIPPED, ii );
        itemsList->SetPickedItemStatus( UR_FLIPPED, ii );
        item->Flip(center);
        item->Flip(center);

        switch( item->Type() )
        switch( item->Type() )
        {
        {
        case TYPE_MODULE:
        case TYPE_MODULE:
@@ -1008,7 +1018,7 @@ void WinEDA_PcbFrame::Block_Move()


/**
/**
 * Function Block_Duplicate
 * Function Block_Duplicate
 * Duplicate all items within the selected block.
 * duplicates all items within the selected block.
 * New location is determined by the current offset from the selected block's
 * New location is determined by the current offset from the selected block's
 * original location.
 * original location.
 * @param none
 * @param none