Olá,
Como a configuração de cores do windows pode ser diferente para cada computador, o melhor é pegar a paleta de cores e configurar para refletir essas configurações. Eu faço assim :
tenho uma função que altera a paleta de cores :
**********************
FUNCTION ConfigCores()
**********************
aPalette := WvW_GetPalette()
aPalette[01] := GetSysColor( COLOR_WINDOWTEXT ) // 8
aPalette[02] := RGB( 0, 51, 153 )
aPalette[04] := RGB( 0, 255, 255 )
aPalette[08] := GetSysColor( COLOR_BTNFACE ) // 15
aPalette[10] := RGB( 100, 135, 220 )
aPalette[13] := RGB( 227, 92, 47 )
WvW_SetPalette( aPalette )
RETURN NIL
e depois uso as cores como em Clipper :
#define COR_DE_FUNDO setcolor("3/9")
#define COR_WINDOWS_XP setcolor( 'N/W,N/GR*,,,N/W*' )
#define COR_NORMAL setcolor("N/W*,GR+/B*,N/N,GR+/N*,W+/N*,R/W*,W/W*,B/W*")
Getsyscolor é uma função que pega as cores do sistema :
HB_FUNC ( GETSYSCOLOR )
{
int i = ISNIL(1) ? 0 : hb_parni(1);
if ( i >= 0 && i < 29 )
{
hb_retnl( (LONG) GetSysColor(i) );
}
}
Dessa forma posso criar uma tela que funciona tanto no XP quanto no win98. Por exemplo :
***************
FUNCTION MAIN()
***************
dbsetdriver("DBFCDX")
hb_setcodepage("PT850")
set confirm on
set deleted on
set bell off
set scoreboard off
set eventmask to INKEY_ALL
set date british
set epoch to 1950
ConfigCores()
WVW_SetFont(,'Ms Sans Serif', 16, 8,, PROOF_QUALITY )
wvw_setmaincoord(.F.)
wvw_noclose()
wvw_size_ready(.T.)
wvw_SetPaintRefresh(0)
WVW_SetCodePage(,250)
wvw_SetVertCaret(.F.)
wvw_enableshortcuts(0,.T.)
wvw_maximize(0)
wvw_settitle( , "PDV - Frente de Loja" )
COR_WINDOWS_XP
scroll()
wvw_drawboxraised(,01,01,04,97)
COR_DE_FUNDO
@ 01, 01 clear to 04, 97
COR_WINDOWS_XP
wvw_drawboxraised(,06,01,28,47)
COR_NORMAL
@ 06, 01 clear to 28, 47
COR_WINDOWS_XP
wvw_drawboxraised(,30,01,32,97)
COR_NORMAL
@ 30, 01 clear to 32, 97
COR_WINDOWS_XP
wvw_drawboxraised(,06,49,10,97)
wvw_drawboxraised(,12,49,16,97)
wvw_drawboxraised(,18,49,28,97)
COR_DE_FUNDO
@ 06, 49 clear to 10, 97
@ 12, 49 clear to 16, 97
@ 18, 49 clear to 28, 97
wvw_drawlabel(, 06, 50, "Valor Unitário",,, RGB( 0, 255, 255 ), RGB( 100, 135, 220 ), "Tahoma",,, 2 )
wvw_drawlabel(, 12, 50, "Subtotal" ,,, RGB( 0, 255, 255 ), RGB( 100, 135, 220 ), "Tahoma",,, 2 )
wvw_drawlabel(, 23, 65, "Seu logotipo aqui",,, RGB( 0, 255, 255 ), RGB( 100, 135, 220 ), "Tahoma",,, 2 )
mcodigo := space(13)
mquant := 0.0
COR_NORMAL
wvw_drawlabel(, 31, 03, "CÓDIGO :",,, aPalette[1], aPalette[16], "Tahoma",,, 2 )
wvw_drawlabel(, 31, 72, "QUANTIDADE :",,, aPalette[1], aPalette[16], "Tahoma",,, 2 )
@ 31, 14 get mcodigo picture "9999999999999"
@ 31, 88 get mquant picture "@E 9999.99"
read
RETURN NIL
Espero que ajude em alguma coisa.
[]s
Manoel Angeiras