Limit ^BMF command to certain pages
dnahman
Posts: 28
Hi,
Suppose I have button with address 1 on two different pages, and I want to hide it via code on one page only. The ^BMF command (and other button commands) address all of the instances of address 1 equally.
Has anybody found a creative workaround to this? I'm hoping to avoid otherwise identical buttons with different address codes.
Thanks,
David
Suppose I have button with address 1 on two different pages, and I want to hide it via code on one page only. The ^BMF command (and other button commands) address all of the instances of address 1 equally.
Has anybody found a creative workaround to this? I'm hoping to avoid otherwise identical buttons with different address codes.
Thanks,
David
0
Comments
Thanks,
david
- on page 1, make a multistate bargraph with 4 states. level code 1, channel code 1, address code 1. For states 2 and 4, put whatever graphics you want the button to have when it is visible. For states 1 and 3, make the button invisible (fill = transparent, text = transparent, etc)
- on page 2, make a multistate bargraph with 4 states. level code 1, channel code 1, address code 1. For states 3 and 4, put whatever graphics you want the button to have when it is visible. For states 1 and 2, make the button invisible (fill = transparent, text = transparent, etc)
You can now control which pages the buttons are visible on in code using a SEND_LEVEL dvTP, 1, n
where n is the following:
1: neither page has the button showing
2: only page 1 shows the button
3: only page 2 shows the button
4: both pages show the button
--david
Matt's suggestion I think is by far the simplest approach. It's one line of code, instead of "burning" an address, you use a level. With John's you use a bitmap to hide the button (sorry John, don't know if that's exactly what you were saying.) And mine uses logic that there's no reason to hide or show a button on a page that you're not even on to begin with.
So you've got three options - what is your most perfect solution? A command that shows and hides buttons that you're not even looking at? That's much like sending DVD feedback to a panel when it's looking at the radio page. There's no reason to send unnecessary traffic to the panel when you don't have to, and this is essentially what you're doing. So if anything, your current approach to sending data to a panel is wasteful; perhaps you should reevaluate the way you do things before looking for "elegant" and "simple" approaches when it comes to hiding and showing a button.
If you could give a page (or popup) name as an extra argument to a version of ^BMF, then you would have the ability to change the attributes of a button on an instance by instance basis -- not unlike setting one instance of a button to hidden, and another with the same address & channel codes to visible from within tpDesign.
As another example I have a source and destination routing matrix page. For some destinations, a given source may be invalid certain contexts. These change fairly frequently. Right now I have to define separate popup pages for the sources based on the selected destination and modify the touchpanel file and the axs file for each change. It would be nice to be able to set the visibility of each source & destination in a descriptive structure for each source, and either hide/show on each popup during the online event for each panel when I populate each button with its source name, etc.
--david
Hmm . . . perhaps Visual Architect or AMXhome would fit your needs more. I don't know if you should be meddling with TPD4 or NS3 very much, it could be dangerous.