[Laszlo-user] relative positioning - multiple class instances

Benjamin Shine ben at laszlosystems.com
Tue Apr 4 18:51:06 EDT 2006


Have you considered writing a custom layout? They're designed to  
position views relative to each other, so I think it would accomplish  
your goals.

-ben

On Apr 4, 2006, at 3:35 PM, graphis1 at mac.com wrote:

>
> I am creating a custom set of "form helper" classes that make form
> creation easier. The biggest problem I'm having at the moment is the
> positioning of elements relative to one another.
>
> Normally I would do this by referencing
> parent.nameofpreviouselement.y" but this relies on each element
> having a unique name, and so breaks when I have multiple instances of
> the class on the canvas. What's the best way of achieving relative
> positioning across multiple instances?
>
> Is it possible to give elements a unique name oninit so they don't
> conflict, or is there a better way? (I could also do with giving the
> edittext box a unique name so that it can be referenced later on by
> the submit method, but as far as I'm aware the name attribute is
> readonly and not scriptable.)
>
> Simplified example:
>
> // editext should be positioned to the right of the static text
> <text name = "aUniqueName" width = "80" y = "20">Example: </text>
> <edittext y = "${parent.aUniqueName.y}" x = "$
> {parent.aUniqueName.width + 10 }" name = "anotherUniqueName" />
>
> Thanks in advance for any thoughts on this.
>
>
> _______________________________________________
> Laszlo-user mailing list
> Laszlo-user at openlaszlo.org
> http://www.openlaszlo.org/mailman/listinfo/laszlo-user



More information about the Laszlo-user mailing list