Boost logo

Boost :

From: Mathew Robertson (mathew.robertson_at_[hidden])
Date: 2004-09-21 17:22:26


> I am not looking into embedding any intelligent objects in the 'canvas' to
> begin with, however I am trying to keep that in mind. The component approach
> of ATL/WTL is very interesting from that point of view, wherein you add your
> messaging by multiple derivation, combined with CRTP. This Might be a very
> useful mechanism to make dumb drawing objects intelligent. For example, if I
> had a dumb line, it should be possible to 'attach' a class that can detect
> if that line is being grabbed with the mouse and so on.

Its an interesting idea - except that I personally think that all events should be available to be handled from the 'line', at runtime, so that you can dynamically hook up events. By 'attaching' the 'grab' property to a line, you have constrained the line to never being able to dynamically hook up a different type of event.

The bigest issue that you will have with attaching events to a simple item, such as a line, is that there is a fundamental limit on the number of window handles available in the system - and this limit is quite low under win32. To implement this design, your canvas will have to synthesise events like MouseEnter, MouseLeave, etc

regards,
Mathew Robertson


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk