dbTalk Databases Forums  

Conditional formatting

comp.databases.filemaker comp.databases.filemaker


Discuss Conditional formatting in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tim Wilson
 
Posts: n/a

Default Conditional formatting - 05-28-2007 , 08:39 PM






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 a
couple 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:rojects_completed = 1]
Set Field [projects::name, TextStyleAdd (projects::name;
Strikethrough)]
End If
Go to Record/Request/Page [Next; Exit after last]
End Loop

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 display
based on the value of the "completed_project" field?

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 two
different layouts for these two situations?

Any input would be appreciated.

-Tim


Reply With Quote
  #2  
Old   
Matt WIlls
 
Posts: n/a

Default Re: Conditional formatting - 05-29-2007 , 08:42 AM






In article <1180402789.926557.235070 (AT) g4g2000hsf (DOT) googlegroups.com>
TimWilson <timothy.d.wilson (AT) gmail (DOT) com> wrote:

Quote:
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:rojects_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?
Quote:
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.
Quote:
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



Reply With Quote
  #3  
Old   
Ursus
 
Posts: n/a

Default Re: Conditional formatting - 05-29-2007 , 11:11 AM




"Tim Wilson" <timothy.d.wilson (AT) gmail (DOT) com> schreef in bericht
news:1180402789.926557.235070 (AT) g4g2000hsf (DOT) googlegroups.com...
Quote:
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 a
couple 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:rojects_completed = 1]
Set Field [projects::name, TextStyleAdd (projects::name;
Strikethrough)]
End If
Go to Record/Request/Page [Next; Exit after last]
End Loop

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 display
based on the value of the "completed_project" field?

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 two
different layouts for these two situations?

Any input would be appreciated.

-Tim

1. Although it might work in the end, I would choose a different solution.
Keep your enter/edit layout separate from your viewing layout. On the
view/layout create a calculated field that does thjis strike-trhough for
you. It will wotk right away, without having to use a timeconsuming loop all
of the time.

2. It can be done, but not very nice. Create a constant field that has the
value 1 auto-entered. Create a calculation that returns 1 as long as the
project is not completed. Create a relation between those two field. From
that relation create a small portal. Inside the portal put your button. The
button will be visible as long as the project is not completed and
disapppaer from view when it is. BUT you need to create constants and
calculations and portalls for every field you want to have checked.

3. Create a script that is called toggle_find or something.

If < Get(FoundCount) = Get(TotalRecordCount) //We have all records
Perform Find <Your settings here>
Else // We have a selection
Show All Records
End If

I have answered some question just briefly. Just ask if you need more.

keep well, Ursus





Reply With Quote
  #4  
Old   
Tim Wilson
 
Posts: n/a

Default Re: Conditional formatting - 05-29-2007 , 12:33 PM



On May 29, 11:11 am, "Ursus" <ursus.k... (AT) wanadoo (DOT) nl> wrote:
Quote:
"Tim Wilson" <timothy.d.wil... (AT) gmail (DOT) com> schreef in berichtnews:1180402789.926557.235070 (AT) g4g2000hsf (DOT) googlegroups.com...

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:rojects_completed = 1]
Set Field [projects::name, TextStyleAdd (projects::name;
Strikethrough)]
End If
Go to Record/Request/Page [Next; Exit after last]
End Loop

1. Although it might work in the end, I would choose a different solution.
Keep your enter/edit layout separate from your viewing layout. On the
view/layout create a calculated field that does thjis strike-trhough for
you. It will wotk right away, without having to use a timeconsuming loop all
of the time.
Ursus,

I realized just a few minutes ago that the loop was the wrong way to
go. I realize now that I was in web programming mode where you have to
format the output as you loop through the results. I've eliminated the
looping altogether by setting the strikethrough formatting at the same
time that I mark the project completed. My "Mark project completed"
script is:

Set Field [projects:roject_completed; 1]
Set Field [projects::completed_date; Get(CurrentDate)]
Set Field [projects::name, TextStyleAdd (projects::name;
Strikethrough)]
# Redraw the screen by showing only uncompleted projects
Perform Script ["Show current projects"]

That works perfectly. Marking a project uncompleted is just as easy.

Thanks for the help.

-Tim



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.