:h1 res=100 . Extension of VisPro Rexx Spreadsheet Object
:i1. General
:p.The VisPro Rexx Spreadsheet Object is limited in the way you can start editing
a field. You have to ALT+LeftClick on the field to get it into the edit state.
:p.I didn't like that to be the only way, so i searched for a way to enhance the spreadsheet control.
:p.I did this first for the VisProC object. I subclassified the VPSpreadsheetClass.
First i thought i had to create a complete new object with the VPTOOL kit to do the same for Rexx.
Then i got the idea to try the subclassing in an external rexx-dll. I found that i seems so work.
:p.But i could not use class subclassing, because there is no way in VisProRexx to make the call at the
wright time (between registration of the standard VisProSpreadSheetObject and the
first creation of an instance of it, if the spreadsheet is on the first (Main) window form).
:p.So i decided to use window subclassing. That's what is done if you call SbcSpsht(window, id).
:p.The Spreadsheet Object (Control id on form window) will be subclassed. You can then set the desired edit style and/or let the spreadsheet perform a display optimization.
:p.This sample was build with screen resolution 1280x1024. May be it looks bad on VGA.
This is the first time i tried the window subclassing in an external rexx-dll. During my test cycle (German Warp4 no FP) i could not watch any side effects and problems. This does not mean, that i would not expect them to arise in the future.
So read the :link reftype=hd res=99.Disclaimer:elink.!:ewarning.
:p.To get access to the extensions, you first have to register the rexx function SbcSpsht
:xmp.
/* Event Form events, Opened */
/* Register the extension and subclass the spreadsheet */
call RxFuncAdd 'SbcSpsht', 'SBCSPSHT', 'SbcSpsht'
SbcSpshtRV = SbcSpsht(window, 1000);
:exmp.
:p.SbcSpsht must be called for every spreadsheet object after its creation. Successfully subclassing is shown by a return value of "1", "0" means subclassing could not be done.
:p.Be sure to set the max number of cells before this call, because the text of up to all fields must be checked to find the longest.
:p.If You have set the max number of cells and performed the optimization, You my size the spreadsheet to the size that displays all fields. Be sure the control will fit into your window!