Using Buttons with Scripts


FileMaker makes it easy to add buttons to layouts, to which you can then attach scripts. Such buttons are treated as layout objects, meaning you can use all the formatting tricks covered in the rest of this chapter.

To add a button

1.

Make sure you're in Layout mode ( in Windows, on the Mac) and select a layout via the pop-up menu.

2.

Click the Button Tool within the Layout status area (Figure 13.49), then use your cursor to draw a button within the layout. Release the cursor when the button reaches the size you want (Figure 13.50).

Figure 13.49. Click the Button Tool to add a script-linked button to a layout.


Figure 13.50. Click and drag the cursor in the layout to create a button.


3.

When the Button Setup dialog appears, select a script step from the left-hand list (Figure 13.51). Set options for the script step, if any, using the Specify button in the Options panel. Not every step will offer the same options, and steps grayed out in the list don't apply to your particular button.

Figure 13.51. Use the Button Setup dialog box to assign a script and shape to the button.


4.

If you want, change the Button Style from the default Rectangular button to the Rounded button. Leave Change to hand cursor over button selected to help cue users that the button triggers an action. Click OK to close the dialog box.

5.

When the layout reappears with the new button, type in a label for it at the I-beam cursor (Figure 13.52). When you're done, click anywhere outside the button.

Figure 13.52. When the layout reappears with the new button, type in a label so its function is clear.


6.

Format the button's appearance using the steps covered in Working with Graphics on pages 212220 (top, Figure 13.53). Switch to Browse mode ( in Windows, on the Mac) and your button is ready for action (bottom, Figure 13.53).

Figure 13.53. Format the button's text and appearance using the steps covered in Working with Graphics (top). Switch to Browse mode to see the final appearance (bottom).


Tips

  • If you've never used scripts, don't let the many scripting options available in the Button Setup dialog box put you off. Some of the most useful scriptstriggering a sort, switching to another layout, printing a reportare easy to set up and will save you lots of time.

  • Generally, you don't want buttons to appear on printouts, so switch to Layout mode and select the button. Choose Format > Set Sliding/Printing. In the Set Sliding/Printing dialog box, check Do not print the selected objects and click OK to apply the change and close the dialog box.




FileMaker Pro 8 for Windows and Macintosh(c) Visual Quickstart Guide
FileMaker Pro 8 for Windows & Macintosh
ISBN: 032139674X
EAN: 2147483647
Year: 2006
Pages: 184
Authors: Nolan Hester

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net