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

UPC - Desabilita Botoes 204

Discussão em 'Outros/Diversos' iniciado por fdantas, Fevereiro 12, 2009.

  1. fdantas

    fdantas Administrator Moderador

    Código:
    /********************************************************************************* 
    ** Programa...: UPC_Desabilita_Botoes_204
    ** Author.....: Desconhecido
    ** Descricao..: Desabilitar Botäes de Um programa Datasul EMS 2.04
    ** Data.......: 01/06/2003
    ** 
    ** Visite www.4each.com.br 
    ** 
    *********************************************************************************/
    /* Parameter Definitions ****************************************************/
    define input parameter p-ind-event  as character.
    define input parameter p-ind-object as character.
    define input parameter p-wgh-object as handle.
    define input parameter p-wgh-frame  as widget-handle.
    define input parameter p-cod-table  as character.
    define input parameter p-row-table  as rowid.
    
    /* variaveis locais *********************************************************/
    define variable              c-objeto                  as char           no-undo.
    define new global shared var wh-objeto                 as Widget-handle  No-undo.
    define new global shared var adm-broker-hdl            as handle         no-undo.
    define new global shared var wh-IM0099-bt-first        as handle         no-undo.
    define new global shared var wh-IM0099-bt-prev         as handle         no-undo.
    define new global shared var wh-IM0099-bt-next         as handle         no-undo.
    define new global shared var wh-IM0099-bt-last         as handle         no-undo.
    
    assign c-objeto   = entry(num-entries(p-wgh-object:file-name, "~/"), p-wgh-object:file-name, "~/").
    
    /* MESSAGE  "upc1     " SKIP                   */
    /*          "EVENTO   " p-ind-event  SKIP      */
    /*          "OBJETO   " p-ind-object SKIP      */
    /*          "NOME OBJ " c-objeto     SKIP      */
    /*          "FRAME    " p-wgh-frame:NAME  SKIP */
    /*          "TABELA   " p-cod-table  SKIP      */
    /*          "ROWID    " STRING(p-row-table)    */
    /*          "---->    " p-wgh-object:FILE-NAME */
    /*          VIEW-AS ALERT-BOX.                 */
    
    /* Logica para gravar os handles dos botäes    */
    run pi-vld-widget (input   p-wgh-frame,
                       input  "btfirst",
                       output wh-IM0099-bt-first).
    
    run pi-vld-widget (input   p-wgh-frame,
                       input  "btprev",
                       output wh-IM0099-bt-prev).
    
    run pi-vld-widget (input   p-wgh-frame,
                       input  "btnext",
                       output wh-IM0099-bt-next).
    
    run pi-vld-widget (input  p-wgh-frame,
                       input  "btlast",
                       output wh-IM0099-bt-last).
    
    
    
    If p-ind-event  = "AFTER-CONTROL-TOOL-BAR" and
       p-ind-object = "CONTAINER"      Then  Do:
    
        Assign
            wh-IM0099-bt-last:sensitive = No
            wh-IM0099-bt-first:sensitive = No.
        
    End.
    
    procedure pi-vld-widget:
    /**
    *** Valida widget da tela principal.
    ***
    **/
    
        Def Input  Param f-pagexx      As Handle.
        def input  param p-nome-objeto as char.
        def output param p-wh-objeto   as widget-handle.
    
    
        def var v-wh-group as widget-handle.
        def var v-wh-child as widget-handle.
        def var h_frame as widget-handle.
                                       
        assign v-wh-group = f-pagexx:first-child.
    
        bloco-encontra-objeto:
        do while v-wh-group <> ?:
           assign v-wh-child = v-wh-group:first-child.
           do while v-wh-child <> ?:
               if  v-wh-child:name = p-nome-objeto
               then do:
                   assign p-wh-objeto = v-wh-child.
                   leave bloco-encontra-objeto.
               end.
               assign v-wh-child = v-wh-child:next-sibling.
           end.
           assign v-wh-group = v-wh-group:next-sibling.
        end.
    end procedure.
    

    Arquivos Anexados:

Compartilhe esta Página