of_savemenu


pfcwnsrv.pbl   >   pfc_n_cst_winsrv_preference   >   of_savemenu   

Full name pfc_n_cst_winsrv_preference.of_savemenu
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_savemenu(boolean,string,string,menu)

Name Datatype
No Data

Name Datatype
li_cnt integer
li_limit integer
li_rc integer
ls_item string

protected function integer of_savemenu (boolean ab_useregistry, string as_keyorini, string as_inisection, menu am_source);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_SaveMenu
//
//	Access:  		protected
//
//	Arguments:
//	ab_UseRegistry	Function behavior. - use the registry or an .ini file.
//	as_KeyOrIni		The KeyName for use with the Registry or the IniFile name
//						for use with an .Ini file.
//	as_IniSection	The name of the .Ini section. 
//	am_Source		The menu that should be searched.
//
//	Returns:  		integer
//						1 if it succeeds and -1 if an error occurs.
//
//	Description:  	Recursively save all Menu items that have a pictures into
//						the registry.  Function will continue to save even if an
//						error is found.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.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_rc
integer				li_limit
integer				li_cnt
string				ls_item

//Check arguments
If Not IsValid(am_source) or IsNull(am_source) Then
	Return -1
End If

//Check If the menu item has a picture.
if Len (am_source.ToolbarItemName) > 0 then
	//Store all appropriate Menu item information.	
	ls_item = 'menuitem.'+am_source.ClassName()
	li_rc = of_Save (ab_UseRegistry, as_KeyOrIni, as_IniSection, &
		ls_item+'.toolbaritembarindex', string(am_source.ToolbarItemBarIndex))
	li_rc = of_Save (ab_UseRegistry, as_KeyOrIni, as_IniSection, &
		ls_item+'.toolbaritemorder', string(am_source.ToolbarItemOrder))
	li_rc = of_Save (ab_UseRegistry, as_KeyOrIni, as_IniSection, &
		ls_item+'.toolbaritemspace', string(am_source.ToolbarItemSpace))
	li_rc = of_Save (ab_UseRegistry, as_KeyOrIni, as_IniSection, &
		ls_item+'.toolbaritemvisible', string(am_source.ToolbarItemVisible))
End If
	
//Search through the rest of the menu	
li_limit = UpperBound (am_source.item)
For li_cnt = 1 to li_limit
	of_SaveMenu (ab_UseRegistry, as_KeyOrIni, as_IniSection, am_Source.item[li_cnt])
Next

return 1

end function

     
Name Owner
pfc_n_cst_winsrv_preference.of_save pfc_n_cst_winsrv_preference
pfc_n_cst_winsrv_preference.of_savemenu pfc_n_cst_winsrv_preference

     
Name Owner
powerobject.classname powerobject
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.len systemfunctions
systemfunctions.string systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_winsrv_preference.of_save pfc_n_cst_winsrv_preference
pfc_n_cst_winsrv_preference.of_savemenu pfc_n_cst_winsrv_preference

     
Full name
No Data

     
Name Scope
No Data