;** Imp_Ret  ********************************************************************
;* Importa‡Æo de Retorno de Banco                                              *
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido    : 18/01/2020 por Bruno Carvalho
;Ultima Alteracao:   /  /     por                            
;Motivo Alteracao:

;*******************************************************************************
;* Rotina                                                                      *
;*******************************************************************************
Proc SD_DialogImpRet(Disparo,Campo,Evento,Elemento)
Temp=True
MSG_CAMPO=""
TECLA=""
If Disparo="OPEN"  Then AoCriarShowDialog() EndIf
If Disparo="EVENT" And Evento["Type"]="KEY" Then
   Switch
     Case Evento["KeyCode"] = 9: Temp=False
     Case Evento["KeyCode"] = -59: Dialog_F1()
     Case Evento["KeyCode"] =  27:
          Temp=False
          Switch
            Case Campo="TG_OPCOES"        : Campo="NO"
            Case Campo="YES" Or Campo="NO": Campo="TG_OPCOES"
          EndSwitch
     Case (Evento["KeyCode"] <= -104 And Evento["KeyCode"] >= -113) Or
           Evento["KeyCode"]  = -139 Or  Evento["KeyCode"]  = -140:
           SYS_TECLA_ACIONADA=Evento["KeyCode"]
           Seta_Tecla_Acionada()
           CancelDialog
     Case Evento["KeyCode"] = 13:
          Temp=False
          If Checa_TAG()
             Then Switch
                    Case Campo="TG_OPCOES"   : Campo="YES"
                  EndSwitch
          EndIf
          RefreshDialog
   EndSwitch
EndIf
Switch
  Case Campo="TG_OPCOES"    : MensagemRadioButtons()
Endswitch

Monta_Prompt(MSG_CAMPO,TECLA)
Return Temp

EndProc ;SD_DialogImpRet

;*******************************************************************************
;* ROTINA PRINCIPAL                                                            *
;*******************************************************************************
AutoLib="\\Sistemas\\Cadastro\\Bib_Show,\\Sistemas\\Cadastro\\Bibliot"
LimpAguarde()

While True
  ShowDialog "Importa‡Æo de Retorno" Proc "SD_DialogImpRet"
  Trigger "OPEN","ARRIVE"
  Key "F1","ENTER","ESC","TAB",
    -104, -105, -106, -107, -108, -109, -110, -111, -112, -113, -139, -140  
    @ 05,12   Height 11 Width 72

    Label  @ 00,00 "" For "TG_OPCOES"
    RadioButtons @ 01,00 Height 7 Width 46
      "~1~ CIELO",
      "~2~ Banco do Brasil",
      "~3~ Caixa Econ“mica Federal",
      "~4~ Bradesco",
      "~5~ Santander"
        Tag "TG_OPCOES"
        To VSDGOPCAO
        
    Pushbutton @ 07,22 width 11 "~O~k"      OK     Default Value "Ok" Tag "YES" To BottonValue
    Pushbutton @ 07,36 width 11 "~C~ancela" CANCEL                    Tag "NO"  To BottonValue

  EndDialog
  If Not RetVal Then QuitLoop EndIf

  ClearAll
  Switch
    Case VSDGOPCAO=1 : Play "Imp_Ciel" 
    Case VSDGOPCAO=2 : Play "Imp_BB"  
    Case VSDGOPCAO=3 : Play "Imp_CEF"
    Case VSDGOPCAO=4 : Play "Imp_BRAD"
    Case VSDGOPCAO=5 : Play "Imp_SANT"
  EndSwitch
EndWhile
ClearAll
Release Vars All
Release Procs All