cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

change in 6.0 \t behavior in response() display text?

naglists
1-Visitor

change in 6.0 \t behavior in response() display text?

Has anyone noticed a change to the behavior of \t within a response()
dialog in 6.0?

In Editor 5.3 m110 the following:

local status = response("I
do:\n\tAAAA\n\tBBBB\n\tCCCC\n\nProceed?\n\n","&Yes","&No");

Produced a prompt that looked like:
5 REPLIES 5

Doh! I am right and I am wrong.

The problem/change exists as described however, removing the &s does solve
the problem. Ok, never mind. Please consider this "just" a change report.
Thanks for listening! 😉


And, now I'm back.

When your options are Yes and No you are fine. (Ok/Cancel substitutions for
one option may also work.) But if you have:

Yes No Cancel

You must use the &s in order to get the accelerators and if you do, \t is
mis-displayed as a square.

Hi Paul--



s/\t/ /g



(For those who don't read regex, that means "replace the tab
metacharacters with a series of spaces, and Bob's your uncle.")



FWIW, there seems to be a significant difference between how response()
renders the message window if you include custom buttons, vs. if you
just use the defaults. Here it is with the defaults:
response("Hmmm\n\tDoes this work?\n\tLet's see")







...and here it is with custom buttons: response("Hmmm\n\tDoes this
work?\n\tLet's see","&Yes","&No","&Maybe")







If I use the hack I described above, I can get this: response("Hmmm\n
Does this work?\n Let's see","Yes","No","Maybe")







This is all based on Arbortext 6.0 M040 (64-bit) running on Windows 7.



(Apologies if you can't see the images in this message. You can
experiment with the response() commands above to see the difference for
yourself if you're running 6.0.)



--Clay





Clay Helberg

Senior Consultant

TerraXML


PTC states that using "standard" response pairs (there are two [Yes] [No]
and [OK] [Cancel]) allows Editor to use MFC message box dialog. Any other
set of responses (or "forcing" accelerators by using [&Yes]) will cause
Editor to generate a XUI dialog. To have the control you want in this
dialog, you must create and manage it yourself.

But there was no explanation of why or acknowledgment that it had changed
between 5.3 m110 and 6.0 m010. I definitely had response()s that worked
(with respect to formatting the \t as desired) before that I now must "fix"
by changing the buttons, removing the "forced" accelerator, or performing
some of the regex magic Clay suggested.

The XUI dialog behavior change, that &Yes &No force a XUI dialog rather
than an MFC dialog, was released in 5.4 F000. They believe the change in
the \t behavior is a result of a change in MFC. (Not 100% sure how that
would work unless 5.3 m110 and 6.0 m010 would call different MFC classes on
the same WinXP laptop ... but whatever, enough for me to move on.)

Announcements

Top Tags