1. MouseTrap Crash

Derek, in case this will be helpful... I'm clicking on a mousetrap I've
set and getting this error...

c:\euphoria\include\win32lib\Win32Lib.ew:15331 in function hitMouseTrap() 
true/false condition must be an ATOM 
    pWindow = 27
    pEvent = 513
    pX = 61'='
    pY = 63'?'
    lMouseTraps = {}
    lR = {
           0,
           {10,10},
           {100'd',10},
           {100'd',100'd'},
           {10,100'd'},
           1,
           0,
           {513}
         }
    i = 1

... called from c:\euphoria\include\win32lib\Win32Lib.ew:29682 in function
fDoMouse()
    id = 27
    hWnd = 8389150
    iMsg = 513
    wParam = 1
    lParam = 4128829
    pReturn = -2761
    mouseX = 61'='
    mouseY = 63'?'
    action = <no value>
    doActions = 1
    lWheelPosn = 0
    lRC = {-2761}
    lEventParms = <no value>
    cmp = <no value>
    lRgns = <no value>


-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » topic index » view message » categorize

2. Re: MouseTrap Crash

cklester wrote:
> 
> Derek, in case this will be helpful... I'm clicking on a mousetrap I've
> set and getting this error...

[snip]

I suspect you are calling updateMouseTrap somewhere and the third
parameter to that is not correct. According to the docs, that parameter
can only be one of two things: An integer (a control ID) or a 4-element
sequence in which each element is an integer. This is supposed to 
be a 'rect' specification in the form {left, top, right, bottom}.


-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

3. Re: MouseTrap Crash

Derek Parnell wrote:
> 
> cklester wrote:
> > 
> > Derek, in case this will be helpful... I'm clicking on a mousetrap I've
> > set and getting this error...
> 
> [snip]
> 
> I suspect you are calling updateMouseTrap somewhere and the third
> parameter to that is not correct.

That was a good clue. Actually, it was when I created the mouseTrap,
I was passing a sequence of four sequences (points)... But that's
fixed and it works.

Now, when I click on the mouseTrap area, wouldn't returnValue(-1)
prevent the click from going through to the underlying controls? It
doesn't seem to be stopping the click. I get a click response for
the mousetrap, but the underlying window also receives the click
although I've used returnValue(-1) in the mousetrap click code.

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

4. Re: MouseTrap Crash

cklester wrote:
> 
> Derek Parnell wrote:
> > 
> > cklester wrote:
> > > 
> > > Derek, in case this will be helpful... I'm clicking on a mousetrap I've
> > > set and getting this error...
> > 
> > [snip]
> > 
> > I suspect you are calling updateMouseTrap somewhere and the third
> > parameter to that is not correct.
> 
> That was a good clue. Actually, it was when I created the mouseTrap,
> I was passing a sequence of four sequences (points)... But that's
> fixed and it works.

Great!
 
> Now, when I click on the mouseTrap area, wouldn't returnValue(-1)
> prevent the click from going through to the underlying controls? It
> doesn't seem to be stopping the click. I get a click response for
> the mousetrap, but the underlying window also receives the click
> although I've used returnValue(-1) in the mousetrap click code.

Well it has never been documented that that would be the behaviour of
a mousetrap event handler. But if that is a need you have, I can see
what I can do.

-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

5. Re: MouseTrap Crash

Derek Parnell wrote:
> > Now, when I click on the mouseTrap area, wouldn't returnValue(-1)
> > prevent the click from going through to the underlying controls? It
> > doesn't seem to be stopping the click. I get a click response for
> > the mousetrap, but the underlying window also receives the click
> > although I've used returnValue(-1) in the mousetrap click code.
> 
> Well it has never been documented that that would be the behaviour of
> a mousetrap event handler. But if that is a need you have, I can see
> what I can do.

Okay, I assumed it would behave as any other control... Let me tell you
what I'm doing and maybe you can offer a better way.

I'm displaying a bitmap on a child window ('cuz I need to receive
events for that bitmap). I can then place another graphic on top of
that bitmap. I want to be able to click and move the graphic around.
I've put a mousetrap on top of that graphic and it receives the
click event and I will no doubt be able to move it around. But I
don't want the underlying controls/window to receive the click.

What do you think?

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu