BBjEditBox::getSelection

Description

In BBj 12.00 and higher, this method returns the selected text in a BBjEditBox control.

Syntax

Return Value

Method

BBjVector

getSelection()

Parameters

None.

Return Value

Returns a four-element BBjVector that identifies the currently selected text in the BBjEditBox control. If the vector is Selection!, then Selection!.getItem(0) and Selection!.getItem(1) identify the paragraph and offset of the beginning of the selected text while Selection!.getItem(2) and Selection!.getItem(3) identify the paragraph and offset of the end of the selected text. All values are zero-based. If the start and end points are the same, there is no selection and the location of the caret (insertion point) is reported.

Remarks

This is the same structure returned from BBjCEdit::getSelection, but the BBjEditBox paragraph numbers are always 0.

Example

rem ' BBjEditBox::getSelection

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(100,100,350,125,"select",$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")
text$ = "The quick brown fox jumpsover the lazy dog."
editbox! = window!.addEditBox(101,25,25,300,25,text$,$$)
editbox!.focus()
select! = window!.addToolButton(102,25,75,150,25,"Select",$$)
select!.setCallback(select!.ON_TOOL_BUTTON_PUSH,"select")
process_events

eoj:
release

select:
    print editbox!.getSelection()
    editbox!.select(4,9)
    print editbox!.getSelection()
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.