int EditField::Insert(int pos, const WString& itext) { if(IsReadOnly()) return 0; WString ins; const wchar *s = itext; for(;;) { wchar chr = *s++; if(chr == '\t') ins.Cat(WString(' ', 4)); else if(chr >= ' ') { chr = (*filter)(chr); if(chr) { chr = convert->Filter(chr); if(chr && (charset == CHARSET_UNICODE || FromUnicode(chr, charset, 0))) ins.Cat(chr); } } else break; } if(ins.GetCount() + text.GetCount() > maxlen) { BeepExclamation(); return 0; } text.Insert(pos, ins); Update(); return ins.GetLength(); }
Report message to a moderator