Re: Win32Lib: Disable Focusability
- Posted by Derek Parnell <ddparnell at bigpond.com> Aug 04, 2004
- 472 views
Don wrote: > > > > 1> subclass the control and intercept all mouse events unless > > > its over the scroll bar. > > > > Can you explain what it means to subclass a control? Thanks!!! :) > > Sure thing. > > Lets say you create a plain window and have a message loop for it. > In most cases (with Win32Lib) it has a message loop and it doles out > messages to your routines depending on which ones you need. > > Subclassing involves taking over of the normal message loop and replacing > it with one of your own. I could (in effect) have Windows send my routine > *all* messages meant for the window before Win32Lib (or anything else) > can see it and do my own processing first. In the case of the ListView, > we could subclass the control and handle all mouse events ourselves. Any > message we dont process I can pass to its normal handler (Win32Lib). Its > simply a way to customize a controls behaviour with our own routine. D'oh!! I forgot about the 'subclassing' trick. In Win32lib, all you need to do to avoid selecting items in a listview is this ... procedure Event_lv(integer self, integer event, sequence parms) if find(parms[1],{WM_LBUTTONDOWN, WM_RBUTTONDOWN}) then returnValue(-1) end if end procedure setHandler(lv, w32HEvent, routine_id("Event_lv")) -- Derek Parnell Melbourne, Australia