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

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.

FYI, you cannot redefine properties in a subclass, and computed properties behave exactly like regular properties in this regard. If you are able to work with computed properties this way, then you are taking advantage of undefined behavior which could change at any time... in fact it has been stated that computed properties are *not* suppose to work this way and would be considered a bug (look it up in the archives).

This is also why you crashed when you tried to set Super.Left... there is only a single Left which is applied to all subclasses of RectControl.

What you are permitted to do is use methods with the same name as the Property. While this appears to be almost exactly what you were doing with computed properties, it is really quite different and the sanctioned method. The problem that I found is that a method shadowing a property will often not work when the property is accessed by the RB framework. I know, I know... that is the whole point... but if you think about it the RB framework is calling RectControl.Left and not mySubClassRectControl.Left, and your method does not exist in the RectControl object.

So the ultimate answer is that there is official sanctioned way for you to do what you are trying to do. All we are left with is to lobby REAL Software to make it work, such as a possible "StateChanged ()" event.

_______________________________________________
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