BBjMDI::getDefaultForwardMenuAccelerators

Description

In BBj 6.0 and higher, this method returns the default value of BBjMDI::getForwardMenuAccelerators() for newly created windows.

Syntax

Return Value

Method

boolean

getDefaultForwardMenuAccelerators()

Parameters

None.

Return Value

Returns the default behavior of BBjMDI::getForwardMenuAccelerators() for newly created windows.

0 = Newly created windows will not forward keystrokes to the MDI parent for menu accelerator consideration.

1 = Newly created windows will forward keystrokes to the MDI parent for menu accelerator.

Remarks

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

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
mdi!.setDefaultForwardMenuAccelerators(forward)

rem ' Print out whether we're forwarding or not based on their answer to
rem ' the Message Box.
if mdi!.getDefaultForwardMenuAccelerators()
    PRINT "Child processes will forward accelerator keys to the MDI."
else
    PRINT "Child processes will not forward accelerator keys to the MDI."
endif

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.