FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour PROBLEMAS EN LA CLASSE BTNGET.PRG
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
PROBLEMAS EN LA CLASSE BTNGET.PRG
Posted: Tue Feb 19, 2008 03:33 PM

Buenas amigos, por favor, tengo una duda en la classe BTNGET.PRG:

Cuando tengo un GET numerico en mi DIALOGO, y lo defino como:

ALIGNMENT = RIGHT //-> Numeros a la derecha del GET.

Los Numeros, no aparecen correctamente, fican abajo de la BITMAP.

Cual los cambios tengo que hacer en la classe BTNGET.PRG?

Muchas gracias,

Descupas, por mi portunhol.

Best regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
PROBLEMAS EN LA CLASSE BTNGET.PRG
Posted: Tue Feb 19, 2008 04:13 PM

can you post a minimal test please ?

Best Regards, Saludos



Falconi Silvio
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
PROBLEMAS EN LA CLASSE BTNGET.PRG
Posted: Tue Feb 19, 2008 04:33 PM
Silvio wrote:can you post a minimal test please ?



Silvio, en el RESOURCE WORKSHOP.EXE click en RIGHT en cualcuer GET y adccione la classe BTNGET.PRG en tu sistema.

Puedes bajar la BTNGET.PRG de acá:

http://www.fivewin.com.br/exibedicas.asp?id=587

http://www.fivewin.com.br/exibedicas.asp?id=585

Best regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
PROBLEMAS EN LA CLASSE BTNGET.PRG
Posted: Tue Feb 19, 2008 05:15 PM
Best Regards, Saludos



Falconi Silvio
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
PROBLEMAS EN LA CLASSE BTNGET.PRG
Posted: Tue Feb 19, 2008 05:42 PM
Silvio wrote:look it please
http://fivetechsoft.com/forums/viewtopic.php?t=9264

or

http://fivetechsoft.com/forums/viewtopic.php?t=9212


I hope you help with it


VERY THANKS, SILVIO.

NO TENGO ESTOS PROBLEMAS.

MI PROBLEMA SILVIO, ÉS CUANDO NECESITO DE UN GET CON ESCRITA A LA DERECHA(RIGHT) DEL GET.

EL PROBLEMA, NO ÉS EN LA TGET.PRG By Antonio Linares.

El Problema, es en la BTNGET.PRG by:

*-- PROGRAM FILE -------------------------------------------------------
*  Application: Addon for FiveWin
*  Description: TBtnGet - Colored TGet class with button
*    File Name: tbtnget.prg
*       Author: Ricardo Ramirez       Tester: Ricardo Ramirez
* Date created: 1998-01-01            Date updated: þ2001-03-26
* Time created: 8:17:12PM             Time updated: þ16:028:17M
*    Copyright: (c) 1998-2000 by Punto-Co
*
 * $Id: btnget.prg,v 1.4 2001/08/10 18:12:21 RRamirez Exp $
*
* Compliments of:
*  George Georguiev
*-----------------------------------------------------------------------


Best regards, y gracias por la ayuda.

Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
PROBLEMAS EN LA CLASSE BTNGET.PRG
Posted: Tue Feb 19, 2008 06:05 PM

I use btnget 32 bit from many applications no errors !!!!

If you not post here a test sample where it make error NONE cannot help you !!

Best Regards, Saludos



Falconi Silvio
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
PROBLEMAS EN LA CLASSE BTNGET.PRG
Posted: Tue Feb 19, 2008 06:37 PM

Karinha caro amigo:

Yo uso la clase BTNGET sin problemas, en los recursos la defino con alineación a la izquierda, el get es numerico (recibe puros números) a pesar de que el campo lo tengo definido como carácter, este es el código.

REDEFINE BTNGET aGets[02] VAR oHdr:HDR_SOC ID 102 OF oDlg UPDATE;
WHEN lAppend;
RESOURCE "Buscar" PICTURE "@K 9999999";
VALID ChkSoc(oDlg,oHdr,aGets);
ACTION (oHdr:HDR_SOC := BrwSoc(cSocios,oDlg),ChkSoc(oDlg,oHdr,aGets));
MESSAGE "Número de socio"

En el valid hago lo siguiente:

STATIC FUNCTION ChkSoc(oDlg,oHdr,aGets)
oHdr:HDR_SOC := STR(VAL(oHdr:HDR_SOC),LEN(oHdr:HDR_SOC),0)
....
....
RETURN(.T.)

