Interface TextAlignable
Description
In BBj 7.0 and higher, a BBjControl implements the TextAlignable interface if the control allows the text to align left, right, or center.
Implementing Classes
BBjButton, BBjCheckBox, BBjEditBox, BBjEditBoxSpinner, BBjInputD, BBjInputDSpinner, BBjInputE, BBjInputESpinner, BBjInputN, BBjInputNSpinner, BBjInputT, BBjInputTSpinner, BBjListBox, BBjListButton, BBjListEdit, BBjMenuButton, BBjRadioButton, BBjStaticText, BBjToolButton
Methods of TextAlignable
Return Value | Method |
---|---|
int | getAlignment() |
void | setAlignment(int align) |
Example
rem ' TextAlignable
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(10,10,200,200,"TextAlignable",$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
button! = window!.addButton(1,25,25,150,25,"Center",$$)
button!.setCallback(button!.ON_BUTTON_PUSH,"align")
text! = window!.addStaticText(101,25,75,150,25,"Center",$4000$)
listedit! = window!.addListEdit(102,25,125,150,150,"ListEdit",$4000$)
listedit!.setFieldHeight(25)
listedit!.setText("Center")
process_events
eoj:
release
align:
switch button!.getAlignment()
case button!.ALIGN_LEFT
button!.setAlignment(button!.ALIGN_CENTER)
button!.setText("Center")
text!.setAlignment(text!.ALIGN_CENTER)
text!.setText("Center")
listedit!.setAlignment(listedit!.ALIGN_CENTER)
listedit!.setText("Center")
break
case button!.ALIGN_CENTER
button!.setAlignment(button!.ALIGN_RIGHT)
button!.setText("Right")
text!.setAlignment(text!.ALIGN_RIGHT)
text!.setText("Right")
listedit!.setAlignment(listedit!.ALIGN_RIGHT)
listedit!.setText("Right")
break
case button!.ALIGN_RIGHT
button!.setAlignment(button!.ALIGN_LEFT)
button!.setText("Left")
text!.setAlignment(text!.ALIGN_LEFT)
text!.setText("Left")
listedit!.setAlignment(listedit!.ALIGN_LEFT)
listedit!.setText("Left")
break
swend
return
See Also
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.