Re: Win32lib: clicks and focus problems with mouse vs. keyboard
- Posted by Derek Parnell <ddparnell at bigpond.com> Jun 28, 2003
- 433 views
----- Original Message ----- From: "Pete Lomax" <petelomax at blueyonder.co.uk> To: "EUforum" <EUforum at topica.com> Subject: Win32lib: clicks and focus problems with mouse vs. keyboard > > > Two for the price of one today. > > 1) One the first screen (Noisy Clicks"), selecting the radio buttons > with the mouse is fine, but using Alt A, B, or C causes a click to be > heard. It is the same noise I get from Alt D which I'd expect. Using Windows ME here, and I can't hear any clicks. Sorry, but I don't know how to 'fix'. > 2) The second problem is that if you press the Focus button to get the > second window, then the lookup button, cursor up and down to the > required entry and press Enter, it works fine. If, however, you select > the entry by double clicking on it, the focus is messed up. > This one is a real pain. It appears that the List control grabs focus again after a double click because there is a mouse up event after the double click. With this in mind, I've recoded your example to cater for this... integer dbc dbc = 0 procedure onMouselookup(integer self, integer event, sequence params) if params[1] = LeftDoubleClick then dbc = 1 elsif params[1] = LeftUp and dbc = 1 then setText(focus,"by mouse") setFocus(focus) closeWindow(lookup) dbc = 0 end if end procedure setHandler(list,w32HMouse,routine_id("onMouselookup")) However, it did find a situation which might of caused some bugs elsewhere when a control in a closed window tries to take focus. I've now catered for that situation, but I'm adverse to coding a special case for the List Double-click effect. -- Derek