RE: SS_NOTIFY and mouse clicks
- Posted by Andy Drummond <andy at kestreltele.com> Nov 10, 2004
- 530 views
Derek Parnell wrote: > > > posted by: Derek Parnell <ddparnell at bigpond.com> > > Andy Drummond wrote: > > > > > > Derek Parnell wrote: > > > > > > > > > posted by: Derek Parnell <ddparnell at bigpond.com> > > > > > > Tommy Carlier wrote: > > > > > > > > Derek Parnell wrote: > > > > > What's an "unclick" event? A click event is a combination of Mousedown > > > > > followed by MouseUp, within the double-click period, and within a few > > > > > pixels of each other. > > > > > > > > Why does it have to be within the double-click period? If I press down > > > > the mouse button, I wait a second, and release the button without moving > > > > the mouse, shouldn't that count as a click? > > > > > > Maybe. On things like buttons and menus, things that have a specific > > > Microsoft generated click event, the time delay is not significant. But > > > on > > > things like bitmaps, windows, labels etc... it might be. > > > > > > To me the 'concept' of a click is a short-sharp action (relatively > > > speaking) > > > which is different from a mouse up/down event. THat's why I choose to > > > implement it this way. > > > > > > > Certain people have heavy fingers, and when they press down a mouse > > > > button, > > > > it's physically tough to lift their heavy finger to release the button. > > > > > > > > I think it is important to make your applications accessible, also for > > > > people with heavy fingers. > > > > > > Such people already tend to have set their double-click period to a > > > reasonable length for themselves. > > > > > > However, I can easily set up Win32lib so that the coder has a choice > > > over > > > this aspect of a click event. It'll be in the next version for you. > > > > > > -- > > > Derek Parnell > > > Melbourne, Australia > > > > Ah well, what I ought to have said is that this application is actually > > for a touch-screen monitor where the touch screen output looks like > > mouse-button-down followed a few thinks later by mouse-button-up. > > I looked at the event & params[] fields when the handler was called > > and they were zero and null for all clicks. > > It sounds like a terminology issue. Pushing the mouse button and > releasing the mouse button are not "clicks". A "click" is the > combination > of the two events. It also sounds lke you are using w32HClick event > and expecting that to show you information about the mouse state. That > event was never designed to do that. > > > Hence the problem. > > BTW, I'm using Judith's IDE and just set a text field as "Clickable", > > that's how I got into this problem. I would use Windows buttons > > but setting their background colours on an ad-hoc basis is not nice. > > Besides I can make nice fancy buttons by drawing them myself ;) > > > > So - if the next version of Win32Lib (which is SOOOOOooo useful) gives > > me the ability to select which mouse events I want that would be great. > > So do I hold my breath? Any ideas when it might appear? > > It already has this. Just use the w32HMouse event instead of w32HClick. > This event gives you the mouse state, including which button was used, > whether it was a down/up/double-click/move/wheel, its X/Y position, > plus the state of the Control-Shift-Alt keys at the time. Read the > docs for more detail. > > procedure Mouse_Field(integer self, integer event, sequence parms) > if parms[1] = WM_LBUTTONDOWN then > . . . > elsif parms[1] = WM_LBUTTONUP then > . . . > end if > end procedure > setHandler(TextField, w32HMouse, routine_id("Mouse_Field")) > Derek, You have answered my question - of course, I should have handled the Mouse events not the Click events ... your code is fine. Thank you for that - you may now get back to the real problems! Andy > -- > Derek Parnell > Melbourne, Australia