5.1 Using predefined controls¶
In this section we will take a look at how to use predefined controls to create dynamic elements.
5.1.1 Bar control
Create and open a display "TestDisplay2" as described in section 3.1.
In the bottom area of the graphics editor you can see a selection of predefined controls. Drag & drop the "Bar vertical" control into your drawing area.
On the right side, you can see a list of all parameters of the referenced control. Select the "VariableNumber" data variable from the DemoServer as the base address for this control by using the
selector.The control is now fully operative; you can also change the other parameters if you want to.
Adding a bar control¶
5.1.2 Increment control
Drag & drop a "Button Increment/Decrement" control into your drawing area.
Select the "VariableNumber" data variable as the base address for this control by using the
selector.Enter "10" as the step. Now the value of the base will be increased by 10 every time you click on the button.
Adding an increment control¶
Hint
You can also change other parameters if you want to. Mandatory parameters are highlighted in red, all other parameters are optional. For example, to adjust the font size of the control, change the value of the parameter "Font -> size".
5.1.3 Decrement control
Copy & paste the increment control.
Choose -10 instead of 10 for the "step" parameter.
Adding a decrement control
5.1.4 Opening the browser and testing the controls
Save the display by clicking
and generate the visualization by choosing . Then start the web browser and open "TestDisplay2" (as described in section 4) to view the predefined controls you have created in this section. Try setting the value of "VariableNumber" by using your increment and decrement buttons. Now the bar should change according to the value of "VariableNumber".