Home AMX User Forum NetLinx Studio

DEVCHAN for Pop-Ups Question

When I do pop-ups, I usually create a DEVCHAN. Something like:
CHAR cPopUpNames[][20] = {
                                 'PopUp 1',
                                 'PopUp 2',
                                 'PopUp 3'
                                 }
DEVCHAN dvMYPOPUPS[] = {
                                {dvTP,1},
                                {dvTP,2},
                                {dvTP,3}
                                }

To utilize them, I usually do this:
BUTTON_EVENT[dcMYPOPUPS]
{
   PUSH:
            {
                 nButtonNumber = GET_LAST(dcMYPOPUPS)
                 SEND_COMMAND dvTP,"'@PPN-',cPopUpNames[nButtonNumber]"
            }
}

This has always worked fine in the past. However, today I found a limitation in using this. I have three popups and six buttons controlling them. Bascially, I am using left and right buttons on each popup. Popup one shows inputs 1 - 10, popup two shows inputs 11 - 20, and popup three shows inputs 21 - 30. The idea I had was to use right and left arrow keys at the bottom of each popup to "scroll" to the next set of numbers either up or down. Short of hard coding each button, what would be the "proper" way to do this?

Comments

  • staticatticstaticattic Posts: 200
    I answered my own question. Basically, I made a counter that counts up to 3 and then starts over at 1. It also counts down to 1 and then starts over at 3. Pressing the left or right arrow keys either increments or decreases nNum by 1. Using that number, I put in a line like this:

    SEND_COMMAND dvTP, "'@PPN-', cPopUps[nNum]

    Maybe not the best way to do this, but it works for now.
Sign In or Register to comment.