Firemonkey上的提示未在Delphi Seattle中显示 [英] Hints on Firemonkey not displaying in Delphi Seattle

查看:96
本文介绍了Firemonkey上的提示未在Delphi Seattle中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很高兴Firemonkey再次获得了控件的Hint属性,至少在Delphi Berlin和Seattle中。
但是,实现似乎还存在一些缺陷。

It is nice that Firemonkey got again the Hint property for controls, at least in Delphi Berlin and Seattle. However, the implementation seems to be a bit flawed yet.

一个奇怪的问题是显示提示似乎与表单的 BorderIcons 属性有关。如果 BorderIcons 保留默认值(Maximize,Minimize,SystemMenu),则会显示提示。但是,如果我更改了一些边框图标,则提示将不再显示。我没有看到任何逻辑,因此看起来像个错误。我在 FMX.Forms 单元中跟踪了一些代码,但是找不到与边框图标的任何关系。 TriggerControlHint 和其他方法中的提示似乎已正确设置。

One weird issue is that the displaying of the Hint seems related to the form's BorderIcons property. If the BorderIcons are left with the default values (Maximize, Minimize, SystemMenu), the hint shows. But if I change some of the border icons, the hints don't show any more. I don't see any logic for it, so it looks like a bug. I traced some code in the FMX.Forms unit, but couldn't find any relation to the border icons. The hints in TriggerControlHint and other methods seem to be set correctly.

有人遇到过这样的问题,您以某种方式解决了吗?

Has anyone had such an issue and have you solved it somehow?

还有其他问题,例如提示在Windows上转换为Seattle的XE8项目上不起​​作用。在此问题中提到了对于从XE7转换而来的项目,Firemonkey提示不适用于Delphi Seattle。我通过重新创建dproj文件来解决该问题,它可能与默认的清单/主题有关。

There are other issue, like hints not working on a XE8 project converted to Seattle on Windows. It was mentioned in this question Firemonkey Hints don't work in Delphi Seattle, for a project converted from XE7. I fixed that by recreating the dproj file and it probably has something to do with the default manifests/themes.

也不会显示放置在TLayout上的控件的提示,因为该布局没有ShowHint属性。对我来说听起来并不合逻辑,但至少可以通过手动设置每个控件的ShowHint属性来克服。

Also hints for controls placed on a TLayout don't show, because the layout doesn't have the ShowHint property. Doesn't sound very logical to me, but at least it can be overcome by setting each control's ShowHint property manually.

此问题在质量控制报告为 RSP-13218

The issue is reported on QC as RSP-13218

推荐答案

在进一步跟踪 FMX.Forms 之后,我发现了该错误。

After more tracing through FMX.Forms I found the bug.

TCommonCustomForm.Create 方法将提示对象设置为

In the end of the TCommonCustomForm.Create method the hint object is set with

if not (csDesigning in ComponentState) then
  FSharedHint := THint.CreateNewInstance(Handle);

但是当BorderIcons更改时,在其他情况下,它也会调用TCommonCustomForm.Recreate方法,它也会重新创建窗口句柄,因此提示不再链接到它。
要修复它,我还必须通过在 Recreate finally 子句之前添加几行来重新创建提示。 c>方法:

but when the BorderIcons are changed, and also in other cases, it calls the TCommonCustomForm.Recreate method, which also recreates the window handle, so the hint is no longer linked to it. To fix it I had to also recreate the hint by adding a few lines before the finally clause in the Recreate method:

if Visible and ([TFmxFormState.Showing] * FormState = []) then
  FWinService.ShowWindow(Self);
// Added lines
if not (csDesigning in ComponentState) then
begin
  FSharedHint.Free;
  FSharedHint := THint.CreateNewInstance(Handle);
end;

这篇关于Firemonkey上的提示未在Delphi Seattle中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