Unexpected behaviour of OnAddConfigPages with a dialog containing a Tab Control

I decided to implement the feature introduced in 13.17 to allow additional custom user defined config tabs to the configuration editor.

This results in unexpected behavior, probably because my configuration dialog also contains tabs.
This screenshot shows my config dialog as it used to be when called from a specific command:

The red square shows its tab control.

I followed the instructions in the 13.17 release notes, and created a new dialog, with a tab control which has one tab page linked to the dialog shown above:

When I enter script config, I get the tabs of the inner tab control of my dialog instead of the main dialog (e.g. first and only tab of the newly created dialog):

Since I remember reading from someone having issues with nested tab controls (outside of this config context), this might be related.
Is there a way to force the tab control to be used in the configuration editor (something like a property to set on the addConfigPagesData object)?
If this is too much of a hassle, forget it, I'll stick with my former usage (custom config called from a dedicated command, or maybe build a custom tab to add to custom config with just a button to call the command launching the full custom config).

OnAddConfigPages needs to be given a dialog containing a tab control with at least one page, and it basically sucks the pages out of the tab control to integrate them in the config dialog. Standalone controls at the top level aren't supported; everything needs to come from within a tab.

My bad, I was too quick in trying to set this up, and used the former template when calling dlg.AddConfigPages.
I might have to rethink the whole thing (or not), since trying quickly to set this up with the new dialog ... I get errors in the current code because referencing controls from the dialog is not working anymore (since they're not in the dialog anymore, but withing a page of the new tab control).

Thanks for your quick answer. I'll report back if I manage to make it work without having to rewrite my whole code :slight_smile: