taskLet me illustrate... - Tasks: task #7018, Enhance message dialogs


You are not allowed to post comments on this tracker with your current authentication level.

task #7018: Enhance message dialogs

Submitted by:  Greg Chicares <chicares>
Submitted on:  Tue 19 Jun 2007 01:16:29 PM UTC  
Should Start On:  Tue 19 Jun 2007 12:00:00 AM UTC Should be Finished on:  Tue 19 Jun 2007 12:00:00 AM UTC
Category:  GUI Priority:  5 - Normal
Status:  Ready For Test Privacy:  Public
Assigned to:  Vadim Zeitlin <zeitlin> Open/Closed:  Open

( Jump to the original submission)

Sat 18 Jul 2009 02:56:08 PM UTC, comment #6:

Thanks for pointing out SetYesNoCancelLabels().
I believe I now understand how to solve 2a and 2b
in the original submission.

Greg Chicares <chicares>
Project Administrator
Sat 18 Jul 2009 12:14:06 PM UTC, comment #5:

P.S. The documentation of [wxMessageDialog::SetYesNoLabels wxMessageDialog::SetYesNoLabels()] incorrectly says that it's only implemented under Mac which is not true any more, I've corrected it but the web page will only update in 24 hours.

Vadim Zeitlin <zeitlin>
Project MemberIn charge of this item.
Sat 18 Jul 2009 12:11:57 PM UTC, comment #4:

I'll retest it in LMI a.s.a.p. but I believe I did test it there and didn't see any problems.

As for the custom icons, I should have explained it better, sorry: the way you do it is not by adding icons but by changing labels of the existing ones using wxMessageDialog::SetOkCancelLabels() (or SetYesNoCancelLabels() if you need 3 buttons). E.g. see the example of a custom log target defined in the dialogs sample:

This remaps "Ok" button to "Copy" and "Cancel" to "Ok" and changes their labels accordingly as well as adds an extended message (which could be used to provide some guidance to the user in LMI case) to all single message log message boxes.

Vadim Zeitlin <zeitlin>
Project MemberIn charge of this item.
Sat 18 Jul 2009 11:59:19 AM UTC, comment #3:

> the exec sample test mentioned below passes now

Yet, as I read comment #1, it always passed.

However, the lmi example in comment #1 still seems to fail
with wx-2.9 RC six as it did with earlier wx versions.

> arbitrary buttons can be added to the message box

Do you mean wxMessageBox()? I looked here:


but didn't see how to add arbitrary buttons.

Or are you referring to one of the wxLog classes?

Greg Chicares <chicares>
Project Administrator
Sat 18 Jul 2009 11:23:03 AM UTC, comment #2:

I've just realized that I forgot to update this ticket even although I had addresses these problems in wx 2.9 branch:

(1) This should work out of the box now, i.e. with nothing special to do. In particular the exec sample test mentioned below passes now.
(2) There is still no such flag nor button by default but arbitrary buttons can be added to the message box now and we can decide to add a "Copy" button to all LMI message dialogs if needed.

I'm marking this "Ready for test" because of (1), please let me know if you'd like me to implement the rest of (2) as well.


Vadim Zeitlin <zeitlin>
Project MemberIn charge of this item.
Tue 19 Jun 2007 02:49:15 PM UTC, comment #1:

Here is evidence of an actual defect on msw.

Symptom: a messagebox is supposed to contain an extremely
long string, but it doesn't appear at all. This fails
silently after eating a few billion machine cycles.

Suspected cause: Perhaps the native ::MessageBox() call
fails and wx does not report that?

Importance: None, really, if we replace wxMessageBox()
with an alternative facility that doesn't use a native
messagebox. Until then, a horrendously-defective xsl file
could conceivably elicit this behavior, but we would strive
not to release such a thing. However, we'd like to get this
fixed, at least so that wx would display some fallback
"messagebox couldn't be displayed" diagnostic, because we
might still use wxMessageBox() in some situations.

To reproduce: Run a compiler command under adverse
conditions as follows.

Use your own valid path to 'g++' in this command:
/MinGW-20050827/bin/g++ -E /lmi/src/lmi/about_dialog.cpp
'-E' would produce lengthy output anyway; the absence of
any '-I' pointing to wx causes error messages as well.

Cut and paste that command into two applications:

(1) 'lmi_wx_shared': "Test | Test system command"
This requires a special command-line argument:
grep durbatul√Ľk *.?pp

(2) 'wx/samples/exec/exec': use Ctrl-O

(2) does not fail, but (1) reproduces the error: by
instrumenting the code, I determined that it attempts to
display 404732 characters in a messagebox.

Greg Chicares <chicares>
Project Administrator
Tue 19 Jun 2007 01:16:29 PM UTC, original submission:

See the thread beginning here:


which describes enhancements or an alternative to
wxMessageBox() to meet the following needs:

(1) Display a really long string, such as might arise from
concatenating the stdout and stderr output of a failing
system command. That's just one use case; the general case
would be a '\n'-delimited string argument, and the goal is
to let the user read all the contents, e.g. by scrolling.

Here is an acceptance test for my low-resolution screen
(if this happens to fit on yours in either dimension,
then stretch it so it doesn't):

std::string s = "0123456789";
s += s;
s += s;
s += s;
s += s;
std::string t = "\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9";
s += t + t + t + t + t;
wxMessageBoxAlternative // A better name can be chosen.

(2) Add a flag such as wxSHOW_COPY_BUTTON that would:

(a) Visually inform the user that such a facility is
available. On msw, Ctrl-C does this, but few people know
that, and I have received screen-print bitmaps in email
that use hundreds of kilobytes just to show me a brief
text diagnostic. This would copy the entire (potentially
lengthy) string to the clipboard, because that's easier
for users than writing it to a file that they'd have to
find and open.

(b) Improve on what Ctrl-C does on msw by filtering out
"---------------------------" lines and button names.

Greg Chicares <chicares>
Project Administrator


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by chicares (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-07-18 zeitlin StatusNone => Ready For Test

    Back to the top

    Powered by Savane 3.3