Hidden Menu-item?

erich

New Member
I'm trying to hide a pop-up menu item, but I cannot get it to work. The progress help file shows that there is a Visible attribute for the MENU-ITEM widget, but when I try to set it to False, it says that the Visible attribute is not setable for the menu-item? I would alternatively create the menu-item dynamically, but I want them in a certain order (so I can't just create that one menu-item) and don't feel I should have to create the entire menu dynamically just to get one menu-item to be hidden (not created)...Anyone know of a way to accomplish this? Hopefully I'm just overlooking something... Thank you.
 
No. You aren't overlooking anything. The menu-item cannot be hidden from the 4GL. But when you think about it, why would you want to? Usually, a menu-item is disabled, not hidden, to prevent access. This is a windows standard.

If it's just one or two menu-items then a possible solution is to use more than one menu, with the various options present on one, and omitted on the other. It's then a simple matter to re-assign the pop-up menu on the widget to one that displays only those options that are valid.
 
The reason I want to hide an option is that it will confuse users who should not be seeing it...it's not a matter of security, but rather of the option not applying to 95% of users and they won't know what it does/can't ever run the program. Like I mentioned, I know I can create the menu dynamically (it's a pop-up on a button), but that seems ridiculous to me just to get the menu-item in the proper order when every other option is fine. The part that makes me mad though is that the progress help says there's a visible attribute when clearly there isn't (or at least it can't be set). Oh well, if anyone else knows of some magic to get this to work w/o a dynamic menu, let me know :-)
 
There is a VISIBLE attribute, but it's just read-only for menu-items. Pretty pointless I agree, but VISIBLE is an attribute that's common to all widgets which is probably why it exists. There are other attributes that are either always READ-ONLY, or are settable only before the widget is realized.

But the popup menus don't have to be dynamically created. Use AppBuilder to create a static default menu with all options visible, do a code-preview and copy the menu definition, then paste it into the definitions section. Change the name, remove the unwanted item and then all you need to do is assign one menu or the other to the button as appropriate.
 
Back
Top