INDEXING ON XBROWSE OPENED

INDEXING ON XBROWSE OPENED

Postby Silvio » Mon Mar 15, 2010 12:39 pm

LOOK THE TEST CODE PLEASE


I WANT ONLY INDEX FILE LICENZE.DBF WHEN THERE IS THE XBROWSE OPENED

I OPEN A SIMPLY XROWSE INTO A MAIN WINDOW


ANY IDEA ?

Code: Select all  Expand view

#include "FiveWin.ch"
#include "XBrowse.ch"



REQUEST DBFCDX
REQUEST DBFFPT




STATIC oBrw,oWnd


function Main()

   local  oBar, oIcon
   local cAppName  := i18n("Licenze 2009")
   local cVersion  := "1.00 RC-1"
   local cBuild    := "build 01.09.2009"
   LOCAL cMsgBar   := "© Falconi Silvio"
   LOCAL oMsgItem2
   LOCAL  oFont := TFont():New( GetDefaultFontName(), 0, GetDefaultFontHeight(),, )

    DEFINE ICON oIcon RESOURCE "ICON1"

   RddSetDefault( "DBFCDX" )

   SetHandleCount( 100 )

   SET DATE FORMAT "dd-mm-yyyy"
   SET DELETED     ON
   SET CENTURY     ON
   SET EPOCH TO    year( date() ) - 20
   SET MULTIPLE    OFF


     if ! Db_Open( "LICENZE", "LI" )
      return NIL
   endif



   DEFINE WINDOW oWnd   ;
      TITLE cAppName + cVersion ;
      COLOR CLR_BLACK, GetSysColor( 15 ) - Rgb( 30, 30, 30 ) ;
      ICON oIcon






 @ 0, 0 XBROWSE oBrw OF oWnd ALIAS "LICENZE"

  SET MESSAGE OF oWnd TO cMsgBar CENTER NOINSET 2007

   oBrw:CreateFromCode()
   oWnd:oClient = oBrw
   ACTIVATE WINDOW oWnd ON INIT PlaceControls( oWnd,oBrw )
   RETURN NIL



FUNCTION Db_Open(cdbf, cAlias )
  use &cDbf ALIAS  &cAlias index &cDbf
  RETURN .t.





FUNCTION Indici( lPack )
   LOCAL oDlgw, oMeter
   LOCAL nActual := 0

   DEFINE DIALOG oDlgw FROM 00,00 TO 06,55 ;
                     TITLE IIf( lPack = .T., "COMPATTARE", "REINDICIZZARE")
   @ 01,02 METER oMeter VAR nActual OF oDlgw ;
                        TOTAL 100 ;
                        SIZE 190,12 ;
                        PROMPT "Percentuale:"
   ACTIVATE DIALOG oDlgw CENTERED NOWAIT

   DelFile( "LICENZE.CDX" )

   USE LICENZE ALIAS LU NEW
   IF lPack = .T.
      PACK
   ENDIF

   INDEX ON LU->NOMEINTERO TAG UTENTI TO LICENZE


   nActual := 100
   oMeter:Set( nActual )
   oMeter:Refresh()
   SysRefresh()
   oDlgw:End()

      if ! Db_Open( "LICENZE", "LI" )
      return NIL
   endif

   RETURN NIL






 STAT  FUNCTION PlaceControls( oWnd,oLbx )
 LOCAL oBAR

    DEFINE BUTTONBAR oBar _3D SIZE 44, 46 OF oWnd 2007



  DEFINE BUTTON OF oBar ;
     FILENAME ".\MENU\REFRESCAR.BMP"       ;
     TOOLTIP i18n( "Indicizza" ) ;
     MESSAGE i18n( "Crea gli indici." ) ;
     GROUP NOBORDER  ;
     ACTION indici(.T.)


 RETUR NIL










 
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Marc Venken and 107 guests