Checkbox
Element type: Dictionary
Shows one or several checkboxes with text on the right.
Keys
Name | Type | Possible values | Required |
---|---|---|---|
Type | String | Input | Required |
InputType | String | Checkboxes | Required |
Variable | String | - | Required |
Label | String | - | |
LabelFontConfiguration | Dictionary (Font) | - | |
Distribution | String | Fit , Center | |
PercentWidth | Number | 0...1 | |
Items | Array(String) or Array(Number) | Required | |
Validation | Dictionary | ||
Margins | Dictionary (Margins) | - | |
Border | Dictionary (Border) | - | |
Condition PRO | Dictionary (Condition) | - |
Detail
Type Required
Type: String
Explanation: The type of the component has to be Input
.
InputType Required
Type: String
Explanation: The type of the component which has to be Checkboxes
.
Variable Required
Type: String
Explanation: The variable used within the application and as a key in the input file Octory will create to let you retrieve the user inputs.
Label
Type: String
Explanation: The label lets you give some insight to the end user about the value they need to enter. Its text will generally be placed on the left side of the input field.
If you do not specify a label, the input field will be centered. To keep the alignment with other input components which have a label, give the Label
a whitespace for value.
LabelFontConfiguration
Type: Dictionary (Font)
Explanation: Let you specify the font configuration to use. Default is "DefaultPrimary" if specified in the Font styles in the configuration file, or system font otherwise.
Distribution
Type: String
Possible values: Fit
, Center
Default: Center
Explanation: Specify how the label and the input field are stacked.
Fit
gives them as much space as they need, but the input component will not be aligned with the other ones.Center
align the label and the input field in the horizontal middle of its container. This allows several input components to be aligned, although it may crop the text label.
PercentWidth
Type: Number
Possible values: 0...1
Explanation: This value allows you to give more width to an input component, by specifying the percentage width it should take in its container. Default is most often 0.4.
Items Required
Type: Array(String) or Array(Number)
Explanation: Array of choices to propose to the end user. All the values need to have the same type to let Octory infer it. You can chose an array of String or Number. If Number is chosen, you can write Int or Real values, but you cannot mix them.
Validation
Type: Dictionary
Explanation: Let you force the user to check all boxes of a Checkboxes
input component.
Input Text Validation
Name | Type | Required |
---|---|---|
WarningText | String | |
FontConfiguration | Dictionary (Font) |
WarningText
Type: String
Explanation: The text to display to the user when the input is empty or its value is incorrect. Default is "Incorrect or empty value".
FontConfiguration
Type: Dictionary (Font)
Explanation: The font configuration to use for the warning text.
Margins
Type: Dictionary (Margins)
Explanation: Add padding to the component's sides.
Border
Type: Dictionary (Border)
Explanation: Add a top or bottom border to a component.
Condition PRO
Type: Dictionary (Condition)
Explanation: Allows to hide or show the component using a boolean expression.
Example
Checkboxes to ask to the user to describe his feelings. Each box is optional.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<key>Slides</key>
<array>
<dict>
<key>Containers</key>
<array>
<dict>
<key>Components</key>
<array>
<dict>
<key>Type</key>
<string>Input</string>
<key>InputType</key>
<string>Checkboxes</string>
<key>Variable</key>
<string>UserAdjectives</string>
<key>Label</key>
<string>How are you feeling?</string>
<key>Items</key>
<array>
<string>Impatient</string>
<string>Ready to start</string>
<string>Nervous</string>
</array>
</dict>
</array>
</dict>
</array>
</dict>
</array>
<!-- ... -->
</dict>
</plist>
Checkboxes which needs to be checked by the user to validate.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<key>Slides</key>
<array>
<dict>
<key>Containers</key>
<array>
<dict>
<key>Components</key>
<array>
<dict>
<key>Type</key>
<string>Input</string>
<key>InputType</key>
<string>Checkboxes</string>
<key>Variable</key>
<string>SecretSpy</string>
<key>Validation</key>
<dict>
<key>WarningText</key>
<string>Please agree, M. Hunt.</string>
</dict>
<key>Items</key>
<array>
<string>I acknowledge that my activity would be denied by the government if I was arrested</string>
</array>
</dict>
</array>
</dict>
</array>
</dict>
</array>
<!-- ... -->
</dict>
</plist>
About checkboxes variable
As the checkboxes input component can have two states for each of its item, Octory will create a variable for each item, with the state as value (true/false for check/uncheck). With the first example, Octory will create 3 variables with the index of the checkbox and the variable name:
UserAdjectives-0
for the Impatient optionUserAdjectives-1
for the Ready to start optionUserAdjectives-2
for the Nervous option