PDA

View Full Version : multi-level user defined menus?



Toadwart
June 21st, 2007, 02:36
The documentation for onMenuSelection and registerMenuItem seems to indicate that we can add multi-level menu items to the radial menu. However, I can't figure out how to add a second level.

This:


registerMenuItem("top","minimized_glow_icon",3);
registerMenuItem("sub1","minimized_glow_icon",1,3);
registerMenuItem("sub2","minimized_glow_icon",2,3);

only creates a single level with "sub2" sitting at position 2 and "top" at position 3 (position 1 is occupied by a system generated item)

and this:


registerMenuItem("top","minimized_glow_icon",3);
registerMenuItem("by sub1","minimized_glow_icon",3,1);
registerMenuItem("sub2","minimized_glow_icon",3,2);

only creates a single level with "sub3" sitting at position 3. Nothing else.


Is there a bug here or am I just not using the correct syntax?

joshuha
June 21st, 2007, 03:14
Try without the commas.


registerMenuItem("top","minimized_glow_icon",3);
registerMenuItem("by sub1","minimized_glow_icon",31);
registerMenuItem("sub2","minimized_glow_icon",32);

Toadwart
June 21st, 2007, 06:46
Try without the commas.


registerMenuItem("top","minimized_glow_icon",3);
registerMenuItem("by sub1","minimized_glow_icon",31);
registerMenuItem("sub2","minimized_glow_icon",32);


Does that work for you? Just causes FG to crash for me.

Dachannien
June 21st, 2007, 07:49
From the looks of it, the second way you did it in your original post seems to match the documentation, but then again, the documentation doesn't always precisely match how things work ;)

One thing you might try is giving the numbers as elements in a single table instead of as separate parameters. It'll probably just crash, but you never know ;)

joshuha
June 21st, 2007, 14:33
Does that work for you? Just causes FG to crash for me.

Sorry I just tested and it didn't. Although I could have sworn I saw it like that somewhere during the beta but I could be just imagining things.

I have tried it with lists and it doesn't work either. So dunno at this point.

joshuha
June 22nd, 2007, 18:17
Keep trying different thing because now I actually want to use this too so any tips on how to do this devs?

Toadwart
June 23rd, 2007, 00:16
Yep,need some help from the devs now. I've tried everything I can think of from tables to tables of tables to strings of comma separated values with no success...:(

Hamish
June 25th, 2007, 21:09
I can't even seem to find out how to edit the radial menu's in the first place. :confused:

joshuha
June 25th, 2007, 21:20
Its registerMenuItem in the windowcontrol https://www.fantasygrounds.com/refdoc/windowcontrol.xcp
and onMenuSelection to execute once one is chosen.

Hamish
June 26th, 2007, 14:36
Thanks again.... I'll need that sooner rather than later I think.
Have you tried different separators for the numbers? From personal experience I know that if you have a function with some arguments, and one of them is actually an array of more arguments, the easiest way to implement it is to use different separators. So I'd try again with characters like : . - _ and so on.....

joshuha
June 26th, 2007, 14:43
Thanks again.... I'll need that sooner rather than later I think.
Have you tried different separators for the numbers? From personal experience I know that if you have a function with some arguments, and one of them is actually an array of more arguments, the easiest way to implement it is to use different separators. So I'd try again with characters like : . - _ and so on.....

I haven't tried that yet but would break convention from the way they have done every other function. The standard they use is if its a variable list of values then it uses a table or list (same thing really). This is true of all of the functions I have seen so far that take multiple parameters.

Hamish
June 29th, 2007, 14:10
I've tried, and you're right, they don't work.
Has this been reported to SW already? Is there any way to report this other than posting here?

Toadwart
June 29th, 2007, 21:10
:cry: Well, I have re-posted this to the House of Healing forum which is the plce for bugs. No response yet though...