EDSidebar icon indicating copy to clipboard operation
EDSidebar copied to clipboard

validateDrop function is not called for each cell

Open redbug26 opened this issue 11 years ago • 2 comments

  • (NSDragOperation)sideBar:(EDSideBar*)tabBar validateDrop:(id<NSDraggingInfo>)sender row:(NSInteger)row

is called once you drop your cursor on the EDSideBar view and not for each cell.

redbug26 avatar Feb 02 '14 18:02 redbug26

I am not sure what the problem is. Could you explain it a bit more or provide some sample code with the issue?

erndev avatar Feb 03 '14 09:02 erndev

Here is a sample. If I go on from anywhere on my screen to row 1 of sidebar, it works. But if I go from anywhere on my screen to row 1 of sidebar and then move my mouse to row 2 (without leaving sidebar), the function validatedrop will not be called for row 2.

- (NSDragOperation)sideBar:(EDSideBar*)tabBar validateDrop:(id<NSDraggingInfo>)sender row:(NSInteger)row
{
    NSPasteboard* pboard = [sender draggingPasteboard];

    if (row==1) {
        return NSDragOperationMove;
    }

    if (row==2) {
        return NSDragOperationCopy;
    }

    return NSDragOperationNone;
}

redbug26 avatar Feb 03 '14 10:02 redbug26