Jump to content
Fivewin Brasil

Janela temporária para Indexação


aldreks

Recommended Posts

Alguém sabe como fazer uma janela/dialogo que seja visualizada enqto se processa uma indexação?? Entenda-se q não pode haver botão nenhum nesta janela/dialogo.

Tipo: "Aguarde finalização de Indexação!"

Alguém tem o código para a escala de progresso do processo?

No aguardo.

-------------------------

qadoshy@hotmail.com

Clipper 5.2e/BLinker7/FW 1.9.1

Link to comment
Share on other sites

Eu fiz um igual se servir

*-----------------------------------------> 30/01/2003

function MsgApres( bAction, cMsg, cTitle )

local oDlg, oMeter, oText, oBtn, oFont

local lEnd := .f., lCancel := .f.

local nVal := 0

DEFAULT bAction:={ || nil }, cMsg:="Processing...", cTitle := "Please, wait"

DEFINE FONT oFont NAME "MS Sans Serif" SIZE 0, -10 Bold

DEFINE DIALOG oDlg FROM 5, 5 TO 11.4, 45 TITLE cTitle FONT oFont ;

STYLE nOr( WS_POPUP,WS_BORDER, WS_VISIBLE ) ;

COLOR 13, RGB( 255, 255, 200 )

@ 0.2, 0.5 SAY oText VAR cMsg SIZE 130, 10 OF oDlg

@ 1, 0.5 METER oMeter VAR nVal TOTAL 10 SIZE 150, 10 OF oDlg

@ 3, 18 BUTTON oBtn PROMPT "&Cancela" OF oDlg ;

ACTION ( lEnd:= .t., lCancel:= .t. ) SIZE 32, 11

* This block gets evaluated only the first time the DialogBox is painted !!!

oDlg:bStart = { || Eval( bAction, oMeter, oText, oDlg, @lEnd, oBtn ),;

lEnd := .t., oDlg:End() }

ACTIVATE DIALOG oDlg VALID lEnd centered nowait

return lCancel

*------------------------------------------------- 20/09/2000

FUNCTION BuildIndex(oMeter, oText, oDlg, lEnd, campo, bolsa )

oMeter:nTotal = RecCount()

OrdSetFocus(0)

if wtiparq

INDEX ON &CAMPO TO &bolsa EVAL (oMeter:Set(RecNo()),SysRefresh(), ! lEnd )

else

INDEX ON &(Campo) TAG &(Bolsa) EVAL (oMeter:Set(RecNo()),SysRefresh(),!lEnd)

endif

RETURN NIL

Exemplo:

*---------------------------------------------

function ires()

if !netuse('resoluca',.t.,0)

return nil

endif

pack

MsgApres( { | oMeter, oText, oDlg, lEnd | ;

BuildIndex( oMeter,oText,oDlg,@lEnd,"RESOLUCA->resoluca","RESOLUCA")},;

"Indexando Arquivo de Resolucao... RESOLUCA.NTX", "Espere um momento" )

MsgApres( { | oMeter, oText, oDlg, lEnd | ;

BuildIndex( oMeter, oText, oDlg, @lEnd, "val(resoluca->resoluca)", "ordres" ) },;

"Indexando Arquivo de Resolucao... ORDRES.NTX", "Espere um momento" )

MsgApres( { | oMeter, oText, oDlg, lEnd | ;

BuildIndex( oMeter, oText, oDlg, @lEnd, "resoluca->projeto", "resproj" ) },;

"Indexando Arquivo de Resolucao... RESPROJ.NTX", "Espere um momento" )

MsgApres( { | oMeter, oText, oDlg, lEnd | ;

BuildIndex( oMeter, oText, oDlg, @lEnd, "resoluca->data", "resdata" ) },;

"Indexando Arquivo de Resolucao... RESDATA.NTX", "Espere um momento" )

dbCloseAll()

return nil

luis

Link to comment
Share on other sites

Amigo Personal, segui suas orientações, porém o diálogo não chega a aparecer. A função roda, processa tudo direitinho, soa o beep mas o dialogo não é mostrado. Pq??

Aguardo seu retorno ou de alguém q possa me ajudar.

FUNCTION mINDEXA

****************

Private oDlgIndexa

DEFINE DIALOG oDlgIndexa ;

Title "Indexação de Arquivos. Aguarde..." ;

