DWC logoBBjTabCtrl::setSlotAt

Description

In BBj 24.11 and higher, this method moves a child BBjControl into the DWC web component on a specified tab. If a non-blank slot name is specified, the child BBjControl is placed in the named slot within the DWC tab web component.

Syntax

Return Value Method
void setSlotAt(int index, BBjControl control)
void setSlotAt(int index, String slot, BBjControl control)

Parameters

Parameter Description
index The 0-based index of the tab.
control BBjControl to be added to this DWC BBjTabCtrl tab web component.
slot Name of the slot within this DWC BBjTabCtrl tab web component to place the BBjControl.

Return Value

None.

Remarks

This method is only meaningful in the DWC client; it's ignored in all other environments.

If no slot string is specified, or is specified as "", the specified control is added to the default slot.

When an absolutely positioned BBjControl is moved into a parent component, the following CSS properties are cleared from the child:

Example

rem ' BBjTabCtrl::setSlotAt

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(100,100,400,350,"BBjTabCtrl setSlotAt",$00090083$,$$)
window!.setCallback(BBjWindow.ON_CLOSE,"eoj")
window!.setCallback(BBjWindow.ON_RESIZE,"resize")
tabctrl! = window!.addTabCtrl(101,25,25,350,300,$00000008$)
for tab = 0 to 9
    id = 200 + tab
    child! = window!.addChildWindow(id,0,0,275,205,"",$00010810$,id,$$)
    for edit = 1 to 6
        child!.addEditBox(10+edit,(tab+1)*10,edit*30-20,100,25,"")
    next edit
    tabctrl!.addTab("Tab "+str(tab),child!)
    color! = bbjapi().makeColor(240,240,240)
    tabctrl!.setBackColorAt(tab,color!)
    color! = bbjapi().makeColor(rnd(255),rnd(255),rnd(255))
    tabctrl!.setForeColorAt(tab,color!)
    rem ' BBjTabCtrl::setTabAt(int,BBjControl)
    rem ' BBjTabCtrl::setTabAt(int,String,BBjControl)
    rem ' This is DWC-specific:
    if info(3,6)="6" then
       dwc_icon! = window!.addWebComponent("dwc-icon")
       dwc_icon!.setAttribute("name","bell")
       tabctrl!.setSlotAt(tab,"prefix",dwc_icon!)
    endif
endif
next tab
tabctrl!.focus()

process_events

eoj:
  release

resize:
  event! = sysgui!.getLastEvent()
  tabctrl!.setSize(event!.getWidth()-50,event!.getHeight()-50)
return

ClosedVersion History

  • BBj 24.11: BBjTabCtrl::setSlotAt added.

See Also

BBjWebComponent::setSlot

BBjControl::setSlot

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