我对 Default:=True 的 TButtons 的样式感到困惑。问题是,至少对于某些样式(例如 Luna),最近聚焦的按钮突出显示为橙色,这与默认按钮使用的样式相同。因此,我担心用户可能会对哪个按钮是默认按钮感到困惑,或者至少会认为两个按钮突出显示很奇怪。这种行为可以在 XE7 中看到(根据评论,在 XE8 中也可以看到)。
问题:
- 这是否被认为是呈现默认按钮的现代方式(相对于无样式的 VCL)?
- 如果这不被认为是标准行为,我可以通过策略性地启用/禁用默认按钮在我自己的对话框中解决它,但我想知道我是否错过了一些控制默认按钮和最近聚焦的按钮之间关系的设置。有没有一个设置可以控制这个?
我怀疑这是一个 VCL 样式错误。创建使用标准操作系统主题的默认 VCL 应用程序。然后添加两个按钮和一个编辑控件。将其中一个按钮设置为默认按钮。
Now use the tab key to cycle round the focus. When the edit control has the focus, the default button is highlighted. That indicates that if you press ENTER then that button will be pressed.
However, if either of the buttons has the focus, then the button with the focus is highlighted. That's because if you press ENTER when a button has the focus, the focused button is pressed, irrespective of whether it is the default button.
规则如下:
- 如果按钮具有焦点,则会突出显示为默认按钮。
- 如果按钮以外的控件具有焦点,则默认按钮(如果有)会突出显示。
因此,这是具有系统主题的 XE7 中的应用程序的外观。非默认按钮具有焦点。
请注意,只有一个按钮突出显示,并且它不是默认按钮。
这是 XE7 中 Luna 风格的相同应用程序。
这里我们有默认按钮和具有焦点的按钮,两者都突出显示。我认为这是一个错误,应该报告。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)