BBjPopupMenu::setFont

Description

In BBj 19.01 and higher, this method sets the font of the BBjPopupMenu.

Syntax

Return Value

Method

void

setFont(BBjFont font!)

Parameters

Variable

Description

font!

Default font to be used for items added to this BBjPopupMenu.

Return Value

None.

Remarks

None.

Example

rem ' BBjPopupMenu::setFont

begin
popup = msgbox("Set popupmenu font?",256+4,"PopupMenu Font") = 6
font = msgbox("Set menuitem fonts?",256+4,"MenuItem Fonts") = 6
sysgui! = bbjapi().openSysGui("X0")
window! = sysgui!.addWindow(25,25,300,200,"BBjPopupMenu::setFont",$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
menuButton1! = window!.addMenuButton(101,50,50,200,40,"MenuButton1")
font! = sysgui!.makeFont("Comic Sans MS",20,BBjFont.FONT_ITALIC)
menuButton1!.setFont(font!)
popupMenu! = sysgui!.addPopupMenu()
print "BBjPopupMenu::getFont ",popupMenu!.getFont()
if popup then popupMenu!.setFont(font!,err=*next); rem ' BBj 19.01+
print "BBjPopupMenu::getFont ",popupMenu!.getFont()
item201! = popupMenu!.addMenuItem(-201,"Dropdown Item 1")
font! = sysgui!.makeFont("Andale Mono",20,BBjFont.PLAIN)
if font then item201!.setFont(font!)
menu202! = popupMenu!.addMenu(-202,"Dropdown Item 2")
font! = sysgui!.makeFont("Courier New",20,BBjFont.PLAIN)
if font then menu202!.setFont(font!)
item203! = menu202!.addMenuItem(-203,"Subitem1")
font! = sysgui!.makeFont("Cursive",20,BBjFont.PLAIN)
if font then item203!.setFont(font!)
item204! = menu202!.addMenuItem(-204,"Subitem2")
font! = sysgui!.makeFont("Impact",20,BBjFont.PLAIN)
if font then item204!.setFont(font!)
item205! = menu202!.addMenuItem(-205,"Subitem3, inherit font")
menuButton1!.setDropdownMenu(popupMenu!)
process_events

eoj:
release

See Also

BBjAPI

BBjSysGui Methods

BBjWindow Methods

FONT Mnemonic - Set SYSWINDOW Font

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