FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour bug FWH 15.05 - clase TGraph
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
bug FWH 15.05 - clase TGraph
Posted: Mon May 11, 2015 02:43 PM

Error description: Error BASE/1132 Error de rango: acceso al array
Args:
[ 1] = A { ... }
[ 2] = N 13

Stack Calls

Called from: .\source\classes\TGRAPH.PRG => (b)TGRAPH_MOUSEMOVE( 1139 )
Called from: .\source\classes\TGRAPH.PRG => TGRAPH:MOUSEMOVE( 1140 )

Un saludo

Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: bug FWH 15.05 - clase TGraph
Posted: Mon May 11, 2015 03:39 PM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
Re: bug FWH 15.05 - clase TGraph
Posted: Thu May 14, 2015 03:17 PM

Hola Antonio:

Dime algo por favor de este bug.

Gracias.

Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: bug FWH 15.05 - clase TGraph
Posted: Thu May 14, 2015 04:57 PM

Moisés,

Tienes un ejemplo para reproducir el bug ? gracias

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
Re: bug FWH 15.05 - clase TGraph
Posted: Thu May 14, 2015 08:14 PM
Claro:

Code (fw): Select all Collapse
#include "Fivewin.ch"
#include "TGraph.ch"


FUNCTION MAIN()

    LOCAL oDlg, oGraph

    DEFINE DIALOG oDlg;
           SIZE 600, 500

    @ 1, 1 GRAPH oGraph;
           SIZE 250, 200;
           TYPE 1;
           YVALUES 3D XGRID YGRID XVALUES LEGENDS


    oGraph:aSeries = { { "Serie 1", CLR_CYAN ,, },;
                       { "Serie 2", CLR_YELLOW,, },;
                       { "Serie 3", CLR_HRED,, } }


    oGraph:aData = { { 14280, 20420, 12870, 25347, 7640 },;
                     { 8350, 10315, 15870, 5347, 12340 },;
                     { 12345, -8945, 10560, 15600, 17610 } }

    oGraph:nClrX = CLR_GREEN
    oGraph:nClrY = CLR_RED

/*
    oGraph:cToolTip =  { | nAt, nSerie, nIndex | nSerie := If( nAt % ;
                         Len( oGraph:aSeries ) == 0, Len( oGraph:aSeries ),;
                         Int( nAt % Len( oGraph:aSeries ) ) ),;
                         "Series: " + Alltrim( Str( nSerie ) ) + CRLF + ;
                         "Bar: " + AllTrim( Str( nIndex := Int( nAt / Len( oGraph:aSeries ) ) + 1 + ;
                         If( nAt % Len( oGraph:aSeries ) == 0, -1, 0 ) ) ) + CRLF + ;
                         "Value: " + AllTrim( Str( oGraph:aData[ nSerie ][ nIndex ] ) ) }
*/
    @ 0, 0 BUTTON "Cambia" ACTION sysrefresh()  

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL



Pasa el ratón por el gráfico.

Muchas gracias.
Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: bug FWH 15.05 - clase TGraph
Posted: Fri May 15, 2015 08:07 AM
Moisés,

Así parece solucionarse, puedes probarlo ?

Code (fw): Select all Collapse
METHOD MouseMove( nRow, nCol, nFlags ) CLASS TGraph

   local nAt := 0

   if ! Empty( ::aBarCoors )
      nAt = AScan( ::aBarCoors,;
         { | aCoors | nRow <= aCoors[ 2 ] .and. ;
                      nRow >= aCoors[ 2 ] - aCoors[ 3 ] .and. ;
                      nCol >= aCoors[ 1 ] .and. ;
                      nCol <= aCoors[ 1 ] + aCoors[ 4 ] } )
      if nAt != 0
         if Len( ::aData[ 1 ] ) >= nAt
            DEFAULT ::cToolTip := { | nAt | AllTrim( Transform( ::aData[ 1 ][ nAt ],;
                                    "999,999,999.99" ) ) }
            ::ShowToolTip( nRow, nCol, Eval( ::cToolTip, nAt ) )
         endif                  
      else 
         ::DestroyTooltip()   
      endif   
   endif                   
                                 
return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: bug FWH 15.05 - clase TGraph
Posted: Fri May 15, 2015 04:53 PM

seem run ok now

but why it crash with sysrefresh ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
Re: bug FWH 15.05 - clase TGraph
Posted: Mon May 18, 2015 03:49 PM

Antonio:

Por favor, ¿me puedes enviar al correo la clase entera corregida para probarlo?.

Muchas gracias.

Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: bug FWH 15.05 - clase TGraph
Posted: Mon May 18, 2015 05:01 PM

Moisés,

Enviada

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
Re: bug FWH 15.05 - clase TGraph
Posted: Sat May 23, 2015 07:10 AM

Hola Antonio:

En efecto, el error no se produce.

Sin embargo, activando los oGraph:cToolTip, sólo funciona en la parte de la izquierda, si se coloca el mouse en las barras de la mitad derecha no se muestra nada.

Muchas gracias.

Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
Re: bug FWH 15.05 - clase TGraph
Posted: Wed May 27, 2015 05:46 PM

Hola Antonio:

¿Lo has podido arreglar por favor?.

Muchas gracias.

Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: bug FWH 15.05 - clase TGraph
Posted: Wed May 27, 2015 07:25 PM
Moisés,

Asi se soluciona:
Code (fw): Select all Collapse
METHOD MouseMove( nRow, nCol, nFlags ) CLASS TGraph

   local nAt := 0

   if ! Empty( ::aBarCoors )
      nAt = AScan( ::aBarCoors,;
         { | aCoors | nRow <= aCoors[ 2 ] .and. ;
                      nRow >= aCoors[ 2 ] - aCoors[ 3 ] .and. ;
                      nCol >= aCoors[ 1 ] .and. ;
                      nCol <= aCoors[ 1 ] + aCoors[ 4 ] } )
      if nAt != 0
         DEFAULT ::cToolTip := { | nAt | AllTrim( Transform( ::aData[ 1 ][ nAt ],;
                                 "999,999,999.99" ) ) }
         ::ShowToolTip( nRow, nCol, Eval( ::cToolTip, nAt ) )
      else 
         ::DestroyTooltip()   
      endif   
   endif                   
                                 
return nil


Aún así la barra inferior no muestra nada
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion