CLICK21 Posted November 28, 2008 Report Share Posted November 28, 2008 Prezados Fivewinners, Peço uma ajuda, como posso atualizar a minha listbox. quando o arquivo receber mais registros , gostaria de atualizar automaticamente. Estou fazendo um prg = o abaixo, mas não sai desse. []´s -------------- // Placing bitmaps at standard ListBoxes in FiveWin #include "FiveWin.ch" //----------------------------------------------------------------------------// function Main() local oDlg, oLbx, cCli, cVlr public cUpdate, cUpdate1, cIni, cFim , cTotal LMKDIR("TMP") set date brit SET _3DLOOK ON SET DELETE ON USE s:\sisfun\dbf\VENDAS ALIAS VENDAS SHARED cUpdate = lastrec() index on vendas->fantasia to c:\tmp\ix close index atualiza(cUpdate,0) sum all tmpbco->valor to cTotal go top DEFINE DIALOG oDlg TITLE " Faturamento de Clientes v. 1.0" FROM 1,.5 TO 27, 50 @ .5, .5 LISTBOX oLbx Fields TMPBCO->CLIENTE, TRANSFORM(TMPBCO->VALOR,"@Ez 9999,999,999.99"); header " Cliente"," Valor em R$"; Fieldsizes 220,50; SIZE 310,160 of oDlg @ 11, 1 say "Periodo de : " +transf(cIni,"@D")+" - "+transf(cFim,"@D") @ 11, 18 say " R$ "+transf(cTotal,"@ez 9,999,999,999.99") @ 10, 12 BUTTON "&Calculo" ACTION dbcloseall() ;main() @ 10, 22 BUTTON "&Sair " ACTION oDlg:End() ACTIVATE DIALOG oDlg CENTERED dbcloseall() erase c:\tmp\ix.ntx return nil Function atualiza(cup,cCont) local cCli, cVlr DBCREATE("C:\TMP\TMPBCO", { {"Cliente" , "C", 50, 0 },; {"Valor" , "N", 15, 2 } } ) USE C:\TMP\TMPBCO ALIAS TMPBCO NEW SELE VENDAS go bott m->cFim = vendas->emissao m->cIni = m->cFim - day(m->cFim) + 1 go top cup=lastrec() cCli = vendas->Fantasia cVlr = 0 set index to c:\tmp\ix DO WHILE !EOF() if vendas->emissao > m->cFim .or. vendas->emissao < m->cIni .OR. VENDAS->TIPOFAT#'VENDAS' skip loop endif cCli = vendas->Fantasia do while vendas->Fantasia = cCli IF VENDAS->BAIXA = 'S' SKIP LOOP ENDIF cVlr = cVlr + vendas->v_fatura1 skip ENDDO sele Tmpbco appe blank replace cliente with cCli replace valor with cVlr sele vendas cVlr = 0 ENDDO sele tmpbco go top return nil Adilson Paes FWH 2.5 - xharbour 0.99.50 - xmate 1.9k Quote Link to comment Share on other sites More sharing options...
CLICK21 Posted November 28, 2008 Author Report Share Posted November 28, 2008 Prezados Fivewinners, Peço uma ajuda, como posso atualizar a minha listbox. quando o arquivo receber mais registros , gostaria de atualizar automaticamente. Estou fazendo um prg = o abaixo, mas não sai desse. []´s -------------- // Placing bitmaps at standard ListBoxes in FiveWin #include "FiveWin.ch" //----------------------------------------------------------------------------// function Main() local oDlg, oLbx, cCli, cVlr public cUpdate, cUpdate1, cIni, cFim , cTotal LMKDIR("TMP") set date brit SET _3DLOOK ON SET DELETE ON USE s:\sisfun\dbf\VENDAS ALIAS VENDAS SHARED cUpdate = lastrec() index on vendas->fantasia to c:\tmp\ix close index atualiza(cUpdate,0) sum all tmpbco->valor to cTotal go top DEFINE DIALOG oDlg TITLE " Faturamento de Clientes v. 1.0" FROM 1,.5 TO 27, 50 @ .5, .5 LISTBOX oLbx Fields TMPBCO->CLIENTE, TRANSFORM(TMPBCO->VALOR,"@Ez 9999,999,999.99"); header " Cliente"," Valor em R$"; Fieldsizes 220,50; SIZE 310,160 of oDlg @ 11, 1 say "Periodo de : " +transf(cIni,"@D")+" - "+transf(cFim,"@D") @ 11, 18 say " R$ "+transf(cTotal,"@ez 9,999,999,999.99") @ 10, 12 BUTTON "&Calculo" ACTION dbcloseall() ;main() @ 10, 22 BUTTON "&Sair " ACTION oDlg:End() ACTIVATE DIALOG oDlg CENTERED dbcloseall() erase c:\tmp\ix.ntx return nil Function atualiza(cup,cCont) local cCli, cVlr DBCREATE("C:\TMP\TMPBCO", { {"Cliente" , "C", 50, 0 },; {"Valor" , "N", 15, 2 } } ) USE C:\TMP\TMPBCO ALIAS TMPBCO NEW SELE VENDAS go bott m->cFim = vendas->emissao m->cIni = m->cFim - day(m->cFim) + 1 go top cup=lastrec() cCli = vendas->Fantasia cVlr = 0 set index to c:\tmp\ix DO WHILE !EOF() if vendas->emissao > m->cFim .or. vendas->emissao < m->cIni .OR. VENDAS->TIPOFAT#'VENDAS' skip loop endif cCli = vendas->Fantasia do while vendas->Fantasia = cCli IF VENDAS->BAIXA = 'S' SKIP LOOP ENDIF cVlr = cVlr + vendas->v_fatura1 skip ENDDO sele Tmpbco appe blank replace cliente with cCli replace valor with cVlr sele vendas cVlr = 0 ENDDO sele tmpbco go top return nil Adilson Paes FWH 2.5 - xharbour 0.99.50 - xmate 1.9k Quote Link to comment Share on other sites More sharing options...
sambomb Posted November 28, 2008 Report Share Posted November 28, 2008 já tentou oLbx:Refresh() ? MSN: samirabreu@hotmail.com Skype: SamirAbreu xHarbour 1.1.0 + FwXh 8.02 Quote Link to comment Share on other sites More sharing options...
Ale SB Posted November 28, 2008 Report Share Posted November 28, 2008 Eu aconselho sempre usar tb o oDlg:UpDate(), dependendo da situaçao..vc precisa...atualizar a Dialog toda...para o refresh()...surtir algum efeito. Fica ai a Dica. @braços Ale aleseribeli@hotmail.com 18-3722-8639-Andradina/SPid=red> "The Flash quando quer se locomover com mais velocidade, vai com seu Opala." Quote Link to comment Share on other sites More sharing options...
sambomb Posted November 28, 2008 Report Share Posted November 28, 2008 Ale, no xbrowse precisar dar um oLbx:lUpdate := .T. para ele ser atualizado junto com o dialogo, sabe se no wBrowse tambem? MSN: samirabreu@hotmail.com Skype: SamirAbreu xHarbour 1.1.0 + FwXh 8.02 Quote Link to comment Share on other sites More sharing options...
Ale SB Posted November 28, 2008 Report Share Posted November 28, 2008 citação:Ale, no xbrowse precisar dar um oLbx:lUpdate := .T. para ele ser atualizado junto com o dialogo, sabe se no wBrowse tambem? MSN: samirabreu@hotmail.com Skype: SamirAbreu xHarbour 1.1.0 + FwXh 8.02 id=quote>id=quote>No xBrowse, Nao precisa nao. comigo..basta eu fazer isto..ja eh o suficiente para atualizar: REDEFINE BUTTONBMP oBtn[1] ; ID 701 OF oDlg ; ACTION ( Cada_Clie("I"),..., oBrw[1]:SetFocus(), oBrw[1]:Refresh(), oDlg:Update() ) ; id=code>id=code>Ja com o wBrowse...q eu nao uso a muito tempo....mas...qdo usava...aconselho a usar o update..sim. @braços Ale aleseribeli@hotmail.com 18-3722-8639-Andradina/SPid=red> "The Flash quando quer se locomover com mais velocidade, vai com seu Opala." Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.