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.

DarkBASIC Professional Discussion / Right click menu not working?

Author
Message
Mugen Wizardry
User Banned
Posted: 1st Jan 2011 18:48 Edited at: 1st Jan 2011 18:58
Hi all. For some reason, my right click menu won't work correctly.

When you right click, it brings up the menu, but it won't highlight if you put your mouse over it.

Also, when clicking OUTSIDE of the menu, I would like it to hide the menu.

BUT when you click on and / or inside the menu and / or select 1 of the menu options, i want it to 1st close then activate that menu option.

Here's the code:



CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 1st Jan 2011 19:17
Well this bit:

mx1=mousex()
my1=mousey()


Needs to be in the loop to update the variables. I believe from there, you should be able to correct the rest of the issues.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Mugen Wizardry
User Banned
Posted: 1st Jan 2011 19:20
ok that fixed EVERYTHING BUT being able to select a command

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Mugen Wizardry
User Banned
Posted: 1st Jan 2011 19:27
I fixed it! Thanks guys!

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 1st Jan 2011 19:31
Quote: "Thanks guys!"


Google Ad is the other guy right?

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Jan 2011 23:16
I guess he was thanking everyone who'd posted on the thread.
Mugen Wizardry
User Banned
Posted: 1st Jan 2011 23:32
Yes I was

But now I have a small problem

For some reason, when i put my mouse over the selected menu in the right click, it doesn't highlight to red.

I created a function to make the menus so there was no problems with the coordinates for each menu item



CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 1st Jan 2011 23:44 Edited at: 1st Jan 2011 23:46
A ink colour is not set after the check in the function. So:



A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Mugen Wizardry
User Banned
Posted: 1st Jan 2011 23:48
thanks

Now the only problem is, i would like a highlight box to appear behind the text when u mouse over the text



CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Mugen Wizardry
User Banned
Posted: 1st Jan 2011 23:53
also, for some reason, when i use more than one menu, it only shows the last menu. if the 1st menu is Open Level, and the last menu is Save Level, it only shows Save Level.

get_menu(10,10,"Open Level",255,255,255,65,25)
get_menu(10,30,"Save Level",255,255,255,65,25)



CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 2nd Jan 2011 00:10 Edited at: 2nd Jan 2011 00:11
The problem is due to redrawing the window over the previous button. So taking the part where you draw the window out of the function should fix it. Also your highlight box didn't have a distinct colour or correct bounds check for the offsets of the button, so the x#/y# variables were missing. Also, you have a ton of floats for things that don't need to be floats. But here's the updated code:



A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Mugen Wizardry
User Banned
Posted: 2nd Jan 2011 00:17
Cheers. Works like a charm!

Thanks!

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Mugen Wizardry
User Banned
Posted: 4th Jan 2011 20:45 Edited at: 4th Jan 2011 20:50
Hi. For some reason, it's not working again...

I can't get it to check for the right coordinates and allow clicking of the menu dependant on those coordinates.

it also is exploding the menus.

if you don't believe me, compile it and see.

here's the code:



Thank you for the help!

Feel free to use it as a token of my gratitude

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 4th Jan 2011 23:33
To be honest, I think this needs a rewrite to get a actually system going here. At the moment, it's pretty much hardcoded and not that efficient. So maybe you could create a button class, then create a menu using them.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Mugen Wizardry
User Banned
Posted: 5th Jan 2011 00:44
fixed it, thanks though

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!

Login to post a reply

Server time is: 2026-07-17 22:50:45
Your offset time is: 2026-07-17 22:50:45