Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Highlighter
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00503867
Message ID:
00503971
Vues:
38
This message has been marked as the solution to the initial question of the thread.
>>>Hi everybody,
>>>
>>>I implemented GridHighlighter in several applications, all work fine, but I have one problem, which I'm not sure, how to resolve. For some forms in addition to highlighting record I want to show records in different backcolor (or forecolor, doesn't matter), depending on some condition. For instance, I have Status field, which can have 3 different values. For value one I want one color, for value two - another and value three - default color. I implemented my code in onPostSetDynamicColor method as showed in Nick's sample form (mycolor.prg). But I could not figure out, how to preserve record highlighting for the current record. IOW, myColor program should be changed somehow, but I don't know, how. Could somebody advise me here?
>>>
>>>Thanks in advance.
>>
>>Nadya, could you clarify?
>>
>>The scenario:
>>Value 2 (backcolor red) is the current field value in the highlighted record. Highlight backcolor is blue. If focus is not on this cell, the cell will show as red.
>>1. When the focus is on this cell, do you want this field to show as red or blue ?
>Blue
>
>>2. When the focus is NOT on this cell, do you want this field to show as red or blue ?
>Blue
>
>How can I do that?
>
>Thanks in advance.

1. Already is the default feature of Grid Highlighter

2.
*** OnPostSetDynamicColor()
LOCAL lcHost
lcHost = THIS.chostname
************** This line calls the function which returns the corresponding color
THIS.PARENT.&lcHost..Column1.DYNAMICBACKCOLOR = "my_color(employee.employee_i, this.parent.GridhighLighter1.nRecno, this.parent.GridhighLighter1.cHighBackColor)"

*** updated MY_COLOR.PRG from the previous sample
LPARAMETER tcValue, tnRecno, tcRecordHighLightColor
tcValue = ALLTRIM(tcValue)
LOCAL lnColor
DO CASE
	CASE tcValue = "4"
		lnColor = RGB(255,0,0)
	CASE tcValue = "5"
		lnColor = RGB(0,255,0)
	CASE tcValue = "6"
		lnColor = RGB(0,0,255)
	CASE tcValue = "7"
		lnColor = RGB(255,255,0)
	OTHERWISE
		lnColor = RGB(255,255,255)
ENDCASE
RETURN IIF(tnRecno = recno(), EVAL(tcRecordHighLightColor), lnColor)
***
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