1. RE: [Win32Lib] 0.57.9 bug? 1 button click, two events?
- Posted by Brian Broker <bkb at cnw.com> Jul 11, 2002
- 404 views
Increments by 1 on my XP system. Have you modified your copy of the lib? -- Brian Dan Moyer wrote: > 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 Derek Parnell <Derek.Parnell at SYD.RABOBANK.COM> Jul 12, 2002
- 398 views
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01C2292A.00997F20 charset=iso-8859-1 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> > > > > ================================================================== De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================================== The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================================== ------_=_NextPart_000_01C2292A.00997F20 Content-Type: application/ms-tnef