WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR

WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR

Postby karinha » Tue Dec 20, 2005 7:39 pm

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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7846
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby Antonio Linares » Tue Dec 20, 2005 8:14 pm

João,

Prueba este cambio en la clase TGet:

Code: Select all  Expand view  RUN
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               
   ...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42127
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby karinha » Tue Dec 20, 2005 9:31 pm

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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7846
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby Antonio Linares » Tue Dec 20, 2005 10:40 pm

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():

Code: Select all  Expand view  RUN
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( ... )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42127
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby karinha » Wed Dec 21, 2005 12:43 am

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...
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7846
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby Antonio Linares » Wed Dec 21, 2005 9:13 am

João,

Cual falla ? El ES_RIGHT y ES_CENTER ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42127
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby karinha » Wed Dec 21, 2005 10:16 am

Kreo ke si, Antonio.

Ejemplo:

Tengo um GET, con 13 digitos:

Correcto, seria esto: 7891101901001

En lo GET: 7891... El resto... no esta visible.

Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7846
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby karinha » Wed Dec 21, 2005 10:38 am

Perdón.

Correcto seria esto:

67.834.510/0001-65

Mostra / Exhibi:

0/0001-65
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7846
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby Alfredo Arteaga » Wed Dec 21, 2005 7:02 pm

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]
User avatar
Alfredo Arteaga
 
Posts: 326
Joined: Sun Oct 09, 2005 5:22 pm
Location: Mexico

Postby karinha » Wed Dec 21, 2005 7:49 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7846
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby Antonio Linares » Thu Dec 22, 2005 7:45 am

Arreglado:

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


Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42127
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby karinha » Thu Dec 22, 2005 11:33 am

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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7846
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby Alfredo Arteaga » Thu Dec 22, 2005 4:10 pm

Bien Antonio!. Todo parece tan simple cuando ya esta hecho...

Nuevamente, gracias.
User avatar
Alfredo Arteaga
 
Posts: 326
Joined: Sun Oct 09, 2005 5:22 pm
Location: Mexico


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Timm Sodtalbers and 41 guests