Mr JC
I have executed your code as it is ( just substituted bitmap names). The widths are okay.
Now, to know more about how xbrowse auto-calculates the widths: If we ourselves specify the width xbrowse does not do any calculations and blindly adopts the width we specify. If we have not specified the widths, it evaluates the bStrData ( while executing the method CreateFromCode ) and calculates the width of the evaluated value in pixels and adds bitmap width if necessaray. Finally it takes the maximum of data width, Header width and footer width. Normally these calculations give satisfactory results.
The problem with Arrays is that the browse calculates the widths on the basis of the data in the first row of the array. In case the data in the first row are smaller in width, values in the next rows are truncated. In case of RDD and RecSets this problem does not arise "normally" if we specify the column name.
So when we browse arrays it becomes necessary for us to specify the widths manually in our program. But the problem is that we have to specify the widths in Pixels and we do not know the exact fit.
I wish someday xbrowse provides a way to specify the widths in number of characters ( easy for us to specify ) than pixels and the xbrowse calculating the width on the basis of the number of characters.
Till then I adopt a work around. I always know how many characters are to be shown. So I invariably give picture clauses. For text I give a picture clause like 'XXXXX'. Now all my array browses are fit exactly.
for example I would write
@ 0,0 XBROWSE oBrw ;
HEADERS '', 'Code', 'Name' ;
PICTURE NIL, REPLICATE( 'X', 5 ), REPLICATE( 'X', 30 ) ;
ARRAY aDataArray AUTOSORT AUTOCOLS ..... etc.