xbrows function

xbrows function

Postby Otto » Sat Dec 04, 2021 10:49 am

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

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: xbrows function

Postby Marc Venken » Mon Dec 06, 2021 8:26 pm

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
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1434
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: xbrows function

Postby Marc Venken » Mon Dec 06, 2021 8:50 pm

Just saw some interesting code in Fivedbu :

Code: Select all  Expand view  RUN

// 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



 
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1434
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: xbrows function

Postby nageswaragunupudi » Fri Dec 10, 2021 12:07 pm

Code: Select all  Expand view  RUN
oBrw := XBROWSER "STATES.DBF" NOMODAL

You can get back the oBrw object with command syntax also.
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

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