Skip to main content
1-Visitor
July 5, 2012
Question

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

  • July 5, 2012
  • 5 replies
  • 2944 views
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

    naglists1-VisitorAuthor
    1-Visitor
    July 6, 2012
    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! 😉


    naglists1-VisitorAuthor
    1-Visitor
    July 6, 2012
    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.

    18-Opal
    July 6, 2012
    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


    naglists1-VisitorAuthor
    1-Visitor
    July 10, 2012
    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.

    naglists1-VisitorAuthor
    1-Visitor
    July 11, 2012
    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.)