FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse with array
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
xBrowse with array
Posted: Tue Jun 08, 2010 10:44 AM

Hi,

I've just recompiled my app with latest xHarbour (commercial) and FW (10.05) and have noticed that the horizontal & vertical scroll bar has disappeared in a xbrowse that browses an array rather than a DBF/SQL Table. I think i can just make out the vertical scroll bar just off of the edge of the browse.

If i query the lHScroll & lVScroll they both return .T.

I'm using a resource file to display the dialog with the xBrowse

I use the AUTOCOLS & AUTOSORT parameter.

This was working fine in (09.05)

Any ideas?

Regards

Pete

Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: xBrowse with array
Posted: Tue Jun 08, 2010 11:08 AM

Update

After doing more tests, it seems to do this on some DBF browses as well - i havent found the common thing between the browses yet!!

I have downgraded my Fivewin a few times: 10.02 does not work, 09.11 works

Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: xBrowse with array
Posted: Tue Jun 08, 2010 11:31 AM

I think i've narrowed it down. I think the calculation of the size of the browse when building from a resource is being calculated incorrectly. If i manually resize the browse & it's relating dialog based on each of the column widths the scroll bars appear fine.

Pete

Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: xBrowse with array
Posted: Tue Jun 08, 2010 12:02 PM

Just checked all other versions of FW and the changes made in FW 10.02 have caused this problem - 10.01 works fine.

Can anyone help?

Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: xBrowse with array
Posted: Wed Jun 09, 2010 09:12 AM

Anyone got any ideas?

regards,

Pete

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: xBrowse with array
Posted: Thu Jun 10, 2010 10:53 AM

Pete,

Are you using resources to create the dialogs where the xbrowses are shown ?
If yes, have you specified "TXBROWSE" as the type of control in your resources ?

A common mistake is to specify "LISTBOX" instead of "TXBROWSE" :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: xBrowse with array
Posted: Thu Jun 10, 2010 11:01 AM

yes we do use resources to create the dialogs and yes they are specified as txbrowse.

An example of how it appears in my resource is below:

CONTROL "", 101, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 9, 25, 380, 144

Regards,

Pete

Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: xBrowse with array
Posted: Fri Jun 11, 2010 08:44 AM

Any ideas?

Regards,

Pete

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: xBrowse with array
Posted: Fri Jun 11, 2010 09:03 AM

Pete,

You have to scpecify WS_HSCROLL and WS_VSCROLL styles also in your resource entry:

CONTROL "", 101, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP | WS_HSCROLL | WS_VSCROLL, 9, 25, 380, 144

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: xBrowse with array
Posted: Fri Jun 11, 2010 09:14 AM

Thanks Antonio - works great now!!

best regards,

Pete

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: xBrowse with array
Posted: Fri Jun 11, 2010 09:19 AM

very good :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: xBrowse with array
Posted: Fri Jun 11, 2010 09:27 AM

Spoke to soon - sorry!!

If i have an xBrowse on a single dimension array and i move the horizontal scroll bar to the right, i get a bound error array message, see below:

Error description: Error BASE/1132 Bound error: array access
Args:
[ 1] = A { ... }
[ 2] = N 0

Stack Calls

Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE:TXBROWSE(476)
Called from: => TXBROWSE:COLATPOS(0)
Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE:TXBROWSE(478)
Called from: => TXBROWSE:SELECTEDCOL(0)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT(1192)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DISPLAY(1174)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1439)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT(10470)
Called from: .\source\classes\WINDOW.PRG => _FWH(3378)
Called from: => DIALOGBOXINDIRECT(0)

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: xBrowse with array
Posted: Fri Jun 11, 2010 09:58 AM

Pete,

We are going to check it, anyhow in the meantime just remove the style WS_HSCROLL in your resource.

Also, please right click on it after that to check if it keeps failing, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: xBrowse with array
Posted: Fri Jun 11, 2010 10:05 AM

I was going to try oBrw:lHscroll := .F. but i couldnt get that to work so I will remove the WS_HSCROLL.

I tried to right click and it did look as if it failed multiple times.

The error only occurs when you drag the thumbnail - clicking on the left/right buttons is ok.

Pete

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: xBrowse with array
Posted: Sat Jun 12, 2010 02:28 PM
Pete,

Please modify the Method ColAtPos() in Class TXBrowse this way:
Code (fw): Select all Collapse
   METHOD ColAtPos( nPos ) INLINE ::aCols[ ::aDisplay[ MinMax( If( nPos == nil .or. nPos == 0, 1, nPos ), 1, Len( ::aDisplay ) ) ] ]

It seems as it solves the bug :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com