Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invalid Expression?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00508032
Message ID:
00508092
Vues:
24
This message has been marked as a message which has helped to the initial question of the thread.
>What makes this an invalid expression?
>
>This.SetAll('DynamicBackColor', 'IIF(checknum = 0, RGB(255,0,0), IIF(amount > 500, RGB(255,0,255), RGB(255,255,255)))', 'column')
>
>How should I set the backcolor to two colors based on two different conditions?
********************************************************************
*  Description.......: my_ColorAPN - sets dynamic color for the grid
*  Calling Samples...: 
*  Parameter List....: 
*  Created by........:  
*  Modified by.......: Nadya Nosonovsky 05/09/2001 11:41:58 AM
********************************************************************
lparameter tcValue, tnRecno, tcRecordHighLightColor, tlEditMode
#include mapreferrs.h
local lnColor
do case
case inlist(m.tcValue,APN_NOTDO, APN_COMPL)
     lnColor = rgb(255,255,255) && White

case m.tcValue = APN_DUPL && Duplicate
      if m.tlEditMode
          lnColor = rgb(64,128,128) && Green
     else
          lnColor=rgb(192,192,192) && Gray
      endif 

case m.tcValue=APN_BAD && Bad
      if m.tlEditMode
         lnColor = rgb(255,0,0) && Red
     else
          lnColor=rgb(192,192,192) && Gray
      endif    

otherwise && Suspect or Edits
      if m.tlEditMode
         lnColor = rgb(255,128,255) && Purple
     else
          lnColor=rgb(192,192,192) && Gray
      endif          
endcase
return iif(m.tnRecno = recno(), eval(m.tcRecordHighLightColor), m.lnColor)
This is GridHighlighter onPostSetDynamicColor method:
************** This line calls the function which returns the corresponding color
local lcHost
lcHost=this.cHostName
if thisform.cOperation="Changemapref"
     store "my_colorMapref(BldMstr.MaprefEd,this.parent.GrdHglt1.nRecno, this.parent.GrdHglt1.cHighBackColor, thisform.EditMode)" ;
          to ('this.parent.'+m.lcHost+'.ColNewMapRef.dynamicbackcolor')
else
     store "my_colorAPN(BldMstr.APNEd,this.parent.GrdHglt1.nRecno, this.parent.GrdHglt1.cHighBackColor, thisform.EditMode)" ;
          to ('this.parent.'+m.lcHost+'.ColApn.dynamicbackcolor')
     store "my_colorParcel(BldMstr.PclIdEd,this.parent.GrdHglt1.nRecno, this.parent.GrdHglt1.cHighBackColor, thisform.EditMode)" ;
          to ('this.parent.'+m.lcHost+'.ColParcelID.dynamicbackcolor')
     store "my_colorParse(BldMstr.Parsed,this.parent.GrdHglt1.nRecno, this.parent.GrdHglt1.cHighBackColor, thisform.EditMode)" to ;
          ('this.parent.'+m.lcHost+'.ColMapNum.dynamicbackcolor'), ;
          ('this.parent.'+m.lcHost+'.ColBlockNum.dynamicbackcolor'), ;
          ('this.parent.'+m.lcHost+'.ColLotNum.dynamicbackcolor'), ;
          ('this.parent.'+m.lcHost+'.ColUnitNum.dynamicbackcolor'), ;
          ('this.parent.'+m.lcHost+'.ColBlockNum.dynamicbackcolor')
endif
I implemented GridHighlighter is several applications already and it worked like a charm. So, I really recommend you to take a look.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform