Renamed remaining constants to match the action (see ab44e7cc)

This commit is contained in:
Maciej Suminski 2017-07-04 10:08:33 +02:00
parent 2767096cb7
commit e18475f220
19 changed files with 58 additions and 58 deletions

View File

@ -76,16 +76,16 @@ void BLOCK_SELECTOR::SetMessageBlock( EDA_DRAW_FRAME* frame )
msg = _( "Drag item" );
break;
case BLOCK_COPY: // Copy
msg = _( "Block Copy" );
case BLOCK_DUPLICATE: // Duplicate
msg = _( "Block Duplicate" );
break;
case BLOCK_DELETE: // Delete
msg = _( "Block Delete" );
break;
case BLOCK_SAVE: // Save
msg = _( "Block Save" );
case BLOCK_COPY: // Copy
msg = _( "Block Copy" );
break;
case BLOCK_PASTE:

View File

@ -844,10 +844,10 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* aDC, EDA_KEY aKey, const wxPoint& a
case BLOCK_MOVE: // Move
case BLOCK_DRAG: // Drag (block defined)
case BLOCK_DRAG_ITEM: // Drag from a drag item command
case BLOCK_COPY: // Copy
case BLOCK_COPY_AND_INCREMENT: // Copy and increment relevant references
case BLOCK_DUPLICATE: // Duplicate
case BLOCK_DUPLICATE_AND_INCREMENT: // Duplicate and increment relevant references
case BLOCK_DELETE: // Delete
case BLOCK_SAVE: // Save
case BLOCK_COPY: // Copy
case BLOCK_ROTATE: // Rotate 90 deg
case BLOCK_FLIP: // Flip
case BLOCK_ZOOM: // Window Zoom

View File

@ -77,7 +77,7 @@ int SCH_EDIT_FRAME::BlockCommand( EDA_KEY key )
break;
case GR_KB_SHIFT:
cmd = BLOCK_COPY;
cmd = BLOCK_DUPLICATE;
break;
case GR_KB_ALT:
@ -142,7 +142,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
block->ClearItemsList();
break;
case BLOCK_COPY: /* Copy */
case BLOCK_DUPLICATE: /* Duplicate */
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
if( m_canvas->IsMouseCaptured() )
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
@ -242,7 +242,7 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* aDC )
// fall through
case BLOCK_MOVE:
case BLOCK_COPY:
case BLOCK_DUPLICATE:
if( block->GetCommand() == BLOCK_DRAG_ITEM &&
GetScreen()->GetCurItem() != NULL )
{
@ -290,7 +290,7 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* aDC )
m_canvas->Refresh();
break;
case BLOCK_SAVE: // Save a copy of items in paste buffer
case BLOCK_COPY: // Save a copy of items in paste buffer
GetScreen()->UpdatePickList();
DrawAndSizingBlockOutlines( m_canvas, aDC, wxDefaultPosition, false );

View File

@ -67,7 +67,7 @@ int LIB_EDIT_FRAME::BlockCommand( EDA_KEY key )
break;
case GR_KB_SHIFT:
cmd = BLOCK_COPY;
cmd = BLOCK_DUPLICATE;
break;
case GR_KB_ALT:
@ -119,7 +119,7 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
case BLOCK_DRAG: // Drag
case BLOCK_DRAG_ITEM:
case BLOCK_MOVE: // Move
case BLOCK_COPY: // Copy
case BLOCK_DUPLICATE: // Duplicate
if( GetCurPart() )
ItemCount = GetCurPart()->SelectItems( GetScreen()->m_BlockLocate,
m_unit, m_convert,
@ -161,7 +161,7 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
}
break;
case BLOCK_SAVE: // Save
case BLOCK_COPY: // Save
case BLOCK_PASTE:
case BLOCK_FLIP:
break;
@ -205,7 +205,7 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
case BLOCK_SELECT_ITEMS_ONLY:
break;
case BLOCK_COPY_AND_INCREMENT: // not used in Eeschema
case BLOCK_DUPLICATE_AND_INCREMENT: // not used in Eeschema
case BLOCK_MOVE_EXACT: // not used in Eeschema
break;
}
@ -261,7 +261,7 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
m_canvas->Refresh( true );
break;
case BLOCK_COPY: // Copy
case BLOCK_DUPLICATE: // Duplicate
GetScreen()->m_BlockLocate.ClearItemsList();
if( GetCurPart() )
@ -305,7 +305,7 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
case BLOCK_ZOOM: // Handled by HandleBlockEnd
case BLOCK_DELETE:
case BLOCK_SAVE:
case BLOCK_COPY:
case BLOCK_ABORT:
default:
break;

View File

