BBjMDI::getListButton

Description

In BBj 17.0 and higher, this method returns a BBjListButton control that was previously added to the BBjMDI window.

Syntax

Return Value

Method

BBjListButton

getListButton(int controlID)

BBjListButton

getListButton(string name)

Parameters

Variable

Description

controlID

Specifies the ID of the control.

name

Specifies name given to a BBj control using the setName method.

Return Value

This convenience method calls getControl () and casts the result to a BBjListButton.

Remarks

If the control is not a BBjListButton , this method will generate an !ERROR=26.

Example

rem ' BBjMDI::getListButton
if len(cvs(argv(1,err=*next),8)) then goto client
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
mdi! = bbjapi().getMDI()
title$ = "BBjMDI::getListButton"
print 'title'(title$)
mdi!.createMDIWindow(100,100,800,600,title$,$0000009f$)
mdi!.setVisible(1)
status! = mdi!.addStatusBar(); status!.setText("MDI Status Bar")
mdi!.setCallback(mdi!.ON_CLOSE,"eoj")
mdi!.setBackColor(sysgui!.makeColor(255,255,0))
imagemanager! = sysgui!.getImageManager()
image$ = "com/basis/utilities/launchdock/icons/bbj.png"
image! = imagemanager!.loadImageFromServerJar(image$)
mdi!.setBackgroundImage(0,image!)
rem invoke = scall("bbj "+pgm(-1)+" - f &"); wait 0.1
invoke = scall("bbj "+pgm(-1)+" - n &"); wait 0.1
rem invoke = scall("bbj "+pgm(-1)+" - f &"); wait 0.1
gosub toolbar
rem invoke = scall("bbj "+pgm(-1)+" - f &"); wait 0.1
invoke = scall("bbj "+pgm(-1)+" - w &"); wait 0.1
rem invoke = scall("bbj "+pgm(-1)+" - f &"); wait 0.1
invoke = scall("bbj "+pgm(-1)+" - e &"); wait 0.1
rem invoke = scall("bbj "+pgm(-1)+" - f &"); wait 0.1
rem invoke = scall("bbj "+pgm(-1)+" - f &"); wait 0.1
invoke = scall("bbj "+pgm(-1)+" - s &"); wait 0.1
invoke = scall("bbj "+pgm(-1)+" - f &"); wait 0.1
invoke = scall("bbj "+pgm(-1)+" - f &"); wait 0.1
invoke = scall("bbj "+pgm(-1)+" - f &"); wait 0.1
invoke = scall("bbj "+pgm(-1)+" - f &"); wait 0.1
invoke = scall("bbj "+pgm(-1)+" - f &"); wait 0.1
process_events
toolbar:
  tb! = mdi!.addToolButton(101,0,0,50,50,"1",$4000$)
  tb!.setCallback(tb!.ON_TOOL_BUTTON_PUSH,"tb")
  mb! = mdi!.addMenuButton(102,0,0,50,50,"2",$4000$)
  mb!.setCallback(mb!.ON_BUTTON_PUSH,"mb")
  lb$ = ""; for lb = 0 to 9; lb$ = lb$ + str(lb) + $0a$; next lb
  lb! = mdi!.addListButton(103,0,0,100,200,lb$,$4000$)
  lb!.setCallback(tb!.ON_LIST_SELECT,"lb")
return
tb:
  event! = sysgui!.getLastEvent()
  tb! = event!.getControl()
  tb = msgbox(tb!.getText(),0,event!.getEventName())
return
mb:
  event! = sysgui!.getLastEvent()
  mb! = event!.getControl()
  mb = msgbox(mb!.getText(),0,event!.getEventName())
return
lb:
  event! = sysgui!.getLastEvent()
  lb! = event!.getControl()
  lb = msgbox(event!.getSelectedItem(),0,event!.getEventName())
return
rem ' client windows
client: 
print 'hide',
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
title$ = cvs(argv(1),8)
print 'title'(title$)
x=rnd(250),y=rnd(250)
if title$="f" then w=100,h=100 else w=50,h=50
window! = sysgui!.addWindow(x,y,w,h,title$,$00090083$,$00090083$)
window!.setTrack(1)
window!.setBackColor(sysgui!.makeColor(rnd(255),rnd(255),rnd(255)))
window!.setCallback(window!.ON_CLOSE,"eoj")
button! = window!.addMenuButton(1,0,0,25,25,title$,$$)
button!.setCallback(button!.ON_BUTTON_PUSH,"size")
checkbox! = window!.addCheckBox(2,25,0,25,25,title$,$0004$)
checkbox!.setCallback(checkbox!.ON_CHECK_ON,"resizable")
checkbox!.setCallback(checkbox!.ON_CHECK_OFF,"resizable")
status! = window!.addStatusBar(99,$$)
status!.setForeColor(sysgui!.makeColor(255,255,255))
status!.setBackColor(sysgui!.makeColor(0,0,255))
status!.setText("Status Bar")
if title$="n" then
   bbjapi().getMDI().getNorthBorder().setWindow(window!)
endif
if title$="s" then
   bbjapi().getMDI().getSouthBorder().setWindow(window!)
endif
if title$="w" then
   bbjapi().getMDI().getWestBorder().setWindow(window!)
endif
if title$="e" then
   bbjapi().getMDI().getEastBorder().setWindow(window!)
endif
process_events
eoj:
event! = sysgui!.getLastEvent()
release

See Also

BBjAPI

BBjControl

BBjMDI

BBjWindow

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