property profiles? what and how

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
rinzwind
Posts: 135
Joined: Tue May 01, 2012 10:44 am

property profiles? what and how

Post by rinzwind » Fri Aug 28, 2015 5:52 am

Probably I misunderstand what it's about... but its not working as I think it should work.

I add a button, create a new property profile, change some properties like color. So far so good.

Then I would think I can apply the newly created profile to other controls. But no... it's not listed. Then I thought, oke maybe they inherit profiles from the parent. So I added a property profile to the stack or card. Still nothing.

So what's the intended use of these? The manual makes me think I am right but apparently not.

rinzwind
Posts: 135
Joined: Tue May 01, 2012 10:44 am

Re: property profiles? what and how

Post by rinzwind » Fri Aug 28, 2015 2:28 pm

hmm no one knows? That tells me something ;0

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: property profiles? what and how

Post by Simon » Sat Aug 29, 2015 1:13 am

Hi rinzwind,
Who is the Big parent? Of the whole thing?
Try it there :)

But I'm not sure that's how it is supposed to be used, maybe, it does work for all new objects. I've seen it used for localization of apps.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: property profiles? what and how

Post by Simon » Sat Aug 29, 2015 1:22 am

For just color stuff I'd use the colors & patterns in the inspector of Big Daddy.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: property profiles? what and how

Post by jacque » Sat Aug 29, 2015 4:47 am

Profile settings have to be applied to each object individually. Once they are all set, you can change the current profile and all objects will change their settings at once. Profiles are more like a master switch for sets of pre-applied customizations. If you want all objects to be controlled by the parent object, don't use profiles; instead, set up the parent object and all objects belonging to it will inherit those settings (when applicable.)

For example, if you want all the buttons in a group to have red text, set the textcolor of the group to red. All objects that have a text property within that group will inherit the color.

Profiles are often used for things like language internationalization. You can set the French profile of a label field to the French text, its German profile to the German text, etc. Repeat for every language you want to support in every object that has text. Then when you apply the French profile to the stack, all objects with a French profile will display the French text, and so forth. You can do the same with any property settings. For example, you might want a "blue" theme. You'd set the background color of each object to a shade of blue. You'd set a "purple" theme the same way, setting each objects "purple" profile to an appropriate color. Then you can switch profiles to change the theme of your app all at once from blue to purple.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

rinzwind
Posts: 135
Joined: Tue May 01, 2012 10:44 am

Re: property profiles? what and how

Post by rinzwind » Sat Aug 29, 2015 8:14 am

Thanks for the explanation Jacque. I do see the point in the translation example. But for theming it makes little sense if you still have to apply the color settings to each and every control. One would think that you could create a profile ButtonColorScheme with the custom colors set.. every button has that profile applied. And if you change the profile, every button with that profile will change with it. But that's not how it works I see now. If you make a profile 'Blue' you still would have to change each and every button if you change something in it. Right? That's also the only way the translation example can work (since every text has its own translation). So no sharing of profile information at all. Maybe time for a concept like Template or something?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: property profiles? what and how

Post by dunbarx » Sat Aug 29, 2015 1:36 pm

Are you perhaps thinking of, or wishing for, something along the lines of the templateButton (or template"AnyConttrol")?

This only applies to the creation of new controls, which will come into being with the properties of their template.

But you can roll your own easily, either via groups as Jacque mentioned, or where you can set the properties (here I literally mean "the properties" property) of a "group" of controls referenced by some common theme. Do you see what I mean? If you had ten buttons, and five of them were set apart in some way, perhaps by something common in their names, you can set the properties of all of those at once by setting that single, er, property to "the properties" of some "master" button.

The downside to that is that ALL the properties are set, not just a bunch of the ones you might be interested in. In that case, as I said, you would have to roll your own, setting the properties of that special group under script control. Still simple to do.

Craig Newman

Post Reply