Home AMX User Forum NetLinx Studio

Changing state question.

udiudi Posts: 107
I want to do an icon that have 3 state (open,close,stop). And I want that when I will press a buttons the state will change Respectively to the buttons.
For example if I press the stop button the icon will change to stop icon, and if I press the open button the icon will change to open icon.
I managed to do so by using a button that has no icon and using the command:
SEND_COMMAND dvTP,"'^ICO-500,1&2,158'"


The code looks like this:
SWITCH (WIN_CHANEL_BUTTONS[index])
{
//Master
CASE bt_WIN_Master_Open:
{
SEND_COMMAND dvTP,"'^ICO-500,1&2,158'"
}
CASE bt_WIN_Master_Close:
{

SEND_COMMAND dvTP,"'^ICO-500,1&2,159'"
}
CASE bt_WIN_Master_Stop:
{

SEND_COMMAND dvTP,"'^ICO-500,1&2,160'"
}
}

Is this a good way or there is a better way?
Thanks for any help

Comments

  • DHawthorneDHawthorne Posts: 4,584
    I make the button a multi-state bargraph, and assign the graphics per state (you can have as many or few as you like). From there it's a matter of the program using SEND_LEVEL to the button to activate the desired state.
Sign In or Register to comment.