xBrowse, footer and total dbf records

xBrowse, footer and total dbf records

Postby MOISES » Tue Dec 24, 2019 5:41 pm

Hello:

I would like to have a footer in xBrowse without column separations with the total number of records in the dbf that will be dynamically updated when records are added or deleted.

Please, how is this done?

Thank you very much.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: xBrowse, footer and total dbf records

Postby nageswaragunupudi » Wed Dec 25, 2019 5:10 am

APPROACH-1
Code: Select all  Expand view
#include "fivewin.ch"

REQUEST DBFCDX

function Main()

   local oDlg, oBar, oBrw, oFont

   SET DELETED ON
   USE STATES NEW SHARED

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 400,500 PIXEL TRUEPIXEL FONT oFont
   DEFINE BUTTONBAR oBar OF oDlg SIZE 80,32 2007

   @ 52,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE "STATES" AUTOCOLS ;
      CELL FOOTERS NOBORDER FASTEDIT

   WITH OBJECT oBrw
      :nEditTypes       := EDIT_GET
      :nRowDividerStyle := LINESTYLE_LIGHTGRAY

      :aCols[ 1 ]:bFooter := { || oBrw:nLen }
      :aCols[ 2 ]:cFooter := "States"

      //
      :CreateFromCode()
   END

   // Add,Edit,Delete buttons and actions
   DEFINE BUTTON OF oBar PROMPT "Add"    CENTER ACTION oBrw:EditSource( .t. )
   DEFINE BUTTON OF oBar PROMPT "Edit"   CENTER ACTION oBrw:EditSource()
   DEFINE BUTTON OF oBar PROMPT "Delete" CENTER ACTION oBrw:Delete()
   DEFINE BUTTON OF oBar PROMPT "Close"  CENTER ACTION oDlg:End() GROUP
   //

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil
 


Image

APPROACH-2

Code: Select all  Expand view
#include "fivewin.ch"

REQUEST DBFCDX

function Main()

   local oDlg, oBar, oBrw, oFont

   SET DELETED ON
   USE STATES NEW SHARED

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 400,500 PIXEL TRUEPIXEL FONT oFont
   DEFINE BUTTONBAR oBar OF oDlg SIZE 80,32 2007

   @ 52,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE "STATES" AUTOCOLS ;
      CELL FOOTERS NOBORDER FASTEDIT

   WITH OBJECT oBrw
      :nEditTypes       := EDIT_GET
      :nRowDividerStyle := LINESTYLE_LIGHTGRAY
      //
      :bRecSelHeader    := { || "RecNo" } // OR { || "SlNo" }
      :bRecSelData      := { || oBrw:BookMark } // OR { || oBrw:KeyNo }
      :bRecSelFooter    := { || oBrw:nLen }
      :nRecSelWidth     := "999"
      //
      :CreateFromCode()
   END

   // Add,Edit,Delete buttons and actions
   DEFINE BUTTON OF oBar PROMPT "Add"    CENTER ACTION oBrw:EditSource( .t. )
   DEFINE BUTTON OF oBar PROMPT "Edit"   CENTER ACTION oBrw:EditSource()
   DEFINE BUTTON OF oBar PROMPT "Delete" CENTER ACTION oBrw:Delete()
   DEFINE BUTTON OF oBar PROMPT "Close"  CENTER ACTION oDlg:End() GROUP
   //

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil
 


Image
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 58 guests