On Mar 1, 2006, at 12:00 PM, Thom McGrath wrote:

I'm subclassing RectControl (because of the standard mouse events & such) and need to know when it is moved. There doesn't appear to be any Resized or Moved events, so how do I know when it has been moved?

I have tried overriding the various positioning properties, such as Left, with a computed property. This works great when moving programmatically, but they don't get set while to window is resizing with Lock* properties enabled on it. It also crashes the app (unexpect quit) when I try to get or set super.left, which is another major problem.

Can somebody help me find a way?

I do something similar.

All of these actions trigger the Paint() event in a Canvas, or in a ContainerControl. With the ContainerControl you have better control and it includes Moved(), Resizing() and Resized() events (never tried to use Moved() but the other two I have).

But there are issues that I have run into with ContainerControls which make it less than perfect. Such as the quirks of the ContainerControl (it is new after all) since ContainerControl on windows do not behave quite the same as other controls (like you cannot create control arrays) -- but most of these can be worked around as long as you are aware of them. The most significant problem that I have found is that the ContainerControl cannot get notified of a change of Enabled state except in the Paint() event... and if you have code in the Paint() event then it can start a cascade of Paint() events for all of the overlapping controls above and below.

In short, there is no good answer but you might get further along using a Canvas and checking for a new position and/or size in the Paint() event, or by using a ContainerControl.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to