Tweak dragdrop to computer

When the dragdrop succeeds to a location outside the program, the effect
is Move.
When the dragdrop succeeds to another slot, the effect is Link.
When the dragdrop succeeds to Tabs, the effect is Copy.
When the dragdrop fails, the effect is None.
This commit is contained in:
Kaphotics
2016-08-21 09:07:44 -07:00
parent c44d808142
commit a45b19364d

View File

@@ -3363,7 +3363,7 @@ private void pbBoxSlot_MouseMove(object sender, MouseEventArgs e)
pb.BackColor = Color.FromArgb(100, 200, 200, 200);
// Thread Blocks on DoDragDrop
DragDropEffects result = pb.DoDragDrop(new DataObject(DataFormats.FileDrop, new[] { newfile }), DragDropEffects.Move);
if (result == DragDropEffects.None || result == DragDropEffects.Copy) // not dropped to another box slot, restore img
if (result != DragDropEffects.Link) // not dropped to another box slot, restore img
pb.Image = img;
if (result == DragDropEffects.Copy) // viewed in tabs, apply 'view' highlight
getSlotColor(slotSourceSlotNumber, Properties.Resources.slotView);
@@ -3458,6 +3458,7 @@ private void pbBoxSlot_DragDrop(object sender, DragEventArgs e)
SAV.setStoredSlot(pkz, slotDestinationOffset);
getQuickFiller(SlotPictureBoxes[slotDestinationSlotNumber], pkz);
e.Effect = DragDropEffects.Link;
slotSourceOffset = 0; // Clear offset value
}
}