okSlider (Wire In)

positionPOSITIONPosition of the top left corner.
sizeSIZESize in pixels.
labelTEXTLabel text, shown inside the button.
tooltipTEXTTooltip text.
endpointHEX BYTEEndpoint address for the corresponding Wire In.
bitNUMBERBit to which this component addresses (0=LSB, 15=MSB).
minvalueNUMBERThe minimum value on the slider in base 10.
maxvalueNUMBERThe maximum value on the slider in base 10. This cannot exceed 255.
valueNUMBERDefault value taken when the profile is loaded.
styleSTYLEVERTICAL – Displays the slider vertically.HORIZONTAL – Displays the silder horizontally.SHOWLABELS – Show min/max/value labels.

XML Example

<object class="okSlider">
	<tooltip>4-bit vertical slider.</tooltip>
</object>Code language: HTML, XML (xml)

Lua Scripting

This component supports executing a script function when its value changes. The current value can be obtained by using GetValue() method and changed using SetValue(), for example here is a function that could be used to maintain the sum of two sliders values constant:


function OnSlider(slider, event)
	local value = slider:GetValue();

	local slider2 = okUI:FindPanel("panel1"):FindSlider("slider2")
	slider2:SetValue(255 - value)
endCode language: JavaScript (javascript)

Assuming the panel contains the following elements:


<object class="okSlider">

<object class="okSlider" name="slider2">
</object>Code language: HTML, XML (xml)

All XML components that support Lua scripting also inherit from the Control class. Please refer to the FrontPanel Scripting documentation for more information on this class.

Example Screenshot