@ -337,7 +337,7 @@ void AddMenusForBlock( wxMenu* PopMenu, LIB_EDIT_FRAME* frame )
{
AddMenuItem( PopMenu, ID_POPUP_SELECT_ITEMS_BLOCK, _( "Select Items" ),
KiBitmap( green_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK, _( "Duplicate Block" ), KiBitmap( duplicate_module_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_DUPLICATE_BLOCK, _( "Duplicate Block" ), KiBitmap( duplicate_module_xpm ) );
msg = AddHotkeyName( _( "Flip Block Horizonal" ), g_Libedit_Hokeys_Descr, HK_MIRROR_Y );
AddMenuItem( PopMenu, ID_POPUP_MIRROR_Y_BLOCK, msg,
KiBitmap( mirror_h_xpm ) );

View File

@ -739,7 +739,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM:
case ID_POPUP_ZOOM_BLOCK:
case ID_POPUP_DELETE_BLOCK:
case ID_POPUP_COPY_BLOCK:
case ID_POPUP_DUPLICATE_BLOCK:
case ID_POPUP_SELECT_ITEMS_BLOCK:
case ID_POPUP_MIRROR_X_BLOCK:
case ID_POPUP_MIRROR_Y_BLOCK:
@ -911,9 +911,9 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
HandleBlockEnd( &dc );
break;
case ID_POPUP_COPY_BLOCK:
case ID_POPUP_DUPLICATE_BLOCK:
m_canvas->SetAutoPanRequest( false );
GetScreen()->m_BlockLocate.SetCommand( BLOCK_COPY );
GetScreen()->m_BlockLocate.SetCommand( BLOCK_DUPLICATE );
m_canvas->MoveCursorToCrossHair();
HandleBlockEnd( &dc );
break;

View File

@ -625,7 +625,7 @@ public:
/**
* Function BlockCommand
* returns the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to
* returns the block command (BLOCK_MOVE, BLOCK_DUPLICATE...) corresponding to
* the \a aKey (ALT, SHIFT ALT ..)
*/
virtual int BlockCommand( EDA_KEY aKey ) override;

View File

@ -847,7 +847,7 @@ void AddMenusForBlock( wxMenu* PopMenu, SCH_EDIT_FRAME* frame )
msg = AddHotkeyName( _( "Copy Block" ), g_Schematic_Hokeys_Descr,
HK_COPY_BLOCK );
AddMenuItem( PopMenu, wxID_COPY, msg, KiBitmap( copy_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK, _( "Duplicate Block" ), KiBitmap( duplicate_module_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_DUPLICATE_BLOCK, _( "Duplicate Block" ), KiBitmap( duplicate_module_xpm ) );
msg = AddHotkeyName( _( "Drag Block" ), g_Schematic_Hokeys_Descr,
HK_MOVEBLOCK_TO_DRAGBLOCK );
AddMenuItem( PopMenu, ID_POPUP_DRAG_BLOCK, msg, KiBitmap( drag_xpm ) );

View File

@ -85,7 +85,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PLACE_BLOCK:
case ID_POPUP_ZOOM_BLOCK:
case ID_POPUP_DRAG_BLOCK:
case ID_POPUP_COPY_BLOCK:
case ID_POPUP_DUPLICATE_BLOCK:
case ID_POPUP_SCH_DELETE_NODE:
case ID_POPUP_SCH_DELETE_CONNECTION:
case ID_POPUP_SCH_ENTER_SHEET:
@ -135,7 +135,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
case wxID_COPY: // really this is a Save block for paste
screen->m_BlockLocate.SetCommand( BLOCK_SAVE );
screen->m_BlockLocate.SetCommand( BLOCK_COPY );
screen->m_BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc );
break;
@ -358,12 +358,12 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
SetSheetNumberAndCount();
break;
case ID_POPUP_COPY_BLOCK:
case ID_POPUP_DUPLICATE_BLOCK:
if( screen->m_BlockLocate.GetCommand() != BLOCK_MOVE )
break;
m_canvas->MoveCursorToCrossHair();
screen->m_BlockLocate.SetCommand( BLOCK_COPY );
screen->m_BlockLocate.SetCommand( BLOCK_DUPLICATE );
screen->m_BlockLocate.SetMessageBlock( this );
HandleBlockEnd( &dc );
break;

View File

@ -1243,11 +1243,11 @@ public:
/**
* Function BlockCommand
* Returns the block command internat code (BLOCK_MOVE, BLOCK_COPY...)
* Returns the block command internat code (BLOCK_MOVE, BLOCK_DUPLICATE...)
* corresponding to the keys pressed (ALT, SHIFT, SHIFT ALT ..) when
* block command is started by dragging the mouse.
* @param aKey = the key modifiers (Alt, Shift ...)
* @return the block command id (BLOCK_MOVE, BLOCK_COPY...)
* @return the block command id (BLOCK_MOVE, BLOCK_DUPLICATE...)
*/
virtual int BlockCommand( EDA_KEY aKey ) override;

View File

@ -51,9 +51,9 @@ typedef enum {
typedef enum {
BLOCK_IDLE,
BLOCK_MOVE,
BLOCK_DUPLICATE,
BLOCK_DUPLICATE_AND_INCREMENT,
BLOCK_COPY,
BLOCK_COPY_AND_INCREMENT,
BLOCK_SAVE,
BLOCK_DELETE,
BLOCK_PASTE,
BLOCK_CUT,

View File

@ -161,7 +161,7 @@ enum main_id
ID_POPUP_MOVE_BLOCK,
ID_POPUP_MOVE_BLOCK_EXACT,
ID_POPUP_DRAG_BLOCK,
ID_POPUP_COPY_BLOCK,
ID_POPUP_DUPLICATE_BLOCK,
ID_POPUP_ROTATE_BLOCK,
ID_POPUP_DELETE_BLOCK,
ID_POPUP_FLIP_BLOCK,

View File

@ -111,7 +111,7 @@ int PCB_EDIT_FRAME::BlockCommand( EDA_KEY aKey )
break;
case GR_KB_SHIFT:
cmd = BLOCK_COPY;
cmd = BLOCK_DUPLICATE;
break;
case GR_KB_CTRL:
@ -163,12 +163,12 @@ void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
GetScreen()->m_BlockLocate.ClearItemsList();
break;
case BLOCK_COPY: // Copy
case BLOCK_COPY_AND_INCREMENT:
case BLOCK_DUPLICATE: // Duplicate
case BLOCK_DUPLICATE_AND_INCREMENT:
if( m_canvas->IsMouseCaptured() )
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
Block_Duplicate( command == BLOCK_COPY_AND_INCREMENT );
Block_Duplicate( command == BLOCK_DUPLICATE_AND_INCREMENT );
GetScreen()->m_BlockLocate.ClearItemsList();
break;
@ -239,8 +239,8 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
case BLOCK_DRAG: // Drag (not used, for future enhancements)
case BLOCK_MOVE: // Move
case BLOCK_COPY: // Copy
case BLOCK_COPY_AND_INCREMENT: // Copy and increment relevant references
case BLOCK_DUPLICATE: // Duplicate
case BLOCK_DUPLICATE_AND_INCREMENT: // Duplicate and increment relevant references
case BLOCK_PRESELECT_MOVE: // Move with preselection list
GetScreen()->m_BlockLocate.SetState( STATE_BLOCK_MOVE );
nextcmd = true;
@ -267,7 +267,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
Block_Flip();
break;
case BLOCK_SAVE: // Save (not used, for future enhancements)
case BLOCK_COPY: // Copy
GetScreen()->m_BlockLocate.SetState( STATE_BLOCK_STOP );
if( GetScreen()->m_BlockLocate.GetCount() )

View File

@ -112,7 +112,7 @@ int FOOTPRINT_EDIT_FRAME::BlockCommand( EDA_KEY key )
break;
case GR_KB_SHIFT:
cmd = BLOCK_COPY;
cmd = BLOCK_DUPLICATE;
break;
case GR_KB_CTRL:
@ -159,8 +159,8 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
case BLOCK_DRAG: // Drag
case BLOCK_DRAG_ITEM: // Drag a given item (not used here)
case BLOCK_MOVE: // Move
case BLOCK_COPY: // Copy
case BLOCK_COPY_AND_INCREMENT: // Specific to duplicate with increment command
case BLOCK_DUPLICATE: // Duplicate
case BLOCK_DUPLICATE_AND_INCREMENT: // Specific to duplicate with increment command
// Find selected items if we didn't already set them manually
if( itemsCount == 0 )
@ -250,7 +250,7 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
DeleteMarkedItems( currentModule );
break;
case BLOCK_SAVE: // Save
case BLOCK_COPY: // Copy
case BLOCK_PASTE:
break;
@ -330,12 +330,12 @@ void FOOTPRINT_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
m_canvas->Refresh( true );
break;
case BLOCK_COPY: // Copy
case BLOCK_COPY_AND_INCREMENT: // Copy and increment pad names
case BLOCK_DUPLICATE: // Duplicate
case BLOCK_DUPLICATE_AND_INCREMENT: // Duplicate and increment pad names
GetScreen()->m_BlockLocate.ClearItemsList();
SaveCopyInUndoList( currentModule, UR_CHANGED );
CopyMarkedItems( currentModule, GetScreen()->m_BlockLocate.GetMoveVector(),
command == BLOCK_COPY_AND_INCREMENT );
command == BLOCK_DUPLICATE_AND_INCREMENT );
break;
case BLOCK_PASTE: // Paste
@ -356,7 +356,7 @@ void FOOTPRINT_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
case BLOCK_ZOOM: // Handled by HandleBlockEnd
case BLOCK_DELETE:
case BLOCK_SAVE:
case BLOCK_COPY:
case BLOCK_ABORT:
default:
break;

View File

@ -147,7 +147,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_ZOOM_BLOCK:
case ID_POPUP_FLIP_BLOCK:
case ID_POPUP_ROTATE_BLOCK:
case ID_POPUP_COPY_BLOCK:
case ID_POPUP_DUPLICATE_BLOCK:
case ID_POPUP_PCB_EDIT_DRAWING:
case ID_POPUP_PCB_GETINFO_MARKER:
case ID_POPUP_PCB_MOVE_TEXT_DIMENSION_REQUEST:
@ -263,8 +263,8 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
HandleBlockPlace( &dc );
break;
case ID_POPUP_COPY_BLOCK:
GetScreen()->m_BlockLocate.SetCommand( BLOCK_COPY );
case ID_POPUP_DUPLICATE_BLOCK:
GetScreen()->m_BlockLocate.SetCommand( BLOCK_DUPLICATE );
GetScreen()->m_BlockLocate.SetMessageBlock( this );
m_canvas->SetAutoPanRequest( false );
HandleBlockPlace( &dc );
@ -1654,7 +1654,7 @@ void PCB_BASE_EDIT_FRAME::duplicateItem( BOARD_ITEM* aItem, bool aIncrement )
wxPoint crossHairPos = GetCrossHairPosition();
const BLOCK_COMMAND_T blockType = aIncrement ? BLOCK_COPY_AND_INCREMENT : BLOCK_COPY;
const BLOCK_COMMAND_T blockType = aIncrement ? BLOCK_DUPLICATE_AND_INCREMENT : BLOCK_DUPLICATE;
if( !HandleBlockBegin( &dc, blockType, crossHairPos ) )
return;

View File

@ -234,7 +234,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_ZOOM_BLOCK:
case ID_POPUP_MIRROR_X_BLOCK:
case ID_POPUP_ROTATE_BLOCK:
case ID_POPUP_COPY_BLOCK:
case ID_POPUP_DUPLICATE_BLOCK:
break;
case ID_POPUP_CANCEL_CURRENT_COMMAND:
@ -783,8 +783,8 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
HandleBlockPlace( &dc );
break;
case ID_POPUP_COPY_BLOCK:
GetScreen()->m_BlockLocate.SetCommand( BLOCK_COPY );
case ID_POPUP_DUPLICATE_BLOCK:
GetScreen()->m_BlockLocate.SetCommand( BLOCK_DUPLICATE );
GetScreen()->m_BlockLocate.SetMessageBlock( this );
m_canvas->SetAutoPanRequest( false );
HandleBlockPlace( &dc );

View File

@ -252,8 +252,8 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
PopMenu->AppendSeparator();
AddMenuItem( PopMenu, ID_POPUP_PLACE_BLOCK,
_( "Place Block" ), KiBitmap( checked_ok_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK,
_( "Copy Block (shift + drag mouse)" ),
AddMenuItem( PopMenu, ID_POPUP_DUPLICATE_BLOCK,
_( "Duplicate Block (shift + drag mouse)" ),
KiBitmap( copy_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_MIRROR_X_BLOCK,
_( "Mirror Block (alt + drag mouse)" ),

View File

@ -46,7 +46,7 @@ void PCB_EDIT_FRAME::ProcessMuWaveFunctions( wxCommandEvent& event )
switch( id ) // End any command in progress.
{
case ID_POPUP_COPY_BLOCK:
case ID_POPUP_DUPLICATE_BLOCK:
break;
default: // End block command in progress.

View File

@ -489,7 +489,7 @@ void PCB_EDIT_FRAME::createPopUpBlockMenu( wxMenu* menu )
AddMenuItem( menu, ID_POPUP_ZOOM_BLOCK, _( "Zoom Block" ), KiBitmap( zoom_area_xpm ) );
menu->AppendSeparator();
AddMenuItem( menu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), KiBitmap( checked_ok_xpm ) );
AddMenuItem( menu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), KiBitmap( copy_xpm ) );
AddMenuItem( menu, ID_POPUP_DUPLICATE_BLOCK, _( "Duplicate Block" ), KiBitmap( copy_xpm ) );
AddMenuItem( menu, ID_POPUP_FLIP_BLOCK, _( "Flip Block" ), KiBitmap( mirror_v_xpm ) );
AddMenuItem( menu, ID_POPUP_ROTATE_BLOCK, _( "Rotate Block" ), KiBitmap( rotate_ccw_xpm ) );
AddMenuItem( menu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), KiBitmap( delete_xpm ) );