xBrowse how to show a button-seek-result on top

Post Reply
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

xBrowse how to show a button-seek-result on top

Post by ukoenig »

I'm trying to show the result of a seek from button on browser top
but it is shown on different places

I tested :
VSetPos(1)
VGoTop()
but it is not the solution I need.
The first found record must be placed on top-position.

I remember there was a solution ( post ), but couldn't find it.

Image

regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: xBrowse how to show a button-seek-result on top

Post by nageswaragunupudi »

Glad to see you are using the new features of recordselector. Text, pointer bitmap and header bitmap.

You asked in another thread. To change the recordselector text color, please set oBrw:nClrText := <nNewColor> and call oBrw:Refresh().

Now coming to your question.
oBrw:nRowSel := 1 and oBrw:Refresh() should bring the current row to top.

But please keep this in mind. Assuming the browse can display 10 rows and data has more than 10 rows, any row in the last 9 rows can not be displayed on the top. Because xbrowse never allows blank lines in the bottom.
Regards

G. N. Rao.
Hyderabad, India
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: xBrowse how to show a button-seek-result on top

Post by ukoenig »

Mr. Rao,

thank You very much

tested but the seek-result is still displayed on different row-positions

("TOUREN")->(DBSEEK( TRIM(cTour) ) ) // on Button-action
oBrw1:nRowSel := 1
oBrw1:Refresh()


the result of the other test

oBrw:nClrText := <nNewColor>

the color is only shown on selector-header, not the rows

Image

The result including my changes

Image

another test gives the needed result und moves to the top but destroys the new recordselector-counter
maybe changing the contens of the codeblock ( it is just a test )

Image

regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: xBrowse how to show a button-seek-result on top

Post by nageswaragunupudi »

Mr Uwe

It is working for me here.
Please try this code.

Code: Select all | Expand

func xbtest()

   field STATE
   local oDlg, oBrw, oFont

   USE CUSTOMER NEW SHARED VIA "DBFCDX"
   INDEX ON STATE TAG TMPSTATE TO TMP MEMORY
   SET ORDER TO TAG TMPSTATE
   GO TOP

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 600,600 PIXEL TRUEPIXEL FONT oFont

   @ 60,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE "CUSTOMER" ;
      COLUMNS "STATE", "FIRST", "CITY", "AGE", "SALARY" ;
      CELL LINES NOBORDER

   WITH OBJECT oBrw
      :bRecSelData   := { || oBrw:KeyNo }
      :nRecSelWidth  := "9999"
      :AutoFit()
      //
      :CreateFromCode()
   END

   @ 20, 20 BUTTON "AL" SIZE 60,24 PIXEL OF oDlg ACTION ( CUSTOMER->( DBSEEK( "AL" ) ), oBrw:nRowSel := 1, oBrw:Refresh() )
   @ 20, 90 BUTTON "AR" SIZE 60,24 PIXEL OF oDlg ACTION ( CUSTOMER->( DBSEEK( "AR" ) ), oBrw:nRowSel := 1, oBrw:Refresh() )
   @ 20,160 BUTTON "AZ" SIZE 60,24 PIXEL OF oDlg ACTION ( CUSTOMER->( DBSEEK( "AZ" ) ), oBrw:nRowSel := 1, oBrw:Refresh() )
   @ 20,230 BUTTON "CA" SIZE 60,24 PIXEL OF oDlg ACTION ( CUSTOMER->( DBSEEK( "CA" ) ), oBrw:nRowSel := 1, oBrw:Refresh() )

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: xBrowse how to show a button-seek-result on top

Post by ukoenig »

Mr. Rao,
Thank You very much

Your sample works and I got it working as well.
From inside my program I added the following lines :

instead of buttons the value is selected from a second browser ( with a different array related to the index )
In case of the defined index the browser shows different values can be selected

oBrw2:bLClicked := { || ( nRow := oBrw2:nArrayAt, ;
IIF( nNEUTour = 1, ( ("TOUREN")->(DBSETORDER("TOUREN2")), ; // Index 1 = values F01 - F18
cTour := "F" + aTour[ nRow ] ), NIL ), ;
IIF( nNEUTour = 2, ( ("TOUREN")->(DBSETORDER("TOUREN3")), ; // Index 2 = values M01 - M18
cTour := "M" + aTour[ nRow ] ), NIL ), ;
IIF( nNEUTour = 3, ( ("TOUREN")->(DBSETORDER("TOUREN4")), ; // Index 3 = values S01 - S18
cTour := "S" + aTour[ nRow ] ), NIL ), ;
("TOUREN")->(DBSEEK( TRIM(cTour) ) ), ;
oBrw1:SetFocus(), ;
oBrw1:nRowSel := 1, oBrw1:Refresh() ) }


The second situation :
is there maybe a solution as well to show records on browser-top during incremental seek ?
or maybe better centered, to show the records before and after

regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
Post Reply