Problema con el GRID 2

Moderator: Rathinagiri

Post Reply
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Problema con el GRID 2

Post 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

Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Problema con el GRID 2

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Problema con el GRID 2

Post by Rathinagiri »

I think you don't use RGB() of function here. We have to return an array of three numbers between 0-255.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Problema con el GRID 2

Post 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!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Problema con el GRID 2

Post 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.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Problema con el GRID 2

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Problema con el GRID 2

Post 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
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Problema con el GRID 2

Post 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!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply