Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Easy Pop-Up Menu System

Author
Message
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 18th Jul 2004 10:13 Edited at: 18th Jul 2004 10:20
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.

Login to post a reply

Server time is: 2024-11-23 20:03:43
Your offset time is: 2024-11-23 20:03:43