it-swarm.cn

拖放操作的拖放部分常用的习惯用法是什么?

我在这里只关心D%D操作的另一部分,即下降。与用户交流时可以丢弃的常见习语有哪些?哪些是“最佳”的,在什么情况下?

特别是,我想知道在拖动发生之前和之后都向用户传达某些信息的人。这些可以是视觉的或“触觉的”(鼠标光标的更改)。

12
shemnon
  • 指示可能的掉落目标
  • 显示结果的实时预览
  • 实时显示正在拖动的内容

alt text

  • 如果您无法在某处放置任何东西,请在光标附近的弹出窗口中向用户解释原因:

alt text

  • 保持您的放下目标更大!拖放已经严重违反了弗里茨定律;无需使情况变得更糟。
5
Robert Fraser

我见过的应用程序显示了可以放下轮廓的轮廓。

这是从wordpress小部件页面

Wordpress widget page
(来源: srulytaber.com

10
Sruly

一种常见的方法是,当您浏览所有其他内容时,将光标变成“不能放下”的光标。

逻辑将是:

  1. 开始拖动。
  2. 将光标变成“不能放下”。
  3. 拖动时检查是否可以接受下降,然后将光标变为“可以下降”。
  4. 放下并重置光标。

注意:我并不一定要提倡此操作,但是它确实向用户显示了他们处于拖放操作的中间,并指出了放置在何处有效。

7
ChrisF

用户拖动项目后,可以稍微突出显示放置位置。这样,您可以将注意力吸引到放置位置。

当然,前提条件是首先要显示可拖动的内容。有这个问题的答案 为此

5
Gamlor

有时放置目标在一组线性排列对象内。放置该项目后,放置目标之后的对象将移动以为新对象腾出空间。在这种情况下,通常用细线表示插入点将分开以留出空间的两个对象之间。

例如,在几乎所有使用鼠标的GUI中,都可以选择文本并将其从文档的一个部分拖到另一部分。插入点由两个字符之间的细线表示。

前面讨论的Netflix队列也是这种情况。 Netflix除了细线外,还使用黑色箭头指示电影的播放位置。

 Thundercats: Season 1: Vol. 1: Disc 3     
 .....................................     
 Thundercats: Season 1: Vol. 1: Disc 4
>------------------------------------- 
 Thundercats: Season 1: Vol. 1: Disc 5
 .....................................
 Thundercats: Season 1: Vol. 1: Disc 6

(我不知道如何在拖动时抓取屏幕截图。)

3
Patrick McElhaney

删除的典型工作流程是:

repeat while mouse is down

    dragEnter -> mouse pointer has moved into some new area.
                 Highlight the area if the dragged data is valid for dropping into it,
                 adjust cursor (forbidden, copy, symlink, or move)
                 adjust the drag image (e.g. when dragging from icon view in file picker
                 to list view in another file picker, now's the time to animate the
                 drag image to look like the list view items would when dropped.

    dragLeave -> Undo any previous highlight.

end repeat

if we were over a valid drop location
    drop
else
    show an animation of the drag image snapping back to its
         point of Origin to make it clear the drag was canceled.
end if

Undo any previous highlight.

下拉突出显示的典型类型为:

  • 在容器周围勾勒出轮廓(例如,滚动视图),以表明某物是有效的放置目标
  • 插入标记,指示该项目将在之间或之后放置的列表项或文本字符
  • 表示放置的图标的选定变体(或文件夹图标的“折叠打开”变体)将最终以内部项出现,而不是在项之前或之后。

请注意,插入标记不仅对您可以自由重新排列商品顺序的列表有用,而且对排序后的列表(例如,在已排序列表中的两个文件之间或两个文件之间放置一滴是完全有效的,但您要指出的是,在排序后,该文件将向下显示。

仅出于完整性考虑,拖动的典型工作流程是:

detect whether a click-and-hold or click-and-move is really intended to be a drag:
 - Is it obvious? (e.g. dragging a file by its icon -- there is nothing else you can do
 - Or: Wait for a while, has the mouse moved by at least 4 pixels in some direction
       and has the mouse still not been released? (Accounts for most peoples' less-than-pefect motor skills
 - Or: Is the drag in a certain direction that doesn't make sense for anything else?
       (E.g. dragging sideways over text may be an attempt at a new selection,
       OTOH a vertical drag > 4px on a selection is pretty guaranteed to be a drag attempt.

Set up a drag image that is attached to the mouse. This image usually looks exactly
    like a 70% opaque version of the selection (giving the illusion you're moving
    the selection) and if you haven't moved the mouse yet, should invisibly overlay
    the actual selection. (I.e. move it relative to the mouse, don't center it
    under the mouse)

Start the drag! (following this we do the workflow for dropping)

(至少这是现代Mac OS X应用中通常会发生拖放的方式,尽管在拖放期间更新拖动图像是相当新的事情)

2
uliwitness