Hola foro
Se puede centrar un say verticalmente desde recursos ?
un saludo
LOCAL oFont1, oFont2
DEFINE FONT oFont1 NAME "Arial" SIZE 0,-36 NESCAPEMENT 90*10
DEFINE FONT oFont2 NAME "Arial" SIZE 0,-24 BOLD NESCAPEMENT 45*10
ACTIVATE DIALOG ODLGD CENTERED ;
ON INIT SNDPLAYSOUND(".\LEMBRETE.WAV" ) ;
ON PAINT( SayRotated( oDlgd, 260, 10, ; // 235 210
"Vendas ", oFont1,,, .t. ), ;
SayRotated( oDlgd, 150, 500, "About ", oFont2, ; //150,420
CLR_HRED, CLR_YELLOW, .F. ) )
//---------------------------------------------------------------------------//
Function SayRotated( oWnd, Y, X, cPrompt, oFont, nClrText, nClrPane, l3D )
Local hDC := oWnd:hDC
DEFAULT nClrText := CLR_HRED, l3D := .T.
IF l3D
DrawRotated( hdc, cPrompt, Y + 1, X + 1, CLR_BLACK, nClrPane, oFont )
DrawRotated( hdc, cPrompt, Y - 1, X - 1, nClrText, nClrPane, oFont )
ENDIF
DrawRotated( hdc, cPrompt, Y , X , nClrText, nClrPane, oFont )
Return Nil
//----------------------------------------------------------------------------
Static Function DrawRotated( hDC, cPrompt, Y, X, nClrText, nClrPane, oFont )
Local hOldFont, nOldMode, nOldClrText, nOldClrPane, nOldBkMode
nOldClrText := SetTextColor( hDC, nClrText )
if nClrPane <> Nil
nOldClrPane := SetBkColor( hDC, nClrPane )
else
nOldBkMode := SetBkMode( hDC,1 )
Endif
hOldFont := SelectObject( hDC, oFont:hFont )
TextOut( hDC, Y, X, cPrompt, Len( cPrompt ) )
SelectObject( hDC, hOldFont )
if nClrPane<>nil
SetBkColor( hDC, nOldClrPane )
else
SetBkMode( hDC, nOldBkMode )
Endif
SetTextColor( hDC, nOldClrText )
Return Nil
//----------------------------------------------------------------------------
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 43 guests