It is now possible to add additional buttons and additional functionality to RPreview, without modifying and recompiling RPreview.prg.
We can place this code at any place in our program before using RPreivew or preferably at the beginning of the program
RPrevUserBtns( { |oPreview, oBar| ReportExtend( oPreview, oBar ) } )
and the function ReportExtend:
function ReportExtend( oPreview, oBar )
DEFINE BUTTON OF oBar ;
RESOURCE 'SAVE' ; // from our resource or bitmap file
TOOLTIP 'Save To PDF' ;
ACTION Preview2PDF( oPreview )
DEFINE BUTTON OF oBar ;
RESOURCE 'MAIL' ; // from our resource or bitmap file
TOOLTIP 'Mail PDF as Attachment ' ;
ACTION Preview2Mail( oPreview )
return nil
Now these two buttons appear in the RPreview as if it is a part of the Preview. There is no need to alter RPreview program and recompile