gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTableView event stuff..


From: Matt Rice
Subject: NSTableView event stuff..
Date: Tue, 07 Nov 2006 00:37:49 -0800
User-agent: GNUMail (Version 1.2.0)

in order to make this less lengthy i will not go into what happens when
the mouse is outside of the table view, and i will assume that the mouse is/stays inside of the table view, hopefully this will help explain what my patch does

i've attempted to refer to the 3 seperate terms for dragging verbosely

dragging is/is not possible: ability to begin a drag and drop operation.
mouse dragging:         the mouse button was held down while the mouse moved
dragging operation:     a drag and drop operation.

-mouseDown:
        abort/validate editing of the currently edited object.
        double click or greater; track the cell or edit cell [~1] and exit

looping over each mouse event including the original mouse down
NSLeftMouseDown:
        a) if dragging is possible:
        keep looping over all events until dragging operations
        have been confirmed or denied [~2].

        b) if dragging is not possible:
        select the row under the mouse according to any modifiers.
        on mouse down track the cell [~3] for the row/column
        get the current event if it has changed which could be the
        final event used in the cell tracking, a mouse up or a mouse dragged,
        possibly event the same event as tracked if the cell did not track,
        if it has changed, next iteration use the current event,
        
NSLeftMouseDragged:
        if dragging is possible attempt to confirm or deny a drag operation.
        
        otherwise, select the row under the mouse according to any modifiers
        
NSLeftMouseUp:
        select the current row if it isnt selected      
        
        if dragging is still possible:
        dragging has been denied we don't receive the mouse up
        for an aborted or successful drag operation.  So track the cell at the
        row/column passing the original mouseDown: event, NSCell will notice
        the event is out of date and get the current event, which is the mouse
        up. [~4]

consequences:
        you cannot select rows in a cell which accepts mouse input until mouse
        up.
        
you can only use cells which require mouse dragging to function properly
        in table views where dragging is not possible in the first place.
        e.g. NSPopUpButtonCell or NSSliderCell

details:
a look at the code will confirm that the current implementation does not
  function exactly the same as described here,
  for instance [~1] is not checked,

  and cell tracking occurs on mouse dragging


[~1]: should only edit on double click to avoid validating/ending editing.

[~2]: the mouse has moved too far vertically in the case of verticalMotionCanBeginDrag: NO

[~3.1]: the cell loops over each event recieved. in the case of untilMouseUp:NO it will return when the mouse goes up or the mouse dragging has left the cells
frame, for YES it will not return until the mouse goes up.

[~3.2]: it is worth noting the table view will not recieve events during the cell tracking.. this is the reason why confirming a drag operation used to be
so hard on the user,
because it would have to get all the way to the cells boundry to
confirm it (without moving 2 pixels in the vertical direction). as opposed to
the 4 horizontal pixels it is checking for.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]