Grouping Labels in IDE

Maybe a silly newbie question that is well documented, but can I group all my labels into a folder or something in the IDE?

My app is a single window affair split into PagePanels and I already have 200+ labels and it’s nowhere near finished. Scrolling though all those labels in the IDE is becoming tiresome and getting worse day by day.

[quote=168467:@Richard Brown]Maybe a silly newbie question that is well documented, but can I group all my labels into a folder or something in the IDE?

My app is a single window affair split into PagePanels and I already have 200+ labels and it’s nowhere near finished. Scrolling though all those labels in the IDE is becoming tiresome and getting worse day by day.[/quote]

Make a label part of a control group.

  • In the inspector, click the gear icon on top
  • In control set, click “None” and switch to “New Control set”

Now your label is a member of a control set. Each time you duplicate it with Command-D (Ctrl-D), it will simply add a member.

Then you can expand the control set in the navigator or fold it.

Each member is accessed by its index. For instance Label(1).

For years I’ve put mine into a control array for exactly that reason.

With the new IDE, it’s a little different: you have to put them all as part of a named control set. You can access that by selecting one of the labels, and on the Inspector palette, clicking the gear icon at the top to access additional attributes. There you’ll see a Control Set menu. You can create a new one and assign the selected Label to it. Then go through and select all of the other labels and add them to the same control set. Eventually they’ll all be grouped into a “folder” that’s the name of the control set.

Obviously it’s easier to do this from the beginning than now, after you’ve already got so many controls created. I have tried scripting the IDE to see if it’s possible to write a script that will do this for you (find all the Label controls and add them to a control set), but if so, that would be useful.

Once the labels are in a control set, they’ll each have a unique number (an index). You can use that to access a specific Label if you need (say to change its caption).

As well as the control set idea, you might want to take a look at ContainerControls, if you aren’t already using them. Good way to break up your UI controls in the Navigator.

[quote=168470:@Marc Zeedar]Obviously it’s easier to do this from the beginning than now, after you’ve already got so many controls created. I have tried scripting the IDE to see if it’s possible to write a script that will do this for you (find all the Label controls and add them to a control set), but if so, that would be useful.

[/quote]

Marc, here is a trick :

  • Select all the labels
  • In the inspector, click the gear icon
  • select “New Control Set” or select the name of a previous control set

Bam ! All labels are part of the same control set :wink:

I’m glad I came across this old thread.

I’m in early development and I’ve realised that I need to start grouping things together. Labels being the first, and some of the graphic elements like rectangles etc. would be nice. Not that many yet, but it seems like a good idea to get it sorted early on.

I tried creating a New Control Set as per Michel’s instructions just above and it didn’t work.

There must be something I’ve done wrong - This is what I’ve tried:

Selected all the labels in the Navigator
Clicked the gear icon in the Inspector
Selected New Control Set

The results I get, is that ALL of the labels have been renamed with the same name, but appended with a unique index.

In this instance, that name was the last label name on the selected list: lblTare. Above the new list of lblTare(indexes) is “Members”, then above that is “lblTare Set”.

Is there something I’ve missed?

I’m using 2016r3.

No, that is the way it is supposed to work. All members have the same name, with an index to differentiate them.

You should have lblTare(0), lblTare(1), lblTare(2) , and so on.

You can change that name by selecting all the member and changing the name in the IDE. But will still all have the same name. If you try to rename a member, it will get out of the control set and become individual again.

Ok, I think I see the light.

So, if I have generic type labels (which most probably are) then all works well - because who really cares what their name is.

Although I’d like to be able to change that set name to “LabelsGeneric” or similar. There are a few labels that I refer to directly for display purposes, which can be retained as they were.

Is that what you’re getting at?

if you planning for multi-language in future, it is better to have individual label control. Do the above only for label that is of no importance.

Thanks Michel, I’ve just tested this and it’s working absolutely perfect!! :slight_smile: It all makes sense now.

The only thing I would add, is that after selecting the gear button, then select the “ID” button to change the set to a more suitable name. It would be nice if when you select “New Control Set” you had the option to name it then.

Yep. Most of the time labels are just decorations. It’s nice that I’ve now Iearned how to group them together and then forget about them. A much more pleasing Navigator is the result. :slight_smile:

Why? Just have a localized constant as the caption.

i don’t use constant for the localised version.
i have a table for keep the various language for labels, buttons, tab panels etc