+ case wxT('\n'):
+ if (!line.IsEmpty())
+ {
+ wxStaticText *s = new wxStaticText( this, wxID_ANY, line );
+ box->Add( s );
+ line = wxT("");
+ }
+ else
+ {
+ box->Add( 5, y );
+ }
+ break;
+
+ case wxT('&'):
+ // this is used as accel mnemonic prefix in the wxWidgets
+ // controls but in the static messages created by
+ // CreateTextSizer() (used by wxMessageBox, for example), we
+ // don't want this special meaning, so we need to quote it
+ line += wxT('&');
+
+ // fall through to add it normally too
+
+ default:
+ if (text[pos] == wxT(' '))
+ last_space = pos;
+
+ line += message[pos];
+
+ if (is_pda)
+ {
+ int width = 0;
+ GetTextExtent( line, &width, (int*)NULL, (int*)NULL, (int*)NULL, &font );
+
+ if (width > max_width)
+ {
+ // exception if there was no previous space
+ if (last_space == 0)
+ last_space = pos;
+
+ int diff = pos-last_space;
+ int len = line.Len();
+ line.Remove( len-diff, diff );
+
+ wxStaticText *s = new wxStaticText( this, wxID_ANY, line );
+ box->Add( s );
+
+ pos = last_space;
+ last_space = 0;
+ line = wxT("");
+ }
+ }