PDA

View Full Version : How to disable a menu items


mak83
02-25-2009, 10:49 AM
Hi.

Just a short question: How can I disable (gray out) menu items in the menu bar?

I've read the documentation of the menuMan interface (and the corresponding interfaces) several times now, but there doesn't seem to be an appropriate method and only pop-up menu items seem to have an "enabled" attribute.

thx
M.

decon
02-27-2009, 09:56 AM
Do you mean a macro with an event handler, like:


on isenabled return (selection.count > 0)
on execute do (
blaa blaa ..
)

mak83
02-27-2009, 10:27 AM
Do you mean a macro with an event handler, like:


on isenabled return (selection.count > 0)
on execute do (
blaa blaa ..
)


I don't think so. But honestly - I'm not sure. I'm quite new to MaxScript, you know.

Let my try to explain what I need in more detail:

I've added a new menu to the main menu bar. This new menu contains some menu items.

Now I want to gray out some of these menu items (like, for example, the menu items under "Group" are grayed out when the selection is empty or like the menu item "Edit->Undo" is grayed out when nothing has changed in the current scene yet).

So what I'm looking for now is a command like "gray out menu item X".

Regards,
M.

PEN
02-27-2009, 01:20 PM
Timo has it right there. You need to tell each macro how it will set its state when it becomes visible. As for the whole menu I'm not sure that you can, just the macros in the menus.

mak83
02-27-2009, 02:37 PM
Thanks alot - it works fine!

At first I was a little bit confused because I did not realize which macro you meant - but another look at my code and reading your posts again made it clear ;)

CGTalk Moderation
02-27-2009, 02:37 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.