Centrar Say ?

Centrar Say ?

Postby Frafive » Fri May 30, 2008 7:02 am

Hola foro

Se puede centrar un say verticalmente desde recursos ?


un saludo
Frafive
 
Posts: 189
Joined: Wed Apr 05, 2006 9:48 pm

Postby karinha » Fri May 30, 2008 12:43 pm

Haces asi, con SAYROTATED()
Code: Select all  Expand view  RUN
    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

//----------------------------------------------------------------------------


Saludos, desde Brasil.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7860
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 47 guests