Page 1 of 1
xbrows function
Posted: Sat Dec 04, 2021 10:49 am
by Otto
Hello friends,
I always use xBrowse for testing.
I have never looked at xBrowse.prg so closely because I was always satisfied with the result.
Today I would have been comfortable if I had a non-modal xBrowser.
I thought, maybe I can just change the source code.
But you can transfer all of these parameters.
XBrowse( uData, cTitle, lAutoSort, bSetUp, aCols, bSelect, lExcel, lFastEdit, bValid, cSerial, lNoModal, lAutoFit )
It is also interesting that you can get the xBrowse object back and make further adjustments with it.
e.g. size and position
Best regards,
Otto

Re: xbrows function
Posted: Mon Dec 06, 2021 8:26 pm
by Marc Venken
Otto,
I also use Xbrowse dayly and most of my program is used from inside xbrowses....
You use autocode for generating xbrowses, but I'm looking (thinking) into a other way.
oBrowse:= MyBrowse("Customers")
and from this point in code I think to generate a function that will retrieve ALL possible data from a Xbrowse (setup/maintenance) function where all xbrowses are located.
This function would look somewhat like this :
Function MyBrowse(cBrowse)
local oBrw
use Xbrw // data needed to generate the xbrowse Customers
Seek the cBrowse
Start generating the browse
oBrw:=xbrowse(xBrw->dbf,xBrw->title,xBrw->lSort,..... ) // XBrowse( uData, cTitle, lAutoSort, bSetUp, aCols, bSelect, lExcel, lFastEdit, bValid, cSerial, lNoModal, lAutoFit )
//more setup if possible
if !empty(xBrw->Header)
oBrw:setgroupheader("xBrw->header",xbrw->headerfrom,xBrw->headerto)
endif
etc... etc...
It's just a starting idea, because I have to generate Xbrowse a lot and this way the code for them would almost be only 1 line.
I'm sure this technique is used be people at this forum, so I hope a working starting program will be posted ))
return oBrw
Re: xbrows function
Posted: Mon Dec 06, 2021 8:50 pm
by Marc Venken
Just saw some interesting code in Fivedbu :
Code: Select all | Expand
// xbrowse is setup here...
StyleBrowse( oBrw )
Static Function StyleBrowse( oBrw )
WITH OBJECT oBrw
:l2007 := .F.
:nMarqueeStyle := MARQSTYLE_HIGHLROW
:lFullGrid := .T.
:lRowDividerComplete := .T.
:lColDividerComplete := .T.
//:nRowDividerStyle := LINESTYLE_NOLINES
:nColDividerStyle := LINESTYLE_LIGHTGRAY
:nRowDividerStyle := LINESTYLE_LIGHTGRAY
:nHeaderHeight := 23
//:nFooterHeight := oBrw:nHeaderHeight
:nRowHeight := oBrw:nHeaderHeight
//:nStretchCol := 1
:nFreeze := 1
if lPijama
:SetColor( CLR_BLACK, RGB( 232, 255, 232 ) )
else
:SetColor( nClrTxtBrw, nClrBackBrw )
endif
END
Return nil
Re: xbrows function
Posted: Fri Dec 10, 2021 12:07 pm
by nageswaragunupudi
You can get back the oBrw object with command syntax also.