Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ABS() coding assistance???
Message
 
 
To
24/08/2001 11:38:56
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00548379
Message ID:
00548707
Views:
9
>>>Well, I didn't simply because I wanted only to fix it, not to do it right. Of course, if I had done it myself, it would rather be adding a new column to the cursor, which would contain just the inputmask (the one specific to the current record), and would have just "report1.cInputMaskField" as the dynamicinputmask source. I just love to have no functions at all in grid's dynamic properties.
>>
>>Dragan,
>>
>>This got me thinking :) I have a grid, which has a Status Work Field. Depending on the value in this field, I show the row in different color using DynamicForeColor property. I have a grid method myForeColor with case statements. I also have a Lookup table with Status Value and Description. So, do you think, I can add a new field into this table, say, myColor N (?), which would held the color depending on status? Do you think, it would speed up the grid operations? Do you have an example of your idea?
>
>It already works for me. I have a generic one-column grid for displaying names, and it's based on a cursor with several columns more - crcolor i, crbold l, critalic l - and .column1.dynamicbackcolor='alias.crcolor', and it goes the same for .dynamicfontbold and .dynamicfontitalic. The trick is to pre-fill the .crcolor with 0x00ffffff (white) initially, and then pick different color numbers to color the records. This is the fastest coloring trick I've found so far, since it calculates nothing - it just takes the color number from another field in the same record. True, the pre-fill does take some time, but then the values are calculated only once, and not upon each grid.refresh.

What should be crColor? Should it be Integer rgb(255,255,255) or it should be something different? If yes, what should be format and how can I convert values to this format? Here is my current myForeColor method:
********************************************************************
*  Description.......: grdAddrStd.myForeColor - sets grid's forecolor depending on Status field value
*  Calling Samples...: 
*  Parameter List....: tcFieldVal
*  Created by........: Nadya Nosonovsky 06/29/01 11:31:54 PM 
*  Modified by.......: 
********************************************************************
lparameter tcFieldVal
local lnColor
if vartype(m.tcFieldVal)<>"C"
   tcFieldVal=evaluate('BldMstr.'+thisform.AdddrField)
endif   
* --	changed the forecolor of the whole row 
* --	red = auto suspect 
* --	blue = manually resolve 
* --	green = auto-correct 
* --	highlight the selected line light blue ... 
*--------------------------------------------------------------------------
local lnColor
do case
    case m.tcFieldVal='5' && Auto-suspect
         lnColor=rgb(255,0,0) && Red
         
    case m.tcFieldVal='4' && Auto-correct    
         lnColor=rgb(0,128,0) && Green
         
    case m.tcFieldVal='6' && Manually-resolved
         lnColor=rgb(0,0,255) && Blue
    otherwise
         lnColor=rgb(0,0,0) && Black
endcase
return m.lnColor
Do you set DynamicForeColor in code or in Property sheet?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform