API Reference


Brew Release
Brew MP 1.0.2
See Also
- TextLayout_FindTextRange
- IWidget_GetTextRange
This function is used to get the beginning and end positions of a text widget's text from it's underlying TextLayout object. Given a starting index and a type of range to retrieve, the function will search for positions of the text boundaries surrounding that index. If the client passes in W_TEXT_RANGE_TYPE_WORD for the type, the function will find the start and end word boundaries surrounding the provided index. If the client passes in W_TEXT_RANGE_TYPE_PARAGRAPH, the function will provide the start and end locations of the paragraph boundaries surrounding the specified index.
  • po
    [in] Pointer to the text widget object.
  • nIndex
    [in] Starting index to search from for boundaries in both directions.
  • nTextRangeType
    [in] Type of range you are requesting, either W_TEXT_RANGE_TYPE_WORD, or W_TEXT_RANGE_TYPE_PARAGRAPH
  • pnStartIndex
    [out] Pointer to start position of text range. pnEndIndex [out] Pointer to end position of text range.
   int IWidget_GetTextRange(IWidget* po, int nIndex, int nTextRangeType, int* pnStartIndex, int* pnEndIndex);
   AEE_SUCCESS - If BREW was able to successfully set the mode key
   AEE_EFAILED - If the property was not handled
Side Effect
This function may be useful in implementing text selection on a user double-click or triple-click in a block of text. If the user double-clicked on a word, for example, the program could use this function to get the start and end index of that word in order to set the text selection.
  • Follow