zoukankan      html  css  js  c++  java
  • 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");
                }
  • 相关阅读:
    [Codeforces 933A]A Twisty Movement
    [Codeforces 100633J]Ceizenpok’s formula
    [HAOI 2011]向量
    [JSOI 2008]最大数
    [Codeforces 750E]New Year and Old Subsequence
    [BZOJ 3439]Kpm的MC密码
    [TJOI 2013]单词
    [SCOI 2011]糖果
    [BZOJ 2160]拉拉队排练
    [AtCoder arc090F]Number of Digits
  • 原文地址:https://www.cnblogs.com/aegisada/p/4522122.html
Copyright © 2011-2022 走看看