macos:Destination-feedback
出自UXGuide.net
请帮助我们修订和更新本文的中文部分
本文的中文部分虽然取自官方最新中文版本,但与英文原版相比已落后了一年多,可能无法反映英文版本中最近的修改,且文中笔误、前后译法矛盾、未翻译完全的片断较多,请您帮助一起修订完善。详情参见中文版修订完善计划。
目标反馈
Destination Feedback
目录 |
If the user drags an item to a destination in your application, your application provides feedback that indicates whether it will accept that item. Destination feedback should not occur simply because your application is “drag-aware”; rather, it should depend on the destination’s ability to accept the type of data contained in the dragged item. For example, a text entry field that accepts only text should not be highlighted when the dragged item is a graphic.
如果用户将一个对象拖到您的程序中时,您应该提供反馈来告诉用户您的程序是否能够接受该对象。目标反馈不应仅仅因为您的程序是可拖拽就表示可接受,而是根据目标区域能否接受拖拽对象的数据的能力来决定。例如,一个文本框只能接受文本,而不应该接受图像。
Use pointers to indicate what result letting go of the mouse will have. For example, if you are dragging an icon out of a toolbar, show the poof pointer when the user has the icon outside of the toolbar to indicate that if they let go of it there, the item will disappear. Other pointers that provide useful feedback during a drag operation include the alias, copy, and not allowed pointers. See “Pointers” for more information on the pointers available in Mac OS X.
使用光标来指示拖拽动作的结果。例如,如果您将一个图标拖出工具栏,在图标被拖出工具栏时,其光标将会改变来指示该图标将会消失。其他的的光标如别 名,复制,不允许的操作也能提供有用的反馈。关于Mac OS X中可用的光标的更多信息,请参考“光标”一节。
- Carbon: The actual appearance of destination feedback depends on the type of destination. The Drag Manager provides some utilities for simple highlighting; if your application needs more complex highlighting, you must provide your own highlighting utilities.
- Carbon: 目标反馈的实际外观取决于目标的类型。拖拽管理器提供了一些很简单的高亮效果, 如果您的程序需要更复杂的高亮效果,您需要自己实现。
窗口 Windows
The valid destination region of a document window is usually the window’s content area minus the title bar and areas used for controls (such as scroll bars, resize controls, tool palettes, rulers, and placards). When there are multiple destination regions within a window, only one destination region is highlighted at a time.
文档窗口中有效的目标区域.目标区域一般是窗口的内容部分除去标题栏和控件部分(如滚动条,改变大小的控件,工具条,标尺等)。当窗口中有多个目标区域 时,只有一个会被高亮。
When the user drags an acceptable item from one destination region to another, your application highlights the destination region as soon as the pointer enters it and removes the highlighting when the pointer leaves the region.
如果一个对象在各个可以接受该对象的目标区域间拖动时,您的程序应该立即高亮显示鼠标指针进入的区域,并且在鼠标离开该区域时立即取消 高 亮。
If a drag-and-drop operation takes place entirely within one destination region (moving a document icon to a different location in the same folder window, for example), don’t highlight the destination region, to avoid distracting the user. However, if the user drags an item completely out of a destination region and then drags the same item back to the same destination region, the destination region should be highlighted.
如果拖拽操作发生在同一个区域内(如在一个文件夹窗口中拖动文档图标),则不要高亮目标区域,以免分散用户的注意力。然而,如果 用户将一个对象完全拖出了该区域,然后又将同一个对象拖回来,则应该高亮目标区域。
You can provide more specific destination feedback within a larger destination region. For example, when the user drags text from one document window to another, the destination window should display an insertion point where the dragged text would go if the user releases the mouse button.
当目标区域比较大时,您可以提供更为具体的目标反馈。例如,如果用户从一个文档窗口中拖拽了一些文字到另外一个文档窗口,则目标窗口应 该 显示当用户松开鼠标时拖拽的文字被插入的位置。
In many situations, highlighting a more narrowly defined area of a window is more appropriate than highlighting the entire content region; examples are spreadsheets, text boxes, fill-in forms, and panes. In these cases, the destination region must be tailored to more precisely indicate the specific destination.
在很多情况下,高亮一个已精确定义过的的区域比高亮整个窗口的内容区域要好一些;例如表格,文本框,填充表单,和面板等。在这些情况 中,目标区域必须尽可能精确的指定到特定的位置。
文字 Text
While the user is dragging an item to a text area, an insertion indicator (a vertical bar) should appear in the text where the dragged item would be inserted if the user releases the mouse button.
当用户将对象拖拽到文字区域时, 程序应该显示插入指示符(一个竖直条),表示用户松开鼠标时被拖拽对象的插入位置。
表单 Lists
An insertion indicator should appear in a list where a dragged item would be inserted if the user releases the mouse button. For example, when a user drags an item into the Sidebar of the Finder, a horizontal insertion indicator appears.
当用户将对象拖拽到表单时, 表单中应该显示插入指示符表示用户松开鼠标时,被拖拽对象的插入位置。例如,当用户拖拽对象到Finder的侧边栏时,插入位置会显示一个水平的插入指示 符。
多个拖拽对象 Multiple Dragged Items
If the user drags multiple items, the destination feedback should occur only if it can accept all of the dragged items. If the destination cannot accept all of the dragged items, the user’s attempt results in feedback as described in “Feedback for an Invalid Drop”
如果用户一个拖拽了多个对象,则目标区域只有在它能接受所有被拖拽的对象时才给出反馈。如果目标区域不能全部接受拖拽的对象,反馈结果 在”无效拖拽的反馈”中有所描述。
When the destination can accept all of the dragged items, the destination should accept them in the order specified by the source. The source application should organize the dragged items in the order in which they were selected, except in two cases. If the dragged items come from ordered views (such as View by Date or an alphabetized list), that view’s ordering takes precedence over the selection order. If both the source and the destination provide a spatial ordering (such as in graphic applications), the spatial ordering takes precedence over the selection order.
当目标区域能够接受所有对象时,它应该按照对象被选定的顺序来接受。源应用程序应该将拖拽的对象按照被选定的顺序来组织,除了两种情 况。如果 拖拽的对象来自于一个已经排序的视图(如按照日期排序的视图或者按字母排序的表单),则该视图的排序优先级大于选定顺序。如果源应用程序和目标应用程序都 提供了空间排序(如某些图形程序中),空间排序的优先级高于选定顺序。
自动滚动 Automatic Scrolling
When an item is being dragged, your application must determine whether to scroll the contents or allow the item to “escape” the window. If your application allows items to be dragged outside of windows, you should define an automatic scrolling region. Automatically scroll a destination window only if it is also the source window and is frontmost. Don’t automatically scroll inactive windows.
当对象被拖拽时,您的程序必须决定是否滚动窗口内容或者允许对象“逃逸”出窗口。如果您的程 序允许对象被拖拽到 窗口之外,您应该定义一个自动滚动的区域。只有目标窗口同同时是源窗口并且是最前端的窗口时,窗口才需要自动滚动。不要自动滚动非活动的窗口。
将垃圾筐作为目标 Using the Trash as a Destination
Dragging items to the Trash results in moving the item from the source to the Trash. For example, dragging a text selection from a word-processing application and dropping it on the Trash icon (or in the Trash window) results in the text being deleted from the application and a clipping containing that text being created inside the Trash. Note that the item is moved, although it is dragged between two containers. This exception to the rules described earlier is appropriate because the user can undo the operation by dragging the clipping out of the Trash back to its original source; it is consistent with the principle of preventing accidental data loss.
将对象拖拽到垃圾筐会导致对象会被移动到垃圾筐。例如,将字处理程序中选定的文字拖拽到垃圾筐图标(或垃圾筐窗口)会导致文字从字处理 程序中删 除,并且在垃圾筐中会创建一个包含这些文字数据片段段。注意,虽然对象是在两个容器间拖拽的,但是该对象被移动了,而不是复制。这个和前面所说的规则不一 样, 因为用户可以将垃圾筐中的数据片段拖拽回原来的地方,这并没有违背防止偶然的数据丢失的原则。
It is important to preserve the Trash’s container property; do not simply delete the source without creating a clipping or other item in the Trash.
维持垃圾筐的容器属性很重要,不要简单的删除对象而不在垃圾筐中创建一个数据片段或者对象的副本。