BBjMDI::setDefaultForwardMenuAccelerators

Description

In BBj 6.0 and higher, this method returns the initial value returned by BBjMDI::getForwardMenuAccelerators().

Syntax

Return Value

Method

void

setDefaultForwardMenuAccelerators(boolean forwardKeys)

Parameters

Variable

Description

forwardKeys

Specifies whether subsequently created windows should forward their keystrokes for consideration as menu accelerators on the MDI parent window.

0 = Do not forward keys.

1 = Forward keys for menu accelerator consideration.

Return Value

None.

Remarks

The default value for this property is zero. Setting this property on the MDI window will not affect existing windows, only windows created after the call to this method.

This method may only be called from the parent MDI BBj session.

Example

sysgui = unt
open(sysgui)"X0"
api! = BBjAPI()
mdi! = api!.getMDI()

rem 'create an MDI Window
mdi!.createMDIWindow(350, 50, 800, 600, "MDI Window")

rem 'Add a menubar with a "File" menu and "New", "Save", and "Quit" menu items
bar! = mdi!.addMenuBar()
fileMenu! = bar!.addMenu(-101, "File")
newItem! = fileMenu!.addMenuItem(-103, "New")
newItem!.setAccelerator($204E$); REM Ctrl-N
newItem!.setCallback(api!.ON_MENU_ITEM_SELECT, "PARENT_NEW")
saveItem! = fileMenu!.addMenuItem(-102, "Save")
saveItem!.setAccelerator($2053$); REM Ctrl-S
saveItem!.setCallback(api!.ON_MENU_ITEM_SELECT, "PARENT_SAVE")
quitItem! = fileMenu!.addMenuItem(-102, "Quit")
quitItem!.setAccelerator($2051$); REM Ctrl-Q
quitItem!.setCallback(api!.ON_MENU_ITEM_SELECT, "PARENT_APP_CLOSE")
mdi!.setCallback(api!.ON_CLOSE, "PARENT_APP_CLOSE")
mdi!.setVisible(1)

rem ' Yes/No
rem ' Question Mark
rem ' Default is false
forward = MSGBOX("Forward menu accelerator keys to the MDI window?", 4 + 32 + 256, "Menu Accelerators")

rem ' If NO, forward = 0, if YES, forward = 1
forward = 7 - forward

rem ' Set the default for the forward menu accelerators property on top
rem ' level windows.
mdi!.setDefaultForwardMenuAccelerators(forward)

rem ' Start child processes
i = 1
while (i < ARGC)
    cmdline! = BBjAPI().getConfig().getCurrentCommandLineObject()
    cmdline!.setProgramName(ARGV(i))
    BBjAPI().newBBjSession(cmdline!)
    I = I + 1
wend
process_events

PARENT_SAVE:
    PRINT "Parent Save"
return

PARENT_NEW:
    PRINT "Parent New"
return

PARENT_APP_CLOSE:
    res= mdi!.closeAll(0); goto LAB
    LAB: release

See Also

BBjAPI

BBjMDI

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