Olá! Eu preciso colorir de amarelo uma linha do browse de destino no programa EMS5 - bas_bord_ap. Porém não está dando certo. O nome do browse é 'br_dlg_item_bord_ap_cjto' e a tabela item_bord_ap. Verifiquei o post https://www.4each.com.br/threads/colorir-célula-em-um-browser-via-upc.39427/#post-65777 com as dicas o @rafael.andrade. No meu teste, a coluna foi pintada de amarelo em um segundo e sumiu quando as informações foram carregadas no browse. Dúvidas: 1) Como faço para manter a cor da coluna? 2) Qual e a sintaxe para colorir a linha, independente do número de colunas? O código-teste é: IF p_ind_event = "ROW-DISPLAY" AND p_ind_object = "BROWSER" THEN DO: wh_browse_destino:QUERY:GET-BUFFER-HANDLE(2). //(2) tabela item_bord_ap wh_browse_destino:FETCH-SELECTED-ROW(1) NO-ERROR. wh_browse_destino:GET-BROWSE-COLUMN(5):BGCOLOR = 14. // Deveria colorir de amarelo. END. Caso tiver exemplos de UPC para colorir uma determinada linha do browse agradeço.
Consegui resolver. // UPC => APB711ZD.P DEFINE INPUT param p_ind_event as char NO-UNDO. DEFINE INPUT param p_ind_object as char NO-UNDO. DEFINE INPUT param p_wgh_object as handle NO-UNDO. DEFINE INPUT param p_wgh_frame as widget-handle NO-UNDO. DEFINE INPUT param p_cod_table as char NO-UNDO. DEFINE INPUT param p_rec_table as recid NO-UNDO. DEFINE NEW GLOBAL SHARED VARIABLE wh_browse_destino AS WIDGET-HANDLE NO-UNDO . DEFINE NEW GLOBAL SHARED VARIABLE wh_browse_destino_query AS WIDGET-HANDLE NO-UNDO . DEFINE NEW GLOBAL SHARED VARIABLE wh_browse_destino_buffer AS WIDGET-HANDLE NO-UNDO . DEFINE VARIABLE c-handle-obj AS CHARACTER NO-UNDO. DEFINE NEW GLOBAL SHARED VARIABLE wh_browse_destino_colunas AS WIDGET-HANDLE EXTENT 26 NO-UNDO. DEFINE VARIABLE idx AS INTEGER NO-UNDO. DEFINE VARIABLE i-cont AS INTEGER NO-UNDO. IF p_ind_event = "ITEM BORDERO" AND p_ind_object = "viewer" THEN DO: ASSIGN p_wgh_object = p_wgh_frame:FIRST-CHILD. DO WHILE VALID-HANDLE(p_wgh_object): IF p_wgh_object:NAME = "br_dlg_item_bord_ap_cjto" THEN DO: ASSIGN wh_browse_destino = p_wgh_object:HANDLE. END. IF p_wgh_object:TYPE = 'field-group' THEN ASSIGN p_wgh_object = p_wgh_object:FIRST-CHILD. ELSE ASSIGN p_wgh_object = p_wgh_object:NEXT-SIBLING. END. /* Do While da Frame Geral */ IF VALID-HANDLE(wh_browse_destino) THEN DO: ASSIGN wh_browse_destino_query = wh_browse_destino:QUERY. ASSIGN wh_browse_destino_buffer = wh_browse_destino_query:GET-BUFFER-HANDLE(1). DO idx = 1 TO 26: ASSIGN wh_browse_destino_colunas[idx] = wh_browse_destino:GET-BROWSE-COLUMN(idx). END. /* ---------------------------------------------------------------------------------------------- */ /*--------------------------------- COLORIR A LINHA DO BROWSE ---------------------------------------*/ /* ---------------------------------------------------------------------------------------------- */ ON "row-display" OF wh_browse_destino PERSISTENT RUN upc/upapb711zd.p ("ROW-DISPLAY", "BROWSER", p_wgh_object, p_wgh_frame, p_cod_table, p_rec_table). END. END. IF p_ind_event = "ROW-DISPLAY" AND p_ind_object = "BROWSER" THEN DO: IF VALID-HANDLE(wh_browse_destino_query) THEN DO: DO i-cont = 1 TO wh_browse_destino_query:NUM-BUFFERS: wh_browse_destino_buffer = wh_browse_destino_query:GET-BUFFER-HANDLE(i-cont). IF wh_browse_destino_buffer:NAME = "item_bord_ap" AND i-cont > 0 THEN DO: DO idx = 1 TO 26: ASSIGN wh_browse_destino_colunas[idx]:BGCOLOR = 14 NO-ERROR. END. END. END. END. END.