Como pongo un texto en vertical usando TSAY

Como pongo un texto en vertical usando TSAY

Postby Vladimir Zorrilla » Sat Mar 07, 2009 9:59 pm

Amigos

Como pongo un texto en vertical usando TSAY ya que no puedo hacerlo con XBROWSE


Mil gracias
ME INTERESA FW Y XHB POR SER OPEN SOURCE
Vladimir Zorrilla
 
Posts: 225
Joined: Tue Feb 28, 2006 4:25 pm
Location: PERU

Re: Como pongo un texto en vertical usando TSAY

Postby cuatecatl82 » Mon Mar 09, 2009 5:43 pm

Vladimir:

Intenta de la Siguiente manera:

Code: Select all  Expand view
STATIC FUNCTION texto()

LOCAL oFont1, oFont2, oDlgd

    DEFINE DIALOG oDlgd FROM 2, 2 TO 40,40 TITLE "Texto en Dialogos"
    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 PAINT( SayRotated( oDlgd, 260, 10, "Texto 1 ", oFont1, CLR_HBLUE, CLR_GREEN, .T. ),;
                             SayRotated( oDlgd, 150, 50, "Texto 2",  oFont2, CLR_HRED,  CLR_YELLOW, .F. ))

Return nil


Aki el codigo fuente:

Code: Select all  Expand view
//---------------------------------------------------------------------------//
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

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


Puedes Revisar el post que deje hace unas semanas:
viewtopic.php?f=6&t=14659

Espero te Sirva. un saludo..
Soluciones y Diseño de Software
Damos Soluciones...

I.S.C. Victor Daniel Cuatecatl Leon
Director y Diseñador de Proyectos

http://www.soldisoft.unlugar.com
http://www.sisa.unlugar.com
danyleon82@hotmail.com
www.facebook.com/victordaniel.cuatecatlleon
User avatar
cuatecatl82
 
Posts: 625
Joined: Wed Mar 14, 2007 6:49 pm
Location: San Cristobal de las Casas, Chiapas México


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 36 guests