From a35af06d0b95f4e4933d490ef91baadf072fdf0b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 27 Feb 2005 21:00:42 +0000 Subject: [PATCH] For Windows you have to insert exactly one newline in a tooltip. All other tooltips for that frame (?) will be word wrapped at that newline's position automatically. --- ChangeLog | 3 +++ src/mmg/mmg.cpp | 13 ++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b2ca8de3..3c08a1be9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2005-02-27 Moritz Bunkus + * mmg: bug fix: Improved the word wrapping of the tooltips on + Windows. + * mmg: bug fix: It was possible to select a file for appending even though no file was added first. diff --git a/src/mmg/mmg.cpp b/src/mmg/mmg.cpp index f77ead550..407c4efa4 100644 --- a/src/mmg/mmg.cpp +++ b/src/mmg/mmg.cpp @@ -501,14 +501,21 @@ format_date_time(time_t date_time) { #if defined(SYS_WINDOWS) wxString format_tooltip(const wxString &s) { + static bool first = true; wxString tooltip(s), nl(wxT("\n")); unsigned int i; - for (i = 30; i < tooltip.length(); ++i) - if (wxT(' ') == tooltip[i]) + if (!first) + return s; + + for (i = 60; i < tooltip.length(); ++i) + if (wxT(' ') == tooltip[i]) { + first = false; return tooltip.Left(i) + nl + tooltip.Right(tooltip.length() - i - 1); - else if (wxT('(') == tooltip[i]) + } else if (wxT('(') == tooltip[i]) { + first = false; return tooltip.Left(i) + nl + tooltip.Right(tooltip.length() - i); + } return tooltip; }