Hi Hugo,

ok you're talking about setting absolute constraints (top, left, right,
bottom) right?
I was thinking of adding to StyledUIBase, but since it is something used
only when positioned in an absolute way, maybe a Bead will be better.

For example "PositionAbsolute" could be the name and have "top", "left",
"right", "bottom" properties?
that should go to Basic since it could be used cross UI sets.

One more thing. I prefer to not add "Bead" to bead's name, since the
implementation indicates already that it is a IBead so we can be less
verbose (I didn't notice that in DataGridSortBead, and will be removing the
Bead now).


El vie., 11 sept. 2020 a las 20:32, Hugo Ferreira (<[email protected]>)
escribió:

> Sure.
> I created this bead right now.
> I was a component property repeated on several components that I will
> convert all in a bead.
> I have other use cases that will convert all in beads and end up with a
> very light and clean component (Royale way) ;)
>
> package pt.solidsoft.framework.components
> {
> import org.apache.royale.core.IBead;
> import org.apache.royale.core.IStrand;
> import org.apache.royale.core.UIBase;
>
> public class RightPositionBead implements IBead
> {
> public var right:int = 0;
>
> public function set strand(value:IStrand):void
> {
> if (right > 0)
> (value as UIBase).style = "right: " + right + "px";
> }
> }
> }
>
> Use case:
> ...
> <g:Group percentWidth="100"
> percentHeight="100">
> <c:Image src="resources/images/LoginBackground.jpg"
> percentHeight="100"/>
> <g:VGroup itemsHorizontalAlign="itemsCenter"
> y="80"
> width="400"
> height="360"
> hasShadow="true"
> borderRadius="5"
> backgroundColor="#5c7bb0">
> <g:beads>
> <c:RightPositionBead right="150"/>
> </g:beads>
> ...
>
>
> Carlos Rovira <[email protected]> escreveu no dia sexta, 11/09/2020
> à(s) 19:04:
>
> > Can you post a snippet of code to understand what you mean?
> >
> > El vie., 11 sept. 2020 a las 20:00, Hugo Ferreira (<
> [email protected]
> > >)
> > escribió:
> >
> > > But if you have a Group and set the right style in a component, then
> this
> > > component is right aligned with a space.
> > > It works.
> > > I have a property for that, so I thought that a bead could make sense.
> > >
> > > Carlos Rovira <[email protected]> escreveu no dia sexta,
> > 11/09/2020
> > > à(s) 18:29:
> > >
> > > > Hi Hugo,
> > > >
> > > > Group does not have that APIs, since they are all positioned
> > absolutely.
> > > > Instead HGroup and VGroup has what you want, since "all items" can be
> > > > aligned left, center, right horizontally and top, center, bottom
> > > > vertically:
> > > >
> > > >  /**
> > > > * Distribute all items horizontally
> > > > * Possible values are:
> > > > * - itemsLeft
> > > > * - itemsCenter
> > > > * - itemsRight
> > > > * - itemsSpaceBetween
> > > > * - itemsSpaceAround
> > > > *
> > > > * @langversion 3.0
> > > > * @playerversion Flash 10.2
> > > > * @playerversion AIR 2.6
> > > > * @productversion Royale 0.9.4
> > > > */
> > > > public function get itemsHorizontalAlign():String
> > > >
> > > > and
> > > >
> > > > /**
> > > > * Distribute all items vertically
> > > > * Possible values are:
> > > > * - itemsSameHeight
> > > > * - itemsCenter
> > > > * - itemsTop
> > > > * - itemsBottom
> > > > *
> > > > * @langversion 3.0
> > > > * @playerversion Flash 10.2
> > > > * @playerversion AIR 2.6
> > > > * @productversion Royale 0.9.4
> > > > */
> > > > public function get itemsVerticalAlign():String
> > > >
> > > > also
> > > >
> > > > /**
> > > > * A boolean flag to activate "itemsExpand" effect selector.
> > > > * Make items resize to the fill all container space
> > > > *
> > > > * @langversion 3.0
> > > > * @playerversion Flash 10.2
> > > > * @playerversion AIR 2.6
> > > > * @productversion Royale 0.9.4
> > > > */
> > > > public function get itemsExpand():Boolean
> > > >
> > > > El vie., 11 sept. 2020 a las 18:28, Hugo Ferreira (<
> > > [email protected]
> > > > >)
> > > > escribió:
> > > >
> > > > > I really don'' know what is the better name for this:
> > > > > RightBead
> > > > > PositionBead with a right property
> > > > >
> > > > > I have components that are inside a Group and I position the
> > > components x
> > > > > pixels from the right, so, they use a right style.
> > > > >
> > > > > This could be a bead that can work on any component.
> > > > > Makes sense what I'm saying ?
> > > > > Or this already exists in some form ?
> > > > >
> > > >
> > > >
> > > > --
> > > > Carlos Rovira
> > > > http://about.me/carlosrovira
> > > >
> > >
> >
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Reply via email to