Set properties of Text Label of group

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
kolia
Posts: 82
Joined: Thu May 28, 2015 3:53 pm

Set properties of Text Label of group

Post by kolia » Tue Sep 08, 2015 6:17 pm

Hello,

Some controls are grouped. I want to display the label of the group control and set text properties different from that of the controls that are Inside. Is there a way to do that?
Thank you
Nicolas
Nicolas
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1

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

Re: Set properties of Text Label of group

Post by dunbarx » Tue Sep 08, 2015 6:58 pm

Hi.

If you group a number of, for example, buttons, the labels of those buttons will appear on the actual control. The group itself can have a label property, apart from its members, and can be set either from the inspector or under scripts control. It can have its own text properties. The individual controls can have their own text and style properties as well, within the group. Try a test group and see...

Craig Newman

kolia
Posts: 82
Joined: Thu May 28, 2015 3:53 pm

Re: Set properties of Text Label of group

Post by kolia » Tue Sep 08, 2015 7:23 pm

Hi,
Well this is strange. When I set the group control label to bold, for instance, everything Inside goes to bold.
Nicolas
Nicolas
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1

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

Re: Set properties of Text Label of group

Post by FourthWorld » Tue Sep 08, 2015 9:00 pm

Most visual attributes are inherited per the message path. So a control that has no textStyle property set will inherit it from its parent group if it's in a group, and if the group has no textStyle sent it will inherit from the card, then the stack, then the mainstack, then the home stack, then the engine defaults.

To override any attribute at any level, set the property in question to the desired value. In your case, set the textStyle of the buttons within the group to "plain".
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: Set properties of Text Label of group

Post by dunbarx » Tue Sep 08, 2015 10:22 pm

Richard said:
Most visual attributes are inherited per the message path. So a control that has no textStyle property set will inherit it from its parent group
I mentioned this in my first post, but as a new user, you likely did not know that when you drag a control from the tools palette it comes "naked", that is, without explicit text properties (and others as well) pre-set. This is often not noticed until you run into a situation where everything seems insane, like you did. This is because if you do indeed create a new field and start typing, you will get text, and therefore it looks like there must be text properties already applied to that field.

There are not.

If you look at the text pane of a newly created field in the property inspector, you will find everything blank. Try it. At this point you can apply whatever properties you want to, and they would override any properties inherited from any enclosing (parent) object, like a group or a card.

Craig

kolia
Posts: 82
Joined: Thu May 28, 2015 3:53 pm

Re: Set properties of Text Label of group

Post by kolia » Wed Sep 09, 2015 6:01 am

I see it becomes straightforward now. Thanks for the info.
Nicolas
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1

Post Reply