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 / [DBP] Menu system

Author
Message
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 27th Jul 2007 22:59
I've made a few menu systems before (when I say menu systems, I mean drop-down menus, like Windows), but they all could only have a menu per clicky-thing (you know what I mean). With this one you can have as many branches as you like.

Here is a screeny for y'all:


I will not release the source code uite yet, because there are still some things to be fixed, and features to be added.

One important feature (which is what lead me to make it in the first place) is menu loading. I tried making something with BlueGUI to load menus, but the way you made them made it too difficult. My method is alot easier to handle.

Here is what a menu file might look like:


But, you can ofcourse just make them using the functions. BlueGUI I believe makes you create submenus everytime you wanna branch something, but with mine you dont. For example, here is what a simple File menu might look like:


Where the first parameter is the parent (what it will branch from) - use 0 for it to be one of the top ones (w/e). The second being the caption, or, what text it will have.

It returns a handle to that item, and you will be able to check if you click it, i.e. "if MenuClick() = newproj", or use it to branch a submenu from.

I will try and release the source code by today or tomorrow, I'll see how things go.



"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
draknir_
18
Years of Service
User Offline
Joined: 19th Oct 2006
Location: Netherlands
Posted: 28th Jul 2007 16:39
cool, looks really easy to use is there a degree of customizability to it? like the menu colors? also it would be neat to allow textures/sprites for the menus if possible
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Jul 2007 01:41 Edited at: 29th Jul 2007 01:42
Well I've been trying to make a more complete GUI system, and it uses a set of system colours which can be changed. As for using images, I might think about that

Here is a screenshot of it's capabilities so far:


[edit]

The gadgets it uses incase you're wondering are:
The menu
A big panel
A button inside the panel
A word-wrapped label inside the panel

In my last GUIs I never used the idea of gadgets and parents and children. This has been a little more challenging to get stable, but it seems to work pretty well

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 29th Jul 2007 03:22
Looks like it's really coming along I really like the naming system when declaring new menu's. It's really easy to keep track of, hehe. Good luck with this project!

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Jul 2007 05:36
Thanks Nerd. The new almost-fully-working treeviews have the exact same system, except this time you have to number which gadget you use.

Screenie of treeviews:




"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Xsnip3rX
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: Washington State
Posted: 30th Jul 2007 02:23
why are you never on msn anymore toasty?

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 30th Jul 2007 02:46
I can tell you that you definatelly wont see me for the next two weeks. In a few hours I'm flying off to Corfu to stay with my dad, and he doesn't have the internet, so, before I say my bye-byes, here is a new screenshot. This shows off how the Treeviews look a little cooler, they only stay within their boxes, the imagelists with icons, and scrollbars.

(Imageshack is being a bit slow for me, so the image is attached)

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers

Attachments

Login to view attachments
Xsnip3rX
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: Washington State
Posted: 31st Jul 2007 06:00
very nice.

wickedly kick it
18
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 11th Aug 2007 21:07
this is NICE! i might use it to make a crash test sim (your idea anyways)

jeffhuys
18
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 16th Aug 2007 11:55
WOW! Do you have the blue things from BlueGUI? Anyways, SAWEET!

Legend of The Beast WIP...
You're the 'th to view this signature!
Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 23rd Aug 2007 12:36
This is looking great, its sounds like I'm do the same method your doing for my level editor. Keep up the good work

Login to post a reply

Server time is: 2024-11-22 18:29:16
Your offset time is: 2024-11-22 18:29:16