Improvements to Client Menu Bar

I have a couple items in the Client Menu Bar that are used to open new windows and perform other actions depending on which object is selected on a given screen. It would be useful if there was a way to bind an Enabled property for each item to avoid performing error checking in every menu script.

Also, would it be possible to allow different menu bar structures depending on which child window is selected, similar to how some software packages (and also the Mac OS) operate?

Thanks!

Right now the menu structure is static. You have to perform validation in your script to check for a user’s roles or whatever. When you find yourself using the same code over and over again you can create a global script function in the Script Modules area (under Tools > Script Modules).

You can add a new script called nav. In that script module add a function like this:def openWindow(window): import system username = system.security.getUsername() roles = system.security.getRoles() if window == "SomeWindow": if "Operator" in roles: system.nav.openWindow(window) else: system.gui.messageBox("You don't have privileges")That way the code can be in one place. You can call this function in your script like this:app.nav.openWindow("SomeWindow")I will add a ticket in to make the menu structure dynamic but we won’t be able to get to that one for a while.