Hi All
I have a browse (twbrowse ) with an array - I am trying to reset the browse incrementally as I search ,
ascan is returning the element I want but I not sure how to reset the browse focus to that
element.
Cheers
Colin
Hi All
I have a browse (twbrowse ) with an array - I am trying to reset the browse incrementally as I search ,
ascan is returning the element I want but I not sure how to reset the browse focus to that
element.
Cheers
Colin
Hi,
did you try with oLbx:goto( nAt ) where nAt is the array element position ?
regards
MArcelo
Thanks Marcelo
But goto is not a method of twbrowse
Cheers
Colin
Colin,
Have you tried just setting oLbx:nAt to the value you want, then doing a refresh?
Regards,
James
Colin,
Suppose that nNr = the number of the selected element in the array, isn't this example working ?
oLbx:nAt := nNr
oLbx:Refresh()
Good luck.
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
Otto,
You were just a fraction of a second quicker than I was, but with the same suggestion.
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
Thanks All but still not working
@ 12,375 GET oValue1 VAR cValue1 picture '@' UPDATE of oBar SIZE 200,20 ;
on change(if(oValue1:nLastKey>32,chr(oValue1:nLastKey),""),nFnd := ascan(aData,trim(oValue1:cText)),;
if(oValue1:nLastkey==13,(oValue1:Hide(),oValue1:oJump(oLbx),oLbx:SetFocus(),oLbx:GoToCol(1)),(oLbx:nAt := nFnd,oLbx:Refresh()))) ;
FONT oFont ;
PIXEL
I have checked that the ascan is giving me the right item number - nFnd
Any other thoughts
Colin
Colin,
I had some problems with arrays and tsBrowse ( derivative of twBrowse ). My problems had to do with adding an element to the array, and not being able to see it on the browse.
The bottom line is that I had to do a re-load of the array to the browse and then reposition to the proper element. At that point I could get it into focus.
You may have to experiment a bit to see how the array is being maintained in the browse.
Tim
Colin,
>Any other thoughts
I think your code is too complex to just test if setting nAt will work. It could be something else in your code that is causing the problem.
I suggest creating a VERY simple example that just displays the browse, then with the press of a button resets nAt and does a refresh. If that doesn't work then post your sample code and maybe we can solve it.
Regards,
James
Colin,
Here is another thought. You are using oLbx:goToCol( 1 ) in your code. I see no method by that name in TWBrowse nor in TControl or TWindow (the parent classes). Are you perhaps using a different browse or a modified version of TWBrowse?
I just did a search of all the FWH source code and the only PRG containing "gotocol" is TEDITOR.PRG so either your code has an error or you are using a modified browse class.
Regards,
James
Hi James
I am using Hernan's twbrowse.
Cheers
Colin
Colin Haig wrote:Thanks Marcelo
But goto is not a method of twbrowse
Cheers
Colin
Hi Marceo
I have tried
// This works
DEFINE BUTTON oBtn5 of oBar RESOURCE "FIND" ;
FLAT ;
PROMPT 'Find' ;
ACTION(oLbx:skip(20),oLbx:Refresh()) ;
TOOLTIP('Find Value')
// This Does Not Work
DEFINE BUTTON oBtn5 of oBar RESOURCE "FIND" ;
FLAT ;
PROMPT 'Find' ;
ACTION(oLbx:nAt := 20,oLbx:Refresh()) ;
TOOLTIP('Find Value')
Regards
Colin
To All
This Works
@ 12,375 GET oValue1 VAR cValue1 picture '@' UPDATE of oBar SIZE 200,20 ;
on change(if(oValue1:nLastKey>32,chr(oValue1:nLastKey),""),nItem := ascan(aData,trim(oValue1:cText)),;
if(oValue1:nLastkey==13,(oValue1:Hide(),oValue1:oJump(oLbx),oLbx:SetFocus(),oLbx:GoToCol(1)),(aData[nItem],oLbx:Refresh()))) ;
FONT oFont ;
PIXEL
When I use oLbx:nAt := nValue then tested with MsgInfo(oLbx:nAt) it showed nValue but the
browse would not refresh to the new value.
Regards
Colin