Xbrowse, array and go to specific row

Xbrowse, array and go to specific row

Postby Adolfo » Thu Feb 21, 2013 3:02 pm

Initial Data

.- a 2dimension array(100 rows * 2 columns )
.- a xbrowse with only 20 visible rows
.- after initializing the xbrowse, I wanna go to the 21° row, show it and refresh the xbrowse (as last row)
.- i could go up and down the xbrowse (thru program), always showing the row I want.

With Manuel Mercado's TSBROWSE I used oTsb:Gopos(21,1) with no problem, automatic scroll and refresh, automatic focus and depending on the place, the row was the first or last visible row.

I tried
oXFast:SetPos(21,1)
oXFast:nRowSel(21)
with no results.
My main concern is that, the number of visible row could change depending on screen resolution.

Any idea or tip will be appreciated.

From Chile
Adolfo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1650
User avatar
Adolfo
 
Posts: 846
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Xbrowse, array and go to specific row

Postby nageswaragunupudi » Thu Feb 21, 2013 4:39 pm

Please try this sample:
Code: Select all  Expand view
Function Main()

   local aData       := {}
   local oDlg, oBrw, n
   local nDlgHeight  := 300  // test varying the height 300 to 600

   for n := 1 to 100
      AAdd( aData, { n, n * 10 } )
   next

   DEFINE DIALOG oDlg SIZE 200,nDlgHeight PIXEL
   @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      DATASOURCE aData AUTOCOLS LINES CELL NOBORDER

   WITH OBJECT oBrw
      :nArrayAt      := 21
      :nRowSel       := 21
      //
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED


Return nil

 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse, array and go to specific row

Postby Adolfo » Thu Feb 21, 2013 6:27 pm

Nages..

It works.. but how can I do it if after initializing the xBrowse, I want to go to another Row, in fact, depending on the user input in an external get, I can go to the 21° row first, show a dialog, go to the 1° row show another dialog, then to another and so on.

Each time I know the initial row number I'll have no problems at all, but if some parameters change, It would be 2 to 5 diferent rows on each users input... any idea?

Thanks for your help

From Chile
Adolfo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1650
User avatar
Adolfo
 
Posts: 846
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Xbrowse, array and go to specific row

Postby nageswaragunupudi » Fri Feb 22, 2013 12:34 am

Please do the same after the user input.

Code: Select all  Expand view
oBrw:nArrayAt := oBrw:nRowSel := <nUserInput>
oBrw:Refresh()
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse, array and go to specific row

Postby Adolfo » Fri Feb 22, 2013 12:58 am

Works Perfect
Thanks Nages..
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1650
User avatar
Adolfo
 
Posts: 846
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 51 guests