[−][src]Enum fm_plugin::Registration
Register ScriptSteps and Functions for your plugin.
Function Registration
Registration enables the function so that it appears in the calculation dialog in the application.
idis the unique id that you can use to represent which function was called, it will be passed back to the registered function as the first parameter (see the parameter of the same name infmx_ExtPluginType).nameis the name of the function as it should appear in the calculation formula.definitionis the suggested syntax that will appear in the list of functions in the calculation dialog.descriptionis the text that will display when auto-entered into the calculation dialog. The format is "type ahead word list|description text".min_argsis the number of required parameters for the function.0is the smallest valid value.max_argsis the maximum number of parameters that they user should be able to specify in the calculation dialog and still have correct syntax usage for the function. Use-1to allow a variable number of parameters up to the number supported by calculation formulas in the application.compatible_flagssee bit flags above.function_ptris the pointer to the function that must match the signature defined byfmx_ExtPluginType. If you implementFileMakerFunctionfor your function, then you can just referenceMyFunction.extern_funchere.
Script Step Registration
Registration::ScriptStep::definition must contain XML defining the script step options. Up to ten script parameters can be specified in addition to the optional target parameter. All the parameters are defined with <Parameter> tags in a <PluginStep> grouping.
The attributes for a <Parameter> tag include:
-
Type- if not one of the following four types, the parameter is ignoredCalc- a standard Specify button that brings up the calculation dialog. When the script step is executed, the calculation will be evaluated and its results passed to the plug-inBool- simple check box that returns the value of0or1List- a static drop-down or pop-up list in which the id of the item selected is returned. The size limit of this list is limited by the capabilities of the UI widgets used to display it. AListtype parameter expects to contain<Value>tags as specified belowTarget- will include a specify button that uses the newInsert From Targetfield targeting dialog that allows a developer to put the results of a script step into a field (whether or not it is on a layout), into a variable, or insert into the current active field on a layout. If noTargetis defined then the resultDataobject is ignored. If there are multipleTargetdefinitions, only the first one will be honored.
-
ID- A value in the range of0to9which is used as an index into theDataVectparms object for the plug-in to retrieve the value of the parameter. Indexes that are not in range or duplicated will cause the parameter to be ignored. A parameter of typeTargetignores this attribute if specified -
Label- The name of parameter or control that is displayed in the UI -
DataType- only used by theCalcandTargetparameter types. If not specified or not one of the six data types, the typeTextwill be usedTextNumberDateTimeTimestampContainer
-
ShowInline- value is either true or false. If defined and true, will cause the parameter to show up inlined with the script step in the Scripting Workspace -
Default- either the numeric index of the default list item or the true/false value for a bool item. Ignored for calc and target parameters
Parameters of type List are expected to contain <Value> tags whose values are used to construct the drop-down or pop-up list. The id of a value starts at zero but specific id can be given to a value by defining an ID attribute. If later values do not have an ID attributes the id will be set to the previous values id plus one.
Sample XML description:
<PluginStep>
<Parameter ID="0" Type="Calc" DataType="text" ShowInline="true" Label="Mood"/>
<Parameter ID="1" Type="List" ShowInline="true" Label="Color">
<Value ID="0">Red</Value>
<Value ID="1">Green</Value>
<Value ID="2">Blue</Value>
</Parameter>
<Parameter ID="2" Type="Bool" Label="Beep when happy"/>
</PluginStep>
Variants
Fields of Function
id: i16name: &'static strdefinition: &'static strdescription: &'static strmin_args: i16max_args: i16display_in_dialogs: boolcompatibility_flags: u32min_version: ExternVersionfunction_ptr: fmx_ExtPluginTypeFields of ScriptStep
id: i16name: &'static strdefinition: &'static strdescription: &'static strdisplay_in_dialogs: boolcompatibility_flags: u32min_version: ExternVersionfunction_ptr: fmx_ExtPluginTypeImplementations
impl Registration[src]
pub fn register(&self, plugin_id: &QuadChar) -> FMError[src]
Called automatically by register_plugin!.
pub fn min_version(&self) -> ExternVersion[src]
Returns minimum allowed version for a function/script step.
pub fn unregister(&self, plugin_id: &QuadChar)[src]
Called automatically by register_plugin!.
Auto Trait Implementations
impl RefUnwindSafe for Registration[src]
impl Send for Registration[src]
impl Sync for Registration[src]
impl Unpin for Registration[src]
impl UnwindSafe for Registration[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,