Page 1 of 1

records on xbrowse

PostPosted: Mon Mar 25, 2024 9:42 am
by Silvio.Falconi
I can Know how many records are on xbrowse ?
I explain

I would like to activate the arrows for moving the records (up and down) only when the records are greater than the normal number displayed in the xbrowse table

Re: records on xbrowse

PostPosted: Mon Mar 25, 2024 12:11 pm
by nageswaragunupudi

Re: records on xbrowse

PostPosted: Tue Mar 26, 2024 9:13 am
by Silvio.Falconi
nageswaragunupudi wrote:oBrw:nLen

But in case of DBF, please see
viewtopic.php?f=3&t=44259&p=268091&hilit=DELETED&sid=ff38ec55e29d34b39e3578311e2aeb8d#p268091


Image

I want to have the exact number of pages displayed with the dimensions of the xbrowse and I need this to activate my buttons which you can see in the right corner under the xbrowse
to activate my buttons I make

Code: Select all  Expand view

....
:CreateFromCode()
 END
lArrows:= IIF( oBrw:nDataRows<oBrw:nLen,.t.,.f.)


 


but it not run because I have 0 and -4

how I can resolve it ?

Re: records on xbrowse

PostPosted: Tue Mar 26, 2024 9:49 am
by nageswaragunupudi
oBrw:nLen and oBrw:nDataRows get their values after the first Refresh/paint of the browse.
Also oBrw:nDataRows changes when browse is resized.

Code: Select all  Expand view
DEFINE BUTTON/BTNBMP ..... (arrows)  ... WHEN ( oBrw:nDataRows >= oBrw:nLen )

would work

Re: records on xbrowse

PostPosted: Tue Mar 26, 2024 11:20 am
by Silvio.Falconi
nageswaragunupudi wrote:oBrw:nLen and oBrw:nDataRows get their values after the first Refresh/paint of the browse.
Also oBrw:nDataRows changes when browse is resized.

Code: Select all  Expand view
DEFINE BUTTON/BTNBMP ..... (arrows)  ... WHEN ( oBrw:nDataRows >= oBrw:nLen )

would work



Not%20working

I made
Code: Select all  Expand view
@  oBrw:nbottom+2, oBrw:nWidth-86 BTNBMP    aBtn[ 5 ]   SIZE 30, 25 PIXEL OF oDlg FLAT GDIP NOROUND  ; //
        RESOURCE "GRID_BOTTOM", "", hBmp, "" ;
     ACTION  oBrw:KeyDown(VK_DOWN, 0)  TOOLTIP "avanti"  WHEN (  oBrw:nDataRows >= oBrw:nLen   )
     @  oBrw:nbottom+2, oBrw:nWidth-56 BTNBMP    aBtn[ 6 ]   SIZE 30, 25 PIXEL OF oDlg FLAT GDIP NOROUND  ; //
        RESOURCE "GRID_TOP", "", hBmp1, "" ;
     ACTION oBrw:KeyDown(VK_UP, 0)   TOOLTIP "indietro" WHEN ( oBrw:nDataRows >= oBrw:nLen  )


INIT

Image

[img]with%20search[/img]

Image

Re: records on xbrowse

PostPosted: Tue Mar 26, 2024 11:29 am
by Silvio.Falconi
perhaps I resolved with WHEN ( oBrw:nDataRows < oDbf:OrdKeyCount() )

init
Image

after search
Image

Re: records on xbrowse

PostPosted: Tue Mar 26, 2024 12:43 pm
by nageswaragunupudi
oDbf:OrdKeyCount() )


This works only for oDbf.
Using oBrw:nLen or oBrw:KeyCount() works for all datasources.

Re: records on xbrowse

PostPosted: Tue Mar 26, 2024 12:49 pm
by Silvio.Falconi
nageswaragunupudi wrote:
oDbf:OrdKeyCount() )


This works only for oDbf.
Using oBrw:nLen or oBrw:KeyCount() works for all datasources.


ok but the button are not refreshed , only when I move the mouse into obrw

for a sample
WHEN ( oBrw:nDataRows <= oBrw:nLen ) not work
WHEN ( oBrw:nDataRows >= oBrw:nLen ) not work


oBrw:nDataRows <= oBrw:nLen - Not working

Image

oBrw:nDataRows >= oBrw:nLen Here it works but in reverse

Image

Re: records on xbrowse

PostPosted: Wed Mar 27, 2024 9:20 am
by Silvio.Falconi
any solution please ?

the problem is when I make a search for a sample "frank" ( on First) ndatarow is 3 and also obrw:nlen is 3

I tried to inser a variable nTotalrecords at init

oDbf:= TCustomer():New()
oDbf:setorder(1)
oDbf:Gotop()
nTotalRecords:= oDbf:OrdKeyCount()


and the on each button

WHEN ( nTotalRecords > oBrw:nDataRows ) but it's wrong also