BUI logoDWC logoBBjControl::getAttribute

Description

In BBj 15.00 and higher, this method returns a control attribute for the BBjControl previously set with BBjControl::setAttribute.

Syntax

Return Value

Method

string getAttribute(String attribute)

Parameters

Parameter Description
attribute Specifies an attribute to be retrieved from the control.

Return Value

Returns the text value of this attribute, or "" if the attribute isn't set.

Remarks

This functionality is primarily intended for setting low-level BUI element attributes or DWC component attributes. When running in GUI, the attributes don't affect the control itself, but may be used by the developer.

Example

rem ' BBjControl::getAttribute

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()

window! = sysgui!.addWindow(100,100,400,400,"getAttribute",$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")
control! = window!.addButton(100,125,25,250,25,"Control",$$)
window!.addStaticText(201,5,75,100,25,"Attribute:",$8000$)
window!.addStaticText(202,5,125,100,25,"Value:",$8000$)
attribute! =  window!.addEditBox(101,125,75,250,25,"attribute",$$)
value! =  window!.addEditBox(102,125,125,250,25,"",$$)
setAttribute! = window!.addButton(103,125,175,250,25,"setAttribute",$$)
setAttribute!.setCallback(setAttribute!.ON_BUTTON_PUSH,"setAttribute")
getAttribute! = window!.addButton(104,125,225,250,25,"getAttribute",$$)
getAttribute!.setCallback(getAttribute!.ON_BUTTON_PUSH,"getAttribute")
hasAttribute! = window!.addButton(105,125,275,250,25,"hasAttribute",$$)
hasAttribute!.setCallback(hasAttribute!.ON_BUTTON_PUSH,"hasAttribute")
removeAttribute! = window!.addButton(106,125,325,250,25,"removeAttribute",$$)
removeAttribute!.setCallback(removeAttribute!.ON_BUTTON_PUSH,"removeAttribute")

process_events

eoj:
   release

setAttribute:
  attribute$ = attribute!.getText()
  value$ = value!.getText()
  control!.setAttribute(attribute$,value$)
return

getAttribute:
  attr$ = attribute!.getText()
  attr! = control!.getAttribute(attr$)
  i = msgbox("value = """ + str(attr!) + """",0,"getAttribute "+attr$)
return

hasAttribute:
  attr$ = attribute!.getText()
  has! = control!.hasAttribute(attr$)
  i = msgbox("has "+attr$+" = "+Boolean.toString(has!),0,"hasAttribute "+attr$)
return

removeAttribute:
  attr$ = attribute!.getText()
  control!.removeAttribute(attr$)
return

See Also

BBjAPI

BBjSysGui

BBjWindow

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