Is it possible to create a “box”, like a container or something, that uses tab strip navigation between other boxes? But the main window can’t change, it just stays there behind that box. Like another “layer” of a smaller window inside of the main window, that can be navigated through tab strip.
Ignition’s tab-strip control component has two modes of operation. By default, it does window swapping as each tab is selected. That can be turned off, and the user can then use the selected tab to control visibility of containers on the same window. Each container would have the same size and position – aligned to edge of the tab-strip, but the visibility binding will let you see only one at a time.
Alright! How the visibility should be binded? Could you give me a little push? I tried to script this yesterday, using the containers, but I was getting an error message and couldn’t get rid of it. I don’t know what was wrong on my script, but now it’s already erased, so I can’t show you.
So, I generally give the container a meaningful name, and put that as the “window name” in the tab-strip. Then the container’s visibility binding would look like this (expression binding):
Here is a simple example. There are two containers on top of eachother, and a tab strip above them. As @pturmel suggested, the visibility is changed on each, depending on the name of the selected tab in the tab strip.
Unfortunately, I can’t open that .proj you sent.
The version of Ignition i’m using is 7.7.7. When I try to open your file, it says it can’t open projects from newer versions of Ignition :((((((((( sad
But I made it work with @pturmel answer. Thanks to both of you!
Well… There are two containers. Yellow and Red, with the visibility property using an expression: if({Root Container.Yellow.name} = {Root Container.Tab Strip.selectedTab},1,0) and if({Root Container.Red.name} = {Root Container.Tab Strip.selectedTab},1,0). The tab strip has two tabs, with the “Window Name” set to “Red” and “Yellow” (the names of the containers".
@pturmel You’re correct; however, I usually choose to leave the if so that it is more apparent what is happening. Easier for less experienced programmers to decipher!
Similarly, I will usually write:
if ( boolean_variable == true ){
// Do something
}
Rather than:
if ( boolean_variable ){
// Do something
}
There are times (and this may be one of them) that including the if actually makes the binding more confusing, in which case, it should be removed.
Having to put in a superfluous comparison generally means one’s variable names suck. If you follow reasonable guidelines (I like this summary), that problem goes away.