PDA

View Full Version : Need 2 clicks to close XDialog??


ABC123

Scott Emerick
06-17-2003, 11:17 AM
Hi All,

OK, another stumbling block here.

I have a XDialog with and embedded XDialog. All works fine, however when I click the OK button nothing happens unless I click it a second time, then everything works as planned.

What is causing me to have to click the OK button twice?

IF a_dlg_button = "OK" THEN

end if

Is the first lines after %code%

Thanks in advance.

Scott

AaronBBrown
06-17-2003, 12:17 PM
Is the OK button in the embedded dialog or the parent dialog? It should be in the parent dialog.

Scott Emerick
06-17-2003, 12:30 PM
Arron,

Its in the parent Dialog.

Scott

Peter.Wayne
06-17-2003, 03:13 PM
i think you're going to have to post at least the relevant portion of your script.

Scott Emerick
06-17-2003, 06:07 PM
Here's the code, I replaced the less than signs with greater than signs so the board doesn't eat the code. thank you!

varC_result = ui_dlg_box("Sorry",>>%dlg%

{startup=init}
{region0}
{region1}
{font=arial,10}
{image=$sys_error}{sp=4}{text=55,4:vtext};
I have a licence:{sp=2}(2vhavelic!vhavelic);
{region2};
{embedded=55,5sorry};
{endregion2};
{region};
{endregion};
{endregion0};
{line=1,0};
{justify=center}
>*15=ok_button_label!OK>
{endregion1};
%dlg%, >>%code%
IF a_dlg_button = "OK" THEN

end if
DIM mflag as C
IF a_dlg_button = "init" THEN
a_dlg_button = ""
show_page(vl,2)
mflag = "1"
END IF

IF a_dlg_button = "vhavelic" THEN
a_dlg_button = ""
IF mflag = "1" THEN
page = page + 1
show_page(vl,page)
mflag = "2"
ELSE
a_dlg_button = ""
page = 1
show_page(vl,page)
mflag = "1"
END IF
END IF
%code%)

Peter.Wayne
06-17-2003, 06:24 PM
the conflict appears to be with the asterisk in the OK button. remove the asterisk and you will not have to press the button twice.

Scott Emerick
06-17-2003, 06:27 PM
Thanks Dr.wayne,

That was too simple.

Scott

JerryBrightbill
06-18-2003, 05:30 AM
Scott

I have seen this problem before in xdialog. The asterisk is intended to put focus on the button, but it doesn't always work that way. The result is that you have to put focus on the button first before it "clicks". Try using

{initial_focus}

right before the button in the code. This seems to work reliably all the time.

Jerry