I am trying to create a script where I can set a calculation which would determine the fill color of a field based on a value of another field. Does anyone have any info on this. I have tried to find a command in the script functions but none seem to affect the fill color of a a field (or any object - it doesn't need to be a field thats color is changed).
Any info would be appreciated.
Calculating Field Fill Color
3 posts
• Page 1 of 1
Posts: 1
Joined: Tue Apr 12, 2005 6:23 am |
|
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am |
A couple options here...
a) You can have a library of container fields containing your possible colors. This library can be in its own table, or in a single repeating field. You'd then have your calculation return one of these values (one of these records/fields) depending on which color you wanted. b) In FM7 you can manipulate the color of text directly and, given the right characters and font size, this can be made to look like a background fill in some cases. I'd experiment with the TextColor function to see if that would work for you. For a truly cool example of what you can do with TextColor, check out Shaun's bar graph example. John Sindelar
SeedCode |
Posts: 58
Joined: Tue Jul 26, 2005 12:08 pm Location: London |
A good way to get alternating colours for list views is:
Create the following fields: 1. A global container field sample below is called: GBL_colourgreen 2. A calculation field the result of which is a container. Sample below is called: Alternate_colour If(Mod(Status(CurrentRecordNumber),2) = 0, GBL_colourgreen,"") Now do the following: 1. In layout mode draw a block using the Filemaker drawing tool and then fill it with the required fill colour. 2. While still in layout mode copy this new block. 3. Go to Browse mode and paste it into the GBL_colourgreen field 4. Go to layout mode and go to Graphic format and format the GBL_colourgreen field as ‘reduce or enlarge image to fit frame' and unclick ’maintain original proportions’. The result will be the colour will alternate depending on whether the record number is odd or even. Sit the field behind the list text and it looks great! You can of course create any number of these as a library and use as appropriate. Trust this helps. Dave |
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests