xBrowse with array
-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England
xBrowse with array
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
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 2:06 pm
- Location: Oxford, England
Re: xBrowse with array
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
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 2:06 pm
- Location: Oxford, England
Re: xBrowse with array
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
Pete
-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England
Re: xBrowse with array
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?
Can anyone help?
-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England
- Antonio Linares
- Site Admin
- Posts: 42729
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 94 times
- Been thanked: 108 times
- Contact:
Re: xBrowse with array
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"
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"

-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England
Re: xBrowse with array
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
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 2:06 pm
- Location: Oxford, England
- Antonio Linares
- Site Admin
- Posts: 42729
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 94 times
- Been thanked: 108 times
- Contact:
Re: xBrowse with array
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
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
-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England
- Antonio Linares
- Site Admin
- Posts: 42729
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 94 times
- Been thanked: 108 times
- Contact:
-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England
Re: xBrowse with array
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)
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)
- Antonio Linares
- Site Admin
- Posts: 42729
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 94 times
- Been thanked: 108 times
- Contact:
Re: xBrowse with array
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
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
-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England
Re: xBrowse with array
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
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
- Antonio Linares
- Site Admin
- Posts: 42729
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 94 times
- Been thanked: 108 times
- Contact:
Re: xBrowse with array
Pete,
Please modify the Method ColAtPos() in Class TXBrowse this way:
It seems as it solves the bug
Please modify the Method ColAtPos() in Class TXBrowse this way:
Code: Select all | Expand
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
