Page 1 of 1

Get the formattedwidth of super power button

Posted: Sat Nov 26, 2022 5:01 pm
by terryho
Hi all,

I try to use the following to get the formattedwidth of a widget "super power button"

put the formattedwidth of widget "superpowerbutton1" into aval
answer aval

but the answer is empty.

Does there any method to get the formattedwidth of the widget?

Regards

Terry Ho

Re: Get the formattedwidth of super power button

Posted: Sat Nov 26, 2022 5:21 pm
by richmond62
From my reading of the LC Dictionary I am not sure if
formattedWidth can be used for widgets.

Re: Get the formattedwidth of super power button

Posted: Sat Nov 26, 2022 6:06 pm
by bn
Hi Terry,

if you want to know the width of the powerButton widget then ask for the width.

I do not see anything resembling formattedWith in the dictionary of powerbutton.

Kind regards
Bernd

Re: Get the formattedwidth of super power button

Posted: Sat Nov 26, 2022 6:37 pm
by stam
I think Ralph has included a formattedWidth property with the new version of UniversalButton (which is fairly identical to PowerButton and both may indeed be Ralph's).

Have a look at his GitHub repository: https://github.com/revig/universal-button-widget

Re: Get the formattedwidth of super power button

Posted: Sat Nov 26, 2022 7:50 pm
by prometheus
I think PowerButton is LiveCode's, they might look similar since (I guess) they might have some material guidelines in the design, I have used both, and they are not the same, not even close, so there are no formattedWidth property on the power button, just get its width

Re: Get the formattedwidth of super power button

Posted: Sat Nov 26, 2022 7:52 pm
by prometheus
richmond62 wrote:
Sat Nov 26, 2022 5:21 pm
From my reading of the LC Dictionary I am not sure if
formattedWidth can be used for widgets.
Just if it is implemented by the author

Re: Get the formattedwidth of super power button

Posted: Wed Nov 30, 2022 2:45 pm
by terryho
Hi all,

Just solve it. By create a hide button, put the power button in this hide button and under this hide button to calculate fontsize.

Regards

Terry Ho

Re: Get the formattedwidth of super power button

Posted: Wed Nov 30, 2022 6:53 pm
by prometheus
terryho wrote:
Wed Nov 30, 2022 2:45 pm
Hi all,

Just solve it. By create a hide button, put the power button in this hide button and under this hide button to calculate fontsize.

Regards

Terry Ho
Hey Terry, not sure in what scenario are you doing this, and what exactly you need but why don't you just submit a feature request here: https://quality.livecode.com
I asked for a couple of additions time ago and in the next update of the enhancements pack it was implemented :)

Re: Get the formattedwidth of super power button

Posted: Wed Nov 30, 2022 8:40 pm
by FourthWorld
prometheus wrote:
Wed Nov 30, 2022 6:53 pm
...why don't you just submit a feature request here: https://quality.livecode.com
I asked for a couple of additions time ago and in the next update of the enhancements pack it was implemented :)
I wonder if it will be easier to add that feature to the widget in LCB or to add that and more with a fresh implementation under the resurrected plan to provide widgets as LCS groups?

I haven't yet delved into all the new add-ons. What does this new button widget do that the other five ways to make a button doesn't?

And why so many ways to make one control type? What does that communicate to new users?

Re: Get the formattedwidth of super power button

Posted: Wed Nov 30, 2022 10:46 pm
by prometheus
Richard I think that reduces it to a matter of individual preference, I use that one because it has what I need, without any extra coding I have:

A nice ripple effect
Gradients
Full control of the label and icon positioning
Ability to work as a switch/checkbox
A lot of color customization possibilities

All of that saves me from a lot of extra coding

Kudos