Input Modules
What are input modules on Terminaux?
Input modules are components that describe how the input is going to be shown to users, and the actual implementation of the input, such as the method of telling users to provide an input. They are defined in a single abstract InputModule
class that contains the necessary properties and functions that describe an input. Additionally, the derived classes may implement the two functions that work on rendering the input placeholder and processing user input, RenderInput()
and ProcessInput()
.
The following built-in input methods are available:
ComboBoxModule
MaskedTextBoxModule
MultiComboBoxModule
SliderBoxModule
TextBoxModule
You can use an information box that supports input modules, called InfoBoxMultiInputColor
. It allows you to specify an array of input modules. You can also make presentations use the input modules to customize the flow of the presentations according to the user input.
In order to be able to use those modules, you'll need to instantiate a class and to fill the necessary fields that are required for modules to be distinguishable. An example code shown below shows the definitions of the three types of input modules:
For all input modules, Name
and Description
properties must be filled when instantiating such modules for reachability. Some of the modules might require extra information to be supplied by the caller. Here are some of the built-in modules which require extra properties to be filled:
ComboBoxModule
Choices
MultiComboBoxModule
Choices
SliderBoxModule
MinPos
MaxPos
Value
In order to make your own derived input module class, you must inherit from the base InputModule
class, which will require implementing the following abstract functions:
RenderInput()
ProcessInput()
ProcessInput()
uses the inputPopoverPos
and the inputPopoverSize
fields to determine where to render the popover, which could either:
Render over the rendered input placeholder with
RenderInput()
, orRender under the input placeholder, such as combo boxes with selection choices.
In customized applications, you may have to render the input yourself using the RenderInput()
function and to process the input yourself using the above function. Additionally, you may have to calculate the popover position yourself. It's usually located at the same position as the rendered input, but there are cases where you may need to render it just below the rendered input.
Last updated