• Flex 右键菜单控制


                //设置监控右键菜单项
                private function setUserMenuItem():void{
                    var contextMenu:ContextMenu = new ContextMenu();
                    contextMenu.hideBuiltInItems(); // 隐藏一些内建的鼠标右键菜单项
                
                    var cmiGoRoundMenuItem:ContextMenuItem = new ContextMenuItem("方法1",true);
                    contextMenu.customItems.push(cmiGoRoundMenuItem);
                    cmiGoRoundMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, f1);
                    
                    //var cmiCheckMenuItem:ContextMenuItem = new ContextMenuItem("核查调度",true);
                    //contextMenu.customItems.push(cmiCheckMenuItem);
                    //cmiCheckMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, checkAttemperFunction);
                    
                    var cmiTaskQueryMenuItem:ContextMenuItem = new ContextMenuItem("方法2",true);
                    contextMenu.customItems.push(cmiTaskQueryMenuItem);
                    cmiTaskQueryMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, f2);
                    
                    var cmiMessageSendMenuItem:ContextMenuItem = new ContextMenuItem("方法3",true);
                    contextMenu.customItems.push(cmiMessageSendMenuItem);
                    cmiMessageSendMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, f3);
                
                    this.pPanel.contextMenu = contextMenu;//向对象中添加右键菜单                 
                }
                
                private function f1(event:ContextMenuEvent):void{
                    event.target.caption = "方法1调完成";//改变标题
                    Alert.show("1");
                }
                 private function f2(event:ContextMenuEvent):void{
                    Alert.show("2");
                }
                 private function f3(event:ContextMenuEvent):void{
                    Alert.show("3");
                }
  • 相关阅读:
    安装Bind到CentOS(YUM)
    安装Ansible到CentOS(YUM)
    安装AB到CentOS(YUM)
    安装APACHE到CentOS(YUM)
    07 Spring Cloud Eureka是什么?
    06 Spring Boot Starter的介绍及使用
    05 Spring Boot项目搭建步骤(超详细)
    04 Spring Cloud开发环境的准备和Lombok安装步骤
    03 Spring Cloud和Dubbo的区别及各自的优缺点
    02 Spring Cloud 模块介绍
  • 原文地址:https://www.cnblogs.com/aegisada/p/4522122.html
Copyright © 2020-2023  润新知