API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

ITEXTCTL_GETSELECTION()

Brew Release
Brew MP 1.0.2
See Also
ITextCtl ITEXTCTL_SetSelection ITEXTCTL_SetCursorPos ITEXTCTL_GetCursorPos
Description
Gets the selected text.
Params
pITextCtl
[]:
pointer to the ITextCtl interface object.
Interface
  • ITEXTCTL
Prototype
  •     uint32 ITEXTCTL_GetSelection(ITextCtl * pITextCtl);
    
Return
  • Double word indicating the selection positions.
    The lower word is for selection start.
    The upper word is for selection end.
Side Effect
  • None.
Comments
If there is no selection, the start position will equal the end position where the cursor currently is. The start and end will have a value equal to ITEXTCTL_GetCursorPos(). The selection takes the cursor position into consideration, the selection start value will be less than the selection end when the cursor is at the beginning of the selection. If a key that is handled by the current input mode is handled by the text control a selection will be erased and replaced by the character chosen by that input mode. A call to ITEXTCTL_SetCursorPos() will unselect the selection without removing characters. A call to ITEXTCTL_SetSelection() will change the selection and will not remove the characters of an existing selection. You can use the helper macros to get the selection values: TC_SEL_GET_START(dw) : gets the selection start value. TC_SEL_GET_END(dw) : gets the selection end value.