New Meterxp

New Meterxp

Postby Silvio » Fri Jan 26, 2007 10:58 am

Have a small sample using a meter style xp ( tprogress) to index a file ?
on resource dialog ?
thanks
Best Regards, Saludos

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

Postby StefanHaupt » Fri Jan 26, 2007 6:42 pm

Silvio,

this a small sample

Code: Select all  Expand view
PROCEDURE NewIndex ()

LOCAL oFnt := SetFont ()
LOCAL oDlg, oMeter, oRadio, oSay, cSay := "Indiziere..."
LOCAL oOk, oClose
LOCAL nRadio
LOCAL nStart := 0, nTotal := 100

DEFINE DIALOG oDlg RESOURCE "INDEX" FONT oFnt

......

REDEFINE PMETER oMeter VAR nStart TOTAL nTotal ID 1000 OF oDlg FONT oFnt


REDEFINE BUTTON oOk ID 101 OF oDlg ACTION (oOk:disable(),;
                                           oClose:disable(),;
                                           BuildIdx (oMeter,oSay,,nRadio),;
                                           oClose:SetText(OemToAnsi("Schließen")),;
                                           oClose:enable() )

REDEFINE BUTTON oClose ID 102 OF oDlg ACTION ( oDlg:end() )

ACTIVATE DIALOG oDlg ON INIT dbCloseAll ()

oFnt:Release ()
OpenFiles ()
SetRela (0)

RETURN




#define idx_PROD 1
#define idx_LIEF 2
#define idx_KUND 3
#define idx_RECH 4
#define idx_RESE 5
#define idx_ANGE 6

//----------------------------------------------------------------//
STATIC PROCEDURE BuildIdx (oMeter,oText,lEnd, nRadio)

FIELD Datum, Plz, Beschr, Anbiet_Nr, Name, Vorname, Nr, Best_Nr, L_Nr
FIELD Firma, KundenNr, Anwendung, Ersatzart, Prod_Nr, Strasse
FIELD Hersteller,Art_name, ArtikelNr, Gruppe1, Gruppe2
FIELD I_Groesse, I_Speed, I_SpGr
FIELD K_Nummer, Intern1

LOCAL nTotal, nCount, nPos, nLast
LOCAL nChoice := nRadio
LOCAL lAll := (nChoice == 7)
LOCAL cExt := ORDBAGEXT ()
LOCAL aGrp := ReadTyp ()
LOCAL i := 1

LOCAL aIndex := {.f.,.f.,.f.,.f.,.f.,.f.}, nStart

IF lAll
  nRadio--
  FOR i := 1 TO nRadio
    aIndex[i] := .T.
  NEXT
  nStart := 1
ELSE
  aIndex[nRadio] := .T.
  nStart := nRadio
ENDIF

lEnd:=.F.
CLOSE ALL   // Alle Dateien schließen

FOR i :=  nStart TO nRadio

DO CASE
CASE aIndex[idx_PROD]

  FErase ("Product"+cExt)
  USE Product NEW
  nLast := LastRec()
  nPos := 0
  oMeter:SetRange (0, nLast)
  oMeter:Refresh()
  nCount := INT (oMeter:nTotal / 100)
  nCount := IIF (nCount < 1, 1, nCount)

oText:Varput ("Indiziere Produktdaten (1 von 42)"); oText:Refresh()//;nPos := 0
  INDEX ON UPPER (SubStr(Hersteller,1,10))+SUBSTR(Gruppe2,1,3) TAG Herst ;
        EVAL (oMeter:Set (RECNO()), SysRefresh(), !lEnd) EVERY nCount

....

oMeter:nTotal := 100
oMeter:Set(0)
oMeter:Refresh()
oText:Varput ("Indiziere..."); oText:Refresh()

CLOSE ALL

NEXT

RETURN


and in the rc-file

Code: Select all  Expand view
CONTROL "", 1000, "msctls_progress32", 0 | WS_CHILD | WS_VISIBLE, 9, 106, 136, 9


Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Postby Silvio » Mon Jan 29, 2007 11:11 am

Dear Stefan
Can you send me an private email because i lose your personal email
thanks Danke
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: Google [Bot] and 56 guests