PDA

View Full Version : multi-level user defined menus?



Toadwart
June 24th, 2007, 04:03
<https://www.fantasygrounds.com/forums/showthread.php?t=6608&highlight=radial+menu>


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:

Code:



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:


Code:




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?

Hamish
July 1st, 2007, 21:23
I'm also very interested to know how this is supposed to work....

joshuha
July 3rd, 2007, 13:56
Another bump for this. I really need this because on certain controls I don't have enough space for my menu items because of the default icons that are on there.

Toadwart
July 16th, 2007, 04:02
Bump bump bumpity-bump

I have managed to work around this but would be much better if I could get the heirarchical menus working . . .

joshuha
July 16th, 2007, 05:02
What was the workaround you used? My problem is I have say 5 menu choices I want on a control. When that control is on the top level of my sheet it works all fine and dandy. When part of a windowlist though the default windowlist commands (delete, add new, etc.) all take up too many slots and override mine. Submenus would be the perfect solution but can't figure it out.

Toadwart
July 18th, 2007, 20:54
My problem is sort of the opposite of yours. I wanted to be able to right-click on my inventory windowlist and have a "sort" option that has a submenu to select which column (name, weight, location) to sort by.
My workaround was to add a single "sort" menu to each field in the windowlist entries.
It's actually quite nice in that you can right-click on the weight column to sort by weight, or the name to sort by name, etc. However, when there are a lot of entries in the list it can take several seconds for the inventory tab to activate (the first time you visit it after opening the sheet, after that it's fine - until you close the sheet and re-open it again)

joshuha
July 18th, 2007, 21:07
For your example can't you appy the menu to the stringcontrol you use for the header for those columns and then have it call the sort function within the windowlist?

This would save you on the loading as each field in each column wouldn't have to be registering the menu item.

Toadwart
July 19th, 2007, 04:30
*smacks self up-side the head*
Thanks J. That didn't even occur to me. Probably because it's an FG1 ruleset I'm converting over to FGII and the column headings aren't stringcontrols (yet). Have just left them as part of the frame image.

joshuha
September 7th, 2007, 14:52
As of 2.1 this is working using the following convention.



registerMenuItem("Assign","customdice",3);
registerMenuItem("D4","d4labeled",3,1);

Toadwart
September 8th, 2007, 05:04
Yay :D :D :D