Buttonbar

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
HenryDi
Posts: 5
Joined: Sat Oct 24, 2020 4:39 pm

Buttonbar

Post by HenryDi » Sat Oct 24, 2020 4:54 pm

Hello LiveCoder,

I try to implement the new widget buttonbar. I ask me, if its possible to use own SVG Files or graphics for the button bar. Have someone an idea todo that. i didn´t find anything in the API documentation.

Thanks for helping me.

henry

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9387
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Buttonbar

Post by richmond62 » Sat Oct 24, 2020 6:21 pm

Do you mean by "new widget buttonbar" the Header bar or the Navigation bar, or something else?
-
Screenshot 2020-10-24 at 20.06.41.png
-
https://livecode.com/livecode-widgets-t ... 0App%20Bar.

https://livecode.com/livecode-widgets-t ... ation-bar/

Neither of which indicate a way in which to change the SVG icons.

[Which, by-the-way, is one of the reasons I am anti-widget: I'd far rather "roll my own" so I have complete control and choice.]

Devin Asay offers this: http://livecodeshare.runrev.com/stack/8 ... con-Picker

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9387
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Buttonbar

Post by richmond62 » Sat Oct 24, 2020 6:44 pm

I'd always go for something home-grown:
-
Screenshot 2020-10-24 at 21.52.07.png
-
Attachments
Nav Bar.livecode.zip
Here's the stack.
(20.96 KiB) Downloaded 155 times

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9663
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Buttonbar

Post by dunbarx » Sun Oct 25, 2020 1:12 am

Hi.

Have you seen this?
https://livecode.com/extensions/button-bar/1-0-1/

Widgets are self-contained controls that are constructed in order to add to the standard LiveCode controls. Can you give an example of what you are trying to do? I will bet that we can find something besides a widget for you.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9387
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Buttonbar

Post by richmond62 » Sun Oct 25, 2020 9:16 am

Well, I, for one, hadn't.
-
Screen Shot 2020-10-25 at 10.14.16 am.png
-
BUT it suffers from the same "nanky-poo" as the other types of widgets of this sort:

1. Cannot use your own icons/SVGs/ what-have-ye.

2. Someone's obsession with monochrome is forced on you.
-
sweater.jpg
sweater.jpg (9.89 KiB) Viewed 5296 times
-
the standard LiveCode controls
AND the "dirty word" there is standard, mainly because
what is one man's standard is another man's headache . . .

I have just sorted through 65 USB cables trying to find the "right" connector for some bit of hardware
that has been 'holidaying' in a cupboard for 20 years . . . if some were to come up to me now and start
talking about "the USB standard" I might very well thump them. :?

------

As I have demonstrated above, it is a comparatively easy bit of work to assemble a collection of standard buttons,
using one's own PNG images as icons, into a group.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4002
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Buttonbar

Post by bn » Sun Oct 25, 2020 9:51 am

You can change the icons of both the Navigation bar and the Header bar using the Properties Inspector by clicking on the icon and selecting another icon from font awesome. Font awesome is the SVG icon font used for the icons.

Kind regards
Bernd

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9387
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Buttonbar

Post by richmond62 » Sun Oct 25, 2020 10:10 am

selecting another icon from font awesome
Indeed you can.

BUT you are confined to those icons, and they are all black.

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 261
Joined: Sat Aug 16, 2008 9:48 am
Location: Stockholm, Sweden
Contact:

Re: Buttonbar

Post by SWEdeAndy » Sun Oct 25, 2020 11:26 am

richmond62 wrote:
Sun Oct 25, 2020 10:10 am
selecting another icon from font awesome
Indeed you can.

BUT you are confined to those icons, and they are all black.
Well, no and no:

LiveCode lesson: How do I add a custom SVG to use in my app?
http://lessons.livecode.com/m/4071/l/10 ... -in-my-app

and
button bar widget.png
button bar widget.png (7.71 KiB) Viewed 5258 times
.

But sure, it does have its limits. I sometimes roll my own too when I want more design freedom.
Andreas Bergendal
Independent app and system developer
WhenInSpace: https://wheninspace.se

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9663
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Buttonbar

Post by dunbarx » Sun Oct 25, 2020 2:33 pm

Up at 50,000 feet, I think that, like dataGrids, widgets attract users because they are the latest and greatest, but are also the most complex and restrictive.

They are.

Some. like the browser widget, are wonderful, compact and ready to use.

But I always roll my own. It usually takes less time that learning the ins and outs of those toys, and, like Richmond always says, you keep control.

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Buttonbar

Post by jacque » Sun Oct 25, 2020 4:23 pm

You can add your own SVGs to the widgets by importing an icon family into the stack. That will allow you to choose your own SVGs for these widgets.

The SVGs must be converted to image drawings, and the icon family must be set in script on each launch. It works well once set up correctly. The advantage is the ability to scale smoothly at any size and resolution, which is particularly valuable on mobile devices.

Search for "icon families" in the sample stacks, I believe there are some tools there that automate the process of creating families in the correct format for importing. I'll try to look up the name of the particular tool I used later today.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Buttonbar

Post by jacque » Sun Oct 25, 2020 7:52 pm

There are three utilities in Sample Stacks for creating SVG icons and icon families:

SVG Icon Family Maker -- Devin Asay
SVG Icon Picker -- Devin Asay
SVG Icon Tool -- Brian Milby

I used SVG Icon Tool to create a family of custom SVG icons. The resulting file needs to be placed in the Copy Files pane of standalone builder so that it is embedded in the app. On preOpenStack or wherever convenient, the script sets the icon family to the name of the imported set using

Code: Select all

setCurrentIconFamily(pFamily)
You can find the SVG Icon Tool and the others here: http://livecodeshare.runrev.com/search/tag/SVG or by clicking the Sample Stacks icon in the LC toolbar and searching there for "icon".

The icon family is global and will appear everywhere unless you set it back to the "IDE" or "fontAwesome" defaults when the stack closes. But when your custom family is the current one, the Property Inspector will show your custom icons and you can select them normally for use in widgets or buttons.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Buttonbar

Post by jacque » Tue Oct 27, 2020 10:27 pm

The resulting file needs to be placed in the Copy Files pane of standalone builder so that it is embedded in the app.
I just looked up how I managed this in my project and the above isn't what I did. Instead, I put the binary file into a custom property of the stack. I'm not sure if including it in Copy Files will work but I do know that is works as a custom property.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”