PROGRAM objlib_subclass; {-- *************************************************************************** -- ** Descr. : A simple tutorial script showing how to subclass a object from -- ** a object library module into a formsmodule. In this example we -- ** get an Alert-Object and subclass it to a formsmodule. -- ** -- ** MINVERS: requires FormsAPI Master 1.0 Build 232 and up -- *************************************************************************** -- ** 11/01/02 1.001.00 Initial Creation, muellers@orcl-toolbox.com -- ***************************************************************************} {*Global Variable Declaration*} VAR frm : number; olb : number; obj : number; newobj : number; {*Main Program Block*} BEGIN //load the forms module and object library frm := api_loadmodule(C_FAPIMASTERDIR+'test.fmb'); olb := api_loadmodule(C_FAPIMASTERDIR+'objlib.olb'); //get the alert we would like to subclass from the objectlibrary obj := objectlib_FindObjByName(olb,'ARE_YOU_SURE_ALERT'); //create the alert in our forms module with the same name //this is similar to the copy command in formsbuilder newobj := generic_replicate(frm,obj,api_getObjectname(obj)); //now make the copied item subclassed, pointing it to the //original objectlibrary object - this would be similar to //smartclass the existing item in formsbuilder (except that //the object in the objectlib doesn't have to be a smartclass!) generic_subclass(newobj, obj); //save our module under a new name api_savemodule(frm,C_FAPIMASTERDIR+'test_objlib.fmb'); //kill our loaded formsmodules from memory api_destroymodule(frm); api_destroymodule(olb); END.