formatting
This commit is contained in:
parent
6c9244e8c3
commit
25df2772db
|
@ -78,8 +78,8 @@ public:
|
|||
|
||||
/**
|
||||
* Function InitData
|
||||
* Init the initial values of a BLOCK_SELECTOR, before starting a block
|
||||
*command
|
||||
* sets the initial values of a BLOCK_SELECTOR, before starting a block
|
||||
* command
|
||||
*/
|
||||
void InitData( WinEDA_DrawPanel* Panel, const wxPoint& startpos );
|
||||
|
||||
|
@ -96,14 +96,14 @@ public:
|
|||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
void PushItem( ITEM_PICKER& aItem );
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
void ClearListAndDeleteItems();
|
||||
|
|
|
@ -380,8 +380,10 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
|
|||
DrawAndSizingBlockOutlines( DrawPanel, DC, FALSE );
|
||||
return 0;
|
||||
}
|
||||
|
||||
DrawAndSizingBlockOutlines( DrawPanel, DC, FALSE );
|
||||
Block_SelectItems();
|
||||
|
||||
// Exit if no items found
|
||||
if( !GetScreen()->m_BlockLocate.GetCount() ) {
|
||||
DrawPanel->ManageCurseur = NULL;
|
||||
|
@ -393,6 +395,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
|
|||
DisplayToolMsg( wxEmptyString );
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Move cursor to the center of the smallest rectangle
|
||||
// containing the centers of all selected items.
|
||||
// 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 tempX, tempY;
|
||||
BOARD_ITEM* item = (BOARD_ITEM*) itemsList->GetPickedItem( 0 );
|
||||
|
||||
minX = item->GetPosition().x;
|
||||
minY = item->GetPosition().y;
|
||||
maxX = minX;
|
||||
|
@ -419,6 +423,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
|
|||
if( tempY < minY )
|
||||
minY = tempY;
|
||||
}
|
||||
|
||||
blockCenter.x = ( minX + maxX ) / 2;
|
||||
blockCenter.y = ( minY + maxY ) / 2;
|
||||
DrawPanel->CursorOff( DC );
|
||||
|
@ -431,6 +436,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
|
|||
}
|
||||
|
||||
if( DrawPanel->ManageCurseur )
|
||||
{
|
||||
switch( GetScreen()->m_BlockLocate.m_Command )
|
||||
{
|
||||
case BLOCK_IDLE:
|
||||
|
@ -469,7 +475,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
|
|||
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
|
||||
if( GetScreen()->m_BlockLocate.GetCount() )
|
||||
{
|
||||
// TODO (if useful) Save_Block( );
|
||||
// @todo (if useful) Save_Block( );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -487,6 +493,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
|
|||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( endcommande == TRUE )
|
||||
{
|
||||
|
@ -641,7 +648,7 @@ void WinEDA_PcbFrame::Block_SelectItems()
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC,
|
||||
wxPoint aOffset )
|
||||
|
@ -649,6 +656,7 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC,
|
|||
PICKED_ITEMS_LIST* itemsList = &aPanel->GetScreen()->m_BlockLocate.m_ItemsSelection;
|
||||
WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) aPanel->GetParent();
|
||||
g_Offset_Module = -aOffset;
|
||||
|
||||
for( unsigned ii = 0; ii < itemsList->GetCount(); ii++ )
|
||||
{
|
||||
BOARD_ITEM* item = (BOARD_ITEM*) itemsList->GetPickedItem( ii );
|
||||
|
@ -840,6 +848,7 @@ void WinEDA_PcbFrame::Block_Rotate()
|
|||
wxASSERT(item);
|
||||
itemsList->SetPickedItemStatus( UR_ROTATED, ii );
|
||||
item->Rotate(centre, rotAngle);
|
||||
|
||||
switch( item->Type() )
|
||||
{
|
||||
case TYPE_MODULE:
|
||||
|
@ -881,7 +890,7 @@ void WinEDA_PcbFrame::Block_Rotate()
|
|||
|
||||
/**
|
||||
* Function Block_Flip
|
||||
* Flip items within the selected block.
|
||||
* flips items within the selected block.
|
||||
* The flip center is the center of the block
|
||||
* @param none
|
||||
*/
|
||||
|
@ -906,6 +915,7 @@ void WinEDA_PcbFrame::Block_Flip()
|
|||
wxASSERT(item);
|
||||
itemsList->SetPickedItemStatus( UR_FLIPPED, ii );
|
||||
item->Flip(center);
|
||||
|
||||
switch( item->Type() )
|
||||
{
|
||||
case TYPE_MODULE:
|
||||
|
@ -1008,7 +1018,7 @@ void WinEDA_PcbFrame::Block_Move()
|
|||
|
||||
/**
|
||||
* 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
|
||||
* original location.
|
||||
* @param none
|
||||
|
@ -1112,7 +1122,7 @@ void WinEDA_PcbFrame::Block_Duplicate()
|
|||
break;
|
||||
}
|
||||
|
||||
if ( newitem )
|
||||
if( newitem )
|
||||
{
|
||||
newitem->Move( MoveVector );
|
||||
picker.m_PickedItem = newitem;
|
||||
|
|
Loading…
Reference in New Issue