Re: Conditional formatting



In article <1180402789.926557.235070@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
TimWilson <timothy.d.wilson@xxxxxxxxx> wrote:

Hey everyone,

I'm just getting stated with FM8.5 Advanced. I'm building a little
database app to track departmental projects and the action steps
associated with them. I've got the bulk of it done, but I've hit
acouple snags.

1. I have a button that will mark a particular project completed. In
my "Project List" layout I want the names of the projects
("project_name") to be rendered with a strikethrough effect when the
completed_project field is true. I can't seem to get the script
right.Here's what I've got:

Go to Layout["Project List" (projects)]
Show All Records
Loop
If [projects::projects_completed ]
Set Field [projects::name, TextStyleAdd (projects::name;
Strikethrough)]
End If
Go to Record/Request/Page [Next; Exit after last]
End Loop

I tested the formatting statement and it works fine for me. What
happens if you step through the script in Script Debugger? Do you
actually pass through the If section?

2. I'd like to dynamically place a button on my layout. If I'm
looking at the list of current projects (showing only projects that
aren't completed), I want a little button next to each record that
runs a script to mark the project completed. If I'm looking at the
report with all projects displayed (including completed ones) I want
a different button to appear next to the completed projects that will
"uncomplete" it. So my report should show one of two buttons for each
record. I just don't want to display both buttons for each record
because that would be confusing. How do choose which button to
displaybased on the value of the "completed_project" field?

There is a technique that reveals/hides a button using a relationship.
The button is placed inside a portal; if the portal's relationship is
satisfied, the button is displayed. Go to
http://www.filemakermagazine.com/ and search for "invisible layout
objects" and you can watch Matt's movie describing the technique.
An alternate option would be to create any number of global fields
containing your button graphics, and calculation fields returned as
containers, which would resolve to the contents of a global field
based on your criteria. Include that criteria as an If statement in a
script attached to the button so that it executes only when the
criteria are met.

3. Finally, I have two buttons labeled "Hide Completed" and "Show
All" at the bottom of the project list report. The purpose of the
buttons is to toggle between showing all records and showing only
those projects that aren't yet completed. Can I make this a little
smarter? I only want the "Show All" button to display when I'm
showing the list of completed projects (vice versa for the other
situation). Can I do this with a single layout, or am I going to have
to create twodifferent layouts for these two situations?

Similar to the above, lay a calculated text field over a button, the
calculation determining how the button is labelled and describing what
the button does. Consider also calculated Tool Tips.
Matt

--
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo

.