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.

Newcomers DBPro Corner / Problems with my button function

Author
Message
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 6th Jul 2006 13:50
Hi. There is something wrong with the buttonfunction Im currently using (
). It seems that the program, cant tell the difference between my buttons. As an example, if I press the button that activates the helpfiles, I also activate the button that EXITS the helpfiles. And its extremy annoying. Can anyone see whats wrong, or is the problem in another part of my program?
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 6th Jul 2006 15:12
Seems strange to make the button, and detect the mouse click in a function.

I do this..........



spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 6th Jul 2006 15:44
Is the button that exits the helpfiles in the same place as button to go into helpfiles? My bet is it is. Mouseclick in DBPro is not like mouseclick in other languages where it is activated once, it simply tells you if mouse button is currently pressed.

What you probably need to do is add a loop when button is pressed (just after that ocde that sets detectPress=id), and only exit loop when mouse button is released;

repeat : until mouseclick()=0

Boo!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 6th Jul 2006 17:03
I was thinking the same thing spooky

Science, Mathematics, and Physics do not lie - only people do.
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 6th Jul 2006 22:51 Edited at: 6th Jul 2006 22:56
Quote: "Seems strange to make the button, and detect the mouse click in a function."


Not more strange then I dont want to repeat the code over and over again, and at the same time make so things happen if the cursor is on top of the text, like the text glowing up. But your point is noted.

Quote: "Is the button that exits the helpfiles in the same place as button to go into helpfiles? My bet is it is. Mouseclick in DBPro is not like mouseclick in other languages where it is activated once, it simply tells you if mouse button is currently pressed."


Well, this is something Im aware of. Thats why I put the button that activates the helpfiles at the top of the screen, and the button that returns from it at the bottom. The problem can be seen in another perspective:
. The top button activates the helpfiles, the button one activates a small menu. If the button that activates the menu would be over the ove that activates the helpfiles, the menu is only activated for a tiny part of a second. Thats why the button that activates the menu is bellow the one that activates the helpfiles. But still, if I activates the helpfiles, they exit. If I make so the button that exit does not exit, the helpfiles does not exit. So it might be the rest of code, and not the button function.

EDIT:

Found the problem. It wasnt any real coding error, it was just me doing a sloppy code. The problem was that the code was:
, when the buttonfunction returns a zero when its NOT pressed. But that doesnt explain why the button bellow another becomes "dominant".

Login to post a reply

Server time is: 2024-11-26 16:35:41
Your offset time is: 2024-11-26 16:35:41