1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[RESOLVIDO] UPC FT0502 (zoom)

Discussão em 'EMS , HCM e Totvs 11' iniciado por muertebr, Abril 16, 2009.

Status do Tópico:
Não esta aberto para novas mensagens.
  1. muertebr

    muertebr Membro Participativo

    Ola sou novo no forum, e estou precisando faze uma upc que ao dar 2 cliques em um fill-in ele abra o programa de zoom e retornoe o valor... só q até o momento nao consegui....
    se alguem puder da uma ajuda:

    segue código:

    UPC FT0502
    Código:
    {include/i-freeac.i}
    
    def input param p-ind-event        as char          no-undo.
    def input param p-ind-object       as char          no-undo.
    def input param p-wgh-object       as handle        no-undo.
    def input param p-wgh-frame        as widget-handle no-undo.
    def input param p-cod-table        as char          no-undo.
    def input param p-row-table        as rowid         no-undo.
    
    def var h-frame         as widget-handle no-undo.
    def var h-nome-tr-red   as widget-handle no-undo.
    def var h-nome-tr-red-t as widget-handle no-undo.
    def var h-nr-nota-fis   as widget-handle no-undo.
    def var h-nome-transp   as widget-handle no-undo.
    def var h-cidade-cif    as widget-handle no-undo.
    def var h-cidade-cif-t  as widget-handle no-undo.
    
    {utp/ut-glob.i}
    
    IF p-ind-event = "INITIALIZE" AND p-ind-object = "VIEWER" THEN DO:
        run upc/findwidget.p (input "nome-tr-red",  input p-wgh-frame, output h-nome-tr-red).
        IF VALID-HANDLE(h-nome-tr-red) THEN DO:
            CREATE FILL-IN h-nome-tr-red-t 
            ASSIGN FRAME     = h-nome-tr-red:FRAME
                   WIDTH     = h-nome-tr-red:WIDTH
                   HEIGHT    = h-nome-tr-red:HEIGHT
                   ROW       = h-nome-tr-red:ROW
                   COL       = h-nome-tr-red:COL
                   SENSITIVE = NO
                   VISIBLE   = YES
                   NAME      = "nome-tr-red-t"
                   FONT      = h-nome-tr-red:FONT
                   FORMAT    = h-nome-tr-red:FORMAT
                   SCREEN-VALUE = h-nome-tr-red:SCREEN-VALUE
             TRIGGERS:
                   ON VALUE-CHANGED PERSISTENT RUN upc/upc-ft0502evt.p(INPUT h-nome-tr-red, INPUT h-nome-tr-red-t).
             END TRIGGERS. 
        END.
    END.
    
    run upc/findwidget.p (input "nome-tr-red-t",  input p-wgh-frame, output h-frame).
    IF VALID-HANDLE(h-frame) THEN DO:
        on 'F5':u                    of h-frame persistent run upc/findwidgeteste.p(INPUT p-wgh-frame).
        on 'MOUSE-SELECT-DBLCLICK':u of h-frame persistent run upc/findwidgeteste.p(INPUT p-wgh-frame).
        h-frame:load-mouse-pointer('image/lupa.cur').
    END.
    
    findwidgeteste.p
    Código:
    def input param p-wgh-frame as widget-handle  no-undo.
    def var h-frame   as widget-handle no-undo.
    def var wh-pesquisa as widget-handle no-undo.
    {utp/ut-glob.i}
    
    run upc/findwidget.p (input "nome-tr-red-t",  input p-wgh-frame, output h-frame).
    IF VALID-HANDLE(h-frame) THEN DO:
        {include/zoomvar.i &prog-zoom=adzoom/Z01AD268.w
                           &campo=h-frame:SCREEN-VALUE}
    END.
    
  2. TrombiniSP

    TrombiniSP Membro Participativo

    Colocando Zoom em campo criado dinamicamente.

    Código:
    def input param p-ind-event        as char          no-undo.
    def input param p-ind-object       as char          no-undo.
    def input param p-wgh-object       as handle        no-undo.
    def input param p-wgh-frame        as widget-handle no-undo.
    def input param p-cod-table        as char          no-undo.
    def input param p-row-table        as rowid         no-undo.
    
    def new global shared var wh-fill    as widget-handle no-undo.
    def new global shared var tx-label   as widget-handle no-undo.
    def var c-objeto as char no-undo.
    
    assign c-objeto   = entry(num-entries(p-wgh-object:private-data, "~/"), p-wgh-object:private-data, "~/").
    
    if  p-ind-event = "BEFORE-INITIALIZE"
    and p-ind-object = "VIEWER"
    and c-objeto = "v24ad098.w" then do: 
        create text tx-label
            assign frame        = p-wgh-frame
                   format       = "x(17)"
                   width        = 6.2
                   screen-value = "Perfil:"
                   row          = 2.8
                   col          = 59.5
                   fgcolor      = 1
                   visible      = yes.   
        create fill-in wh-fill
            assign frame              = p-wgh-frame
                   format             = "x(10)" 
                   side-label-handle  = tx-label:handle
                   width              = 10
                   height             = 0.88
                   row                = 2.8
                   col                = 65
                   bgcolor            = 1
                   fgcolor            = 15
                   visible            = yes
                   sensitive          = no
                   triggers:
                       ON F5 PERSISTENT RUN upc-curso/zoomupc.p.
                   end triggers.
    end.
    
    if  p-ind-event = "ENABLE" 
    and p-ind-object = "VIEWER"
    and c-objeto = "v24ad098.w" then do:
        assign wh-fill:sensitive   = yes.
    end.
    
    if  p-ind-event = "DISABLE" 
    and p-ind-object = "VIEWER"
    and c-objeto = "v24ad098.w" then do:
        assign wh-fill:sensitive   = no.
    end.
    
    Para o programa de zoom (upc-curso/zoomupc.p), que vai chamar um zoom construido no padrão do EMS 2.0, deve-se fazer o seguinte:
    Código:
    def var wh-pesquisa as widget-handle.
    def new global shared var l-implanta as logical init no.
    def new global shared var wh-fill    as widget-handle no-undo.
    def new global shared var wh-window  as handle no-undo.
    def new global shared var adm-broker-hdl as handle no-undo.
    
    {include/zoomvar.i &prog-zoom=inzoom/z01in172.w 
                                 &proghandle=wh-window
                                 &campohandle=wh-fill
                                 &campozoom=it-codigo}
    
    Nunca passar parametros para programas chamados via UPC como fez neste código, por isso não funciona:
    Código:
    IF VALID-HANDLE(h-frame) THEN DO:
        on 'F5':u                    of h-frame persistent run upc/findwidgeteste.p(INPUT p-wgh-frame).
        on 'MOUSE-SELECT-DBLCLICK':u of h-frame persistent run upc/findwidgeteste.p(INPUT p-wgh-frame).
        h-frame:load-mouse-pointer('image/lupa.cur').
    END.
    
  3. muertebr

    muertebr Membro Participativo

    bah pior q fiz tudo igual...
    ele abre a tela tudo bunitinho, lindinho, dai eu escolho a opção que eu quero e...............

    nada acontece......

    ele não ta alimentando o fill-in com o campo que eu escolho, tentei até pega o zoom com o item, mais a mesma coisa, nd :(

    alguma sugestão?
  4. TrombiniSP

    TrombiniSP Membro Participativo

    Vamos lá:

    Programa upc da tela, :
    Código:
    def input param p-ind-event        as char          no-undo.
    def input param p-ind-object       as char          no-undo.
    def input param p-wgh-object       as handle        no-undo.
    def input param p-wgh-frame        as widget-handle no-undo.
    def input param p-cod-table        as char          no-undo.
    def input param p-row-table        as rowid         no-undo.
    
    /* O CAMPO QUE VC DEVE PASSAR COMO PAREMETRO PARA RECEBER O ZOOM DEVE TER VARIAVEL GLOBAL */
    DEF NEW GLOBAL SHARED VAR h-nome-tr-red-t as widget-handle no-undo.
    
    def var h-frame         as widget-handle no-undo.
    def var h-nome-tr-red   as widget-handle no-undo.
    def var h-nr-nota-fis   as widget-handle no-undo.
    def var h-nome-transp   as widget-handle no-undo.
    def var h-cidade-cif    as widget-handle no-undo.
    def var h-cidade-cif-t  as widget-handle no-undo.
    
    {utp/ut-glob.i}
    
    IF p-ind-event = "INITIALIZE" AND p-ind-object = "VIEWER" THEN DO:
        run esp/findwidget.p (input "nome-tr-red",  input p-wgh-frame, output h-nome-tr-red).
        IF VALID-HANDLE(h-nome-tr-red) THEN DO:
            CREATE FILL-IN h-nome-tr-red-t 
            ASSIGN FRAME        = h-nome-tr-red:FRAME
                   WIDTH        = h-nome-tr-red:WIDTH
                   HEIGHT       = h-nome-tr-red:HEIGHT
                   ROW          = h-nome-tr-red:ROW
                   COL          = h-nome-tr-red:COL
                   SENSITIVE    = NO
                   VISIBLE      = YES
                   NAME         = "nome-tr-red-t"
                   FONT         = h-nome-tr-red:FONT
                   FORMAT       = h-nome-tr-red:FORMAT
                   SCREEN-VALUE = h-nome-tr-red:SCREEN-VALUE
            TRIGGERS:
                ON 'F5'                                   PERSISTENT RUN esp/upc-ft0502evt.p.
                ON 'MOUSE-SELECT-DBLCLICK' PERSISTENT RUN esp/upc-ft0502evt.p.
            END TRIGGERS.
            h-nome-tr-red-t:load-mouse-pointer('image/lupa.cur').
        END.
    END.
    
    if  p-ind-event = "ENABLE" 
    and p-ind-object = "VIEWER" then do:
        assign h-nome-tr-red-t:sensitive   = yes.
    end.
    
    if  p-ind-event = "DISABLE" 
    and p-ind-object = "VIEWER" then do:
        assign h-nome-tr-red-t:sensitive   = no.
    end.
    
    Progrema chamado para exibir o Zoom, upc-ft0502evt.p:
    Código:
    def var wh-pesquisa                         as widget-handle.
    
    def new global shared var l-implanta        as logical init no.
    def new global shared var h-nome-tr-red-t   as widget-handle no-undo.
    def new global shared var wh-window         as handle no-undo.
    def new global shared var adm-broker-hdl    as handle no-undo.
    
    {include/zoomvar.i &prog-zoom=inzoom/z01in172.w 
                       &proghandle=wh-window
                       &campohandle=h-nome-tr-red-t
                       &campozoom=it-codigo}
    
    Agora é só substituir o programa zoom para o qual vc necessita.


    Abs.

    Trombini
  5. muertebr

    muertebr Membro Participativo

    (K)
    um bjooooo

    deu certo...... (K)(K)(K)


    viu agora só uma perguntinha basica...
    tenho um relatório em hcm q teria q faze ele sai direto na impressora, só q é padrão datasul e eles não liberam o fonte.
    Existe alguma forma, upc sei la que faça o relatório sai???
  6. TrombiniSP

    TrombiniSP Membro Participativo


    Surigo que vc abra um novo tópico para esta questão e neste cite o relatório e qual o resultado que vc espera. Mais membros podem ajudar.

    Grato.

    Trombini
Status do Tópico:
Não esta aberto para novas mensagens.

Compartilhe esta Página