/**********************************************************************/ length name $ 8; GETWIDG: method frameid 8; /* Get a list of widgets in the FRAME */ widgets = makelist(); call send( frameid, '_get_widgets_', widgets ); /* Loop through all widgets */ do i=1 to listlen(widgets); /* Get the widget name and id */ name = nameitem(widgets); widget = popl(widgets); /* Since methods cannot be sent to objects in */ /* extended tables, they are skipped; objects */ /* in extended tables can be handled by */ /* setting the instance methods from the */ /* getrow section of the extended table, but */ /* that will not be done for this example */ call send( frameid, '_get_table_', name, table_id ); if ( table_id ) then continue; /* Enable the _POPUP_ method */ call send( widget, '_popups_', 'popup' ); /* Override the _POPUP_ method */ call send(widget,'_set_instance_method_','_popup_', 'sasuser.help.methods.scl','popup'); end; rc=dellist(widgets); endmethod; /**********************************************************************/ length help $40 hframe junk type $8; POPUP: method plist 8 sel 8; /* Add 'Help' to the front of the popmenu */ rc = insertc( plist, 'Help', 1 ); /* Display the popmenu */ call super(_self_,'_popup_',plist,sel); /* Check if 'sel' is 1 (it may be greater than */ /* 1 if the object added other items to the */ /* popmenu) */ if ( sel = 1 ) then do; /* Get the help entry (specify a blank value */ /* for a default value in GETNITEMC) */ help = getnitemc( _self_, 'help', 1, 1, '' ); if ( help ne '' ) then do; /* Parse method parses a string into its components */ /* this method is in the sashelp.fsp library */ call method( 'sashelp.fsp.parse.scl', 'namediv', help, junk, junk, junk, type, rc ); path=searchpath(help); rc=cexist(path); if not rc then do; call send(_frame_,'_set_msg_','Help entry not found'); return; end; /* CBT entries can have a CBT frame specified */ if ( type = 'CBT' ) then do; hframe = getnitemc( _self_, 'hframe', 1, 1, '' ); call cbt( help, 1, hframe ); end; else call display(help); end; else do; helplist = makelist(); rc=insertc(helplist,'Sorry, no help available'); rc=popmenu(helplist); rc=dellist(helplist); end; end; endmethod; /**********************************************************************/