Script dialog: Set Tab's Name on runtime

Is it possible to rename tabs in a tab control on runtime? The names used are those of each individual dialog (the title property), but when you create a dialog of this type, only the template where the tab control is located is used. So to change each name, you would have to create an object for each individual dialog, and change the name there...or is there a simpler way?

Don't you need to create the other dialogs that are inside the tab control as well (as part of the same button/script), and double-click the tab control's Tabs property to add them to it in the dialog editor? The names should come from those other dialogs, as I remember things at least.

Yes, I meant to create the dialog object within the script. It is only necessary to create one object and use the template of the dialog where the tabs are, not the others. But then there is no way to change the titles of the other dialogs (and thus the tab names themselves).

Update: Creating a dialog object for each individual dialog, then changing their title doesn't change the tab's name.

I can't see a way to make the tab names dynamic, if that's what you need. They'll always be the same as the dialog titles in the resources.

Are you aiming to do something like show an error count in the tab title, or similar information that changes at runtime?

I want to make a true multilanguage script dialog (like this other I did), but those tabs are getting in the way :smiley:

You should be able to use Language Overlays for that, doing everything in the dialog editor: Language Overlays [Directory Opus Manual]

But there's a bug in it at the moment ( Dialog editor destroys language resource strings ), which can result in one language being copied over the other. So you might want to wait until the next beta, which should fix that.

Thanks. Actually I'm using LanguageStr() to cherry picking strings from DOpus itself, but for tab names I guess Language Overlays is the only option.

This (renaming tabs/dialog titles) will be possible in the next beta.

2 Likes

Many thanks for this! I can confirm is working as expected in v.0.51

2 Likes