customizing visual feedback in nstableview

  • Is it possible to override the default visual feedback for dropping
    objects onto table views?  I would like it to become highlighted
    instead of drawing a black line inbetween cells, since this does not
    make sense with a sorted table view.

    Thanks in advance,

    Francisco Tolmasky
    <ftolmasky...>
    http://www-scf.usc.edu/~tolmasky/
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On 18. Mar 2004, at 11:11, Francisco Tolmasky wrote:

    > Is it possible to override the default visual feedback for dropping
    > objects onto table views?  I would like it to become highlighted
    > instead of drawing a black line inbetween cells, since this does not
    > make sense with a sorted table view.

    You can use setDropRow:dropOperation: to re-target the drop position.
    You should then re-target it to where it fits into the sorted list.
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On Mar 18, 2004, at 2:51 PM, Allan Odgaard wrote:

    > On 18. Mar 2004, at 11:11, Francisco Tolmasky wrote:
    >
    >> Is it possible to override the default visual feedback for dropping
    >> objects onto table views?  I would like it to become highlighted
    >> instead of drawing a black line inbetween cells, since this does not
    >> make sense with a sorted table view.
    >
    > You can use setDropRow:dropOperation: to re-target the drop position.
    > You should then re-target it to where it fits into the sorted list.
    >

    This can become 'interesting' from a UI standpoint if you are dealing
    with a Sorted list, or with a list that only shows a subset of the
    original contents (filtered).

    I'm not sure what the exact proper behavior is hig wise.

    but it's something to think about..
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • Let me restate what I'm trying to do.  Try dropping some vcards onto
    addressbook.  No specific cell is highlighted, and no line is drawn
    inbetween any, instead, since it is sorted, one big black box is drawn
    around the entire table view, which is what I want.

    On Mar 18, 2004, at 1:18 PM, Scott Anguish wrote:

    >
    > On Mar 18, 2004, at 2:51 PM, Allan Odgaard wrote:
    >
    >> On 18. Mar 2004, at 11:11, Francisco Tolmasky wrote:
    >>
    >>> Is it possible to override the default visual feedback for dropping
    >>> objects onto table views?  I would like it to become highlighted
    >>> instead of drawing a black line inbetween cells, since this does not
    >>> make sense with a sorted table view.
    >>
    >> You can use setDropRow:dropOperation: to re-target the drop position.
    >> You should then re-target it to where it fits into the sorted list.
    >>
    >
    > This can become 'interesting' from a UI standpoint if you are dealing
    > with a Sorted list, or with a list that only shows a subset of the
    > original contents (filtered).
    >
    > I'm not sure what the exact proper behavior is hig wise.
    >
    > but it's something to think about..
    >
    >
    >
    Francisco Tolmasky
    <ftolmasky...>
    http://www-scf.usc.edu/~tolmasky/
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On Mar 18, 2004, at 4:40 PM, Francisco Tolmasky wrote:

    > Let me restate what I'm trying to do.  Try dropping some vcards onto
    > addressbook.  No specific cell is highlighted, and no line is drawn
    > inbetween any, instead, since it is sorted, one big black box is drawn
    > around the entire table view, which is what I want.
    >

    Well, to be able to retarget to a specic item (so that it would go into
    an item....)

    - (void)setDropRow:(int)row
    dropOperation:(NSTableViewDropOperation)operation

    Used if you wish to retarget the proposed drop. To specify a drop on
    the second row, one would specify row as 2, and operation as
    NSTableViewDropOn. To specify a drop below the last row, one would
    specify row as [tv numberOfRows] and operation as NSTableViewDropAbove.

    if you want the entire table view to highlight, in the past I've
    actually implemented the drag and drop on the scrollview that contains
    the tableview.
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On Mar 18, 2004, at 11:51 AM, Allan Odgaard wrote:

    >> Is it possible to override the default visual feedback for dropping
    >> objects onto table views?  I would like it to become highlighted
    >> instead of drawing a black line inbetween cells, since this does not
    >> make sense with a sorted table view.
    >
    > You can use setDropRow:dropOperation: to re-target the drop position.
    > You should then re-target it to where it fits into the sorted list.
    >
    That doesn't actually change the visual feedback.

    There is a private method (so I'd recommend that you don't use it in a
    shipping application):

    - (void) _drawDropHighlightBetweenUpperRow: (int) parameter1
    andLowerRow: (int) parameter2 atOffset: (float) parameter3;

    If it is something you could usefully employ, send an enhancement
    request.

    mmalc
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • - (NSDragOperation)tableView:(NSTableView*)tv validateDrop:(id
    <NSDraggingInfo>)info proposedRow:(int)row
    proposedDropOperation:(NSTableViewDropOperation)op
            [tv setDropRow:-1 dropOperation:NSTableViewDropOn];

    On 18/3-2004, at 22:58, mmalcolm crawford wrote:

    > On Mar 18, 2004, at 11:51 AM, Allan Odgaard wrote:
    >
    >>> Is it possible to override the default visual feedback for dropping
    >>> objects onto table views?  I would like it to become highlighted
    >>> instead of drawing a black line inbetween cells, since this does not
    >>> make sense with a sorted table view.
    >>
    >> You can use setDropRow:dropOperation: to re-target the drop position.
    >> You should then re-target it to where it fits into the sorted list.
    >>
    > That doesn't actually change the visual feedback.
    >
    > There is a private method (so I'd recommend that you don't use it in a
    > shipping application):
    >
    > - (void) _drawDropHighlightBetweenUpperRow: (int) parameter1
    > andLowerRow: (int) parameter2 atOffset: (float) parameter3;
    >
    > If it is something you could usefully employ, send an enhancement
    > request.
    >
    > mmalc
    > _______________________________________________
    > cocoa-dev mailing list | <cocoa-dev...>
    > Help/Unsubscribe/Archives:
    > http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    > Do not post admin requests to the list. They will be ignored.
    >
    >
    Peter Mark

    Mark's Recording Studio A/S
    Lundeskovsvej 3
    2900 Hellerup
    Denmark
    Tel: +45 35366078 Fax: +45 35366038
    www.marks-studio.dk
    <info...>
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On Mar 18, 2004, at 1:40 PM, Francisco Tolmasky wrote:

    > Let me restate what I'm trying to do.  Try dropping some vcards onto
    > addressbook.  No specific cell is highlighted, and no line is drawn
    > inbetween any, instead, since it is sorted, one big black box is drawn
    > around the entire table view, which is what I want.

    In that case, you should be able to do what you want by overriding
    -draggingEntered: to draw the black outline, and just invoke the
    inherited method if the dragging source is local.

    -jcr

    Should array indices start at 0 or 1? My compromise of 0.5 was rejected
    without, I thought, proper consideration. (Stan Kelly-Bootle)
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.