Hi all,
I created this out of a desire for an easy to build, easy to use, windows-like menu process for my 3D world editor. It seems to work pretty well, even given that it does not do mouse-overs or other such animations. (Not really needed for my purposes anyway.) So I thought some of you would like it as well. With a little work, a few changes and such, anyone should be able to create most any kind of pop-up menu.
Using this code, all menus are saved in data statements, one line to describe the pop-up window followed by X lines of button material. Then another menu follows the previous, etc., until the end of the list is found. Starting any menu is done by its identity number, which may be a positive or negative ineteger. Button click data is returned as both an integer and a string value presently, which allows that you may do a case select on the one you like. (And rem out the other if desired.)
Current limits as written are;
--Almost an unlimited number of menus (as many as you make data for,)
--10 sub-menus of nesting allowed,
--and, 20 button entries per menu or sub-menu.
Notes:
--The menu placement code is incomplete, in that it does not cascade sub-menus to the left when the menus are opened near the screen's right edge.
--This snip is already a part of the CodeBase (minus some additional comments and cosmetic changes here) but I thought I'd include it here for receiving comments.
--Currently done in DBC, but should function in DBPro if anyone will make that test for me.
Happy coding!
S.
Any truly great code should be indisguishable from magic.