FROM 0,0 to 150,300 pixel;

OF oJanWPoint

ACTIVATE DIALOG oDlgIndexa Centered ON INIT _INDEXA()

RETURN(.T.)

FUNCTION _INDEXA

****************

INDEXAR([PONTO])

INDEXAR([FUNCIONA])

INDEXAR([ACESSO])

tone(2800,1)

RETURN(oDlgIndexa:end())

citação:

Faça uma Dialog normal, do jeito que voce quiser,

coloque um ON INIT Sua_função(), o retorno da sua

função oDlg:End()

Logo.jpg


id=quote>id=quote>

-------------------------

qadoshy@hotmail.com

Clipper 5.2e/BLinker7/FW 1.9.1

Link to comment
Share on other sites

Eu faço assim:

FUNCTION reorgani(oWnd)

LOCAL oMeter

LOCAL lOk := .F.

IF MsgNoYes("Reorganiza as bases de dados agora ?","CONFIRME")

FERASE("*.cdx")

MsgMeter({|oMeter,oText,oWnd| indesist( oMeter,oWnd)},"Reorganizando os dados","AGUARDE")

lOk := .T.

ENDIF

RETURN(nil)

*******************************

Siage

Clipper 5.3b, Fivewin 2.4, Exospace, Blinker 7

Editado por - siage on 07/04/2005 10:08:02

Editado por - siage on 07/04/2005 10:08:57

Editado por - siage on 07/04/2005 10:09:34

Link to comment
Share on other sites

Olá Siage,

1ªmente, seja muito bem vindo ao fórum icon_smile_big.gif

2ªmente, vc também pode usar a Meter da VMsgBar icon_smile_wink.gif, eu uso e vc pode até minimizar o programa enquanto está reorganizando sem dar nenhum problema, ou então rodar outro programa icon_smile_wink.gif

Vagner Wirts

Clipper 5.2 Lib 5.3 - Blinker 5.0 FW 2.0, Harbour 43.0 (Flex), xHarbour 99.1 99.2 99.3 (Simplex) FW 2.5 icon_smile_big.gif

Link to comment
Share on other sites

Grande Vagner, q tal vc abrir a caixa de ferramenta e expor para o ET aqui do q se trata sua colocação?

Como é a sua forma de fazer a tal janela temporária com o meter sem q haja aquele botão de OK, e etc???

Vc pode revelar todo o código, ou é caixa preta de avião??

Será q isso fica apenas reservado aos deuses do Olimpo??

Abraços meu amigo!

*********

citação:

Olá Siage,

1ªmente, seja muito bem vindo ao fórum icon_smile_big.gif

2ªmente, vc também pode usar a Meter da VMsgBar icon_smile_wink.gif, eu uso e vc pode até minimizar o programa enquanto está reorganizando sem dar nenhum problema, ou então rodar outro programa icon_smile_wink.gif

Vagner Wirts

Clipper 5.2 Lib 5.3 - Blinker 5.0 FW 2.0, Harbour 43.0 (Flex), xHarbour 99.1 99.2 99.3 (Simplex) FW 2.5 icon_smile_big.gif


id=quote>id=quote>

-------------------------

qadoshy@hotmail.com

Clipper 5.2e/BLinker7/FW 1.9.1

Link to comment
Share on other sites

Olá Aldreks,

Baixe em dicas + dicas, têm a VBar com meter, lá lhe dá um exemplo de como usar o meter na minha vbar, o restante é tudo a mesma coisa, só não crio uma dialog para isso, uso desse jeito :

/*---- Funcao para Ordenar Arquivos ----*/

Func Ordenar(cOpc_Reo,cArq_Reo,cInd_Reo,aTag_Reo,aCha_Reo,lFaz_Tem,aCon_Reo,lDescend)

Local cDrive := DbSetDriver(),nX,nXxx_Reo,nNr_Maxi

Static nQual := 0

CursorWait()

nQual ++

Do Whil .T.

DbUseArea(.T.,Iif(cDrive=="DBFCDX","DbfCdx","ADS"),cArq_Reo,"ArquAuxi",.F.)

If Used()

cAr1_Reo := oSistema:cServidor__+oSistema:cArqu_Tempo+"\"+Right(cInd_Reo,8)+Iif(cDrive=="DBFCDX".or.cDrive=="ADS",".Cdx",".Ntx")

cCh1_Reo := aCha_Reo[1]

