EDUTEK Posted July 20, 2019 Report Share Posted July 20, 2019 Bom Dia! Como faço para mostrar uma dialogo por n tempo num xbrowse? eu já uso o DEFINE TIMER mas como que eu faço para a dialog ficar visível e depois de "n" tempo fechar automaticamente, sem ação do usuário. pois será um painel tipo aeroporto, o xbrowse ele já atualiza, tenho 2 xbrowse ( Veiculos em manutenção e Veiculos Liberados) eu gostaria de mostrar quando um veiculo fosse liberado, mostrar um dialogo por alguns segundos com os ultimos veiculos liberados e depois fechar automaticamente. alguém sabe como faço isso ? Quote Link to comment Share on other sites More sharing options...
kapiaba Posted July 22, 2019 Report Share Posted July 22, 2019 Como faço para mostrar uma dialogo por n tempo num xbrowse? Não entendi? Quote Link to comment Share on other sites More sharing options...
EDUTEK Posted July 22, 2019 Author Report Share Posted July 22, 2019 tenho 2 xbrowse nque mostra 1 - veiculos em manutencao e 2 - veiculos liberados usando o define timer DEFINE TIMER oTimer2 INTERVAL 20000 ACTION {syslog_os_painel_mostra(),oDlg:SetFocus(),oSay2:refresh(),oSay3:refresh(),oBrw:refresh(),oBrw2:refresh() } OF oDlg executo um dialogo que mostra os 3 últimos veículos liberados. eu queria mostrar o Dialogo por 20 segundo e fechar automaticamente. pois não vai ter interferência de usuário, é uma tela que fica na sala dos motoristas. Quote Link to comment Share on other sites More sharing options...
Theotokos Posted July 22, 2019 Report Share Posted July 22, 2019 não sei se daria certo, mas um ideia, pois não testei... vc colocar no ON PAINT da dialog em questão um temporizador e então ao final fechar oDialog:bPaint := {|| Sleep(20000), oDialog:End() } mais ou menos isso... Quote Link to comment Share on other sites More sharing options...
kapiaba Posted July 22, 2019 Report Share Posted July 22, 2019 Procure no \samples Por: GetTickCount() Quote Link to comment Share on other sites More sharing options...
kapiaba Posted July 22, 2019 Report Share Posted July 22, 2019 FUNCTION... MsgRun( "Desligando o Programa... ", ; "Por Favor, Espere! ", ; { | oDlg | ( DESLIGA_PROG( oDlg ) ) } ) LIBERA_TUDO() RETURN NIL //-> Mostra o Desligamento do Programa FUNCTION DESLIGA_PROG_NFE( oDlg ) LOCAL nFor, nStart FOR nFor := 4 to 0 step -1 nStart = GetTickCount() while ( GetTickCount() - nStart ) < 1000 end oDlg:cMsg := "Aguarde, Desligando o Programa em: "+ ; LTrim( Str( nFor ) ) + " Segundo" + ; If( nFor > 1, "s", "" ) oDlg:Refresh() SysRefresh() NEXT RETURN NIL FUNCTION LIBERA_TUDO() FreeResources() SysRefresh() DbCloseAll() RELEASE All Hb_GCAll( .T. ) CLEAR MEMORY PostQuitMessage( 0 ) __QUIT() RETURN NIL Quote Link to comment Share on other sites More sharing options...
EDUTEK Posted July 22, 2019 Author Report Share Posted July 22, 2019 Grato! vou testar ambos. Quote Link to comment Share on other sites More sharing options...
Jmsilva Posted July 22, 2019 Report Share Posted July 22, 2019 #include "FiveWin.ch" function Main() local oDlg, cTest := "Hello world! " DEFINE DIALOG oDlg TITLE "I am a DialogBox" COLOR "W+/B" @ 1, 3 GET cTest @ 3, 5 BUTTON "&Teste" SIZE 40, 12 ; ACTION test() DEFAULT @ 3, 16 BUTTON "&Sair" SIZE 40, 12 ACTION oDlg:End() ACTIVATE DIALOG oDlg CENTERED ; VALID MsgYesNo( "Do you want to end ?" ) return nil function Test() local oDlg, cTest := "Teste nowiant " DEFINE DIALOG oDlg TITLE "Teste 2" COLOR "W+/gr" @ 1, 3 say cTest OF oDlg COLOR ("N/W") ACTIVATE DIALOG oDlg CENTERED NOWAIT SYSWAIT(2) oDlg:END() return nil Quote Link to comment Share on other sites More sharing options...
EDUTEK Posted July 23, 2019 Author Report Share Posted July 23, 2019 Obrigado, usando NOWAIT na dialog e o SYSWAIT() funcionou da forma que eu precisava. Obrigado a todos. Jmsilva 1 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.