Texto vertical en un dialogo...

Texto vertical en un dialogo...

Postby Ruben Fernandez » Mon Mar 12, 2007 1:28 pm

Amigos:

Necesito colocar un texto vertical en un dialogo.
Declarando el font NESCAPEMENT 900 solo funciona
para las impresiones no para los says en un dialogo.

Agradezco alguna sugerencia

Muchas gracias

Ruben Fernandez.
Ruben Fernandez
 
Posts: 366
Joined: Wed Aug 30, 2006 5:25 pm
Location: Uruguay

Postby Raymundo Islas M. » Mon Mar 12, 2007 2:51 pm

Hola Ruben

Esto quizas podria ayudarte :


******************************************************************************
* Function SayRotated(oWnd,Y,X,cPrompt,oFont,nClrText,nClrPane,l3D)
* Dibuja un texto rotado
* oWnd: Ventana / diálogo
* Y,X: coordenadas en pixels del inicio del texto (nTop, nLeft)
* oFont: Fuente (definir antes) // debe ser True Type
* nClrText,nClrPane: Colores de texto y fondo. Si éste ultimo es nil se
* pinta transparente
* l3D: Con efecto 3D
*
* César E. Lozada (cesarlozada@hotmail.com)
* Los Teques, Venezuela Marzo 25, 2003
*
******************************************************************************
#include "Fivewin.ch"
******************************************************************************
Function Test
Local oDlg, 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

DEFINE DIALOG oDlg FROM 0,0 TO 20,40 COLOR CLR_BLACK,CLR_WHITE;
TITLE "Textos rotados"

ACTIVATE DIALOG oDLg CENTERED;
ON PAINT( SayRotated(oDlg,235,0,"90 grados 3D",oFont1,,,.t.),;
SayRotated(oDlg,125,50,"45 grados",oFont2,CLR_HRED,CLR_YELLOW,.f.))

RELEASE FONT oFont1
RELEASE FONT oFont2
return
******************************************************************************
Function SayRotated(oWnd,Y,X,cPrompt,oFont,nClrText,nClrPane,l3D)
Local hDC:=oWnd:hDC
DEFAULT nClrText:=CLR_BLUE, 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
******************************************************************************
Static Function DrawRotated(hDC,cPrompt,Y,X,nClrText,nClrPane,oFont)
Local hOldFont, nOldMode, nOldClrText, nOldClrPane

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
******************************************************************************


Saludos
FWH 10.6 + xHarbour + Borland 582
User avatar
Raymundo Islas M.
 
Posts: 592
Joined: Tue Mar 14, 2006 11:34 pm
Location: Acapulco, Gro. MEXICO

Postby Ruben Fernandez » Mon Mar 12, 2007 3:02 pm

Gracias Raymundo

Lo pruebo y te digo.

Muchas gracias.

Saludos

Ruben Fernandez
Ruben Fernandez
 
Posts: 366
Joined: Wed Aug 30, 2006 5:25 pm
Location: Uruguay


Return to FiveWin para Harbour/xHarbour

Who is online

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