Aproveitando o assunto já que estou criando a tela do PDV com Gt-Wvg/Wvt tenho tido resultados com Wvt_Paint() que hora atualizam a tela e hora não.
DO WHILE .T.
atualizatela()
WvtSetPaint(aPaint)
Wvt_Paint()
@10,10 SAY "Código do produto: " GET cod PICT"999999"
READ
if lastkey()=27
EXIT
endif
seek cod
*** achou o codigo pega valor do produto e joga na tela
ENDDO
RETURN NIL
FUNCTION atualizatela()
***CARREGA O ARRAY COM OS ELEMENTOS DA TELA
aPaint:={}
***IMAGEM DE FUNDO DA TELA
AAdd( aPaint, { "Image", {|| Wvt_DrawImage( 0, 0, 25, 80, IMAGE_VOUCH ) }, { WVT_BLOCK_IMAGE, 1, 0, 1, 0 } } )
***FUNÇAO PARA ADD LABEL AO aPaint
AddLabel( aPaint, 6, 66, 0,trans(PRODUTO->SUBTOTAL,"999999.99"),.f.,"Arial",35,20)
RETURN NIL
FUNCTION AddLabel( aPaint, nRow, nCol, nCont, cTexto,lZebra,cFont,nHeight,nWidth,aColor,aBackground )
cFont=if(empty(cFont),"Courier New",cFont)
nHeight=if(empty(nHeight),14,nHeight)
nWidth=if(empty(nWidth),9,nWidth)
aColor=if(empty(aColor),{0,0,0},aColor)
aBackground=if(empty(aBackground),{255,255,255},aBackground)
if lZebra=.f.
AAdd( aPaint, { "label", { || wvt_DrawLabel( nRow + nCont, nCol, cTexto , 0, , ;
RGB( aColor[1],aColor[2],aColor[3] ), RGB(aBackground[1],aBackground[2], aBackground[3] ), cFont, nHeight,nWidth , , , , .F., .F. ) }, ;
{ WVT_BLOCK_LABEL, 0, 0, 0, 0 } } )
*--170620 TIVE QUE COLOCAR PARA PRINTAR DIRETO NA TELA OS LABELS NAO APARECIAM SO PELO WVG_SETPAINT
Wvt_DrawLabel( nRow + nCont, nCol, cTexto, 0, , RGB( aColor[1],aColor[2],aColor[3] ),RGB(aBackground[1],aBackground[2],aBackground[3]) , cFont, nHeight,nWidth, , , ,.F.,.F. )
else
AAdd( aPaint, { "label", { || wvt_DrawLabel( nRow + nCont, nCol, cTexto , 0, , ;
RGB( aBackground[1],aBackground[2],aBackground[3] ),RGB(aColor[1],aColor[2],aColor[3] ), cFont,nHeight,nWidth , , , , .F., .F. ) }, ;
{ WVT_BLOCK_LABEL, 0, 0, 0, 0 } } )
*--170620 TIVE QUE COLOCAR PARA PRINTAR DIRETO NA TELA OS LABELS NAO APARECIAM SO PELO WVG_SETPAINT
Wvt_DrawLabel( nRow + nCont, nCol, cTexto, 0, ,RGB(aBackground[1],aBackground[2],aBackground[3]) , RGB( aColor[1],aColor[2],aColor[3] ), cFont, nHeight,nWidth, , , ,.F.,.F. )
endif
RETURN NIL
O jeito que achei para contornar a não atualização da tela foi adicionar o label no aPaint e também usar direto na tela o Wvt_DrawLabel conforme na função acima AddLabel. Assim funcionou.
É muito tedioso quando uma função ou até nosso código que achamos que vamos obter um resultado e não conseguimos o que desejamos, tentar achar o por que se torna um processo chato de tentativa erro/acerto.
Ainda em desenvolvimento...