为什么模态/非模态对话框称为模态/非模态?
我总是很难记住模态对话框还是非模态对话框是否会阻止应用程序其他部分的操作。
有谁知道为什么这样称呼他们?
I always have trouble remembering whether the modal or modeless dialog is the one blocking operations in other parts of the application.
Does anyone know why they are called that way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
看起来唯一的原因是它与 模式 和 模式错误。
Looks like the only reason is that it is related to modes and mode errors.
使用模式对话框,您可以将应用程序设置为特定的模式(如果您愿意,可以选择不同的“状态”),从而仅接受与该“模式”相关的操作,因此可以防止对话框之外的 UI 操作。
在 Andreas 的提示下,我想我可能必须去翻翻尘封的 Windows API 书籍,因为通常情况下,已被广泛接受的单词或表达的词源/起源只能在早期文档中找到,但事实上我们仍然看到 < a href="http://msdn.microsoft.com/en-us/library/dn688965.aspx#glossary-m" rel="noreferrer">来自 MS 的在线术语表 。模态条目如下(重点是我的):
模态
由于在某种模式下操作而导致的限制性或受限交互。模态通常描述限制用户与所有者窗口交互的辅助窗口。另请参见:无模式。
With a modal dialog, you set your application in a particular mode (a different "state" if you will), whereby only actions pertaining to that "mode" are accepted, hence preventing UI actions outside of the dialog.
At Andreas' prompting I thought I may have to dig dusty Windows API books, as often, the etymology/origin of a word or expression that has became broadly accepted is only found in early documentation, but in fact we still see this referenced in an online glossary from MS. The Modal entry reads (emphasis is mine):
modal
Restrictive or limited interaction due to operating in a mode. Modal often describes a secondary window that restricts a user's interaction with the owner window. See also: modeless.
模态系统是具有多种“操作模式”的系统。这样的系统通过使用击键(例如“Esc”、“CTRL+S”)在模式之间切换。一个很好的例子是 Vim 文本编辑器,它可以在“编辑文本模式”和“导航文本模式”之间切换。
因此,模态对话框是一种通过在操作期间将主程序切换到不同模式来阻止主程序的对话框。
A modal system is one with multiple "modes of operation". Such a system switches between modes by using key strokes, for example "Esc" "CTRL+S". A good example is the Vim text editor which switches between "edit text mode" and "navigate text mode".
A modal dialog is thus one which blocks the main program by switching it to a different mode for the duration of the operation.
我相信这是对语言模态的提示。 “模态”对话框(通常)用于呈现属于以下典型模态的信息:
尽管我正在寻找更明确的答案,但我认为是这种情况的部分原因是模态对话框的方式讨论过。例如,以 MSDN - 他们的标准是“显示重要消息的对话框应该始终是模态的。”,这可以很容易地重写为“内容是声明性模态的对话框[此处模态的语言定义]应该创建为模态窗口。”
这还有其他先例。例如,对话框中的“对话框”一词 - 它被称为“对话框”,因为它应该在系统和用户之间呈现对话或对话 - 这是计算过程的语言术语的另一个回归。
I believe this is a tip to Linguistic Modality. "Modal" dialogs are used (typically) to present information that falls into the typical modals of:
Part of why I feel this is the case, although I'm searching for a more definitive answer, is the way modal dialogs are discussed. For example, take MSDN - their criteria is "Dialog boxes that display important messages should always be modal.", which could easily be rewritten as "Dialog boxes whose content is of a declarative modal [linguistic definition of modal here] should be created as Modal windows."
There is other precident for this. For example, the word "dialog" in dialog box - it's called a "Dialog box" because it's supposed to be presenting a dialog, or conversation, between the system and user - another throwback to linguistic terminology for a computational process.