Interface TextControl::getDragEnabled

 


Description

In BBj 8.0 and higher, this method returns whether the TextControl will allow drag operations.

Syntax

Return Value

Method

boolean

getDragEnabled()

Parameters

None.

Return Value

This method returns whether drag operations are currently enabled (0 = not enabled, 1 = enabled).

Remarks

By default, drag operations are enabled.

Example

rem ' TextControl::getDragEnabled

sysgui = unt
open (sysgui)"X0"

sysgui! = BBjAPI().getSysGui()

bold! = sysgui!.makeFont("",-1,sysgui!.BOLD)

window! = sysgui!.addWindow(200,200,700,400,"TextControl::setDragEnabled",$00010003$)

window!.addStaticText(201,25,25,350,25,"BBjCEdit:").setFont(bold!)
cedit! = window!.addCEdit(101,25,50,350,325,"",$0100$)
cedit!.setLineWrap(1)
dragEnabled = cedit!.getDragEnabled()

window!.addStaticText(202,400,25,275,25,"BBjEditBox:").setFont(bold!)
editbox! = window!.addEditBox(102,400,50,275,30,"")
dragEnabled = editbox!.getDragEnabled()

window!.addStaticText(203,400,100,275,25,"BBjInputE:").setFont(bold!)
inpute! = window!.addInputE(103,400,125,275,30)
dragEnabled = inpute!.getDragEnabled()

window!.addStaticText(204,400,175,275,25,"BBjListEdit:").setFont(bold!)
listedit! = window!.addListEdit(104,400,200,275,100,$$)
dragEnabled = listedit!.getDragEnabled()

dragEnabled! = window!.addCheckBox(301,400,300,150,30,"Drag Enabled",$0004$)
editable! = window!.addCheckBox(302,400,325,150,30,"Editable",$0004$)
enabled! = window!.addCheckBox(303,400,350,150,30,"Enabled",$0004$)

highlight=cedit!.HIGHLIGHT_ALL
cedit!.setHighlightOnFocus(highlight)
editbox!.setHighlightOnFocus(highlight)
inpute!.setHighlightOnFocus(highlight)
listedit!.setHighlightOnFocus(highlight)

gosub InitText
gosub setDragEnabled

CALLBACK(ON_CHECK_ON,setDragEnabled,dragEnabled!.getContextID(),dragEnabled!.getID())
CALLBACK(ON_CHECK_OFF,unsetDragEnabled,dragEnabled!.getContextID(),dragEnabled!.getID())

CALLBACK(ON_CHECK_ON,setEditable,editable!.getContextID(),editable!.getID())
CALLBACK(ON_CHECK_OFF,unsetEditable,editable!.getContextID(),editable!.getID())

CALLBACK(ON_CHECK_ON,setEnabled,enabled!.getContextID(),enabled!.getID())
CALLBACK(ON_CHECK_OFF,unsetEnabled,enabled!.getContextID(),enabled!.getID())

CALLBACK(ON_CLOSE,APP_CLOSE,sysgui!.getContext())

REM Process Events
PROCESS_EVENTS

APP_CLOSE:
RELEASE

setDragEnabled:
  cedit!.setDragEnabled(1)
  editbox!.setDragEnabled(1)
  inpute!.setDragEnabled(1)
  listedit!.setDragEnabled(1)
return

unsetDragEnabled:
  cedit!.setDragEnabled(0)
  editbox!.setDragEnabled(0)
  inpute!.setDragEnabled(0)
  listedit!.setDragEnabled(0)
return

setEditable:
  cedit!.setEditable(1)
  editbox!.setEditable(1)
  inpute!.setEditable(1)
  listedit!.setEditable(1)
return

unsetEditable:
  cedit!.setEditable(0)
  editbox!.setEditable(0)
  inpute!.setEditable(0)
  listedit!.setEditable(0)
return

setEnabled:
  cedit!.setEnabled(1)
  editbox!.setEnabled(1)
  inpute!.setEnabled(1)
  listedit!.setEnabled(1)
return

unsetEnabled:
  cedit!.setEnabled(0)
  editbox!.setEnabled(0)
  inpute!.setEnabled(0)
  listedit!.setEnabled(0)
return

InitText:
  while 1
    dread text$,err=*break
    cedit!.addParagraph(-1,text$)
    listedit!.addItem(text$)
  wend
  listedit!.selectIndex(0)
  restore 0
  dread text$
  editbox!.setText(text$)
  inpute!.setText(text$)
return

data "Alice in Wonderland"
data "Down the Rabbit-Hole"
data "Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, 'and what is the use of a book,' thought Alice 'without pictures or conversation?'"

data "So she was considering in her own mind (as well as she could, for the hot day made her feel very sleepy and stupid), whether the pleasure of making a daisy-chain would be worth the trouble of getting up and picking the daisies, when suddenly a White Rabbit with pink eyes ran close by her."

data "There was nothing so very remarkable in that; nor did Alice think it so very much out of the way to hear the Rabbit say to itself, 'Oh dear! Oh dear! I shall be late!' (when she thought it over afterwards, it occured to her that she ought to have wondered at this, but at the time it all seemed quite natural); but when the Rabbit actually took a watch out of its waistcoat-pocket, and looked at it, and then hurried on, Alice started to her feet, for it flashed across her mind that she had never before seen a rabbit with either a waistcoat-pocket, or a watch to take out of it, and burning with curiosity, she ran across the field after it, and fortunately was just in time to see it pop down a large rabbit-hole under the hedge."

See Also

BBjAPI

BBjSysGui

BBjControl

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