change terminal key

> ATTN PROC CALL Keyboard simulation done by the program and not by the keyboard

→ ATTN keyboard simulation →Passes program name to application server → PROC 
keyboard simulation →Transmits the name of the procedure to be executed in 
Internal → CALL keyboard simulation →Transmits the name of the procedure to be 
executed in External

exemple: if use import termcurs.nim
    
    
    var callQuery: Table[string, proc(fld : var FIELD)]
    
    var combo  = new(GRIDSFL)
    #===================================================
    proc callRefTyp(fld : var FIELD) =
      var g_pos : int = -1
      combo  = newGRID("COMBO01",2,2,20)
      
      var g_type  = defCell("Ref.Type",19,ALPHA)
      
      setHeaders(combo, @[g_type])
      addRows(combo, @["TEXT_FREE"])
      addRows(combo, @["ALPHA"])
      addRows(combo, @["ALPHA_UPPER"])
      addRows(combo, @["ALPHA_NUMERIC"])
      addRows(combo, @["ALPHA_NUMERIC_UPPER"])
      addRows(combo, @["TEXT_FULL"])
      addRows(combo, @["PASSWORD"])
      addRows(combo, @["DIGIT"])
      addRows(combo, @["DIGIT_SIGNED"])
      addRows(combo, @["DECIMAL"])
      addRows(combo, @["DECIMAL_SIGNED"])
      addRows(combo, @["DATE_ISO"])
      addRows(combo, @["DATE_FR"])
      addRows(combo, @["DATE_US"])
      addRows(combo, @["TELEPHONE"])
      addRows(combo, @["MAIL_ISO"])
      addRows(combo, @["YES_NO"])
      addRows(combo, @["SWITCH"])
      addRows(combo, @["FPROC"])
      addRows(combo, @["FCALL"])
      printGridHeader(combo)
      
      case fld.text
        of "TEXT_FREE"            : g_pos = 0
        of "ALPHA"                : g_pos = 1
        of "ALPHA_UPPER"          : g_pos = 2
        of "ALPHA_NUMERIC"        : g_pos = 3
        of "ALPHA_NUMERIC_UPPER"  : g_pos = 4
        of "TEXT_FULL"            : g_pos = 5
        of "PASSWORD"             : g_pos = 6
        of "DIGIT"                : g_pos = 7
        of "DIGIT_SIGNED"         : g_pos = 8
        of "DECIMAL"              : g_pos = 9
        of "DECIMAL_SIGNED"       : g_pos = 10
        of "DATE_ISO"             : g_pos = 11
        of "DATE_FR"              : g_pos = 12
        of "DATE_US"              : g_pos = 13
        of "TELEPHONE"         : g_pos = 14
        of "MAIL_ISO"             : g_pos = 15
        of "YES_NO"               : g_pos = 16
        of "SWITCH"               : g_pos = 17
        of "FPROC"                : g_pos = 18
        of "FCALL"                : g_pos = 19
        else : discard
      
      while true :
        let (keys, val) = ioGrid(combo,g_pos)
        
        case keys
          of Key.Enter :
            fld.text  = $val[0]
            break
          else: discard
    
    callQuery["callRefTyp"] = callRefTyp
    
    #===================================================
    
    
    .......
          of Key.PROC:
              if isVoidF(pnFx,Index(pnFx)) :
                callQuery[getVoidF(pnFx,Index(pnFx))] (pnFx.field[Index(pnFx)])
                fldF.reftyp = parseEnum[REFTYP](pnFx.getTextF(F_F1[Freftyp]))
                setTerminal()
                printPanel(base)
    
    
    Run

Reply via email to