macos:Drag-and-drop-semantics

出自UXGuide.net

跳转到: 导航, 搜索

请帮助我们修订和更新本文的中文部分

本文的中文部分虽然取自官方最新中文版本,但与英文原版相比已落后了一年多,可能无法反映英文版本中最近的修改,且文中笔误、前后译法矛盾、未翻译完全的片断较多,请您帮助一起修订完善。详情参见中文版修订完善计划

拖拽的语义
Drag-and-Drop Semantics

Your application must determine whether to move or copy a dragged item after it is dropped on a destination. The appropriate behavior depends on the context of the drag-and-drop operation, as described in this section.

您的程序必须决定当对象被拽到目的区域后是移动对象还是复制对象。哪种行为更加合适取决于拖拽操作的上下文,本小节将对此有所描述。

移动 VS 复制
Move Versus Copy

If the source and destination are in the same container (for example, a window or a volume), a drag-and-drop operation is interpreted as a move (that is, cut and paste). Dragging an item from one container to another initiates a copy (copy and paste). The user can perform a copy operation within the same container by pressing the Option key while dragging. When performing a copy operation, indicate a copy operation to the user by using the copy pointer. (See “Standard Pointers”)

如果拖拽操作的源位置和目标区域于同一个容器内(例如,同一个窗口或者同一个卷),则该操作被理解为移动(也就是剪切并粘贴)。 将一个对象从一个容器拖拽到另外一个容器则是复制(也就是拷贝并粘贴)。用户在拖拽时可以按住Option键从而在同一个容器内进行复制。使用复制光标告诉用户这是一个复制操作。(请参考“标准光标”)

When determining whether to move or copy a dragged item, you must consider the underlying data structure of the contents in the destination window. For example, if your application allows two windows to display the same document (multiple views of the same data), a drag-and-drop operation between these two windows should result in a move.

当决定一个拖拽操作到底是移动还是复制时,您也需要考虑目标窗口内容的数据结构。例如,如果您的程序允许两个窗口显示同样的文档(同一数据的不同视图),这两个窗口之间的拖拽操作应该是移动。

The principle driving these drag-and-drop guidelines is to prevent the user from accidental data loss. Because an Undo command in the destination application does not trigger an Undo in the source application, moving data across applications may result in potential data loss. Moving data within the same window (or same volume, as in the case of the Finder) does not lead to data loss.

这些拖拽操作建议的准则就是防止用户偶然的丢失数据。因为目标程序的撤销操作并不能触发源程序的撤销操作,所以跨程序的移动数据可能会导致数据丢失,而在同一个窗口(或者Finder中的同一个卷)中移动数据则没有这种担忧。

Table 9-1 Common drag-and-drop operations and results
表格 9-1 常用的拖拽操作和结果

Dragged item
拖拽对象
Destination
目标
Result
结果
Data in a document
文档中的数据
The same document
同一文档
Move
移动
Data in a document
文档中的数据
Another document
其他文档
Copy
复制
Data in a document
文档中的数据
The Finder
Finder
Copy (creates a clipping)
复制 (创建一个数据片段)
Finder icon
Finder图标
An open document window
打开的文档窗口
Copy
复制
Finder icon
Finder图标
The same volume
相同的卷
Move
移动
Finder icon
Finder图标
Another volume
其他卷
Copy
复制

何时检测Option键的状态
When to Check the Option Key State

Your application should check whether the Option key is pressed at drop time. This behavior gives the user the flexibility of making the move-or-copy decision at a later point in the drag-and-drop sequence. Pressing the Option key during the drag-and-drop sequence should not “latch” for the remainder of the sequence.

您的程序应该在对象被放下时检测Option键是否被按下。这种行为使得用户可以灵活地在拖拽操作的最后时刻决定移动还是复制对象。在拖拽过程中按下Option键并不会就此锁定随后的操作,在最后时刻前,用户仍然可以改变主意。

Note: The Option key does not act as a toggle switch; Option-dragging between containers always initiates a copy operation. This guideline helps users learn that Option means copy.

注意:Option键并不是开关;按着Option在不同容器间的拖拽永远是复制操作。这个准则会帮助用户了解Option键只意味着复制。

个人工具
名字空间
变换
动作
导航
工具箱