| 1651 | } |
| 1652 | |
| 1653 | S32 GuiTextEditCtrl::findNextWord() |
| 1654 | { |
| 1655 | // First the first word to the right of the current cursor position |
| 1656 | // and return the positional index of its starting character. |
| 1657 | |
| 1658 | // We define the first character of a word as any non-whitespace |
| 1659 | // character which has a non-alpha-numeric character to its immediate left. |
| 1660 | |
| 1661 | const UTF8* text = mTextBuffer.getPtr8(); |
| 1662 | |
| 1663 | for ( S32 i = mCursorPos + 1; i < mTextBuffer.length(); i++ ) |
| 1664 | { |
| 1665 | if ( !dIsspace( text[i] ) ) |
| 1666 | { |
| 1667 | if ( !dIsalnum( text[i-1] ) ) |
| 1668 | { |
| 1669 | return i; |
| 1670 | } |
| 1671 | } |
| 1672 | } |
| 1673 | |
| 1674 | return mTextBuffer.length(); |
| 1675 | } |
| 1676 | |
| 1677 | DefineEngineMethod( GuiTextEditCtrl, getText, const char*, (),, |
| 1678 | "@brief Acquires the current text displayed in this control.\n\n" |