xBrowse with array

xBrowse with array

Postby PeterHarmes » 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
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse with array

Postby PeterHarmes » 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
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse with array

Postby PeterHarmes » 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
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse with array

Postby PeterHarmes » 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?
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse with array

Postby PeterHarmes » Wed Jun 09, 2010 9:12 am

Anyone got any ideas?

regards,

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse with array

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: xBrowse with array

Postby PeterHarmes » 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
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse with array

Postby PeterHarmes » Fri Jun 11, 2010 8:44 am

Any ideas?

Regards,

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse with array

Postby Antonio Linares » Fri Jun 11, 2010 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: xBrowse with array

Postby PeterHarmes » Fri Jun 11, 2010 9:14 am

Thanks Antonio - works great now!!

best regards,

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse with array

Postby Antonio Linares » Fri Jun 11, 2010 9:19 am

very good :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: xBrowse with array

Postby PeterHarmes » Fri Jun 11, 2010 9: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)
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse with array

Postby Antonio Linares » Fri Jun 11, 2010 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: xBrowse with array

Postby PeterHarmes » 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
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse with array

Postby Antonio Linares » Sat Jun 12, 2010 2:28 pm

Pete,

Please modify the Method ColAtPos() in Class TXBrowse this way:
Code: Select all  Expand view

   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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 59 guests