getMacroProps: Difference between revisions
Jump to navigation
Jump to search
m (Macros:Functions:getMacroProps moved to getMacroProps: Taking page out of Macros namespace.) |
m (Added MacroFunction template and Metamacro Function category) |
||
Line 1: | Line 1: | ||
= | {{MacroFunction | ||
|name=getMacroProps | |||
|description= | |||
Returns a property list of the properties for a [[macro button]] for the [[Token:Current Token|Current Token]]. You can retrieve the index of a [[macro button]] with the [[Macros:Functions:getMacroIndexes|getMacroIndexes()]] function.The type of the value returned depends on the delimiter parameter. | Returns a property list of the properties for a [[macro button]] for the [[Token:Current Token|Current Token]]. You can retrieve the index of a [[macro button]] with the [[Macros:Functions:getMacroIndexes|getMacroIndexes()]] function.The type of the value returned depends on the delimiter parameter. | ||
* If the delimiter is not specified then a [[Macros:string propert list|string propert list]] is returned with the default value of 'l' is used. | * If the delimiter is not specified then a [[Macros:string propert list|string propert list]] is returned with the default value of 'l' is used. | ||
Line 7: | Line 7: | ||
* Otherwise a [[Macros:string property list|string property list]] is returned with the delimiter passed in. | * Otherwise a [[Macros:string property list|string property list]] is returned with the delimiter passed in. | ||
|usage= | |||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
[h: getMacroProps(label)] | [h: getMacroProps(label)] | ||
Line 30: | Line 30: | ||
* fontSize - The size of the font for the button. | * fontSize - The size of the font for the button. | ||
* minWidth - the minimum width of the button. | * minWidth - the minimum width of the button. | ||
}} | |||
[[Category:Metamacro Function]] |
Revision as of 16:19, 7 March 2009
getMacroProps() Function
Returns a property list of the properties for a macro button for the Current Token. You can retrieve the index of a macro button with the getMacroIndexes() function.The type of the value returned depends on the delimiter parameter.
- If the delimiter is not specified then a string propert list is returned with the default value of 'l' is used.
- If the delimiter "json" then a json object is returned. (as of MapTool 1.3b49)
- Otherwise a string property list is returned with the delimiter passed in.
Usage
[h: getMacroProps(label)]
[h: getMacroProps(index)]
[h: getMacroProps(label, delim)]
[h: getMacroProps(index, delim)]
Where
- label is the label for the macro button. If you specify a label then all macro buttons on the token that have that label will be updated.
- index is the index of the macro button.
- delim is the delimiter used to separate the values in the string property list which defaults to ';' if not specified.
Valid Properties for Macro Buttons
- autoExec - true/false - Will the macro be automatically executed when the button is clicked on.
- color - The name of the color for the button.
- fontColor - The name of the font color for the button.
- includeLabel - true/false - Will the label be output when the button is clicked.
- group - The name of the group that the button is in.
- sortBy - The sort by value of the macro button.
- index - The index of the button.
- label - the lavle of the button.
- fontSize - The size of the font for the button.
- minWidth - the minimum width of the button.