Development Guide
Table Of Contents
- Chapter 1 Introducing FileMaker Pro Advanced
- Chapter 2 Creating database solutions
- Chapter 3 Customizing database solutions
- Chapter 4 Debugging, analyzing, and optimizing files
- Chapter 5 Developing third-party FileMaker plug-ins
- About external functions
- About the example plug-in
- Installing, enabling, and configuring the example plug-in
- Description of the FMExample plug-in’s external functions
- Using the example plug-in
- Customizing the plug-in example
- Requirements for writing external function plug-ins
- FileMaker messages sent to the plug-in
- Avoiding potential Mac OS X resource conflicts
- Providing documentation for your plug-in
- Appendix A Feature comparison of the runtime application with FileMaker Pro
- Index
Chapter 5
|
Developing third-party FileMaker plug-ins 41
The plug-in should display a dialog box that will allow the user to set
any specific configuration data required by the plug-in. If the plug-in
requires user-definable preferences, you should implement your user
interface here. The Configure button will only be enabled if the sixth
character of the option string is set to “Y.” For more information, see
“Option string syntax” on page 38.
Any options that need to be saved should be placed in their own
registry entry (Windows) or in their own preference file (Mac
OS X).
The FMExample plug-in needs to implement a configuration dialog
box for the
XMpl_UserFormatNumber function, so the flag has been set in
the option string (
Xmpl1Ynnnnn) and the function Do_PluginPrefs is called
when the Preferences message is received.
External Function message
The External Function message, kFMXT_External, is a legacy message
for old style plug-ins. It is no longer required for plug-ins that are
registered in the new style.
GetString message
The GetString message, kFMXT_GetString, is sent to the plug-in when
FileMaker Pro, FileMaker Pro Advanced, or FileMaker Server want
to retrieve one of the following strings from the plug-in. The plug-in
developer can decide where to store the strings.
Avoiding potential Mac OS X
resource conflicts
Problems can occur on Mac OS X machines if your plug-in has the
same ID for a resource that FileMaker
Pro, FileMaker Pro Advanced,
FileMaker Server, or another plug-in has for the same type of resource.
To avoid potential resource ID conflicts with your plug-in and other
applications or plug-ins, follow these guidelines:
1 Use ID numbers between 23,000 and 24,999
Use hard-coded IDs from this range for your dialog boxes, sounds,
icons, and other resources to avoid conflicts with FileMaker
Pro,
FileMaker Pro Advanced, or FileMaker Server resources. FileMaker
does not use any of the IDs in this range for the application resources.
1 Set the current resource file to your plug-in
To avoid conflicts with other plug-ins that use the same resource IDs,
use the Mac
OS X toolbox call in the Resource Manager to set the
current resource file to your plug-in before getting any resource
objects from the resource file.
Include the following line before any line that references or uses a
resource:
UseResFile (pb -> resourceID) ;
When FileMaker Pro, FileMaker Pro Advanced, or FileMaker Server
loads your plug-in, the application gives the resource ID. This is
located in the parameter block near the param2 and param3 variables
in the FMExtern.h file. For more information, see
“API code files” on
page 38.
Providing documentation for your plug-in
Your plug-in should include an example database file with any special
fields and scripts necessary to demonstrate the use of the plug-in’s
external functions. In addition, you should provide documentation
that describes each external function and its parameters.
String Meaning
kFMXT_OptionsStr = 131 The option string
kFMXT_NameStr = 12 The plug-in name
kFMXT_AppConfigStr = 129 The help text to display in the Preferences
dialog box