Navigation: ABC Library Reference > PopupClass > PopupClass Methods >====== Restore (restore a saved menu) ====== | |
Restore( menu )
Restore | Restores a menu saved by the PopupClass.Save method. |
menu | A string constant, variable, EQUATE, or expression containing the name of the menu to restore. |
The Restore method restores a menu saved by the Save method. The Restore method restores all menu attributes that the PopupClass object knows about, including associated menu actions.
Implementation:
The Restore 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