Forecolor in grid displays the records alternating color

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Forecolor in grid displays the records alternating color

Post by Rathinagiri »

The DynamicBackColor in third column of the browser, expects a block which returns an array of color codes. You have given block which returns again a block instead of an array of color codes. ie., you have nested two blocks which is an error here.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Czarny_Pijar
Posts: 172
Joined: Thu Mar 18, 2010 11:31 pm
Location: 19.2341 E 50.2267 N

Re: Forecolor in grid displays the records alternating color

Post by Czarny_Pijar »

rathinagiri wrote:

Code: Select all

DYNAMICBACKCOLOR { bckColor, bckColor, { || If( g_existotal < 0, { 255,   0,   0 }, If( RecNo() % 2 == 0, { 255,255,255 } , { 244,244,244 } ) ) } }	;
DYNAMICFORECOLOR { bckFore , bckFore , { || If( g_existotal < 0, { 255, 255, 255 }, {0,0,0}  ) } } ;
I think that is an important example, and it should be placed in the Samples.
How about a missing Grid.13 ? ;)
jparada
Posts: 433
Joined: Fri Jan 23, 2009 5:18 pm

Re: Forecolor in grid displays the records alternating color

Post by jparada »

Hi,

Thanks for explanation Rathinagiri, now I understand.

Best Regards
Javier
User avatar
nguyenchiduc
Posts: 78
Joined: Sat Nov 13, 2010 7:27 am

Re: Forecolor in grid displays the records alternating color

Post by nguyenchiduc »

Use the color will be very helpful when sorting objects according to the work. Combined with the COMBOBOX would be great.

I recently switched to HMG, the characteristics of the BROWSE and GRID very helpful

Code: Select all

/* DYNAMICFORECOLOR */
PRIVATE mau_chu := { || if ( alltrim(khongma_tho->xu_ly) == 'YES' .OR. alltrim(khongma_tho->ma) == 'OK', {255,255,255}, if ( alltrim(khongma_tho->xu_ly) == 'XOA' , {255,255,255}, if ( alltrim(khongma_tho->xu_ly) == 'LAP_MA' , {0,0,255}, if ( alltrim(khongma_tho->xu_ly) == 'D_HANH' , {255,0,0},{0,0,0})))) } 

/* DYNAMICBACKCOLOR */
PRIVATE mau_nen := { || if ( alltrim(khongma_tho->xu_ly) == 'YES' , {0,0,255}, if ( alltrim(khongma_tho->xu_ly) == 'XOA' , {0,0,0},if ( alltrim(khongma_tho->ma) == 'OK',{255,0,0},{255,255,255} ))) }
<Screen Shots were removed because URLs not active anymore>
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Forecolor in grid displays the records alternating color

Post by sudip »

Yes HMG is a great software tool :)
Your screenshots are also fantastic :D
Well done friend :)
With best regards,
Sudip
User avatar
nguyenchiduc
Posts: 78
Joined: Sat Nov 13, 2010 7:27 am

Re: Forecolor in grid displays the records alternating color

Post by nguyenchiduc »

sudip wrote:Yes HMG is a great software tool :)
Your screenshots are also fantastic :D
Well done friend :)
thank you!

I do not want fancy, showy, but I have to analyze data with many tables at once. With a table has thousands of records and the key (customer, number, object ...). Colors will help me to quickly sort and limit mistakes.

Use the command:

SET FILTER TO something...
combined with DYNAMICFORECOLOR and DYNAMICBACKCOLOR in GRID will help me in analyzing data
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Forecolor in grid displays the records alternating color

Post by Pablo César »

Czarny_Pijar wrote:
rathinagiri wrote:
jparada wrote:Hi,

After getting that negative numbers are deployed with the color red (Thanks again Roberto).

Now I also like to do the same with DynamicBackColor property, and I try to do exactly as I do with the property DynamicForeColor, but I could not do it.

I attached image about the error that I am getting, please take a look, and also attach a small example, please take a look too.

Please can someone tell me how to fix it?

Thanks

Best Regards
Javier
Hi Javier,

Change the two lines (33,34) with this...

Code: Select all

DYNAMICBACKCOLOR { bckColor, bckColor, { || If( g_existotal < 0, { 255,   0,   0 }, If( RecNo() % 2 == 0, { 255,255,255 } , { 244,244,244 } ) ) } }	;
DYNAMICFORECOLOR { bckFore , bckFore , { || If( g_existotal < 0, { 255, 255, 255 }, {0,0,0}  ) } } ;
I think that is an important example, and it should be placed in the Samples.
How about a missing Grid.13 ?
;)
I made some corrections, some are for Grid propose and others which have not working.
Screen1.png
Screen1.png (28.32 KiB) Viewed 2963 times
GRID_13.rar
Source files
(3.32 KiB) Downloaded 188 times
demo.rar
Executable file
(1.16 MiB) Downloaded 225 times
I hope you enjoy it ! :D
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Forecolor in grid displays the records alternating color

Post by Javier Tovar »

Excelente Pablo César,

Saludos
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Forecolor in grid displays the records alternating color

Post by Pablo César »

Thank you Javier, for your kind words.

Reserved merits to Javier Parada :D
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
EduardoLuis
Posts: 684
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: Forecolor in grid displays the records alternating color

Post by EduardoLuis »

Hi Pablo:

As allways your contributions are exellent.-
Thanks for share with all of us.-
With regards. Eduardo
Post Reply