BBjPopupMenu::setMaximumRowCount

Description

In BBj 15.0 and higher, this method sets 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

void

setMaximumRowCount(int max)

Parameters

Variable

Description

max

Specifies maximum number of rows to display.

Return Value

None.

Remarks

If the number of menu items exceeds the specified maximum, a vertical scrollbar will appear.

Example

rem ' BBjPopupMenu setMaximumRowCount

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(100,100,650,175,"setMaximumRowCount",$00090003$,$$)
popup! = sysgui!.addPopupMenu()
print "getMaximumRowCount:",popup!.getMaximumRowCount()
popup!.setMaximumRowCount(10)
print "getMaximumRowCount:",popup!.getMaximumRowCount()
item1! = popup!.addMenuItem(-1,"PopupItem 1",1,0)
item2! = popup!.addMenuItem(-1,"PopupItem 2",1,1)
item3! = popup!.addMenuItem(-1,"PopupItem 3",1,0)
for item = 4 to 9
    item! = popup!.addMenuItem(-1,"PopupItem "+str(item),0,0)
    item!.setCallback(item!.ON_POPUP_ITEM_SELECT,"popup")
next item
submenu! = popup!.addMenu(-1,"PopupSubmenu")
submenu!.addMenuItem(-1,"SubmenuItem 1",1,0)
submenu!.addMenuItem(-1,"SubmenuItem 2",1,1)
submenu!.addMenuItem(-1,"SubmenuItem 3",1,0)
submenu! = submenu!.addMenu(-1,"PopupSubmenu")
submenu!.addMenuItem(-1,"Sub-SubmenuItem 1",1,0)
submenu!.addMenuItem(-1,"Sub-SubmenuItem 2",1,1)
submenu!.addMenuItem(-1,"Sub-SubmenuItem 3",1,0)
item1!.setCallback(item1!.ON_POPUP_ITEM_SELECT,"popup")
item2!.setCallback(item2!.ON_POPUP_ITEM_SELECT,"popup")
item2!.setFont(sysgui!.makeFont("TimesNew Roman",24,0))
item3!.setCallback(item3!.ON_POPUP_ITEM_SELECT,"popup")
edit1! = window!.addEditBox(101,25,25,600,25,"Right-clickhere for the browser default menu",$$)
edit1!.setFont(sysgui!.makeFont("CourierNew",16,0))
edit2! = window!.addEditBox(102,25,75,600,25,"Right-clickhere for the custom popup menu",$$)
edit2!.setFont(sysgui!.makeFont("CourierNew",16,1))
edit2!.setPopupMenu(popup!)
edit3! = window!.addEditBox(103,25,125,600,25,"Right-clickhere to fire a popup request event",$$)
edit3!.setFont(sysgui!.makeFont("CourierNew",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,"PopupItem "+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.