博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
修复 XE7 , XE8 Frame 内 PopupMenu 快捷键失效问题
阅读量:4309 次
发布时间:2019-06-06

本文共 1427 字,大约阅读时间需要 4 分钟。

问题:将 Frame 含 PopupMenu 放置 Form 后,在 Frame 里的 PopupMenu 失效,无法按快捷键。

适用:(XE7 update 1 / XE8) for Windows 平台

修正方法:

请将源码 FMX.Forms.pas 复制到自己的工程目录里,再进行修改。

找到 TCommonCustomForm.KeyDown 函数,修改如下:

procedure TCommonCustomForm.KeyDown(var Key: Word; var KeyChar: System.WideChar; Shift: TShiftState);..... 省略 ......{
+++>} // 遍历所有的 Menu function FindMenu(c: TFmxObject): TFmxObject; var i: Integer; begin if c is TFmxObject then for i:=0 to TFmxObject(c).ChildrenCount - 1 do begin if TFmxObject(c).Children[i] is TMainMenu then TMainMenu(TFmxObject(c).Children[i]).DialogKey(Key, Shift) else if TFmxObject(c).Children[i] is TPopupMenu then TPopupMenu(TFmxObject(c).Children[i]).DialogKey(Key, Shift); FindMenu(TFmxObject(c).Children[i]); end; end;{
<+++}var Control: IControl;begin..... 省略 ...... // 3. perform key in other Menus for I := ChildrenCount - 1 downto 0 do if Children[i] <> FocusPopup then begin{
+++>} FindMenu(Children[I]); // 加入这行:遍歷所有的 Menu if Children[I] is TMainMenu then TMainMenu(Children[I]).DialogKey(Key, Shift) else if Children[I] is TPopupMenu then TPopupMenu(Children[I]).DialogKey(Key, Shift); if Key = 0 then Exit; end;..... 省略 ......end;

 

转载于:https://www.cnblogs.com/onechen/p/4355349.html

你可能感兴趣的文章
为什么linux安装程序 都要放到/usr/local目录下
查看>>
Hive安装前扫盲之Derby和Metastore
查看>>
永久修改PATH环境变量的几种办法
查看>>
大数据学习之HDP SANDBOX开始学习
查看>>
Hive Beeline使用
查看>>
Centos6安装图形界面(hdp不需要,hdp直接从github上下载数据即可)
查看>>
CentOS7 中把yum源更换成163源
查看>>
关于yum Error: Cannot retrieve repository metadata (repomd.xml) for repository:xxxxxx.
查看>>
linux下载github中的文件
查看>>
HDP Sandbox里面git clone不了数据(HTTP request failed)【目前还没解决,所以hive的练习先暂时搁置了】
查看>>
动态分区最佳实践(一定要注意实践场景)
查看>>
HIVE—索引、分区和分桶的区别
查看>>
Hive进阶总结(听课总结)
查看>>
大数据领域两大最主流集群管理工具Ambari和Cloudera Manger
查看>>
Sqoop往Hive导入数据实战
查看>>
Mysql到HBase的迁移
查看>>
Sqoop import进阶
查看>>
Hive语句是如何转化成MapReduce任务的
查看>>
Hive创建table报错:Permission denied: user=lenovo, access=WRITE, inode="":suh:supergroup:rwxr-xr-x
查看>>
Hive执行job时return code 2排查
查看>>