FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TSBrowse with one dimensional array
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
TSBrowse with one dimensional array
Posted: Wed Aug 01, 2007 07: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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
TSBrowse with one dimensional array
Posted: 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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
That works ... but ...
Posted: 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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
TSBrowse with one dimensional array
Posted: 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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Highlight
Posted: 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
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
TSBrowse with one dimensional array
Posted: Thu Aug 02, 2007 07:38 AM
Look at this instance variable:

DATA   nAdjColumn    AS NUMERIC     // column expands to flush table window right


oBrw:nAdjColunm := <most-right-column>
kind regards

Stefan
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
TSBrowse with one dimensional array
Posted: Thu Aug 02, 2007 02: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion