From: John Torjo (john.lists_at_[hidden])
Date: 2004-08-23 15:28:30
>>I thinks this handles most (if not all) cases.
> Yep, in my mind it should be handled by the highest level event handler
> in the structural tree composite thingo that represents the ui layout.
> That event handler has the option to allow dispatch to the next lower
> level handler.
I don't quite agree with this. It is sometimes useful, but quite seldom.
There are times when you need this - and win32gui will solve it by
having global subclassing (to be implemented around late November ;)).
Anyway, I don't know how familiar you are with the way Windows OS
handles things, but it has a quite nice approach - controls send
notifications to their parent.
The parent can handle them, or as I've said before, let them propagate
to the parent's parent and so on.
Usually it's quite ok for the parent to handle such a notification -
since it is related the dialog UI' logic.
>>In fact, I think it should be quite reversed.
>>If a window cannot handle a command/notification, forward it to its
>>parent and so on - until someone handles it or reaches top.
> I think it should be the other way around, if I understand it. You need
> to be able to over-ride the behaviour of your components by interposing
You usually are talking about dialogs. controls sit on dialogs and
notify it when certain events occur. The dialog can then take
Usually these notifications are meaningless (that is, you usually don't
know what to do with them) if they go up higher the hierarchy.
> another handler. E.g. don't do the normal stock window click event do
> this instead (which may also continue the chain down...). More
> importantly, should be able to disable and enable all contained (child)
> messages. Doing so by category as someone else suggested would be
> nice... e.g. all drag drop, all mouse, etc...
Again, these will be possible with advanced global subclassing.
-- John Torjo Freelancer -- john_at_[hidden] Contributing editor, C/C++ Users Journal -- "Win32 GUI Generics" -- generics & GUI do mix, after all -- http://www.torjo.com/win32gui/ -- v1.3beta released - check out splitter/simple_viewer, a File Explorer/Viewer all in about 200 lines of code! Professional Logging Solution for FREE -- http://www.torjo.com/code/logging.zip (logging - C++) -- http://www.torjo.com/logview/ (viewing/filtering - Win32) -- http://www.torjo.com/logbreak/ (debugging - Win32)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk