bbj40.gif 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, BBjInputD, BBjInputE, BBjInputN, BBjMenuButton, BBjRadioButton, BBjStaticText, BBjToolButton

Methods of TextAlignable

Return Value

Method

int

getAlignment()

void

setAlignment(int p_align)

Example

REM AlignableControl{.setAlignment()|.getAlignment()}
LET myAPI!=BBjAPI()
SYSGUI=UNT
OPEN (SYSGUI) "X0"
LET mySysGui!=myAPI!.getSysGui()
mySysGui!.setContext(0)

myWindow! = mySysGui!.addWindow(10,10,200,200,"Alignment Example")

myButton! = myWindow!.addButton(101,50,100,90,30,"Left Align",$0800$)
myText! = myWindow!.addStaticText(102,50,150,90,30,"Text",$$)
myButton!.setAlignment(myButton!.ALIGN_CENTER)
myText!.setAlignment(myText!.ALIGN_CENTER)


CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())
CALLBACK(ON_BUTTON_PUSH,PUSH_BUTT,mySysGui!.getContext(),myButton!.getID())

PROCESS_EVENTS

APP_CLOSE:
RELEASE
RETURN

PUSH_BUTT:
DECLARE TextAlignable con!
con! = cast(TextAlignable, BBjAPI().getLastEvent().getControl())
if(con!.getAlignment() = con!.ALIGN_LEFT) release
con!.setAlignment(con!.ALIGN_LEFT)
con! = cast(TextAlignable, myWindow!.getControl(102))
con!.setAlignment(con!.ALIGN_LEFT)
RETURN

See Also

BBjAPI

BBjSysGui

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