BBjPopupMenu::getMaximumRowCount

Description

In BBj 15.0 and higher, this method returns the maximum number of rows to display in the BBjPopupMenu. If the popup menu contains more than this maximum number of items, a vertical scroll bar will appear.

Syntax

Return Value

Method

int

getMaximumRowCount()

Parameters

None.

Return Values

None.

Remarks

The maximum row count defaults to unlimited (Integer.MAX_VALUE, or 2147483647).

Example

rem ' BBjPopupMenu getMaximumRowCount

sysgui = unt

open (sysgui)"X0"

sysgui! = bbjapi().getSysGui()

window! = sysgui!.addWindow(100,100,650,175,"getMaximumRowCount",$00090003$,$$)

popup! = sysgui!.addPopupMenu()

print "getMaximumRowCount:",popup!.getMaximumRowCount()

popup!.setMaximumRowCount(10)

print "getMaximumRowCount:",popup!.getMaximumRowCount()

item1! = popup!.addMenuItem(-1,"Popup Item 1",1,0)

item2! = popup!.addMenuItem(-1,"Popup Item 2",1,1)

item3! = popup!.addMenuItem(-1,"Popup Item 3",1,0)

for item = 4 to 9

item! = popup!.addMenuItem(-1,"Popup Item "+str(item),0,0)

item!.setCallback(item!.ON_POPUP_ITEM_SELECT,"popup")

next item

submenu! = popup!.addMenu(-1,"Popup Submenu")

submenu!.addMenuItem(-1,"Submenu Item 1",1,0)

submenu!.addMenuItem(-1,"Submenu Item 2",1,1)

submenu!.addMenuItem(-1,"Submenu Item 3",1,0)

submenu! = submenu!.addMenu(-1,"Popup Submenu")

submenu!.addMenuItem(-1,"Sub-Submenu Item 1",1,0)

submenu!.addMenuItem(-1,"Sub-Submenu Item 2",1,1)

submenu!.addMenuItem(-1,"Sub-Submenu Item 3",1,0)

item1!.setCallback(item1!.ON_POPUP_ITEM_SELECT,"popup")

item2!.setCallback(item2!.ON_POPUP_ITEM_SELECT,"popup")

item2!.setFont(sysgui!.makeFont("Times New Roman",24,0))

item3!.setCallback(item3!.ON_POPUP_ITEM_SELECT,"popup")

edit1! = window!.addEditBox(101,25,25,600,25,"Right-click here for the browser default menu",$$)

edit1!.setFont(sysgui!.makeFont("Courier New",16,0))

edit2! = window!.addEditBox(102,25,75,600,25,"Right-click here for the custom popup menu",$$)

edit2!.setFont(sysgui!.makeFont("Courier New",16,1))

edit2!.setPopupMenu(popup!)

edit3! = window!.addEditBox(103,25,125,600,25,"Right-click here to fire a popup request event",$$)

edit3!.setFont(sysgui!.makeFont("Courier New",16,2))

edit3!.setCallback(edit3!.ON_POPUP_REQUEST,"request")

window!.setCallback(window!.ON_CLOSE,"eoj")

for item = asc("A") to asc("Z")

item! = popup!.addMenuItem(-1,"Popup Item "+chr(item),0,0)

item!.setCallback(item!.ON_POPUP_ITEM_SELECT,"popup")

next item

process_events

eoj:

 release

request:

 event! = sysgui!.getLastEvent()

 control! = event!.getControl()

 i = msgbox(event!.toString()+" x="+str(event!.getX())+",y="+str(event!.getY()))

return

popup:

 event! = sysgui!.getLastEvent()

 i = msgbox(event!.toString()+" menuitem="+event!.getMenuItem().toString()+" control="+event!.getControl().toString())

return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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