Navigation: ABC Library Reference > PopupClass > PopupClass Methods >====== Save (save a menu for restoration) ====== | |
Save( menu )
Save | Saves a menu for restoration by the PopupClass.Restore method. |
menu | A string constant, variable, EQUATE, or expression containing the name of the menu to save. |
The Save method saves a menu for restoration by the Restore method. The Save method saves all menu attributes that the PopupClass object knows about, including associated menu actions.
Implementation: The Save method requires an INIClass object. The Init method specifies the INIClass object.
Example:
PopupMgr PopupClass !declare PopupMgr object
INIMgr INIClass !declare INIMgr object
MenuChoices EQUATE('&Save Menu|&Restore Menu|-|&Close')!declare menu definition
CODE
PopupMgr.Init(INIMgr) !initialize PopupMgr object
PopupMgr.AddMenu(MenuChoices) !add Popup menu
ACCEPT
CASE FIELD()
OF ?Save
CASE EVENT()
OF EVENT:Accepted
PopupMgr.Save('MyPopup') !save menu definition to INI
END
OF ?Restore
CASE EVENT()
OF EVENT:Accepted
PopupMgr.Restore('MyPopup') !restore menu from INI
END
END
END