+ 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, -1, line );
+ box->Add( s );
+
+ pos = last_space;
+ last_space = 0;
+ line = wxT("");
+ }
+ }