Interface TextAlignable::getAlignment
Description
In BBj 7.0 and higher, getAlignment returns a value indicating the text's horizontal alignment.
Syntax
Return Value |
Method |
int |
getAlignment() |
Parameters
None.
Return Value
ALIGN_LEFT
ALIGN_RIGHT
ALIGN_CENTER
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
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.