Armando, por favor teste ahi en tu programa:
//-> Esto debe ser incorporado al inicio de la TGET.PRG
#define ES_CENTER 1
#define ES_RIGHT 2
#define ES_LEFT 0
#Define TA_LEFT 0
#Define TA_RIGHT 2
#Define TA_CENTER 6
//-> Senores creo que el problema ecuentrase en la classe TGET.PRG mismo
//-> Favor Ojear las lineas modificadas abajo:
//----------------------------------------------------------------------------//
METHOD Paint() CLASS TGet
local aInfo := ::DispBegin()
Local hOldFont
//-> En 22/12/2005 Por Antonio Linares
//-> Para que el When(.F.) del GET, fique con colores.
if ::oBrush != nil
FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
else
CallWindowProc( ::nOldProc, ::hWnd, WM_ERASEBKGND, ::hDC, 0 )
endif
if IsWindowEnabled( ::hWnd )
CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )
else
SetTextColor( ::hDC, ::nClrText )
SetBkColor( ::hDC, ::nClrPane )
hOldFont = SelectObject( ::hDC, ::oFont:hFont )
do case
case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_CENTER )
SetTextAlign( ::hDC, TA_CENTER )
ExtTextOut( ::hDC, 0, ::nWidth() / 2, ;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
/* //-> Original Modificado Por Antonio Linares - GET Normal
case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_RIGHT )
SetTextAlign( ::hDC, TA_RIGHT )
ExtTextOut( ::hDC, 0, ::nWidth() - 4, ;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
*/
//-> Em 19/02/2008 - Mudei Para Que a BTNGET.PRG Funcione - Joao
//-> Com o Alinhamento a Direita do GET - RIGHT Ligado do Workshop.exe
//-> Mudei de - 4 Para - 64 e Aparentemente Funcionou.
//-> Cambios aqui...
case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_RIGHT )
SetTextAlign( ::hDC, TA_RIGHT )
ExtTextOut( ::hDC, 0, ::nWidth() - 64, ;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
otherwise
SetTextAlign( ::hDC, TA_LEFT )
ExtTextOut( ::hDC, 0, 0, ;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
endcase
SelectObject( ::hDC, hOldFont )
endif
if ValType( ::bPainted ) == "B"
Eval( ::bPainted, ::hDC, ::cPS, Self )
endif
::DispEnd( aInfo )
return 1
Maestro antonio, como hago para saber de donde viene la classe??
Cuando parto de un GET como debo informar a la Classe de dondo partio??
Ejemplo:
Se viene de BTNGET.PRG...
y asi lo pongo:
ExtTextOut( ::hDC, 0, ::nWidth() - 64, ;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
si viene de TGET.PRG Pongo:
ExtTextOut( ::hDC, 0, ::nWidth() - 4, ;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
Gracias maestro
Best regards, saludos.