PDA

View Full Version : The new Menu functions?


Jonas DK
09-16-2005, 05:40 PM
I think it cool that you can now very easily add menus to your project...

but in the help section under the "How do I..."

I really miss a bit on these menues.

I can create the menu
I (if I got it right) figured out that you have to call til application.getmenu()
to have the menu indexed into a table.

But I cant find any actions that will let me assign a value to thise indexed numbers

for eksample if I have en menu item called "Files" and under that a submenu item called "exit"

When I create the menu i give the "files" menu the ID 1 and the "exit" ID 2
When indexed into the table the "files" menu get index -1 (to indicate no funktionallety) and the exit then gets indexed as 2

but what then? I can call the index number from the table but how do i asign a "when clicked" action to it?

Or have I completely missed the point and are at this time way off course????


help....

Jonas DK
. o O (I love the new and improved AMS60)

Desmond
09-19-2005, 10:03 AM
Hello,

You have to use the On Menu event in your application to catch the menu id's:
if e_ID == 1 then
-- Menu ID was 1
elseif e_ID == 200 then
-- Menu ID was 200
end

Jonas DK
09-19-2005, 12:41 PM
Hello,

You have to use the On Menu event in your application to catch the menu id's:
if e_ID == 1 then
-- Menu ID was 1
elseif e_ID == 200 then
-- Menu ID was 200
end


And I have to set this on every page??

But then what is the application "on Menu" tab in the project menu then?

Desmond
09-19-2005, 03:46 PM
No, there's a project-wide On Menu event (Project > Actions > On Menu).

Jonas DK
09-19-2005, 03:54 PM
No, there's a project-wide On Menu event (Project > Actions > On Menu).

But then what is the Page On Menu tab for??

Jonas DK

eric_darling
09-20-2005, 01:21 AM
But then what is the Page On Menu tab for??
For doing something specific on a menu event for just that page.

Jonas DK
09-20-2005, 06:13 AM
For doing something specific on a menu event for just that page.


So does this mean that the Page On.menu events overrule the global on.menu events?

yosik
09-20-2005, 08:59 AM
Like any other action which cancels a previous one.

Example:
a=1;
a=2;

Yossi

Brett
09-20-2005, 09:09 AM
So does this mean that the Page On.menu events overrule the global on.menu events?

Actually the Project's "On Menu" gets called first and then the page's "On Menu" gets called. They both get called with the exact same parameters. As mentioned, it is done this way so that you can catch "global" menu commands on the project's "On Menu" event (i.e. "Exit", "Help", or whatever) and catch page-specific ones on each page.