LoTROInterface

LoTROInterface (https://www.lotrointerface.com/forums/index.php)
-   Lua Programming Help (L) (https://www.lotrointerface.com/forums/forumdisplay.php?f=50)
-   -   Scrollable menus? (https://www.lotrointerface.com/forums/showthread.php?t=1800)

Vinny 05-07-2012 09:15 AM

Scrollable menus?
 
Does anyone have a good example of how to add a scroll bar to a ContextMenu? I've got a menu that is getting way to long and need to add a scroll bar to it.

Garan 05-07-2012 09:31 AM

The Turbine ContextMenu isn't a Control or ScrollableControl, it's just an Object so it doesn't have any of the functionality (like size and position methods) that would normally allow you to add a scrollbar. You'd have to build your own menu class which is a bit of a pain.

Can you instead group some of your functionality into submenus and build a two tier menu where you use one context menu as your main menu and its MenuItems pop up submenus where needed which would also be a context menus (kind of like how the in-game system menu works)? Then you would have the benefits of auto positioning and visibility control without having to build your own menu class.

Vinny 05-07-2012 12:49 PM

Yes, a sub-menu would also work. Is there anything tricky about it?

Garan 05-07-2012 03:37 PM

Nothing tricky about a sub-menu. You don't even have to hide the main menu, context menus automatically replace any other context menu that was previously showing. You just use the Click event of the MenuItem in the main menu to show the sub menu. Bear in mind, most of Turbine's objects have a "MouseClick" event, but for MenuItems it is the "Click" event.

Vinny 05-08-2012 01:34 PM

I found a good example of using sub-menus in Turbine's CombatQuickslots. The sub-menus pop off to the side as you mouse over the selections with no clicking required. It makes it much nicer for browsing multiple subcategories. :)

You'd never guess how to do this from just reading the limited documentation on context menus.

magill 05-08-2012 02:04 PM

Quote:

Originally Posted by Vinny (Post 7894)
Does anyone have a good example of how to add a scroll bar to a ContextMenu? I've got a menu that is getting way to long and need to add a scroll bar to it.

I think the Tonic Bars control panel does that....

Check and let me know if that is what you mean. I have access to the code, but am not a programmer my self.


All times are GMT -5. The time now is 12:10 AM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI