Facility Control

 View Only
  • 1.  Custom Horizontal Slider

    Posted 10-12-2017 18:41
    Hi All!

    Has anyone had occasion to create a horizontal slider with a custom look? I'm trying to recreate the functionality of the slider, but need to match the look to the graphics package (dot instead of audio slider button, different color scheme for lines, etc.)

    Thanks!

    CJ


  • 2.  RE: Custom Horizontal Slider

    Posted 10-16-2017 14:34
    Hi CJ.
    There are slider controls that look like a touch wheel, a fader bar, 2 types of horizontal slider, and 2 types of vertical slider.
    At the moment, that's about it. There is not yet a way to skin the UI components completely into something customized.

    We can add this to our feature request database for you.


    James
    #DashBoard


  • 3.  RE: Custom Horizontal Slider

    Posted 10-19-2017 18:05
    Thanks James...that would be great. Thinking out loud...is there a way to "hide" the slider under an image but keep the slider functionality?
    #DashBoard


  • 4.  RE: Custom Horizontal Slider

    Posted 10-19-2017 21:03

    If you hide the control, you also disable the mouse listeners that allow the slider to function.

    One somewhat inelegant workaround would be to attache a listener to the "ondrag" of a box and use the mouse position there to change value of the slider parameter.

    <abs contexttype="opengear" style="">
       <meta>
          <api>function handleDrag(event)
    {
       if (event.x &gt;= 0 || event.x &lt;= 300)
       {
          params.setValue('Actual_Value', 0, event.x);
       }
    }</api>
          <params>
             <param access="1" constraint="0.0;300.0;0.0;300.0;1" constrainttype="INT_STEP_RANGE" name="Actual Value" oid="Actual_Value" precision="0" type="INT32" value="-70" widget="slider-horizontal"/>
          </params>
       </meta>
       <param expand="true" height="91" left="15" oid="Actual_Value" top="19" width="341"/>
       <label height="86" left="19" name="PUT IMAGE HERE" ondrag="handleDrag(event);" style="txt-align:center;bg#FF0D0D;" top="159" width="300"/>
    </abs>

    #DashBoard


  • 5.  RE: Custom Horizontal Slider

    Posted 12-28-2017 00:57

    Hey James:

    "‹This is working PERFECTLY! Here's where I ended up:

    function handleSliderDrag(event,sliderID)
    {
    if (params.getValue('lockStatus',0) == 0 && params.getValue('act',0) !='' && params.getValue('round',0) !='' && params.getValue('division',0) !='')
    {
    var sliderPosition = Math.round(event.x/70)
    if (sliderPosition >=0 && sliderPosition <=20)
    {
    var parentIP = params.getValue('parentIP',0);
    params.setValue('score' + sliderID, 0, sliderPosition);
    ogscript.setStyle('slider' + sliderID,'bg-u:Images/Slider_' + sliderPosition + '.png');
    ogscript.sendUDPString(parentIP, 2140, ('mark::' + params.getValue('ID',0) + '::' + 'score' + sliderID + '::' + sliderPosition));
    calcTotalScore();

    }
    }
    }

    "‹Much appreciated, as always :-)

    CJ


    #DashBoard