renamed copypasta functions, fixed a paste_module error

This commit is contained in:
Kristoffer Ödmark 2017-09-18 13:09:18 +02:00 committed by Tomasz Włostowski
parent e19882577a
commit 4ce38abce2
5 changed files with 9 additions and 7 deletions

View File

@ -58,7 +58,7 @@ void CLIPBOARD_IO::setBoard( BOARD* aBoard )
m_board = aBoard;
}
void CLIPBOARD_IO::SaveSelection( SELECTION& aSelected )
void CLIPBOARD_IO::SaveSelection( const SELECTION& aSelected )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.

View File

@ -65,7 +65,7 @@ public:
/* Writes all the settings of the BOARD* set by setBoard() and then adds all
* the BOARD_ITEM* found in selection formatted by PCB_IO to clipboard as a text
*/
void SaveSelection( SELECTION& selected );
void SaveSelection( const SELECTION& selected );
BOARD_ITEM* Parse();

View File

@ -165,12 +165,12 @@ TOOL_ACTION PCB_ACTIONS::measureTool( "pcbnew.InteractiveEdit.measureTool",
TOOL_ACTION PCB_ACTIONS::copyToClipboard( "pcbnew.InteractiveEdit.CopyToClipboard",
AS_GLOBAL, MD_CTRL + int( 'C' ),
_( "Copy to Clipboard" ), _( "Copy selected content to clipboard" ),
_( "Copy" ), _( "Copy selected content to clipboard" ),
copy_xpm );
TOOL_ACTION PCB_ACTIONS::cutToClipboard( "pcbnew.InteractiveEdit.CutToClipboard",
AS_GLOBAL, MD_CTRL + int( 'X' ),
_( "Cut to Clipboard" ), _( "Cut selected content to clipboard" ),
_( "Cut" ), _( "Cut selected content to clipboard" ),
cut_xpm );
@ -1304,7 +1304,9 @@ int EDIT_TOOL::copyToClipboard( const TOOL_EVENT& aEvent )
int EDIT_TOOL::cutToClipboard( const TOOL_EVENT& aEvent )
{
copyToClipboard( aEvent );
Remove( aEvent );
TOOL_EVENT ev;
ev.SetParameter( PCB_ACTIONS::REMOVE_FLAGS::NORMAL );
Remove( ev );
return 0;
}

View File

@ -421,7 +421,7 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent )
{
cursorPos = controls->GetCursorPosition();
if( evt->IsCancel() )
if( evt->IsCancel() || evt->IsActivate() )
{
if( module )
{

View File

@ -227,7 +227,7 @@ TOOL_ACTION PCB_ACTIONS::toBeDone( "pcbnew.Control.toBeDone",
TOOL_ACTION PCB_ACTIONS::pasteFromClipboard( "pcbnew.InteractiveEdit.pasteFromClipboard",
AS_GLOBAL, MD_CTRL + int( 'V' ),
_( "Paste from Clipboard" ), _( "Paste content from clipboard" ),
_( "Paste" ), _( "Paste content from clipboard" ),
paste_xpm );