1. Win32Lib: MouseTrap Bug

-- Derek, to see bug in action:
-- 1. run the code below
-- 2. use mousewheel over the EditText box
--    you'll note max of 30, min of 1
-- 3. click the checkbox
-- 4. now try to scroll the EditText again
--    you'll note it will never work again.

-- lemme know what you find out! please! :)

--  code generated by Win32Lib IDE v0.18.14

-- this entire message can be cut, paste, and run, as is.
-- well, might require some editing for linewrapping :/
 
include Win32Lib.ew
without warning

--------------------------------------------------------------------------------
--  Window Window1
constant Window1 = createEx( Window, "Window1", 0, Default, Default, 159, 168,
0, 0 )
constant CheckBox2 = createEx( CheckBox, "CheckBox2", Window1, 8, 8, 88, 20, 0,
0 )
constant EditText3 = createEx( EditText, "1", Window1, 8, 28, 68, 24, 0, 0 )
---------------------------------------------------------
--------------------------------------------------------------------------------
constant txtboxTrap = createMouseTrap( Window1, EditText3 )
filterMouseTrap( Window1, txtboxTrap, { WheelMove } )

procedure EditText3_onMouse (integer self, integer event, sequence
params)--params is ()
	VOID = getNumber( EditText3 )
	if params[1] = WheelMove then
		if params[4] > 0 then
			if VOID < 30 then
				setText(EditText3, sprintf("%d",{VOID+1}))
			end if
		elsif params[4] < 0 then
			if VOID > 1 then
				setText(EditText3, sprintf("%d",{VOID-1}))
			end if
		end if
	end if
end procedure
setHandler( txtboxTrap, w32HMouseTrap, routine_id("EditText3_onMouse"))

WinMain( Window1,Normal )

--=ck
--"Programming in a state of EUPHORIA."

new topic     » topic index » view message » categorize

2. Re: Win32Lib: MouseTrap Bug

cklester wrote:
> 
> -- Derek, to see bug in action:
> -- 1. run the code below
> -- 2. use mousewheel over the EditText box
> --    you'll note max of 30, min of 1
> -- 3. click the checkbox
> -- 4. now try to scroll the EditText again
> --    you'll note it will never work again.
> 
> -- lemme know what you find out! please! :)

[code snipped]

I works just as I would expect it to. You do realize that the MouseTrap
is a section of the window that responds to mouse events. So if you don't
have the mouse over the the section you defined (EditText3), then you
won't get events happening.

-- 
Derek Parnell
Melbourne, Australia

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

3. Re: Win32Lib: MouseTrap Bug

cklester wrote:
> 
> -- Derek, to see bug in action:

Oops. I'm testing with .60.2 and I've patched that version. In the
fDoMouse() routine, delete the lines ...

      -- I must return this code to stop the message being
      -- propagated up the control hiearchy.
      lRC = {kMainMsg}


-- 
Derek Parnell
Melbourne, Australia

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

4. Re: Win32Lib: MouseTrap Bug

Derek Parnell wrote:
> 
> cklester wrote:
> > 
> > -- Derek, to see bug in action:
> 
> Oops. I'm testing with .60.2 and I've patched that version. In the
> fDoMouse() routine, delete the lines ...
> 
>       -- I must return this code to stop the message being
>       -- propagated up the control hiearchy.
>       lRC = {kMainMsg}

Thank you.

-=ck
"Programming in a state of EUPHORIA."

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

Search



Quick Links

User menu

Not signed in.

Misc Menu