WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
WHEN( .F. ) EN FIVEWIN FOR XHARBOUR VERSION 2.7
PERSONAS, NECESITO HELP, COMO HACER PARA KE EL FOCO DEL GET EN UN WHEN( .F. ) FIKE CON COLOR COMO EN EL FIVEWIN 16 BITS??
REDEFINE GET aGet[1] VAR XCGC PICTURE "@K 999.999.999-99" ;
WHEN( .F. ) ;
ID 20 OF oFld:aDialogs[ 1 ] ;
FONT oFont UPDATE ;
COLOR CLR_HRED, CLR_HCYAN ;
CURSOR oHand
ASI, FICA CON ASPECTO(APARIENCIA) DI 'MUERTO/DESHABILITADO', SIN COLOR.
GRACIAS A TODOS. SALUDOS.
PERSONAS, NECESITO HELP, COMO HACER PARA KE EL FOCO DEL GET EN UN WHEN( .F. ) FIKE CON COLOR COMO EN EL FIVEWIN 16 BITS??
REDEFINE GET aGet[1] VAR XCGC PICTURE "@K 999.999.999-99" ;
WHEN( .F. ) ;
ID 20 OF oFld:aDialogs[ 1 ] ;
FONT oFont UPDATE ;
COLOR CLR_HRED, CLR_HCYAN ;
CURSOR oHand
ASI, FICA CON ASPECTO(APARIENCIA) DI 'MUERTO/DESHABILITADO', SIN COLOR.
GRACIAS A TODOS. SALUDOS.
João Santos - São Paulo - Brasil
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
João,
Prueba este cambio en la clase TGet:
Prueba este cambio en la clase TGet:
Code: Select all
METHOD Paint() CLASS TGet
...
local hOldFont
...
if IsWindowEnabled( ::hWnd )
CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )
else
SetTextColor( ::hDC, ::nClrText )
SetBkColor( ::hDC, ::nClrPane )
hOldFont = SelectObject( ::hDC, ::oFont:hFont )
ExtTextOut( ::hDC, 0, 0,;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
SelectObject( ::hDC, hOldFont )
endif
...
Gracias Antonio por tu ayuda.
Cuasi perfecto, solamente um problema, no esta respectando o comando: CENTER, RIGHT O LEFT del WorkSop.exe ke hacer??
Todo o contenido del GET, fica a la Iskierda de GET.
hice asi, esta correcto?
//----------------------------------------------------------------------------//
METHOD Paint() CLASS TGet
local aInfo := ::DispBegin()
// Mudanca(Cambio) enviada(o) por Antonio Linares en 20/12/2005
local hOldFont
if ::oBrush != nil
FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
else
CallWindowProc( ::nOldProc, ::hWnd, WM_ERASEBKGND, ::hDC, 0 )
endif
CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )
if ValType( ::bPainted ) == "B"
Eval( ::bPainted, ::hDC, ::cPS, Self )
endif
::DispEnd( aInfo )
//-> Antonio Linares en 20/12/2005
if IsWindowEnabled( ::hWnd )
CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )
else
SetTextColor( ::hDC, ::nClrText )
SetBkColor( ::hDC, ::nClrPane )
hOldFont = SelectObject( ::hDC, ::oFont:hFont )
ExtTextOut( ::hDC, 0, 0,;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
SelectObject( ::hDC, hOldFont )
endif
// Fim da Mudanca - Fin del Cambio
return 1
Muchas Gracias, e Saludos desde São Paulo - Brasil.
Cuasi perfecto, solamente um problema, no esta respectando o comando: CENTER, RIGHT O LEFT del WorkSop.exe ke hacer??
Todo o contenido del GET, fica a la Iskierda de GET.
hice asi, esta correcto?
//----------------------------------------------------------------------------//
METHOD Paint() CLASS TGet
local aInfo := ::DispBegin()
// Mudanca(Cambio) enviada(o) por Antonio Linares en 20/12/2005
local hOldFont
if ::oBrush != nil
FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
else
CallWindowProc( ::nOldProc, ::hWnd, WM_ERASEBKGND, ::hDC, 0 )
endif
CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )
if ValType( ::bPainted ) == "B"
Eval( ::bPainted, ::hDC, ::cPS, Self )
endif
::DispEnd( aInfo )
//-> Antonio Linares en 20/12/2005
if IsWindowEnabled( ::hWnd )
CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )
else
SetTextColor( ::hDC, ::nClrText )
SetBkColor( ::hDC, ::nClrPane )
hOldFont = SelectObject( ::hDC, ::oFont:hFont )
ExtTextOut( ::hDC, 0, 0,;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
SelectObject( ::hDC, hOldFont )
endif
// Fim da Mudanca - Fin del Cambio
return 1
Muchas Gracias, e Saludos desde São Paulo - Brasil.
João Santos - São Paulo - Brasil
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
João,
Cambia el orden del código:
...
if IsWindowEnabled( ::hWnd )
CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )
else
SetTextColor( ::hDC, ::nClrText )
SetBkColor( ::hDC, ::nClrPane )
hOldFont = SelectObject( ::hDC, ::oFont:hFont )
ExtTextOut( ::hDC, 0, 0,;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
SelectObject( ::hDC, hOldFont )
endif
if ValType( ::bPainted ) == "B"
Eval( ::bPainted, ::hDC, ::cPS, Self )
endif
::DispEnd( aInfo )
Para respetar el CENTER, RIGHT O LEFT, tienes que llamar a SetTextAlign() antes de llamar a ExtTextOut():
Cambia el orden del código:
...
if IsWindowEnabled( ::hWnd )
CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )
else
SetTextColor( ::hDC, ::nClrText )
SetBkColor( ::hDC, ::nClrPane )
hOldFont = SelectObject( ::hDC, ::oFont:hFont )
ExtTextOut( ::hDC, 0, 0,;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
SelectObject( ::hDC, hOldFont )
endif
if ValType( ::bPainted ) == "B"
Eval( ::bPainted, ::hDC, ::cPS, Self )
endif
::DispEnd( aInfo )
Para respetar el CENTER, RIGHT O LEFT, tienes que llamar a SetTextAlign() antes de llamar a ExtTextOut():
Code: Select all
do case
case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_CENTER )
SetTextAlign( ::hDC, TA_CENTER )
case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_RIGHT )
SetTextAlign( ::hDC, TA_RIGHT )
otherwise
SetTextAlign( ::hDC, TA_LEFT )
endcase
ExtTextOut( ... )
Antonio... Por Favor, Donde esta Errado??
No Fica Perfecto...
#define ES_CENTER 1
#define ES_RIGHT 2
#define ES_LEFT 0
#Define TA_LEFT 0
#Define TA_RIGHT 2
#Define TA_CENTER 6
METHOD Paint() CLASS TGet
local aInfo := ::DispBegin()
local hOldFont
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 ) // 1
SetTextAlign( ::hDC, TA_CENTER ) // 6
case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_RIGHT ) // 2
SetTextAlign( ::hDC, TA_RIGHT ) // 2
otherwise
SetTextAlign( ::hDC, TA_LEFT ) // 0
endcase
ExtTextOut( ::hDC, 0, 0,;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
SelectObject( ::hDC, hOldFont )
endif
if ValType( ::bPainted ) == "B"
Eval( ::bPainted, ::hDC, ::cPS, Self )
endif
::DispEnd( aInfo )
return 1
Gracias...
No Fica Perfecto...
#define ES_CENTER 1
#define ES_RIGHT 2
#define ES_LEFT 0
#Define TA_LEFT 0
#Define TA_RIGHT 2
#Define TA_CENTER 6
METHOD Paint() CLASS TGet
local aInfo := ::DispBegin()
local hOldFont
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 ) // 1
SetTextAlign( ::hDC, TA_CENTER ) // 6
case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_RIGHT ) // 2
SetTextAlign( ::hDC, TA_RIGHT ) // 2
otherwise
SetTextAlign( ::hDC, TA_LEFT ) // 0
endcase
ExtTextOut( ::hDC, 0, 0,;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
SelectObject( ::hDC, hOldFont )
endif
if ValType( ::bPainted ) == "B"
Eval( ::bPainted, ::hDC, ::cPS, Self )
endif
::DispEnd( aInfo )
return 1
Gracias...
João Santos - São Paulo - Brasil
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Alfredo Arteaga
- Posts: 326
- Joined: Sun Oct 09, 2005 5:22 pm
- Location: Mexico
- Contact:
Me pregunto si se logró, no respeta la alineación.
---
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 )
case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_RIGHT )
SetTextAlign( ::hDC, TA_RIGHT )
otherwise
SetTextAlign( ::hDC, TA_LEFT )
endcase
ExtTextOut( ::hDC, 0, 0,;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
SelectObject( ::hDC, hOldFont )
endif[/code]
---
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 )
case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_RIGHT )
SetTextAlign( ::hDC, TA_RIGHT )
otherwise
SetTextAlign( ::hDC, TA_LEFT )
endcase
ExtTextOut( ::hDC, 0, 0,;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
SelectObject( ::hDC, hOldFont )
endif[/code]
SI. ÉS ESTO.
MIRA ESTE EJEMPLO POSTADO EN http://www.fivewin.com.br
http://www.fivewin.com.br/exibedicas.asp?id=588
MIRA ESTE EJEMPLO POSTADO EN http://www.fivewin.com.br
http://www.fivewin.com.br/exibedicas.asp?id=588
João Santos - São Paulo - Brasil
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Arreglado:
[/size]
Code: Select all
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 ) )
case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_RIGHT )
SetTextAlign( ::hDC, TA_RIGHT )
ExtTextOut( ::hDC, 0, ::nWidth() - 4,;
{ 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
Perfecto, Impecable, Antonio... Muchas Gracias... Usted és Fantástico, Increíble.
Mui Bueno. Excelente, Noble.
Solución Final:
#define ES_CENTER 1
#define ES_RIGHT 2
#define ES_LEFT 0
#Define TA_LEFT 0
#Define TA_RIGHT 2
#Define TA_CENTER 6
METHOD Paint() CLASS TGet
local aInfo := ::DispBegin()
Local hOldFont
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 ) )
case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_RIGHT )
SetTextAlign( ::hDC, TA_RIGHT )
ExtTextOut( ::hDC, 0, ::nWidth() - 4, ;
{ 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
Gracias También a Vagner Wirts. vwirts@ig.com.br
Saludos, Desde São Paulo - Brazil.
Mui Bueno. Excelente, Noble.
Solución Final:
#define ES_CENTER 1
#define ES_RIGHT 2
#define ES_LEFT 0
#Define TA_LEFT 0
#Define TA_RIGHT 2
#Define TA_CENTER 6
METHOD Paint() CLASS TGet
local aInfo := ::DispBegin()
Local hOldFont
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 ) )
case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_RIGHT )
SetTextAlign( ::hDC, TA_RIGHT )
ExtTextOut( ::hDC, 0, ::nWidth() - 4, ;
{ 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
Gracias También a Vagner Wirts. vwirts@ig.com.br
Saludos, Desde São Paulo - Brazil.
João Santos - São Paulo - Brasil
- Alfredo Arteaga
- Posts: 326
- Joined: Sun Oct 09, 2005 5:22 pm
- Location: Mexico
- Contact: