34 #include <wx/tokenzr.h>
50 const wxString& title,
51 const wxString& message,
83 wxStringTokenizer lines(
string, _T(
"\n"), wxTOKEN_RET_EMPTY);
85 while (lines.HasMoreTokens()) {
87 wxString line = lines.GetNextToken();
88 wxStringTokenizer words(line, _T(
" \t"), wxTOKEN_RET_DELIMS);
91 while (words.HasMoreTokens()) {
93 wxString word = words.GetNextToken();
94 if (length + word.length() < lineWidth) {
96 wrappedLine.Append(word);
97 length = length + word.length();
98 }
else if (word.length() < lineWidth) {
101 wrappedLine.Append(_(
" \n"));
102 wrappedLine.Append(word);
103 length = word.length();
107 for (; i < word.length(); i = i + (lineWidth - 1)) {
108 wrappedLine.Append(_T(
" \n"));
109 wrappedLine.Append(word.Mid(i, lineWidth - 1));
110 length = word.length() - i;
114 wrappedLine.Append(_T(
"\n"));
115 wrapped.Append(wrappedLine);
136 wxStringTokenizer lines(
137 string, _T(
"\n"), wxTOKEN_RET_EMPTY|wxTOKEN_RET_DELIMS);
139 while (lineCount < maxLines && lines.HasMoreTokens()) {
142 truncated.Append(lines.GetNextToken());
145 if (!lines.HasMoreTokens()) {
151 while (lines.HasMoreTokens()) {
153 lines.GetNextToken();
157 truncated.Append(_T(
"\n [ "));
159 truncated.Append(_T(
" lines suppressed.]"));