1. [Win32Lib] 0.57.9 bug? 1 button click, two events?
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Jul 11, 2002
- 392 views
Derek, Is this a bug? In the following stub, each click on the button is supposed to increment a counter by 1 & display it, but I get a display of +2 for each press. Dan -- <code begins> -- code generated by Win32Lib IDE v0.10.5 include Win32Lib.ew without warning ---------------------------------------------------------------------------- ---- -- Window Window1 global constant Window1 = create( Window, "Window1", 0, 50, 50, 200, 200, 0 ) global constant PushButton2 = create( PushButton, "Push Me", Window1, 48, 44, 90, 30, 0 ) global constant CText3 = create( CText, "", Window1, 16, 88, 152, 28, 0 ) ---------------------------------------------------------------------------- ---- integer counter counter = 0 ---------------------------------------------------------------------------- ---- procedure PushButton2_onClick () counter +=1 setText(CText3, sprint(counter)) end procedure onClick[PushButton2] = routine_id("PushButton2_onClick") WinMain( Window1, Normal ) -- <code ends>
2. Re: [Win32Lib] 0.57.9 bug? 1 button click, two events?
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Jul 12, 2002
- 362 views
Derek, Thanks, works fine now. Dan ----- Original Message ----- From: "Derek Parnell" <Derek.Parnell at SYD.RABOBANK.COM> To: "EUforum" <EUforum at topica.com> Subject: RE: [Win32Lib] 0.57.9 bug? 1 button click, two events? > > Dan, > this is because of the "strobe" button change I made for you. The problem is > that 'button' type controls send a special Click message to the app and > other types of controls don't. To account for this, the fDoMouse() routine > simulates a click event for non-buttons. However, the change I did to allow > buttons to trigger mouse events, now also simulates a click on top of the > button's own click. The fix is simple though. > > In the routine fDoMouse() find the lines ... > > if doActions then > VOID = invokeHandler(id, w32HClick, {}) > end if > > and replace them with ... > > > if doActions and (window_family[id] != BUTTON) then > VOID = invokeHandler(id, w32HClick, {}) > end if > > > ----------- > Derek > > > -----Original Message----- > > From: Dan Moyer [mailto:DANIELMOYER at prodigy.net] > > Sent: Friday, 12 July 2002 0:10 > > To: EUforum > > Subject: [Win32Lib] 0.57.9 bug? 1 button click, two events? > > > > > > Derek, > > > > Is this a bug? In the following stub, each click on the > > button is supposed > > to increment a counter by 1 & display it, but I get a display > > of +2 for each > > press. > > > > Dan > > > > > > -- <code begins> > > -- code generated by Win32Lib IDE v0.10.5 > > > > include Win32Lib.ew > > without warning > > > > -------------------------------------------------------------- > > -------------- > > ---- > > -- Window Window1 > > global constant Window1 = create( Window, "Window1", 0, 50, > > 50, 200, 200, > > 0 ) > > global constant PushButton2 = create( PushButton, "Push Me", > > Window1, 48, > > 44, 90, 30, 0 ) > > global constant CText3 = create( CText, "", Window1, 16, 88, > > 152, 28, 0 ) > > -------------------------------------------------------------- > > -------------- > > ---- > > integer counter > > counter = 0 > > -------------------------------------------------------------- > > -------------- > > ---- > > procedure PushButton2_onClick () > > counter +=1 > > setText(CText3, sprint(counter)) > > end procedure > > onClick[PushButton2] = routine_id("PushButton2_onClick") > > > > > > WinMain( Window1, Normal ) > > > > -- <code ends> > > > > > ================================================================== > > > ================================================================== > > > >