Pascal Dutilleul wrote 15 lines
I believe in Delphi this behavior is driven via ControlStyle. There is some design-time support in TComponent as concerns the behavior of the editor, however, the anchors are drawn be the editor, it seems.
But I think Cliff refers to Anchors property introduced to TControl in Delphi 4, which is (at last) something that was long missing.
But there could certainly be a better solution, which is used for instance in GTK and I suggest we incorporate that. Using Anchors as in D4, you can only tell which borders should be resized, exactly as their parent resized, so you have a set of [akLeft, akRight, akTop, akBottom].
If we incorporated the GTK concept, than there is 4 float numbers representing the ratio by which the controls should resize in respective directions. 0 means no resizing (= ak* missing from the set), 1 means 100% resize (= ak* included in the Anchors set). You can supply an arbitrary number between 0 and 1, so you can, for example, have the control resize by 50% of parent's resize (in respective direction). This is much more flexible than Delphi solution. And we could use integers 0-100 instead, because integer math is faster.
Also, I heard that the most flexible solution is implemented in Java Beans, so if anyone knows about that solution, please shed a light on this.
> > 2. I have to implement the align property in > controls that are supposed to > have them.
We could kick away the Align property altogether, perhaps leaving this property write-only to preserve Delphi compatibility, and moving its purpose (quick alignment of a oontrol) to editor. Just an idea.
Show quoted text 13 lines
No, thay aren't. Basically, every TControl descendant can be a parent. The problem is, whether it knows how to draw its children, therefore, this is signaled in ControlStyle.
Show quoted text 11 lines
Since you can resize every control by hand, every control should have the OnResize event. Even in TButton, there may scenarios where you need OnResize event. I remember being quite irritated when I had to embed a control to TPanel just because that control had no OnResize event.
Michal Bukovjan
____________________________________________________________________ Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.
