自定义上下文菜单未显示在 MX TextArea 中
多年来我一直在努力尝试将我的自定义上下文菜单应用于文本区域,它只会显示默认值(复制、粘贴等...)。
import mx.events.FlexEvent;
public var nm:NativeMenu = new NativeMenu();
public var cm:ContextMenu = new ContextMenu();
protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
{
cm.clipboardMenu = true;
var cmi:ContextMenuItem = new ContextMenuItem("ctest");
cm.addItem(cmi);
TA.contextMenu = cm;
}
给定 TA 是 MXML 中的 mx TextArea
我真的很困惑!
Been tearing my hair out for ages trying to get my custom ContextMenu to apply to a TextArea, It will just display the default (copy, paste ect...).
import mx.events.FlexEvent;
public var nm:NativeMenu = new NativeMenu();
public var cm:ContextMenu = new ContextMenu();
protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
{
cm.clipboardMenu = true;
var cmi:ContextMenuItem = new ContextMenuItem("ctest");
cm.addItem(cmi);
TA.contextMenu = cm;
}
given TA is an mx TextArea in MXML
i'm really stumped!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
放上全套代码给大家看看:
希望对大家有帮助!
Just to put a full set of code for everyone to see:
Hope this helps!