BBjPopupMenu::setAttribute

Description

In BBj 19.10 and higher, this method sets a BBjPopupMenu attribute.

Syntax

Return Value

Method

void

setAttribute(string attribute, string value)

Parameters

Variable

Description

attribute

Specifies an attribute to be set on the popup menu.

value

Specifies the value of that attribute.

Return Value

None.

BUI logo DWC logo 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 ' BBjPopupMenu::setAttribute

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

title$ = "BBjPopupMenu::setAttribute"

window! = sysgui!.addWindow(100,100,400,400,title$,$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")

control! = window!.addButton(100,125,25,250,25,"Control with a popup menu",$$)

popup! = control!.addPopupMenu()
item! = popup!.addMenuItem(-1,"Popup Menu Item")

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()
  popup!.setAttribute(attribute$,value$)
return

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

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

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

See Also

BBjAPI

BBjSysGui

BBjWindow

BBjPopupMenu

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