View Full Version : EXAMPLE: Basic Menu Functionality
Desmond
10-03-2005, 03:11 PM
Hello,
This example illustrates how to perform basic tasks with the menu bar in any AutoPlay Media Studio 6.0 application.
Skills Used: Enable and Disable items, Menu Bar, Functions, On Menu event, Menu ID's, Tables.
AXXESS
10-03-2005, 08:46 PM
Great example, Desmond!
A couple questions:
What syntax should be used for sub-sub menus?
Is there an efficient way to change the state of a given menu item with an OnMenu event and populating the menu bar through the Project>Menu Bar dialog?
Desmond
10-04-2005, 09:38 AM
Thanks!
For sub-sub menu's, just expand the table logic:
-- Initialize sub sub item tables
tMenu[1].SubMenu[1].SubMenu = {}
-- Create sub sub menu
tMenu[1].SubMenu[1].SubMenu[1] = {ID = 1011, Text = "Sub Sub Item 1", Enabled = true, Checked = false};
As for your second question . . . there's no *quick* way that I know of. But the steps would be:
Use Application.GetMenu to retrieve the current menu structure
Loop through the table (either recursiively or not) looking for the ID you want to enable/disable
Enable/Disable it
Use Application.SetMenu to write out the modified table
Hope that helps!
Does anyone else have any different menu-interaction techniques that'd be of interest?
Desmond
10-04-2005, 11:01 AM
Hello,
I've just posted an example function to this forum:
http://www.indigorose.com/forums/showthread.php?t=13244
That should allow you to change the properties of an item you create through the Project > Menu Bar dialog, using just it's ID.
Rhett
11-10-2005, 01:17 PM
I'm a chinese AMS user, and for recent days I'm have been puzzled by the menu item state with the built-in function--"g_OnUpdateMenuEnabled (number CommandID, table ItemInfo)".
Thanks to your guilding example, I think I can handle it smoothly later on, but what the function above is used for?
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.