BBjMenuButton::getDropdownButtonWidth

Description

In BBj 15.0 and higher, this BBjMenuButton method returns the width of the dropdown button on the right edge of the menu button.

Syntax

Return Value

Method

int

getDropdownButtonWidth()

Parameters

None.

Return Value

If the dropdown button width hasn't been set using setDropdownButtonWidth, this method returns the initial default width, which varies from one look-and-feel to the next.

Remarks

This value is not affected by the presence or absence of a dropdown menu associated with the menu button.

Example

rem ' BBjMenuButton::getDropdownButtonWidth

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
title$ = "getDropdownButtonWidth"
window! = sysgui!.addWindow(100,100,250,225,title$,$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
menubutton! = window!.addMenuButton(101,25,25,200,25,"MenuButton",$4000$)
dropdown! = sysgui!.addPopupMenu()
dropdown!.addMenuItem(-201,"DropdownItem 1")
dropdown!.addMenuItem(-202,"DropdownItem 2")
menubutton!.setDropdownMenu(dropdown!)
print "BBjMenuButton::getDropdownButtonWidth:",
width = menubutton!.getDropdownButtonWidth()
print width
window!.addStaticText(102,0,128,100,25,"Width:",$8000$)
spinner! = window!.addInputNSpinner(103,125,125,100,25,5,55)
spinner!.setValue(width)
spinner!.setCallback(spinner!.ON_SPIN,"setDropdownButtonWidth")
process_events

eoj:
release

setDropdownButtonWidth:
    event! = sysgui!.getLastEvent()
    width$ = event!.getText()
    width = num(width$)
    menubutton!.setDropdownButtonWidth(width)
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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