TSBrowse with one dimensional array

Post Reply
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

TSBrowse with one dimensional array

Post by TimStone »

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
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

That works ... but ...

Post by TimStone »

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
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Highlight

Post by TimStone »

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
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Post by StefanHaupt »

Look at this instance variable:

Code: Select all

DATA   nAdjColumn    AS NUMERIC     // column expands to flush table window right
oBrw:nAdjColunm := <most-right-column>
kind regards
Stefan
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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
Post Reply