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.

DLL Talk / BlueGUI V2 : GetEvent / EventType() Versus Canvas Gadget

Author
Message
Freddix
AGK Developer
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 20th Feb 2006 20:21 Edited at: 20th Feb 2006 21:57
Hello.

I try to make some sort of painting in a canvas gadget and I encounter a problem.

When I click button, I start painting in the canvas and when I release mouse button, I stop.
The problem is that if I release mouse button during mouse movement, I only get the mouse movement event un EventType() and I can't detect the mouse button release.

How can I fix that problem ?

EDIT : more precision about this problem :
1 / It happen only in a canvas gadget that is in a window detached from DarkBASIC Professional app window
2 / It happen if I follow this : Press mouse button, move mouse with button pressed and release button before stop moving mouse

All we have to decide is what to do with the time that is given to us.
Rob K
Retired Moderator
21
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 23rd Feb 2006 18:20
Quote: "The problem is that if I release mouse button during mouse movement, I only get the mouse movement event un EventType() and I can't detect the mouse button release."


The MOUSE_CLICK event should occur when the mouse button is released (also known as LEFTBUTTON_UP), assuming the mouse is over the canvas.


BlueGUI Windows Plugin
Freddix
AGK Developer
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 23rd Feb 2006 19:17 Edited at: 23rd Feb 2006 21:10
I'm sorry Rob but it doesn't work. If you can came on MSN I'll send you the source code (sorry, I don't want to put it here cos it's for X-Quad Editor)

You'll can see that it does not detect the LEFTBUTTON_UP ...
More to this, there is an error in the BlueGUI includes I have.
You give :
Quote: "
#constant MOUSE_CLICK 0x202
#constant LEFTBUTTON_UP 0x202
#constant RIGHTMOUSE_CLICK 0x205
#constant RIGHTBUTTON_UP 0x205"


And the true values returned by your plugin commands are :

Quote: "
#constant MOUSE_MOVE 0x200
#constant MOUSE_CLICK 0x201
#constant LEFTBUTTON_UP 0x202
#constant RIGHTMOUSE_CLICK 0x204
#constant RIGHTBUTTON_UP 0x205"


(it's what Ig et with a small diag prog I made using your plugin commands.

EDIT : Forget for the problem with mouse up, just found another method and now it work with your commands

All we have to decide is what to do with the time that is given to us.
Rob K
Retired Moderator
21
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 24th Feb 2006 17:52
RIGHTBUTTON_UP and RIGHTMOUSE_CLICK are the same events, so they must have the same values.


BlueGUI Windows Plugin
Freddix
AGK Developer
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 25th Feb 2006 12:59
Rob.k,
on my computer, when I try this :


I get :
512 : move mouse
513 : press left button
514 : release left button
516 : press right button
517 : release right button
I don't get what you give in the includes for button releases

I have also discovered that my problem with mouse button detection happen if frame rate is lower than 60 fps ... it's annoying.
I can send you the source code per mail if needed to show you the exact problem.(but I may prefer MSN )

All we have to decide is what to do with the time that is given to us.
Rob K
Retired Moderator
21
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 25th Feb 2006 14:59
Quote: "I have also discovered that my problem with mouse button detection happen if frame rate is lower than 60 fps ... it's annoying."


Rather than calling getEvent once per loop, process all outstanding events at the top of the loop. This will solve any issues to do with framerate.


BlueGUI Windows Plugin
Freddix
AGK Developer
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 25th Feb 2006 17:52 Edited at: 25th Feb 2006 17:53
Here is my main loop :


I try to read all events availables on each loop.
I generally get counter = 4 at max.

All we have to decide is what to do with the time that is given to us.

Login to post a reply

Server time is: 2024-05-19 04:43:51
Your offset time is: 2024-05-19 04:43:51