├── src └── MsgTimer.prw ├── Examples ├── FwAlertInfo.png ├── FwAlertError.png ├── FwAlertSucces.png ├── Console_IsBlind.png ├── FwAlertWarning.png ├── MsgTimer_Alert_NoYes.png ├── MsgTimer_Info_YesNo.png ├── MsgTimer_Error_Default.png └── MsgTimer_Success_Default.png └── README.md /src/MsgTimer.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlencarGabriel/advpl-MsgTimer/HEAD/src/MsgTimer.prw -------------------------------------------------------------------------------- /Examples/FwAlertInfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlencarGabriel/advpl-MsgTimer/HEAD/Examples/FwAlertInfo.png -------------------------------------------------------------------------------- /Examples/FwAlertError.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlencarGabriel/advpl-MsgTimer/HEAD/Examples/FwAlertError.png -------------------------------------------------------------------------------- /Examples/FwAlertSucces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlencarGabriel/advpl-MsgTimer/HEAD/Examples/FwAlertSucces.png -------------------------------------------------------------------------------- /Examples/Console_IsBlind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlencarGabriel/advpl-MsgTimer/HEAD/Examples/Console_IsBlind.png -------------------------------------------------------------------------------- /Examples/FwAlertWarning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlencarGabriel/advpl-MsgTimer/HEAD/Examples/FwAlertWarning.png -------------------------------------------------------------------------------- /Examples/MsgTimer_Alert_NoYes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlencarGabriel/advpl-MsgTimer/HEAD/Examples/MsgTimer_Alert_NoYes.png -------------------------------------------------------------------------------- /Examples/MsgTimer_Info_YesNo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlencarGabriel/advpl-MsgTimer/HEAD/Examples/MsgTimer_Info_YesNo.png -------------------------------------------------------------------------------- /Examples/MsgTimer_Error_Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlencarGabriel/advpl-MsgTimer/HEAD/Examples/MsgTimer_Error_Default.png -------------------------------------------------------------------------------- /Examples/MsgTimer_Success_Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlencarGabriel/advpl-MsgTimer/HEAD/Examples/MsgTimer_Success_Default.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # advpl-MsgTimer 2 | Função AdvPL de mensagens (Alert, Info, Stop, Success, YesNo e NoYes) com Timer para fechamento automático 3 | 4 | ### Exemplo de utilização: 5 | 6 | ~~~xBase 7 | U_MsgTimer(10, "Mensagem", "Título", MT_ISUCCES, MT_TDEFAULT) 8 | ~~~ 9 | 10 | ![Exemplo Msg Timer](Examples/MsgTimer_Success_Default.png) 11 | 12 | ## Finalidade 13 | Apresentar uma mensagem no formato padrão do Protheus 12, permitindo o fechamento automático caso o usuário não interaja com a mensagem, evitando sessões abertas por muito tempo desnecessariamente. 14 | 15 | > Saiba mais em meu blog: [https://gabrielalencar.dev/2020/01/07/MsgTimer-Advpl-Protheus](https://gabrielalencar.dev/2020/01/07/MsgTimer-Advpl-Protheus/) 16 | 17 | ## Implementação 18 | Compilar o fonte `MsgTimer.prw` no seu RPO e chamar via chamada de função de usuário `U_MsgTimer()`. 19 | 20 | > Caso deseje, o arquivo pode ser renomeado para `.tlpp`, o funcionamento será o mesmo porém no formato TL++. 21 | 22 | ## Futuras implementações 23 | - [x] [Implementar Conout quando IsBlind](https://github.com/AlencarGabriel/advpl-MsgTimer/issues/1) 24 | 25 | ## [Reportar problemas ou sugerir melhorias](https://github.com/AlencarGabriel/advpl-MsgTimer/issues) 26 | 27 | ## Colaborar 28 | Assim como meu objetivo é ajudar aqueles que precisam, caso você faça uma melhoria ou encontre algum problema no projeto, fique a vontade para ajustar e me mandar seu [Pull Request](https://github.com/AlencarGabriel/advpl-MsgTimer/pulls), estarei avaliando e com certeza sendo útil estará disponível e farei uma agradecimento. 29 | 30 | --- 31 | 32 | # Documentação 33 | 34 | ### Lista de Parâmetros: 35 | 36 | Ordem | Parâmetro | Tipo | Opcional? | Default | Descrição 37 | :----:|-----------|-------------|:----------:|:-----------:|------------------------------- 38 | 1 | nSeconds | Numeric | Sim | 0 | Tempo em segundos que a mensagem será exibida antes de ser fechada 39 | 2 | cMensagem | Characters | Sim | " " | Descrição da mensagem [TEXT or HTML Formats] 40 | 3 | cTitulo | Characters | Sim | " " | Título da mensagem [TEXT or HTML Formats] 41 | 4 | cIcone | Characters | Sim | MT_IINFO | Ícone formato **MT_I** [ICON OF MESSAGE] ou RESOURCE compilados 42 | 5 | nTipo | Numeric | Sim | MT_TDEFAULT | Tipo **(botões)** da mensagem formato **MT_T** [TYPE OF MESSAGE] 43 | 44 | > **Importante!** 45 | > - Uso de HTML no Título e/ou Mensagem pode ocasionar problemas de dimensionamento nas mensagens; 46 | > - O parâmetro `cIcone` pode receber qualquer *resource* compilado no RPO; 47 | > - É possível combinar qualquer ícone com qualquer tipo de mensagem; 48 | > - O parâmetro `nSeconds` quando 0 (zero) não apresentará o contador de tempo, nem fechará a mensagem automaticamente; 49 | > - Cuidado ao utilizar mensagem com Timer e tipo `NoYes` ou `YesNo`, pois o retorno default caso o tempo exceda será o botão focado: **No** ou **Yes**. 50 | 51 | ### Definições: 52 | 53 | Definição | Descrição | Retorno Default 54 | ------------|------------------------------------------------------|--------------------- 55 | MT_TDEFAULT | Adiciona somente o botão default "Fechar" | Nil 56 | MT_TYESNO | Adiciona os botões "Sim" e "Não", focando no "Sim" | .T. 57 | MT_TNOYES | Adiciona os botões "Não" e "Sim", focando no "Não" | .F. 58 | MT_ISUCCES | Ícone Default Sucesso | Ícone não influencia no retorno 59 | MT_IALERT | Ícone Default Alerta | Ícone não influencia no retorno 60 | MT_IERROR | Ícone Default Erro | Ícone não influencia no retorno 61 | MT_IINFO | Ícone Default Informação | Ícone não influencia no retorno 62 | 63 | ## Exemplos de utilização: 64 | 65 | Exemplo | Code 66 | --------|------------- 67 | ![MsgTimer Alert NoYes](Examples/MsgTimer_Alert_NoYes.png) | U_MsgTimer(10, "Mensagem", "Título", MT_IALERT, MT_TNOYES) 68 | ![MsgTimer Error Default](Examples/MsgTimer_Error_Default.png) | U_MsgTimer(10, "Mensagem", "Título", MT_IERROR, MT_TDEFAULT) 69 | ![MsgTimer Info YesNo](Examples/MsgTimer_Info_YesNo.png) | U_MsgTimer(10, "Mensagem", "Título", MT_IINFO, MT_TYESNO) 70 | ![MsgTimer Success Default](Examples/MsgTimer_Success_Default.png) | U_MsgTimer(10, "Mensagem", "Título", MT_ISUCCES, MT_TDEFAULT) 71 | 72 | ## Compatibilidade Homologada 73 | 74 | - [x] Protheus 12 - Release 17 75 | - [x] Protheus 12 - Release 23 76 | - [x] Protheus 12 - Release 25 77 | - [x] Protheus 12 - Release 27 78 | 79 | ## Comportamento em caso de execução sem interface `IsBlind()` 80 | 81 | ![MsgTimer sem interface](Examples/Console_IsBlind.png) 82 | --------------------------------------------------------------------------------