Página 1 de 1
Problema esquisito no harbour 3.2
Enviado: 15 Jul 2012 22:25
por JoséQuintas
Eu tenho uma rotina que uso desde os tempos do Clipper para simular sombra.
No Harbour 3.2 não está funcionando, trás caracteres esquisitos.
Houve alguma mudança no esquema de savescreen/restore screen no Harbour 3.2 (nightly)?
Código: Selecionar todos
Procedure Main
SetMode(37,110)
SetColor("W/B")
Clear
wShadow(5,5,20,70)
function wShadow( nLini, nColi, nLinf, nColf )
local nCont, cTxtTmp
local cTelaSalva := SaveScreen( nLini, nColi, nLinf, nColf )
local cTxtNew := ""
for nCont = 1 to Int((Len(cTelaSalva)+999)/1000)
cTxtTmp := SubStr( cTelaSalva, (1000*nCont)-999, 1000 )
cTxtNew += transform( cTxtTmp, replicate( "X"+Chr(7),Len(cTxtTmp)/2) )
next
RestScreen( nLini, nColi, nLinf, nColf, cTxtNew )
return NIL
Problema esquisito no harbour 3.2
Enviado: 16 Jul 2012 10:49
por Toledo
Uma saída seria usar a função HB_SHADOW() do próprio Harbour.
Código: Selecionar todos
#include "Box.ch"
PROCEDURE Main
SET COLOR TO "W+/B"
CLS
DispBox( 10,10,20,50, B_DOUBLE + Space(1), "W+/R" )
HB_Shadow( 10,10,20,50 )
DispOut( "Shadowed box" )
RETURN
Abraços,
Problema esquisito no harbour 3.2
Enviado: 16 Jul 2012 11:26
por JoséQuintas
Para o caso da sombra sim, mas uso na checagem de erros também, e está atrapalhando.
Considerando que o pessoal do Harbour sempre mantém compatibilidade com Clipper... parece um bug.
Problema esquisito no harbour 3.2
Enviado: 17 Jul 2012 18:27
por vailton
Isto se deve a introdução do suporte à UTF direto na VM. A string de retorno está vindo com varios zero-bytes.. Deve haver uma solucao elegante para isto (eu ainda nao a achei ˜ainda˜).
Problema esquisito no harbour 3.2
Enviado: 18 Jul 2012 22:06
por lucimauro
Eu particularmente nao gostei muito do efeito da funcao hB_shadow(), a sombra fica muito preta, e tambem nao sei porque essa do amigo ta com esse problema, mais usa essa abaixo em harbour e funciona perfeitamente.
Código: Selecionar todos
function Sombra(_Li, _Ci, _Lf, _Cf)
Local Tela1, Tela2, Tela3, Tela4
Tela3 := savescreen(_Li + 1, _Ci - 1, _Lf + 1, _Ci - 1)
Tela4 := savescreen(_Lf + 1, _Ci + 0, _Lf + 0, _Cf + 0)
for Tela1:= 2 to len(Tela3) step 2
Tela2:= shadow(asc(substr(Tela3,Tela1,1)))
Tela3:= stuff(Tela3,Tela1,1,Tela2)
end
for Tela1:= 2 to len(Tela4) step 2
Tela2:= shadow(asc(substr(Tela4, Tela1,1)))
Tela4:= stuff(Tela4,Tela1,1,Tela2)
end
restscreen(_Li + 1, _Ci - 1, _Lf + 1, _Ci - 1, Tela3)
restscreen(_Lf + 1, _Ci + 0, _Lf + 0, _Cf + 0, Tela4)
return NIL
*
function Shadow(_Car)
Local Var1, Var2, Var3
Var1:= _Car % 16
Var2:= (_Car - Var1) / 16
Var3:= {0, 0, 8, 8, 0, 8, 0, 8, 0, 1, 2, 3, 4, 5, 6, 7}
Var1:= Var3[Var1 + 1]
Var2:= Var3[Var2 + 1]
return Chr(16 * Var2 + Var1)
Problema esquisito no harbour 3.2
Enviado: 19 Jul 2012 01:17
por JoséQuintas
Obrigado, mas o problema não é apenas na sombra.
Faço uma checagem na saída do sistema, através do savescreen, pra ver se tem erro na tela.
Em caso de erro, envio email pra mim.
Essa diferença faz com que o sistema SEMPRE envie email, porque o savescreen da tela vazia também está diferente.
Preferi voltar ao 3.0, já que continua me atendendo.
Problema esquisito no harbour 3.2
Enviado: 19 Jul 2012 21:22
por JoséQuintas
Resposta pelo grupo do Harbour/users:
2012-04-20 17:52 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
[...]
* harbour/include/hbgtcore.h
* harbour/src/rtl/hbgtcore.c
* changed character values in internal screen buffer to unicode.
Warning: this modification interacts with SAVESCREE()/RESTSCREEN()
data. Now all GTs use extended definition. If somene
has code which needs VGA like screen buffers returned
by SAVESCREE() then it can be forced by
hb_gtInfo( HB_GTI_COMPATBUFFER, .t. )
Anyhow it will force to use only one CP in output.
Problema esquisito no harbour 3.2
Enviado: 24 Jul 2012 11:13
por rossine
Olá José,
Eu também tive problema de mostrar uns caractéres estranhos na minha função de sombreado mas eu troquei ela pela função abaixo e funcionou perfeito:
FT_SHADOW( nTop, nLeft, nBottom, nRight )
só que tive que desligar o "compatbuffer":
Hb_GtInfo( HB_GTI_COMPATBUFFER, .F. )
Espero que isto possa lhe ajudar,
Rossine.
Problema esquisito no harbour 3.2
Enviado: 08 Fev 2015 22:56
por Pablo César
rossine escreveu:só que tive que desligar o "compatbuffer":
Hb_GtInfo( HB_GTI_COMPATBUFFER, .F. )
Acho que isto deve ser por causa disto:
2012-11-10 20:55 UTC+0100 Viktor Szakats (harbour syenar.net)
- src/rtl/hbgtcore.c
- changed HB_GTI_COMPATBUFFER default to be Clipper
compatible. INCOMPATIBLE compared to 3.2 versions,
but restores the compatibility with previous ones
and Clipper. Applications using Unicode, must now
manually change these buffers to be Unicode
compatible using:
#include "hbgtinfo.ch"
hb_gtInfo( HB_GTI_COMPATBUFFER, .F. )