| 1597 | } |
| 1598 | |
| 1599 | S32 GuiTextEditCtrl::findNextWord() |
| 1600 | { |
| 1601 | // First the first word to the right of the current cursor position |
| 1602 | // and return the positional index of its starting character. |
| 1603 | |
| 1604 | // We define the first character of a word as any non-whitespace |
| 1605 | // character which has a non-alpha-numeric character to its immediate left. |
| 1606 | |
| 1607 | const UTF8* text = mTextBuffer.getPtr8(); |
| 1608 | |
| 1609 | for ( S32 i = mCursorPos + 1; i < mTextBuffer.length(); i++ ) |
| 1610 | { |
| 1611 | if ( !dIsspace( text[i] ) ) |
| 1612 | { |
| 1613 | if ( !dIsalnum( text[i-1] ) ) |
| 1614 | { |
| 1615 | return i; |
| 1616 | } |
| 1617 | } |
| 1618 | } |
| 1619 | |
| 1620 | return mTextBuffer.length(); |
| 1621 | } |
| 1622 | |
| 1623 | DefineEngineMethod( GuiTextEditCtrl, getText, const char*, (),, |
| 1624 | "@brief Acquires the current text displayed in this control.\n\n" |