I will attach a test script which displays a demo dialog. I added an OnActivateTab function but it doesn't fire when I change tabs whilst the dialog is being displayed.
function OnInit(initData)
{
initData.name = "qnddlg";
initData.vars("name") = initData.name;
initData.desc = "Quick and Dirty dialog testbed";
initData.copyright = "(c) 2018 Aussie";
initData.version = "1.0";
initData.vars("version") = initData.version;
initData.default_enable = true;
var cmd = initData.AddCommand();
cmd.name = initData.name;
cmd.method = "do_main";
cmd.desc = initData.desc;
cmd.label = initData.name;
cmd.template = "parms/m";
initData.config_desc = DOpus.create.map();
initData.config.dbg = true;
initData.config_desc("dbg") = 'Set to TRUE to write trace information to "Other" log.';
}
//-- Global Variables
var d, f, c, fsu;
var src, tgt, dlg;
var msg, btns, title;
var item, str;
var dbg;
function do_main(clickData)
{
dbg = Script.config.dbg;
if (dbg) DOpus.output(Script.vars("name")+" version "+Script.vars("version")+" starting..");
d = clickData;
f = d.func;
c = f.command;
fsu = DOpus.FSUtil;
src = f.sourcetab;
dlg = src.dlg
tgt = f.desttab;
//-- Start test code here...
dlg.window = src;
dlg.template = "demo";
dlg.detach = true;
dlg.create;
var iteration = 0;
var msg_obj, ctl_name;
dlg.show;
do{
msg_obj = dlg.getmsg();
if (msg_obj==false) break; // User clicked X
ctl_name = msg_obj.control;
if (dbg){
str = iteration++;
str+= " : msg_obj.event = " + msg_obj.event;
str+= " : msg_obj.control = " + ctl_name;
DOpus.output(str);
}
}
while (msg_obj);
}
function OnActivateTab(ActivateTabData)
{
if (dbg) DOpus.output("ActivateTabData.oldtab = " + ActivateTabData.oldtab);
if (dbg) DOpus.output("ActivateTabData.newtab = " + ActivateTabData.newtab);
}
==SCRIPT RESOURCES
<resources>
<resource name="demo" type="dialog">
<dialog fontsize="8" height="87" lang="english" standard_buttons="cancel" width="108">
<control height="57" name="group1" title="Demo Radio" type="group" width="77" x="14" y="6" />
<control checked="yes" group="yes" height="10" name="radio1" title="Radio Button 1" type="radio" width="64" x="19" y="22" />
<control height="10" name="radio2" title="Radio Button 2" type="radio" width="64" x="19" y="34" />
<control height="10" name="radio3" title="Radio Button 3" type="radio" width="64" x="19" y="46" />
</dialog>
</resource>
</resources>