示例#1
0
UInt32 TextInputMenu::SeekPosition(UInt32 fromPos, bool bBackwards, bool bSeekWordStart) const
{
	if ((fromPos <= GetMinPos() && bBackwards) || (fromPos > GetMaxPos() && !bBackwards))
		return fromPos;						//bounds check

	char curChar = bBackwards ? m_inputText[fromPos - 1] : m_inputText[fromPos];
	if (bSeekWordStart || curChar == '<' || curChar == '>')
		return FindWordBoundary(fromPos, bBackwards);

	return fromPos + (bBackwards ? -1 : 1);
}
示例#2
0
Square * Square::GetWordStart(GridDirection dir)
{
    return FindWordBoundary(this, (GridDirection)InvertDirection(dir));
}
示例#3
0
Square * Square::GetWordEnd(GridDirection dir)
{
    return FindWordBoundary(this, dir);
}
示例#4
0
Square *
Square::FindWordBoundary(Square * square, GridDirection dir)
{
    return const_cast<Square *>(FindWordBoundary(const_cast<const Square *>(square), dir));
}