Difference between revisions of "Extensions: INX widgets and parameters"
m (→Available types: alphabetical order) |
m (→Available types: try to fix table some more (remove extraneous column)) |
||
(3 intermediate revisions by one other user not shown) | |||
Line 18: | Line 18: | ||
=== gui-hidden === | === gui-hidden === | ||
If the value is set to <code>true</code> the parameter is hidden from the GUI ( | If the value is set to <code>true</code> the parameter is hidden from the GUI (defaults to <code>false</code>). | ||
=== gui-text === | === gui-text === | ||
Line 26: | Line 26: | ||
=== indent === | === indent === | ||
Sets indentation level of the parameter (e.g. indent="1"). | Sets indentation level of the parameter (e.g. <code>indent="1"</code>). | ||
=== name === | === name === | ||
Line 78: | Line 78: | ||
|[[File:INX_sample-description.png]]<br><small>default appearance</small><br><br><br><br> | |[[File:INX_sample-description.png]]<br><small>default appearance</small><br><br><br><br> | ||
[[File:INX_sample-description_header.png]]<br><small>with <code>appearance="header"</code></small><br><br><br> | [[File:INX_sample-description_header.png]]<br><small>with <code>appearance="header"</code></small><br><br><br> | ||
|- | |- | ||
Line 159: | Line 158: | ||
|[[File:INX_sample-string.png]] | |[[File:INX_sample-string.png]] | ||
} | |} | ||
== Localization of parameters == | == Localization of parameters == |
Revision as of 04:12, 12 February 2017
Here you will find the different parameter elements you may use in your .inx files (Inkscape Extensions)
Introduction
Use parameter elements to capture user input for further use by a script. The basic structure of the element is:
<param name="some_name" type="some_type">default value</param>
The default value is the value that is shown in the input control the first time the user opens the dialog window. Inkscape automatically displays the values used last time when the dialog window is opened again.
Common attributes
gui-description
Tooltip of the parameter, which is shown when the user hovers the mouse cursor over the active area of the parameter in question.
To enable translations for this string use the underscore variant (_gui-description
, see localization of parameters below for details).
If the value is set to true
the parameter is hidden from the GUI (defaults to false
).
gui-text
Label of the parameter.
To enable translations for this string use the underscore variant (_gui-text
, see localization of parameters below for details).
indent
Sets indentation level of the parameter (e.g. indent="1"
).
name
The value of the name
attribute is used as an identifier of the parameter. It has to be unique since the value of this attribute is used to save and transmit parameter values internally!
type
The type
attribute determines the type of the parameter (possible values are boolean, int, float, string, enum, optiongroup, color, notebook, description
), see the extensive description of available types below.
Available types
Localization of parameters
To mark parameters to be included into the translation files (this is done automatically during the build process) there exist special variants of all relevant attributes and tag names that start with an underscore.
- Labels and tooltips can be marked for translation by simply using the attribute names
_gui-text
and_gui-description
instead of their counterparts without underscore. - For
<item>
s and<option>
s (both of which do not use the attributes just explained) add an underscore to the tag name itself:<_item value="1">Localized item name</_item>
and<_option value="1">Localized option name</_option>
respectively. - Also for
description
type (and only fordescription
type!) parameters an underscore is added to the tag name itself:<_param type="description">Localized text here.</_param>