BBjStaticText::getRightMargin

Description

In BBj 19.20 and higher, this method returns the width of the inside right margin of a static text control.

Syntax

Return Value

Method

int

getRightMargin()

Parameters

None.

Return Value

This method returns the width of the inside right margin of a static text control.

Remarks

None.

Example

rem ' margins

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(25,25,1000,850,info(1,4),$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
text$ = "The quick brown fox jumps over the lazy dog."

height = 40

inpute! = window!.addInputE(100,100,100,300,height,"",255,"",text$)
inpute!.setToolTipText("BBjInputE")
inputeTop! = window!.addInputNSpinner(101,200,50,100,height,$$,"-###0",$$,0,inpute!.getTopMargin())
inputeTop!.setToolTipText("setTopMargin")
inputeTop!.setCallback(inputeTop!.ON_SPIN,"topMargin")
inputeLeft! = window!.addInputNSpinner(102,10,100,80,height,$$,"-###0",$$,0,inpute!.getLeftMargin())
inputeLeft!.setToolTipText("setLeftMargin")
inputeLeft!.setCallback(inputeLeft!.ON_SPIN,"leftMargin")
inputeBottom! = window!.addInputNSpinner(103,200,150,100,height,$$,"-###0",$$,0,inpute!.getBottomMargin())
inputeBottom!.setToolTipText("setBottomMargin")
inputeBottom!.setCallback(inputeBottom!.ON_SPIN,"bottomMargin")
inputeRight! = window!.addInputNSpinner(104,410,100,80,height,$$,"-###0",$$,0,inpute!.getRightMargin())
inputeRight!.setToolTipText("setRightMargin")
inputeRight!.setCallback(inputeRight!.ON_SPIN,"rightMargin")

n = 1234567.89
inputn! = window!.addInputN(200,600,100,300,height,$0000$,"$###,###,###.00-",$$,n,n)
inputn!.setToolTipText("BBjInputN")
inputnTop! = window!.addInputNSpinner(201,700,50,100,height,$$,"-###0",$$,0,inputn!.getTopMargin())
inputnTop!.setToolTipText("setTopMargin")
inputnTop!.setCallback(inputnTop!.ON_SPIN,"topMargin")
inputnLeft! = window!.addInputNSpinner(202,510,100,80,height,$$,"-###0",$$,0,inputn!.getLeftMargin())
inputnLeft!.setToolTipText("setLeftMargin")
inputnLeft!.setCallback(inputnLeft!.ON_SPIN,"leftMargin")
inputnBottom! = window!.addInputNSpinner(203,700,150,100,height,$$,"-###0",$$,0,inputn!.getBottomMargin())
inputnBottom!.setToolTipText("setBottomMargin")
inputnBottom!.setCallback(inputnBottom!.ON_SPIN,"bottomMargin")
inputnRight! = window!.addInputNSpinner(204,910,100,80,height,$$,"-###0",$$,0,inputn!.getRightMargin())
inputnRight!.setToolTipText("setRightMargin")
inputnRight!.setCallback(inputnRight!.ON_SPIN,"rightMargin")

inputd! = window!.addInputD(300,100,300,300,height)
inputd!.setToolTipText("BBjInputD")
inputdTop! = window!.addInputNSpinner(301,200,250,100,height,$$,"-###0",$$,0,inputd!.getTopMargin())
inputdTop!.setToolTipText("setTopMargin")
inputdTop!.setCallback(inputdTop!.ON_SPIN,"topMargin")
inputdLeft! = window!.addInputNSpinner(302,10,300,80,height,$$,"-###0",$$,0,inputd!.getLeftMargin())
inputdLeft!.setToolTipText("setLeftMargin")
inputdLeft!.setCallback(inputdLeft!.ON_SPIN,"leftMargin")
inputdBottom! = window!.addInputNSpinner(303,200,350,100,height,$$,"-###0",$$,0,inputd!.getBottomMargin())
inputdBottom!.setToolTipText("setBottomMargin")
inputdBottom!.setCallback(inputdBottom!.ON_SPIN,"bottomMargin")
inputdRight! = window!.addInputNSpinner(304,410,300,80,height,$$,"-###0",$$,0,inputd!.getRightMargin())
inputdRight!.setToolTipText("setRightMargin")
inputdRight!.setCallback(inputdRight!.ON_SPIN,"rightMargin")

edit! = window!.addEditBox(400,600,300,300,height,text$,$$)
edit!.setToolTipText("BBjEditBox")
editTop! = window!.addInputNSpinner(401,700,250,100,height,$$,"-###0",$$,0,edit!.getTopMargin())
editTop!.setToolTipText("setTopMargin")
editTop!.setCallback(editTop!.ON_SPIN,"topMargin")
editLeft! = window!.addInputNSpinner(402,510,300,80,height,$$,"-###0",$$,0,edit!.getLeftMargin())
editLeft!.setToolTipText("setLeftMargin")
editLeft!.setCallback(editLeft!.ON_SPIN,"leftMargin")
editBottom! = window!.addInputNSpinner(403,700,350,100,height,$$,"-###0",$$,0,edit!.getBottomMargin())
editBottom!.setToolTipText("setBottomMargin")
editBottom!.setCallback(editBottom!.ON_SPIN,"bottomMargin")
editRight! = window!.addInputNSpinner(404,910,300,80,height,$$,"-###0",$$,0,edit!.getRightMargin())
editRight!.setToolTipText("setRightMargin")
editRight!.setCallback(editRight!.ON_SPIN,"rightMargin")

password! = window!.addEditBox(500,100,500,300,height,text$,$0400$)
password!.setToolTipText("BBjEditBox (Password)")
passwordTop! = window!.addInputNSpinner(501,200,450,100,height,$$,"-###0",$$,0,password!.getTopMargin())
passwordTop!.setToolTipText("setTopMargin")
passwordTop!.setCallback(passwordTop!.ON_SPIN,"topMargin")
passwordLeft! = window!.addInputNSpinner(502,10,500,80,height,$$,"-###0",$$,0,password!.getLeftMargin())
passwordLeft!.setToolTipText("setLeftMargin")
passwordLeft!.setCallback(passwordLeft!.ON_SPIN,"leftMargin")
passwordBottom! = window!.addInputNSpinner(503,200,550,100,height,$$,"-###0",$$,0,password!.getBottomMargin())
passwordBottom!.setToolTipText("setBottomMargin")
passwordBottom!.setCallback(passwordBottom!.ON_SPIN,"bottomMargin")
passwordRight! = window!.addInputNSpinner(504,410,500,80,height,$$,"-###0",$$,0,password!.getRightMargin())
passwordRight!.setToolTipText("setRightMargin")
passwordRight!.setCallback(passwordRight!.ON_SPIN,"rightMargin")

cedit! = window!.addCEdit(600,600,500,300,height,text$,$0004$)
cedit!.setToolTipText("BBjCEdit")
ceditTop! = window!.addInputNSpinner(601,700,450,100,height,$$,"-###0",$$,0,cedit!.getTopMargin())
ceditTop!.setToolTipText("setTopMargin")
ceditTop!.setCallback(ceditTop!.ON_SPIN,"topMargin")
ceditLeft! = window!.addInputNSpinner(602,510,500,80,height,$$,"-###0",$$,0,cedit!.getLeftMargin())
ceditLeft!.setToolTipText("setLeftMargin")
ceditLeft!.setCallback(ceditLeft!.ON_SPIN,"leftMargin")
ceditBottom! = window!.addInputNSpinner(603,700,550,100,height,$$,"-###0",$$,0,cedit!.getBottomMargin())
ceditBottom!.setToolTipText("setBottomMargin")
ceditBottom!.setCallback(ceditBottom!.ON_SPIN,"bottomMargin")
ceditRight! = window!.addInputNSpinner(604,910,500,80,height,$$,"-###0",$$,0,cedit!.getRightMargin())
ceditRight!.setToolTipText("setRightMargin")
ceditRight!.setCallback(ceditRight!.ON_SPIN,"rightMargin")

listedit! = window!.addListEdit(700,100,700,300,200,text$,$$)
listedit!.setFieldHeight(height)
listedit!.setText(text$)
listedit!.setToolTipText("BBjListEdit")
listeditTop! = window!.addInputNSpinner(701,200,650,100,height,$$,"-###0",$$,0,listedit!.getTopMargin())
listeditTop!.setToolTipText("setTopMargin")
listeditTop!.setCallback(listeditTop!.ON_SPIN,"topMargin")
listeditLeft! = window!.addInputNSpinner(702,10,700,80,height,$$,"-###0",$$,0,listedit!.getLeftMargin())
listeditLeft!.setToolTipText("setLeftMargin")
listeditLeft!.setCallback(listeditTop!.ON_SPIN,"leftMargin")
listeditBottom! = window!.addInputNSpinner(703,200,750,100,height,$$,"-###0",$$,0,listedit!.getBottomMargin())
listeditBottom!.setToolTipText("setBottomMargin")
listeditBottom!.setCallback(listeditTop!.ON_SPIN,"bottomMargin")
listeditRight! = window!.addInputNSpinner(704,410,700,80,height,$$,"-###0",$$,0,listedit!.getRightMargin())
listeditRight!.setToolTipText("setRightMargin")
listeditRight!.setCallback(listeditTop!.ON_SPIN,"rightMargin")

statictext! = window!.addStaticText(800,600,700,300,height,text$,$10000$)
statictext!.setToolTipText("BBjStaticText")
statictextTop! = window!.addInputNSpinner(801,700,650,100,height,$$,"-###0",$$,0,statictext!.getTopMargin())
statictextTop!.setToolTipText("setTopMargin")
statictextTop!.setCallback(statictextTop!.ON_SPIN,"topMargin")
statictextLeft! = window!.addInputNSpinner(802,510,700,80,height,$$,"-###0",$$,0,statictext!.getLeftMargin())
statictextLeft!.setToolTipText("setLeftMargin")
statictextLeft!.setCallback(statictextLeft!.ON_SPIN,"leftMargin")
statictextBottom! = window!.addInputNSpinner(803,700,750,100,height,$$,"-###0",$$,0,statictext!.getBottomMargin())
statictextBottom!.setToolTipText("setBottomMargin")
statictextBottom!.setCallback(statictextBottom!.ON_SPIN,"bottomMargin")
statictextRight! = window!.addInputNSpinner(804,910,700,80,height,$$,"-###0",$$,0,statictext!.getRightMargin())
statictextRight!.setToolTipText("setRightMargin")
statictextRight!.setCallback(statictextRight!.ON_SPIN,"rightMargin")

process_events

eoj:
release

topMargin:
    event! = sysgui!.getLastEvent()
    id = event!.getControl().getID() - 1
    control! = window!.getControl(id)
    margin = num(event!.getText())
    control!.setTopMargin(margin)
return

leftMargin:
    event! = sysgui!.getLastEvent()
    id = event!.getControl().getID() - 2
    control! = window!.getControl(id)
    margin = num(event!.getText())
    control!.setLeftMargin(margin)
return

bottomMargin:
    event! = sysgui!.getLastEvent()
    id = event!.getControl().getID() - 3
    control! = window!.getControl(id)
    margin = num(event!.getText())
    control!.setBottomMargin(margin)
return

rightMargin:
    event! = sysgui!.getLastEvent()
    id = event!.getControl().getID() - 4
    control! = window!.getControl(id)
    margin = num(event!.getText())
    control!.setRightMargin(margin)
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjStaticText::setRightMargin

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