Clipper On Line • Ver Tópico - Imagem Desaparece com gtwvw

Imagem Desaparece com gtwvw

Outras bibliotecas visuais e IDEs para Harbour/xHarbour (xHGTK/HbWxW/GtWvT/GtWvW/WvWtools.etc)

Moderador: Moderadores

 

Imagem Desaparece com gtwvw

Mensagempor leandrolinauer » 25 Set 2018 11:17

Bom dia, desculpe a demora.
Não tenho problema deste tipo não, só de vez enquando em alguns computadores a tela do programa congela.
Abaixo o modo que redesenho.
//adciona o objeto para redesenho
FUNCTION AddObjects( nWinNum, bAction, bNameObj)
                 //nWinNum = janela atual ncurwindow
                 //bAction = função a ser executada wvw_
      //bnameObj = nome do objeto, uso para que na matriz seja substituido pelo redesenho, para evitar repetir o redesenha tornando a tela lenta.
***************************************
   bNameObj:=If(bNameObj=NIl,Str(nWinNum+1,2),bNameObj)
   nOk=.F.
   If Len(p_aListObjects) >= 1 //.And. !Valtype(bNameObj) == "N"       //só entra se for nome de objeto
      iK:=1
      While iK <= Len(p_aListObjects) //corre a matriz e verifica o conteudo
        If Len(p_aListObjects[iK]) > 0
           iK2:=1
           While iK2 <= Len(p_aListObjects[iK])
             If !ChkSoNumero(p_aListObjects[iK,iK2][1]) .And. !ChkSoNumero(bNameObj)
                If p_aListObjects[iK,iK2][1] == bNameObj
                   p_aListObjects[ iK,iK2 ][2] := bAction
                   nOk:=.T.
                EndIf   
             EndIf
             iK2++
           End
        EndIf 
        iK++
      End
   EndIf 
   If nOK=.F.
       aadd( p_aListObjects[ nWinNum+1 ] ,{bNameObj, bAction} ) //adciona a janela ao nome do objeto mais a acao
   EndIf
RETURN .T.

//reseta o objeto
FUNCTION ResetObjects( nWinNum, bNameObj) //esta correta com o exemplo wvwtest9
   while len( p_aListObjects ) < nWinNum+1
         aadd( p_aListObjects, {} )
   enddo
   If bNameObj = NIl
      p_aListObjects[ nWinNum+1 ] := {}
   ElseIf Len(p_aListObjects) >= 1
      iK:=1
      While iK <= Len(p_aListObjects)
        If Len(p_aListObjects[iK]) > 0
           iK2:=1
           While iK2 <= Len(p_aListObjects[iK])
             If !ChkSoNumero(p_aListObjects[iK,iK2][1]) .And. !ChkSoNumero(bNameObj)
                If p_aListObjects[iK,iK2][1] == bNameObj
                   p_nPos:= Ascan(p_aListObjects, {|x| x[1] == p_aListObjects[iK,iK2][1] } )
                   hb_ADel( p_aListObjects, p_nPos ,.T. )             //deu certo, apaga o que nao quero mais para montar de novo evita redesenho
                EndIf   
             EndIf
             iK2++
           End
        EndIf 
        iK++
      End
   EndIf   
RETURN .T.
///pinta o objeto
FUNCTION WVW_Paint( nWinNum,nObjT )
Local i_P:=0
Local ctvetor := 1
   If Len( p_aListObjects ) >= nWinNum+1 .And. nWinNum > 0 //ver se soluciona
      aeval( p_aListObjects[nWinNum+1], {|e| eval( e[2], nWinNum )} )
   EndIf
Return .T.

///wvw_size

function WVW_SIZE(nWinNum, hWnd, message, wParam, lParam)
local cScreen
local lNeedReset := .f., ;
      maxsavedscrrow, maxsavedscrcol

   if !s_lSizeReady
      * program is not ready to handle window resizing
      * (or this function is currently running)
      return NIL
   endif
   if nWinNum<>0
      * only care about Main Window
      return NIL
   endif

   * avoid reentrance
   s_lSizeReady := .f.

   do case
      case wParam == 2 //SIZE_MAXIMIZED
         * reset is required only if we are changing size
         lNeedReset := maxcol() <> wvw_maxmaxcol();
                       .or. maxrow() <> wvw_maxmaxrow()

         if lNeedReset
            maxsavedscrrow := min(min(s_nNormalMaxrow, wvw_maxmaxrow()),maxrow())
            maxsavedscrcol := min(min(s_nNormalMaxcol, wvw_maxmaxcol()),maxcol())
            cScreen := savescreen(0,0,maxsavedscrrow, maxsavedscrcol)
            if setmode(wvw_maxmaxrow()+1, wvw_maxmaxcol()+1) //adjust maxrow() & maxcol()
               restscreen(0,0,maxsavedscrrow, maxsavedscrcol, cScreen)
            endif
         endif
      case wParam == 0 //SIZE_RESTORED
         lNeedReset := maxcol() <> s_nNormalMaxcol .or.;
                       maxrow() <> s_nNormalMaxrow
         if lNeedReset
            maxsavedscrrow := min(s_nNormalMaxrow, maxrow())
            maxsavedscrcol := min(s_nNormalMaxcol, maxcol())
            cScreen := savescreen(0,0,maxsavedscrrow, maxsavedscrcol)
            if setmode(s_nNormalMaxrow+1,s_nNormalMaxcol+1)
               restscreen(0,0,maxsavedscrrow, maxsavedscrcol, cScreen)
            endif
         endif
      otherwise
         * do nothing
   endcase

   * allow next call
   s_lSizeReady := .t.
return NIL

Abraços. :)Pos
Harbour 3.2 + GtWVW + QT + SQLite3 + DBF + SQL (Firebird)
leandrolinauer
Usuário Nível 3

Usuário Nível 3
 
Mensagens: 372
Data de registro: 16 Out 2006 10:59
Cidade/Estado: Paranaíba-MS
Curtiu: 0 vez
Mens.Curtidas: 12 vezes

Anterior



Retornar para Outras Bibliotecas Visuais e IDEs

Quem está online

Usuários vendo este fórum: Nenhum usuário registrado online e 1 visitante


Ola Amigo, espero que meu site e forum tem lhe beneficiado, com exemplos e dicas de programacao.
Entao divulgue o link da Doacao abaixo para seus amigos e redes sociais ou faça uma doacao para o site forum...
MUITO OBRIGADO PELA SUA DOACAO!
Faça uma doação para o forum
cron
v
Olá visitante, seja bem-vindo ao Fórum Clipper On Line!
Efetue o seu login ou faça o seu Registro