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 / Context menu with limitless sub menus

Author
Message
Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 30th Jan 2007 03:10 Edited at: 30th Jan 2007 05:01
A really nice context menu is something I've always wanted for my projects either as a feature or just as a nifty tool for calling up functions to test.

There is only one function for adding a menu: Add_Menu(parent$,name$,group$).

Parent$ identifies the parent name$ to create a submenu. The parent "Root" is not a real menu and simply identifies a menu as default (root) menu. The rest should be pretty straight forward.

Using Cloggy's d3d 2d functions allows the menu to support transparency.



Get the latest source here.

You'll need Cloggy's d3dfunc dll to compile.

There is a bug with Cloggy's dll where anti-aliasing destroys 2d shape alignment. I'll be stripping out some of the faster d3dfunc code to repair this in my next update.

http://3dfolio.com

Attachments

Login to view attachments
Alquerian
18
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 30th Jan 2007 23:11
Good to see you got this finished! (well not finished, but posted as a snippet) Can you destroy menu items as well?

Quit planning to make a game and make a game.
Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 31st Jan 2007 06:06
I could make a function for that. For the moment a new menu could be created by emptying the qMenu type array and adding new menus to it.

http://3dfolio.com
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Jan 2007 18:16
Doesn't work. Just shows me a grey cube.

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 1st Feb 2007 00:06
Mistrel,

I made a slight change to your code and the lines display correctly now



This appears to work for me. I do get problems if I use a display resolution that doesn't match my LCD's native resolution, but I would expect that.

Cheers,

Cloggy
Jack LOL
18
Years of Service
User Offline
Joined: 4th Aug 2006
Location: Near the CPU Close to the graphic card
Posted: 1st Feb 2007 16:06
Cool source, and useful



Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 6th Feb 2007 18:33
Quote: "Zotoaster"


Did you try right clicking in the window?

http://3dfolio.com
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 6th Feb 2007 20:52
Wait.. got it working, lol.

Login to post a reply

Server time is: 2024-11-23 00:30:20
Your offset time is: 2024-11-23 00:30:20