PopUpClick statement doesn't work with submenus

Issue #547 new
Jim Rea repo owner created an issue

http://forum.provue.com/t/submenus-in-popupclick-are-hyperactive/362

Note: This is not documented to work, and did not work in Panorama 6. However, it would be nice if it did work. Here is code submitted by David Duncan that demonstrates this. Note that the "CODE" options are necessary or else the menus will be disabled.

fileglobal fRunsPUMchoice

popupclick
submenu("DC bookings")+
menuitem("Open bookings window","CODE","")+
menuitem("Print bookings calendar","CODE","")+
menuseparator()+
menuitem("Enter a manual booking","CODE","")+
submenu("Truck bookings")+
menuitem("Make a truck booking")+
menuseparator()+
menuitem("Re-send a truck booking")+
menuitem("Cancel a truck booking")+
menu("RunsPUM")+
menuitem("DC bookings…","SUBMENU","DC bookings")+
menuitem("Truck bookings…","SUBMENU","Truck bookings"),
"",fRunsPUMchoice

Comments (2)

  1. Jim Rea reporter

    Michael Kellock reports a possibly related problem with popupdoublefieldchoices statement -- "I can't get a result for the second array element in myChoice - using data in two fields, the myChoice array only ever has one element. The sub-menu items are greyed out. Tested on two Macs."

  2. Jim Rea reporter

    The code below does work, sort of. The submenus do work, but colorChoice is not set to the item value for submenu items.

    Need to figure out why it is different than the code in the original report. Ok, it appears to depend on what is in the Code source, empty text (““) doesn’t work, and “nop” doesn’t work, but “a”, “aa”, etc does work. Aha - it works if the code contains an error!! If the code is valid it runs the code, then pops up the menu again. If the code is not valid, it returns and falls thru to the message statement. Note: «» in the code is not expanded to the menu text.

    local colorChoice,MenuText
    MenuText="(YellowSubmenu)"+tab()+"*S"+cr()+
      tab()+"White"+tab()+"$1.1.1ɜ{Test}"+cr()+
      tab()+"Magenta"+tab()+"$1.1.2ɜ{Test}"+cr()+
      "(RedSubmenu)"+tab()+"*S"+cr()+
      tab()+"Yellow"+tab()+"(YellowSubmenu)$1.1ɜ"+cr()+
      tab()+"Cyan"+tab()+"$1.2ɜ{Test}"+cr()+
      "(Colours)"+cr()+ tab()+"Red"+tab()+"(RedSubmenu)$1ɜ"+cr()+
      tab()+"Green"+tab()+"$2ɜ"+cr()+
      tab()+"Blue"+tab()+"$3ɜ"
    popupbutton MenuText,"",colorChoice
    message colorChoice+cr()+info("menuidentifier")
    

    This code is from:

    http://forum.provue.com/t/inconsistent-behaviour-of-popup-menus-with-submenus-attached/3803

  3. Log in to comment