Get the formattedwidth of super power button

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
terryho
Posts: 126
Joined: Mon Nov 05, 2012 2:53 pm

Get the formattedwidth of super power button

Post by terryho » Sat Nov 26, 2022 5:01 pm

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9762
Joined: Fri Feb 19, 2010 10:17 am

Re: Get the formattedwidth of super power button

Post by richmond62 » 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.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4107
Joined: Sun Jan 07, 2007 9:12 pm

Re: Get the formattedwidth of super power button

Post by bn » Sat Nov 26, 2022 6:06 pm

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

stam
Posts: 2996
Joined: Sun Jun 04, 2006 9:39 pm

Re: Get the formattedwidth of super power button

Post by stam » Sat Nov 26, 2022 6:37 pm

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

prometheus
Posts: 40
Joined: Sun Dec 13, 2015 6:05 pm

Re: Get the formattedwidth of super power button

Post by prometheus » Sat Nov 26, 2022 7:50 pm

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

prometheus
Posts: 40
Joined: Sun Dec 13, 2015 6:05 pm

Re: Get the formattedwidth of super power button

Post by prometheus » Sat Nov 26, 2022 7:52 pm

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

terryho
Posts: 126
Joined: Mon Nov 05, 2012 2:53 pm

Re: Get the formattedwidth of super power button

Post by terryho » 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

prometheus
Posts: 40
Joined: Sun Dec 13, 2015 6:05 pm

Re: Get the formattedwidth of super power button

Post by prometheus » Wed Nov 30, 2022 6:53 pm

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 :)

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9960
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Get the formattedwidth of super power button

Post by FourthWorld » Wed Nov 30, 2022 8:40 pm

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?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

prometheus
Posts: 40
Joined: Sun Dec 13, 2015 6:05 pm

Re: Get the formattedwidth of super power button

Post by prometheus » Wed Nov 30, 2022 10:46 pm

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

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”