Con eso no tengo problemas, si deseas te puedo mostrar una imágen y veras que los números no se esonden bajo el BMP

Saludos

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
PROBLEMAS EN LA CLASSE BTNGET.PRG
Posted: Tue Feb 19, 2008 06:48 PM
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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
PROBLEMAS EN LA CLASSE BTNGET.PRG
Posted: Tue Feb 19, 2008 06:58 PM
Silvio wrote:I use btnget 32 bit from many applications no errors !!!!

If you not post here a test sample where it make error NONE cannot help you !!


Silvio, sorry,

Problemas con el idioma.. hablo poco el español y ingléz... nada. jejeje.

Silvio, el problema és en la classe TGET.PRG mira(look) el ejemplo.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
PROBLEMAS EN LA CLASSE BTNGET.PRG
Posted: Tue Feb 19, 2008 07:22 PM

Karinha:

Uso FWH711 y sí hay algunas diferencias en la clase TGET.

Saludos

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
PROBLEMAS EN LA CLASSE BTNGET.PRG
Posted: Tue Feb 19, 2008 07:53 PM
Armando wrote:Karinha:

Uso FWH711 y sí hay algunas diferencias en la clase TGET.

Saludos


Son muchas diferncias, Armando?

estas modificaciones fueran hechas por el Maestro Antonio Linares para poner colores en GET´s con WHEN( .F. ).

Asi, al hacer los Cambios Danificou la BTNGET.PRG, Comprendes?

Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
PROBLEMAS EN LA CLASSE BTNGET.PRG
Posted: Tue Feb 19, 2008 08:12 PM
//-> Otra alternativa
//----------------------------------------------------------------------------//

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 )

         //-> Checa el Tamano del Get
         If ::nWidth() < 149

             SetTextAlign( ::hDC, TA_RIGHT )

             ExtTextOut( ::hDC, 0, ::nWidth() - 4,                    ;
             { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )

         ElseIf ::nWidth() >= 150  //-> Btnget.prg - Funciono...

             //-> Cambios aca...

             SetTextAlign( ::hDC, TA_RIGHT )

             ExtTextOut( ::hDC, 0, ::nWidth() - 67,                   ;
             { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )

         Endif

         otherwise //-> errores en Btnget.prg

              SetTextAlign( ::hDC, TA_LEFT )

              ExtTextOut( ::hDC, 0, 4,                                        ;
              { 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, esto esta correcto?? O puede causarme danos??
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
PROBLEMAS EN LA CLASSE BTNGET.PRG
Posted: Tue Feb 19, 2008 08:14 PM
Karinha:

Estas son las diferencias que yo veo

Faltan
#define ES_RIGHT 2
#define ES_LEFT 0

En la parte del código que modificaste así es como esta:


      do case
         case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_CENTER )
              SetTextAlign( ::hDC, TA_CENTER )
              if ::lSpinner
                 ExtTextOut( ::hDC, 1, ( ::nWidth() - 3 - GetSysMetrics( SM_CYHSCROLL ) ) / 2,;
                    { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
              else
                 ExtTextOut( ::hDC, 1, ( ::nWidth() - 3 ) / 2,;  
                   { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
              endif

         case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_RIGHT )
              SetTextAlign( ::hDC, TA_RIGHT )
              if ::lSpinner
                 ExtTextOut( ::hDC, 1, ::nWidth() - 7 - GetSysMetrics( SM_CYHSCROLL ),;  
                    { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
              else
                 ExtTextOut( ::hDC, 1, ::nWidth() - 7,;  
                    { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
              endif

         otherwise
              SetTextAlign( ::hDC, TA_LEFT )
              ExtTextOut( ::hDC, 1, 2,;
                { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
      endcase


Saludos
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
PROBLEMAS EN LA CLASSE BTNGET.PRG
Posted: Tue Feb 19, 2008 08:57 PM

Armando, Mil Gracias, Intente:

En el \samples, tiene el ejemplo> TESTGETR.PRG

Incorpora la classe BTNGET.PRG con el ejemplo arriba y miras que el GET al se poner una BITMAP no esta correcto.

saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
PROBLEMAS EN LA CLASSE BTNGET.PRG
Posted: Wed Feb 20, 2008 08:44 AM

perhaps I have an old modified version of btnget of Alfredo.....

Best Regards, Saludos



Falconi Silvio