PROBLEMAS EN LA CLASSE BTNGET.PRG

PROBLEMAS EN LA CLASSE BTNGET.PRG

Postby karinha » Tue Feb 19, 2008 3: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
User avatar
karinha
 
Posts: 7630
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby Silvio » Tue Feb 19, 2008 4:13 pm

can you post a minimal test please ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby karinha » Tue Feb 19, 2008 4: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
User avatar
karinha
 
Posts: 7630
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby Silvio » Tue Feb 19, 2008 5:15 pm

Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby karinha » Tue Feb 19, 2008 5:42 pm



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:

Code: Select all  Expand view
*-- 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
User avatar
karinha
 
Posts: 7630
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby Silvio » Tue Feb 19, 2008 6: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
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Armando » Tue Feb 19, 2008 6: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
User avatar
Armando
 
Posts: 3179
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Postby karinha » Tue Feb 19, 2008 6:48 pm

Armando, por favor teste ahi en tu programa:

//-> Esto debe ser incorporado al inicio de la TGET.PRG
Code: Select all  Expand view
#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:

Code: Select all  Expand view
//----------------------------------------------------------------------------//

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

Se viene de BTNGET.PRG...

y asi lo pongo:
                ExtTextOut( ::hDC, 0, ::nWidth() - 64,                       ;
                   { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )

Code: Select all  Expand view
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
User avatar
karinha
 
Posts: 7630
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby karinha » Tue Feb 19, 2008 6: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
User avatar
karinha
 
Posts: 7630
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby Armando » Tue Feb 19, 2008 7: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
User avatar
Armando
 
Posts: 3179
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Postby karinha » Tue Feb 19, 2008 7: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
User avatar
karinha
 
Posts: 7630
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby karinha » Tue Feb 19, 2008 8:12 pm

//-> Otra alternativa
Code: Select all  Expand view
//----------------------------------------------------------------------------//

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
User avatar
karinha
 
Posts: 7630
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby Armando » Tue Feb 19, 2008 8: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:


Code: Select all  Expand view
      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
User avatar
Armando
 
Posts: 3179
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Postby karinha » Tue Feb 19, 2008 8: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
User avatar
karinha
 
Posts: 7630
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby Silvio » Wed Feb 20, 2008 8:44 am

perhaps I have an old modified version of btnget of Alfredo.....
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Next

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Antonio Linares and 53 guests