Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Displaying DynamicForeColor in grid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00613829
Message ID:
00613955
Vues:
8
You are welcome.

The funny thing is that I also answered the exact same question a few hours earlier. That same day I also received a few e-mails from different people with the similar question regarding my Grid Highlighter functionality.

I noticed several times before that some similar questions often come in batches from different parts of the world simultaneously. One day it's, say, all about BackColors, and the other day about Grid losing the RowSource, etc.... What could be the reason for that? :)

>Thanks hips Nick and to Gerard who after reading his response i saw i could call my function and pass parameter my column name pexp ao it did the trick. I could then have as complicated algoritham in my UDF as a like. So this has done the job:
>
>in Grid.Init
>
> this.SetAll("DynamicForeColor",;
> "thisform.displaycolor(pexp)","Column")
>
>
>my custom method is displaycolor and accept 1 parameter pexp which is my Priority Expires datetime field.
>
>Thisform.displaycolor method looks like this:
>
>LPARAMETER Pexp
>LOCAL lcRetValue
>
>* RGB(0,128,0) green
>* RGB(0,0,255) blue
>* RGB(255,128,0) orange or RGB(255,255,0)
>* RGB(255,255,0) red
>
>IF TTOD(DATETIME())=TTOD(pexp)
> DO CASE
> CASE HOUR(pexp)-HOUR(DATETIME())>3
> lcRetValue = 32768 && RGB(0,128,0) && green
> CASE HOUR(pexp)-HOUR(DATETIME())=3
> lcRetValue = 16711680 && RGB(0,0,255) && blue
> CASE HOUR(pexp)-HOUR(DATETIME())<=2 AND HOUR(pexp)-HOUR(DATETIME())>1
> lcRetValue = 33023 && = RGB(255,128,0) = orange or 65535 RGB(255,255,0) is yellow
> CASE HOUR(pexp)-HOUR(DATETIME())<=1
> lcRetValue = 255 && RGB(255,255,0) && red
>
> ENDCASE
>ELSE
> IF TTOD(DATETIME()) > TTOD(pexp)
> lcRetValue = 255 && RGB(255,255,0) && red
> ELSE
> lcRetValue = 32768 && RGB(0,128,0) && green
> ENDIF
>ENDIF
>
>RETURN lcRetValue
>
>
>
>All the best.
>
>By the way this is for my Client/Server app with ORACLE as a backend.
>Grid will refresh automatically every 30 sec. and give user an indication of what jobs are with higher priority.
>
>Regards
>
>Dejan
>Sydney
>Australia
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform