TSBrowse with one dimensional array

TSBrowse with one dimensional array

Postby TimStone » Wed Aug 01, 2007 7:38 pm

I have been working with TSBrowse ... and its very nice. However, I discovered a problem. If I browse a multi-dimensional array, no problem. However, when I browse a single dimensional array, it only displays the first letter of the column. Here is a sample that reproduces the problem. Is anyone working with TSBrowse, and do you have any thoughts on this ?

Tim

// Test TSBrowse with a single array element
#INCLUDE "fivewin.CH"
#INCLUDE "tsbrowse.CH"

PROCEDURE main

LOCAL aItm := { }
AADD( aItm, "This is text to test on line 1")
AADD( aItm, "This is text to test on line 2")
AADD( aItm, "This is text to test on line 3")
AADD( aItm, "This is text to test on line 4")
AADD( aItm, "This is text to test on line 5")
AADD( aItm, "This is text to test on line 6")
AADD( aItm, "This is text to test on line 7")
AADD( aItm, "This is text to test on line 8")
AADD( aItm, "This is text to test on line 9")
AADD( aItm, "This is text to test on line 10")
AADD( aItm, "This is text to test on line 11")

DEFINE DIALOG oDlg FROM 100,50 TO 400, 500 PIXEL Title "TSBrowse One Directional Array"

@ 0,0 BROWSE oLbx SIZE 600, 150 PIXEL OF oDlg

oLbx:setArray( aItm )

ADD COLUMN TO BROWSE oLbx DATA ARRAY ELEMENT 1 HEADER "Details" SIZE 400 ALIGN 0,1

oLbx:nLineStyle:=0
oLbx:nHeightCell += 4
oLbx:nHeightHead += 6
oLbx:lNoHScroll := .T.


// Activate the dialog screen
ACTIVATE DIALOG oDlg

RETURN NIL
:?
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Postby James Bott » Wed Aug 01, 2007 11:08 pm

Tim,

After looking at the TSBrowse code and the syntax of defining a column for an array, I don't think TSBrowse was designed to handle a single dimension array.

Note that you can define your array like this:

AADD( aItm, {"This is text to test on line 1"})

and TSBrowse works correctly. It is expecting each element of the array to contain an array.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

That works ... but ...

Postby TimStone » Wed Aug 01, 2007 11:24 pm

That works and its an easy fix.

Here is one other interesting observation. When browsing a file, the highlight only extends for the number of columns on the browse ... so if the right side has an empty column ( space ), the browse bar does not extend into it. In all other browses the highlight goes into "non-programmed" space.

Thoughts ?

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Postby James Bott » Wed Aug 01, 2007 11:28 pm

Tim,

>so if the right side has an empty column ( space ), the browse bar does not extend into it.

I noticed that too. I just either widen the colum to fit the browse, or add a dummy column to fill the extra space.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Highlight

Postby TimStone » Wed Aug 01, 2007 11:47 pm

I'm doing the same thing, but it is a "fixable" component I'm sure. The color bars, BTW, go all the way across.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Postby StefanHaupt » Thu Aug 02, 2007 7:38 am

Look at this instance variable:

Code: Select all  Expand view
DATA   nAdjColumn    AS NUMERIC     // column expands to flush table window right


oBrw:nAdjColunm := <most-right-column>
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Postby James Bott » Thu Aug 02, 2007 2:36 pm

Stefan,

>DATA nAdjColumn

I see that has the same effect as increasing the column width specification in the column definition.

I have also modifed TSBrowse to display the highlight bar all the way across even if there is a "phantom" column on the right. This will be in the next release.

Unfortunately, TSBrowse's documentation is incomplete, so we have to learn how to use it either by trial and error or by getting tips like yours.

Thanks,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 51 guests