Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Displaying DynamicForeColor in grid
Message
From
01/02/2002 02:52:38
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00613829
Message ID:
00613846
Views:
13
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform