Page 1 of 1

Problema con el GRID 2

Posted: Wed May 05, 2010 2:32 pm
by srvet_claudio
Hola Roberto,
aparentemente DYNAMICBACKCOLOR y DYNAMICFORECOLOR no funcionan cuando el GRID se carga a partir de una matriz.
Saludos,
Claudio Soto

Code: Select all

#include <hmg.ch>
 
FUNCTION MAIN

mat := {{"Juan","A"},;
        {"Pedro","C"},;
        {"Jose","B"},;
        {"Maria","C"}}
        

   DEFINE WINDOW Form_1; 
                 AT 0,0 ;
                 WIDTH 640;
                 HEIGHT 580;
                 MAIN
                                                                   
                PRIVATE bColor := {|| if ( This.CellRowIndex/2 == int(This.CellRowIndex/2), RGB(128,128,128) , RGB(192,192,192))}
                PRIVATE fColor := {|| RGB (255,0,0)}
                                                            
                @ 100, 10 GRID Grid_1; 
                          WIDTH 580; 
                          HEIGHT 300;
                          HEADERS {"Nomb","Cargo"};
                          WIDTHS  {400,150}; 
                          ITEMS mat;                                                             
                          DYNAMICBACKCOLOR {bColor , bColor};
                          DYNAMICFORECOLOR {fColor , fColor}
                                                        
   END WINDOW      
   
   CENTER WINDOW Form_1
   ACTIVATE WINDOW Form_1
RETURN


Re: Problema con el GRID 2

Posted: Wed May 05, 2010 3:05 pm
by Roberto Lopez
srvet_claudio wrote:Hola Roberto,
aparentemente DYNAMICBACKCOLOR y DYNAMICFORECOLOR no funcionan cuando el GRID se carga a partir de una matriz.
Saludos,
Claudio Soto

Code: Select all

#include <hmg.ch>
 
FUNCTION MAIN

mat := {{"Juan","A"},;
        {"Pedro","C"},;
        {"Jose","B"},;
        {"Maria","C"}}
        

   DEFINE WINDOW Form_1; 
                 AT 0,0 ;
                 WIDTH 640;
                 HEIGHT 580;
                 MAIN
                                                                   
                PRIVATE bColor := {|| if ( This.CellRowIndex/2 == int(This.CellRowIndex/2), RGB(128,128,128) , RGB(192,192,192))}
                PRIVATE fColor := {|| RGB (255,0,0)}
                                                            
                @ 100, 10 GRID Grid_1; 
                          WIDTH 580; 
                          HEIGHT 300;
                          HEADERS {"Nomb","Cargo"};
                          WIDTHS  {400,150}; 
                          ITEMS mat;                                                             
                          DYNAMICBACKCOLOR {bColor , bColor};
                          DYNAMICFORECOLOR {fColor , fColor}
                                                        
   END WINDOW      
   
   CENTER WINDOW Form_1
   ACTIVATE WINDOW Form_1
RETURN

I'll check it ASAP.

Re: Problema con el GRID 2

Posted: Wed May 05, 2010 3:08 pm
by Rathinagiri
I think you don't use RGB() of function here. We have to return an array of three numbers between 0-255.

Re: Problema con el GRID 2

Posted: Wed May 05, 2010 4:27 pm
by Roberto Lopez
rathinagiri wrote:I think you don't use RGB() of function here. We have to return an array of three numbers between 0-255.
Yes, it's true.

Thanks, you saved me a review!

Re: Problema con el GRID 2

Posted: Wed May 05, 2010 4:49 pm
by srvet_claudio
rathinagiri wrote:I think you don't use RGB() of function here. We have to return an array of three numbers between 0-255.
Thanks Rathi, you're right.

Roberto, in the tutorial of HMG appears:

Code: Select all

bColor := { || if ( This.CellRowIndex/2 == int(This.CellRowIndex/2) , RGB (128,128,128) , RGB (192,192,192) ) }
Sorry for the inconvenience.

Greetings to both,
Claudio Soto.

Re: Problema con el GRID 2

Posted: Wed May 05, 2010 7:57 pm
by Roberto Lopez
srvet_claudio wrote: Roberto, in the tutorial of HMG appears:

Code: Select all

bColor := { || if ( This.CellRowIndex/2 == int(This.CellRowIndex/2) , RGB (128,128,128) , RGB (192,192,192) ) }
I've not found that in any sample or doc.

Could be you so kind to point me exactly where is it to correct it?

TIA.

Re: Problema con el GRID 2

Posted: Wed May 05, 2010 8:49 pm
by srvet_claudio
Roberto Lopez wrote:I've not found that in any sample or doc.

Could be you so kind to point me exactly where is it to correct it?
C:\hmg.3.0.32\DOC\data\dynamicbackcolor.htm
C:\hmg.3.0.32\DOC\data\dynamicforecolor.htm

Saludos,
Claudio Soto

Re: Problema con el GRID 2

Posted: Wed May 05, 2010 9:12 pm
by Roberto Lopez
srvet_claudio wrote:
Roberto Lopez wrote:I've not found that in any sample or doc.

Could be you so kind to point me exactly where is it to correct it?
C:\hmg.3.0.32\DOC\data\dynamicbackcolor.htm
C:\hmg.3.0.32\DOC\data\dynamicforecolor.htm

Saludos,
Claudio Soto
Fixed.

Thanks!