Re: xControls & Win32Lib 0.70.4
- Posted by CChris <christian.cuvier at agriculture.gouv.?r> Apr 22, 2008
- 591 views
CChris wrote: > > CChris wrote: > > > > Jonas Temple wrote: > > > > > > Greg, > > > > > > Hope you're lurking.... > > > > > > I'm trying to get current again with Win32Lib and just downloaded 0.70.4. > Unfortunately</font></i> > > > xControls is not playing well with this version. I get the following > > > error: > > > > > > > > > c:\eutools\include\Win32lib.ew:25868 in function registerControl() > > > subscript value 0 is out of bounds, reading from a sequence of length 62 > > > > > > ... called from c:\eutools\include\HSplitter.ew:200 > > > > > > --> See ex.err > > > > > > > > > Press Enter... > > > > > > > > > Jonas Temple > > > <a href="http://www.innovativesys.net">http://www.innovativesys.net</a> > > > > Ok. First, I downloaded xControls2.zip, as I was still using the original > xControls > modified by Greg. > The problem is that there is a slight semantic change, documented in the > change > log for 0.70.1. > The Control routine, when called with the classType action, should return a > class, no longer a family. The change was needed in order to emulate controls > that don't belong to an actual family, like RichEdits for instance. > > The cure is to change the return values accordingly: > * in HSplitter:168, change WINDOW to Window > * in HSplitter:180, change WINDOW to Window > * in FileBrowser:116, change WINDOW to Window > * in DatePicker:176, change WINDOW to Window > > After doing this, validId() crashes because it is passed an id of {-1}, which > it does not expect. These {-1} are components of managed controls cx and cy. > Greg, any hint? > > CChris The latter (validId() crashes) apppears to be a win32lib problem. In the validId() function, replace
if sequence(id) then if not integer(id[2]) or id[2]<1 or id[2]>length(tvitem_data) then
by
if sequence(id) then if length(id)!=2 then return w32False elsif not integer(id[2]) or id[2]<1 or id[2]>length(tvitem_data) then
I didn't check yet whether this, and the changes from WINDOW to Window, is enough to get xControls2 working. CChris