FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
Posted: Tue Dec 20, 2005 07: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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
Posted: Tue Dec 20, 2005 08:14 PM
João,

Prueba este cambio en la clase TGet:

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
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
Posted: Tue Dec 20, 2005 09: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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
Posted: 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, ::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():

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
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
Posted: 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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
Posted: Wed Dec 21, 2005 09:13 AM

João,

Cual falla ? El ES_RIGHT y ES_CENTER ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
Posted: 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
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
Posted: 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
Posts: 326
Joined: Sun Oct 09, 2005 05:22 PM
WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
Posted: Wed Dec 21, 2005 07: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]

Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
Posted: Wed Dec 21, 2005 07:49 PM

SI. ÉS ESTO.

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 - Phone: +55(11)95150-7341
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
Posted: Thu Dec 22, 2005 07:45 AM
Arreglado:

   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


regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
Posted: 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
Posts: 326
Joined: Sun Oct 09, 2005 05:22 PM
WHEN( .F. ) EN GET USANDO FIVEWIN FOR XHARBOUR
Posted: Thu Dec 22, 2005 04:10 PM

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

Nuevamente, gracias.

Continue the discussion