Hola a todos,
como se debe aplicar a un SAY el estilo SS_CENTERIMAGE para que el texto quede centrado verticalmente?
He probado oSay:nStyle := nOr( oSay:nStyle, SS_CENTERIMAGE), pero para que actúe, hay que hacer oSay:Refresh() después de activar el dialogo que lo contiene.
En mi opinión el comando de definición del SAY debería incluir una clausula lVertical o lCenterV o similar, así se aplicaría el efecto al momento de crearlo.
Gracias de antemano
Say centrado vertical
- karinha
- Posts: 7917
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: Say centrado vertical
look,
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=32365&p=189940&hilit=NESCAPEMENT#p189940
Regards.
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=32365&p=189940&hilit=NESCAPEMENT#p189940
Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Re: Say centrado vertical
Gracias karinha por responder tan rápido
quizás no me he explicado bien, no me refiero a imprimir en sentido vertical sino a centrar el texto verticalmente con respecto a la altura del campo
quizás no me he explicado bien, no me refiero a imprimir en sentido vertical sino a centrar el texto verticalmente con respecto a la altura del campo
Saludos
Salvador
Salvador
- nageswaragunupudi
- Posts: 10709
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 6 times
- Contact:
Re: Say centrado vertical
Code: Select all | Expand
#include "fivewin.ch"
#define SS_CENTERIMAGE 0x00000200
//----------------------------------------------------------------------------//
function SayTestDlg
local oDlg, oSay
DEFINE DIALOG oDlg TRUEPIXEL TITLE "SAY VCENTER"
@ 20,20 SAY oSay PROMPT "Center" SIZE 200,100 PIXEL OF oDlg CENTER
if Empty( oSay:hWnd )
oSay:nStyle := nOr( oSay:nStyle, SS_CENTERIMAGE ) // dialogs
else
oSay:WinStyle( SS_CENTERIMAGE, .t. ) // windows, etc
endif
ACTIVATE DIALOG oDlg CENTERED ;
ON PAINT oDlg:Box( oSay:nTop-1, oSay:nLeft-1, oSay:nBottom+1, oSay:nRight+ 1 )
return nil
//----------------------------------------------------------------------------//
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Say centrado vertical
For me works oSay:WinStyle( SS_CENTERIMAGE, .t. ), my SAY is inside a buttonbar
Would be easier if the command SAY had a clause lCenterV or similar
Tankyou very much Mr. Rao
Would be easier if the command SAY had a clause lCenterV or similar
Tankyou very much Mr. Rao
Saludos
Salvador
Salvador
- nageswaragunupudi
- Posts: 10709
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 6 times
- Contact:
Re: Say centrado vertical
Wherever you use, use the full code
That takes care of all situations and saves your time in searching for solution.
Yes we are considering providing additional parameter for Say.
When you want to paint on buttonbar better to use oBar:bPainted than use SAY. Because say's transparency does not work on all cases of gradients.
This paints the text centered in the aRect (you can control alignment too)
For example see how text is painted on buttonbar in this post
viewtopic.php?f=3&t=33237
Code: Select all | Expand
if Empty( oSay:hWnd )
oSay:nStyle := nOr( oSay:nStyle, SS_CENTERIMAGE ) // dialogs
else
oSay:WinStyle( SS_CENTERIMAGE, .t. ) // windows, etc
endif
That takes care of all situations and saves your time in searching for solution.
Yes we are considering providing additional parameter for Say.
When you want to paint on buttonbar better to use oBar:bPainted than use SAY. Because say's transparency does not work on all cases of gradients.
Code: Select all | Expand
oBar:bPainted := { || oBar:SayText( cText, aRect ) }
This paints the text centered in the aRect (you can control alignment too)
For example see how text is painted on buttonbar in this post
viewtopic.php?f=3&t=33237
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 10709
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 6 times
- Contact:
Re: Say centrado vertical
We added a new clause VCENTER to SAY command in FWH16.11
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India