Implemented multi-key delete

Closes #102
This commit is contained in:
Daniel Collin 2014-09-14 11:28:15 +02:00
parent 212be709d5
commit 6369277bcf

View File

@ -1020,13 +1020,6 @@ static void onCancelEdit()
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static void onDeleteKey()
{
deleteArea(getRowPos(), getActiveTrack(), 1, 1);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static void onCutAndCopy(bool cut)
{
TrackViewInfo* viewInfo = getTrackViewInfo();
@ -1048,6 +1041,22 @@ static void onCutAndCopy(bool cut)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static void onDeleteKey()
{
TrackViewInfo* viewInfo = getTrackViewInfo();
const int selectLeft = mini(viewInfo->selectStartTrack, viewInfo->selectStopTrack);
const int selectRight = maxi(viewInfo->selectStartTrack, viewInfo->selectStopTrack);
const int selectTop = mini(viewInfo->selectStartRow, viewInfo->selectStopRow);
const int selectBottom = maxi(viewInfo->selectStartRow, viewInfo->selectStopRow);
if (selectLeft == selectRight && selectTop == selectBottom)
deleteArea(getRowPos(), getActiveTrack(), 1, 1);
else
onCutAndCopy(true);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static void onPaste()
{
const int buffer_width = s_copyData.bufferWidth;