Interface TextAlignable::setAlignment
|
Return Value |
Method |
void |
setAlignment(int p_val) |
Variable |
Description |
p_val |
ALIGN_LEFT – left horizontal alignment ALIGN_CENTER – center horizontal alignment ALIGN_RIGHT – right horizontal alignment |
None.
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.
Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.