Facility Control

 View Only
  • 1.  Dynamic string text

    Posted 11-02-2018 15:24

    Hello! I am trying to make a gameshow system out of ross dashboard. And know I have a problem. The question that is a text string is to long for the label I have pre-defined the length of. Is there a possibility for dynamic text? So, what I want to do is tell the label "when over 70 characters make a line shift at the nearest space." Is there an easy way to do this?


    Best Regards
    Sondre



  • 2.  RE: Dynamic string text

    Posted 11-02-2018 15:28

    Wrap your text in <html></html> and it will be able to span multiple lines automatically:
    <label height="280" left="40" name="&lt;html&gt;&lt;center&gt;I am a very long piece of text in a very narrow box.&lt;/center&gt;&lt;/html&gt;" style="txt-align:center;size:Big;" top="20" width="120"/>

    Note: The < and > brackets are escaped here since I have pasted the raw XML. In the "Name" field of the label (or in ogscript.rename or params.setValue), you would just send:

    "<html><center>I am a very long piece of text in a very narrow box.</center></html>"


    #DashBoard


  • 3.  RE: Dynamic string text

    Posted 11-02-2018 17:17
    Than you so mutch!!
    #DashBoard


  • 4.  RE: Dynamic string text

    Posted 11-03-2018 15:10
    Is there a way to make a button that changes the background color of a visual parameter like this one? So if I push a button the BG of this box turns green or red.

    https://imgur.com/l80aypl
    #DashBoard


  • 5.  RE: Dynamic string text

    Posted 11-05-2018 08:43

    For your second question as to how to change the background color of an element, this can be done with the "ogscript.setStyle" function.

    Example below:

    <abs contexttype="opengear" gridsize="20" id="_top">
       <button buttontype="push" height="80" left="100" name="Click me" top="100" width="200">
          <task tasktype="ogscript">ogscript.setStyle('text1', 'bg#FF00FF');</task>
       </button>
       <label height="80" id="text1" left="360" name="Changes this" style="txt-align:center;bg#181818;bdr#7A7A7A;bdr:thick;font:bold;size:Bigger;" top="100" width="300"/>
    </abs>

    #DashBoard