If lFaz_Tem

DbClearIndex()

oWnd:oMsgBar:MeterOn(LastRec(),300)

oWnd:oMsgBar:oMeter:nClrPane := {nRgb(248,211, 86),nRgb(132,112, 32)}

oWnd:oMsgBar:oMeter:nClrText := nRgb(0,0,0)

oWnd:oMsgBar:cMetTexto := "Arrumando "+cOpc_Reo

nNr_Maxi := LastRec()

Inde On &cCh1_Reo To &cAr1_Reo Eval {|| Nr_Record() }

oWnd:oMsgBar:MeterOff()

Endif

If lFaz_Tem

oWnd:oMsgBar:MeterOn(LastRec(),300)

oWnd:oMsgBar:oMeter:nClrPane := {nRgb(248,211, 86),nRgb(132,112, 32)}

oWnd:oMsgBar:oMeter:nClrText := nRgb(0,0,0)

oWnd:oMsgBar:cMetTexto := "Arquivo Temporário para "+cOpc_Reo

nNr_Maxi := LastRec()

cArq := oSistema:cServidor__+oSistema:cArqu_Tempo+"\Arq"+oSistema:cNr_Usuario+StrZero(nQual,2)

Copy To (cArq) Whil Nr_Record() <= nNr_Maxi For !Deleted()

Close ArquAuxi

cAr0_Reo := cArq_Reo+".Dbf"

Eras &cAr0_Reo

oWnd:oMsgBar:MeterOff()

Endif

cAr1_Reo := oSistema:cServidor__+oSistema:cArqu_Tempo+"\"+Right(cInd_Reo,8)+Iif(cDrive=="DBFCDX".or.cDrive=="ADS",".Cdx",".Ntx")

Eras &cAr1_Reo

If lFaz_Tem

Rena (cArq+".Dbf") To &cAr0_Reo

Endif

DbUseArea(.T.,Iif(cDrive=="DBFCDX","DbfCdx","ADS"),cArq_Reo,"ArquAuxi",.F.)

For nXxx_Reo := 1 To Len(aCha_Reo)

oWnd:oMsgBar:MeterOn(LastRec(),300)

oWnd:oMsgBar:oMeter:nClrPane := {nRgb(248,211, 86),nRgb(132,112, 32)}

oWnd:oMsgBar:oMeter:nClrText := nRgb(0,0,0)

oWnd:oMsgBar:cMetTexto := cOpc_Reo+" "+AllTrim(Str(nXxx_Reo,3))+"º Arquivo Ãndice"

// oWnd:oMsgBar:MeterSet(nXxx_Reo)

cAr1_Reo := cInd_Reo

cTag_Reo := aTag_Reo[nXxx_Reo]

cCh1_Reo := aCha_Reo[nXxx_Reo]

cCo1_Reo := aCon_Reo[nXxx_Reo]

If ValType(cCo1_Reo) # "U" .and. cCo1_Reo # Nil .and. !Empty(cCo1_Reo)

If lDescend

Inde On &cCh1_Reo Tag &cTag_Reo To &cAr1_Reo For (!Deleted() .and. &cCo1_Reo) Descending Eval {|| Nr_Record() }

Else

Inde On &cCh1_Reo Tag &cTag_Reo To &cAr1_Reo For (!Deleted() .and. &cCo1_Reo) Eval {|| Nr_Record() }

Endif

Else

If lDescend

Inde On &cCh1_Reo Tag &cTag_Reo To &cAr1_Reo For !Deleted() Descending Eval {|| Nr_Record() }

Else

Inde On &cCh1_Reo Tag &cTag_Reo To &cAr1_Reo For !Deleted() Eval {|| Nr_Record() }

Endif

Endif

oWnd:oMsgBar:MeterOff()

Next

Close ArquAuxi

Exit

Endif

Enddo

CursorArrow()

//oReor:End()

Retu("")

*---- Funcao para Colocar numero de Registros na Copia ----*

Static Func Nr_Record()

CursorWait()

oWnd:oMsgBar:MeterSet(Recno())

SysRefresh()

Retu(Recno())

Vagner Wirts

Clipper 5.2 Lib 5.3 - Blinker 5.0 FW 2.0, Harbour 43.0 (Flex), xHarbour 99.1 99.2 99.3 (Simplex) FW 2.5 icon_smile_big.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...