|
Anchors will be in the next release and we hope to publish a beta release (for lack of a better term) tonight.
I have had back-off on the OnResize event for now - there a bit of a non-kixforms related issue with OnResize event in that Windows goes into a strange MODAL state when a form is resized. So basically from the script standpoint - the event happens AFTER the form has been resized. In my early testing (pre-anchors) I was really disappointed with the "results" ... the form would stretch ok but the any logic embedded in the script would be delayed ... it looked rather odd actually.
With the Anchor property though, everything is handled by Kixforms - in realtime. The way it will work is like this:
$Button.Anchor = integer
Where integer is a bit-wise combination of four values, as follows:
0 None The control is not anchored to any edges of its container.
1 Left The control is anchored to the left edge of its container.
2 Top The control is anchored to the top edge of its container.
4 Right The control is anchored to the right edge of its container.
8 Bottom The control is anchored to the bottom edge of its container.
So lets say you had a TextBox that you want to stretch in ALL directions as the form resizes (like for example, the editable erea implemented as a TextBox in notepad) that would be anchored like this:
$TextBox.Anchor = 1+2+4+8 ; all sides
Now lets say you had a button that you wanted to anchor to the right side of the form, and as the form was made bigger, the button would appear to "stick" to the right side, that would be done like this:
$Button.Anchor = 2+4 ; top + right
Anyways - i dont want to make it sound like anchors are easy to understand and use - in fact, in my experience - to get them to work as expected takes alot of trial and error ... but the "effect" is mind-blowing and well worth the effort.
-Shawn
|