1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

ZOOM em UPC

Discussão em 'Comandos Básicos' iniciado por lvmor, Fevereiro 8, 2011.

  1. lvmor

    lvmor Sem Pontuação

    Boa Noite Pessoal,

    Alguém teria um exemplo de UPC que crie um zoom para uma campo padrão?

    Abs,

    leonardo
  2. muertebr

    muertebr Membro Participativo

    Opa segue, nos eventos do fill-in coloca:

    Código:
    run upc/findWidget.p (input 'cod-refer',    input p-wgh-frame, output h-cod-refer).
    run upc/findWidget.p (input 'c-cod-refer',  input p-wgh-frame, output h-c-cod-refer).
    CREATE TEXT h-txt-emitente
        assign frame        = h-cod-refer:FRAME
               row          = h-cod-refer:row
               col          = h-cod-refer:col - 5.4
               width        = 5
               HEIGHT       = h-cod-refer:HEIGHT
               visible      = YES
               sensitive    = no
               NAME         = "txt-Cliente"
               SCREEN-VALUE = " Matriz:".
    
        on 'F5':u                    of h-cod-refer persistent run upc/upc-pd0509zoom.p(INPUT p-wgh-frame).
        on 'MOUSE-SELECT-DBLCLICK':u of h-cod-refer persistent run upc/upc-pd0509zoom.p(INPUT p-wgh-frame).
    upc/upc-pd0509zoom.p
    Código:
    def input param p-wgh-frame as widget-handle  no-undo.
    def var h-cod-refer as widget-handle no-undo.
    def var h-c-cod-refer as widget-handle no-undo.
    def var wh-pesquisa as widget-handle no-undo.
    
    {utp/ut-glob.i}
    
    run upc/findWidget.p (input 'cod-refer',    input p-wgh-frame, output h-cod-refer).
    run upc/findWidget.p (input 'c-cod-refer',  input p-wgh-frame, output h-c-cod-refer).
    IF VALID-HANDLE(h-cod-refer) THEN DO:
        {include/zoomvar.i &prog-zoom=adzoom/z02ad098.w
                           &campo=h-cod-refer:SCREEN-VALUE}
    END.
    OBS: Não fui eu que fiz, mais acredito que ainda funcione.
  3. lvmor

    lvmor Sem Pontuação

    Miguel,

    Vivendo e aprendendo!
    Muito Obrigado!

    Leo
  4. rodrigokrigger

    rodrigokrigger Sem Pontuação

    Ola

    Poderia disponibilizar esse programa: findwidget.p ?

    obrigado
  5. muertebr

    muertebr Membro Participativo


    segue:

    Código:
    def input param c-name       as char          no-undo.
    def input param p-wgh-frame  as widget-handle no-undo.
    def output param h-result    as widget-handle no-undo.
    
    def var h-frame  as widget-handle no-undo. 
    
    
    assign h-frame = p-wgh-frame:first-child
           h-frame = h-frame:first-child.
    do while h-frame <> ? :                
        if valid-handle(h-frame) then do:
            if h-frame:NAME = c-name then do: 
                assign h-result = h-frame.
                return.
            end.
        end.
        assign h-frame = h-frame:next-sibling.
    end.
    
    pode ser trocado por uma procedure... que as vezes funciona melhor que o programa findwidget.

    Código:
    Procedure pi-busca-widget:
        Def Input  Param p-nome     As Char.
        Def Input  Param p-frame    As Widget-handle.
        Def Output Param p-object   As Widget-handle.
    
        Def Var h-frame             As Widget-handle.
        Def Var wh-objeto           As Widget-handle.
    
        Assign h-frame = p-frame:First-child.
    
        Do While Valid-handle(h-frame):
            If h-frame:Type <> "field-group" Then Do:
                If h-frame:Type = "frame" Then Do:
    
                    Run pi-busca-widget(Input  p-nome,
                                        Input  h-frame,
                                        Output wh-objeto).
    
                    If wh-objeto <> ? Then Do:
                        Assign p-object = wh-objeto.
                        Leave.
                    End.
                End.
    
                If h-frame:Name = p-nome Then Do:
                    Assign p-object = h-frame.
                    Leave.
                End.
    
                Assign h-frame = h-frame:Next-sibling.
    
            End.
            Else
                Assign h-frame = h-frame:First-child.
        End.
    End Procedure.

Compartilhe esta Página