H Bilbo,

try this:

<j:Card>
<j:CardHeader>
<html:H3 text="Jewel Button" className="primary-normal"/>
</j:CardHeader>
<j:CardPrimaryContent>
<j:Button localId="btn" text="Primary" emphasis="{StyledUIBase.PRIMARY}"
style="border-radius: {btn.height/2}px;"/>
<j:HSlider minimum="30" maximum="400" valueChange="btn.height =
event.target.value"/>
</j:CardPrimaryContent>
</j:Card>

the slide will change btn height and the style will "bind" to the height
doing the operation.
We are using the style to override the jewel theme default setup to change
that particular button instance

remember that you need to add data binding (in Royale we "compose" almost
all instead of having it by default like in flex, the PAYG principe is key).

<c:beads>
<js:ContainerDataBinding/>
</c:beads>

Anyway, while you can do things like this in Royale as you use to do in
Flex, I don't recommend it.
Since we are adding code and listeners for something that CSS is capable to
do itself: You can create a CSS class style that uses the css calc()
function and apply via "className" property.

HTH

Carlos

El jue, 21 ene 2021 a las 21:21, Bilbosax (<[email protected]>)
escribió:

> Thanks for the insight Carlos. I have been studying your Tour De Jewel
> app, a
> beautiful piece of demonstration.
>
> So I have a deeper question about CSS.  Let's say I have a Jewel button
> that
> I need to style on the fly and cannot hardwire it into CSS code.  Let's say
> I have a button that I am going to create at runtime that I won't know it's
> dimensions until I know the size of the container it is in, but I want it
> to
> be a "pill" button so I need to style the "border-radius" in CSS to half
> the
> height of the button once the button is created.  I don't see a way to do
> this with Jewel.  I don't see a bead like SimpleCSSStyles for Jewel that
> will allow me to style in Actionscript during execution.
>
> Is there a way to make a rounded corner button in Jewel using Actionscript
> at runtime to change CSS of a component??
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Reply via email to