|
of_setmenu
|
|
Full name
|
pfc_n_cst_security.of_setmenu
|
Access
|
protected
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
protected function integer of_setmenu(string,menu)
|
Name
|
Datatype
|
lb_override
|
boolean
|
li_count
|
integer
|
li_idx
|
integer
|
li_num_menus
|
integer
|
li_numset
|
integer
|
lm_menu
|
menu
|
lstr_menu_list
|
str_menu[]
|
protected function integer of_setmenu (string as_objname, menu am_menu);//////////////////////////////////////////////////////////////////////////////
//
// Function:
// of_SetMenu
//
// Access:
// protected
//
// Arguments:
// as_objname : string ; Name of object that the menu is part of. This could be a window or a menu.
// am_menu : menu ; Menu that is to be set.
//
// Returns:
// integer
// The number of items set on the menu
//
// Description:
// Sets the menu items on the passed menu based on the current
// contents of the ids_items datastore.
// Note: The ids_items datastore must have already been filtered appropriately
// before calling this function.
//
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 6.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
integer li_idx, li_num_menus, li_count, li_numset
menu lm_menu
str_menu lstr_menu_list[]
boolean lb_override
li_num_menus = 1
lstr_menu_list[li_num_menus].mnu = am_menu
lstr_menu_list[li_num_menus].override = False
Do While li_num_menus > 0
lm_menu = lstr_menu_list[li_num_menus].mnu
li_numset += of_SetMenuStatus(lm_menu, as_objname, lstr_menu_list[li_num_menus].override)
// If a menu item is disabled or invisible then make sure that its' child items are disabled as well
// This is done to make sure that any toolbar items that are on child menu items are not visible
lb_override = Not lm_menu.visible Or Not lm_menu.enabled
li_num_menus = li_num_menus - 1
li_count = upperbound(lm_menu.item)
For li_idx = 1 To li_count
li_num_menus = li_num_menus + 1
lstr_menu_list[li_num_menus].mnu = lm_menu.item[li_idx]
lstr_menu_list[li_num_menus].override = lb_override
Next
Loop
Return li_numset
end function