comando para manipular TAB

Discussão em 'Progress 4GL' iniciado por luizclairrodrigues, Julho 2, 2012.

  1. luizclairrodrigues

    luizclairrodrigues Membro Participativo

    boa tarde!
    estou precisando de um comando que faça o TAB não pegar um determinado campo pular o mesmo, isso tudo é em uma UPC de um programa padrão DataSul PD4050.
    Se alguém me ajudar eu agradeço.
  2. TrombiniSP

    TrombiniSP Membro Participativo

    Olá Luiz,

    Veja este pequeno bloco de código ilustrativo. Deste ponto você já deve ter uma idéia de como proceder.

    Código:
    /* Depois do bloco que captura o handle do objeto Fill-in na
    *  na variável: wh-fi-teste (ver definição). 
    *  DEF NEW GLOBAL SHARED VAR wh-fi-teste       AS WIDGET-HANDLE NO-UNDO.
    */ 
    
    IF p-ind-event  = 'INITIALIZE' AND
       p-ind-object = 'VIEWER'     AND
       VALID-HANDLE(wh-fi-teste)   THEN DO:    
        
        on "TAB":U OF wh-fi-teste
           PERSISTENT RUN pdp/upc/pd4050-u02.p.
    END.
    
    No programa "pd4050-u02.p" você faz todos os tratamentos. Declare a variável wh-fi-teste da mesma forma que no programa chamador e assim poderá manipular seus valores e estados. Você pode simplismete usar o "RETURN NO-APPLY" para que caso sua condição não seja satisfeita o usuário não consiga avançãr para outros campos/objetos.

    Nota: Não entendi muito bem seu texto mas, se for isso que pensei deve funcionar.

    Abraços.

    Trombini
  3. luizclairrodrigues

    luizclairrodrigues Membro Participativo

    Bom dia Trombini !
    Valeu pela força e desculpe a digitação blz, vou seguir suas ideias e obrigado pelo material.

    abraço.

    Luiz.
  4. brunamatosb

    brunamatosb Sem Pontuação

    Como ficaria este exemplo pronto????
    Preciso fazer o mesmo para o re1001 depois de preencher o emitente =/
  5. luizclairrodrigues

    luizclairrodrigues Membro Participativo

    Boa tarde brunamatosb !
    Vou te falar uma coisa , depois da quela ideia que vc me passou eu tive que parar com aquela UPC e fazer outro relatório urgente, estamos até o gargalo , volto a fazer ela semana que vem, mas eu tenho uma pronta que é PD4000 mas eu fui passar a mesma para PD4050 e não deu certo veja abaixo, se vc conceguir me mostra depois blz.
    abraço.

    /*********************************************************************************/
    Primeiro é essa!


    /***********************************************************************
    ** Programa...: upc-pd4000.p
    ** Descrição..: Upc para utilização de validações no pd4000
    ** Data.......: Marþo/2006
    ************************************************************************/
    /*** Parametros ***/
    def input param p-ind-event as char.
    def input param p-ind-object as char.
    def input param p-wgh-object as handle.
    def input param p-wgh-frame as widget-handle.
    def input param p-cod-table as char.
    def input param p-row-table as rowid.

    /*** Variaveis ***/
    def new global shared var wgh-nr-pedrep as widget-handle no-undo.
    def new global shared var wgh-nome-abrev as widget-handle no-undo.
    def new global shared var wgh-nr-pedcli as widget-handle no-undo.

    def var c-objeto as character no-undo.
    def var wgh-child as widget-handle no-undo.
    def var wgh-child-1 as widget-handle no-undo.
    def var wgh-fPage3 as widget-handle no-undo.

    if valid-handle(p-wgh-object) then
    assign c-objeto = entry(num-entries(p-wgh-object:private-data,"~/"),p-wgh-object:private-data, "~/").

    if p-ind-event = "AFTER-INITIALIZE":U then do:
    assign wgh-child = p-wgh-frame:first-child
    wgh-child = wgh-child:first-child.
    do while valid-handle(wgh-child):
    if wgh-child:name = 'nome-abrev':U then
    assign wgh-nome-abrev = wgh-child:handle.
    if wgh-child:name = 'nr-pedcli':U then
    assign wgh-nr-pedcli = wgh-child:handle.
    if wgh-child:type = "FRAME":U then do:
    case wgh-child:name:
    when "fPage3":U then do:
    assign wgh-fPage3 = wgh-child:handle
    wgh-child-1 = wgh-child:first-child
    wgh-child-1 = wgh-child-1:first-child.
    do while valid-handle(wgh-child-1):
    case wgh-child-1:name:
    when "nr-pedrep":U then
    assign wgh-nr-pedrep = wgh-child-1:handle.
    end case.
    assign wgh-child-1 = wgh-child-1:next-sibling.
    end.
    leave.
    end.
    end case.
    end.

    assign wgh-child = wgh-child:next-sibling.
    end.

    if valid-handle(wgh-nr-pedrep) then do:
    on 'leave':U of wgh-nr-pedrep persistent run upc\upc-pd4000-eventos.p (input "leave").
    end.
    end.




    /********************************************************************************/
    Segunda essa!

    define new global shared variable wgh-nome-abrev as widget-handle no-undo.
    define new global shared variable wgh-nr-pedcli as widget-handle no-undo.
    define new global shared variable wgh-nr-pedrep as widget-handle no-undo.

    def input parameter evento as char no-undo.

    case evento:
    when "LEAVE" then do:
    if valid-handle(wgh-nome-abrev) and
    valid-handle(wgh-nr-pedcli) and
    valid-handle(wgh-nr-pedrep) then do:
    if trim(wgh-nr-pedrep:screen-value) <> "" then do:
    if wgh-nome-abrev:sensitive = no then do:
    for last ped-venda no-lock
    where trim(ped-venda.nr-pedrep) = trim(wgh-nr-pedrep:screen-value)
    and (ped-venda.nome-abrev <> wgh-nome-abrev:screen-value
    or ped-venda.nr-pedcli <> wgh-nr-pedcli:screen-value):
    run message.p (input "Pedido Repres. " + trim(wgh-nr-pedrep:screen-value) + " já informado",
    input "Pedido Repres. " + trim(wgh-nr-pedrep:screen-value) + " já foi informado em outro pedido. " +
    "Cliente: " + ped-venda.nome-abrev + " Pedido Cliente: " + ped-venda.nr-pedcli).
    return no-apply.
    end.
    end.
    else do:
    for last ped-venda no-lock
    where trim(ped-venda.nr-pedrep) = trim(wgh-nr-pedrep:screen-value):
    run message.p (input "Pedido Repres. " + trim(wgh-nr-pedrep:screen-value) + " já informado",
    input "Pedido Repres. " + trim(wgh-nr-pedrep:screen-value) + " já foi informado em outro pedido. " +
    "Cliente: " + ped-venda.nome-abrev + " Pedido Cliente: " + ped-venda.nr-pedcli).
    return no-apply.
    end.
    end.
    end.
    end.
    end.
    end case.

Compartilhe esta Página