Home AMX User Forum AMX Technical Discussion

SVSI Panel Builder questions

Hello everyone

We are using SVSI ( amx) and I have a question regarding panel builder and things I want to do.

Is there a way to change the button template ( background) or change the text color programatically?

I can't find any reference to button properties. ( Is there such thing available.. )

I have made a floor plan with destination and sources as a matrix switcher.
We have around 200 TV and destinations in our facilities.

It would be great to have a visual reference , at a glance, and see what is what with color.

Thanks

Comments

  • Each button is an object that can be referenced by instance name.

    The properties of any object can be accessed through the get() method.

     get('Button Name').core.states[0].bgimag // Off state background
     get('Button Name').core.states[1].bgimag // On state background
    

    The button objects can be added dynamically and standard css patterns leveraged to set the properties

     css = {
         state1:'border:4px outset darkslategray;',
         state2:'border:4px inset chartreuse'
     };
    
     button.core.states[0].style = css.state1;
     button.core.states[1].style = css.state2;
    
     /******* APPLY TO PANEL ************/
    
     project.currentpanel.addChild(button);
    

    Best thing is to use console to view the object properties and test out different methods of manipulating them in real time.

    Simple Google search for "changing css in javascript" will lead you down the rabbit hole fast enough.

Sign In or Register to comment.