Once your groups are created, use the Align Objects tool to line them up vertically and horizontally, and then hide all the containers, except for your default as seen here:
/*jshint esversion: 6*/
/*globals console, copyTableContents, document */
/* ^ I use these global variables often,
so I paste the ES6 and globals option into all my scripts.*/
//First, we set up variables. ES6 lets me use const,
//and let, but var is fine to use instead.
const redTab = session.findById("wnd[0]/usr/btnPersonas_159785349635632");
const yelTab = session.findById("wnd[0]/usr/btnPersonas_159785349040783");
const greenTab = session.findById("wnd[0]/usr/btnPersonas_159785349482669");
const blueTab = session.findById("wnd[0]/usr/btnPersonas_159785349776394");
const yellowBox = session.findById("wnd[0]/usr/subPersonas_159785141777266");
const redBox = session.findById("wnd[0]/usr/subPersonas_159785141639166");
const blueBox = session.findById("wnd[0]/usr/subPersonas_159785140679953");
const greenBox = session.findById("wnd[0]/usr/subPersonas_159785141909745");
/* I'm using an onClick script assignment,
which allows me to grab the id of whatever,
tab I trigger the script with. */
let tabSel = source.id;
/* This sets the background color of the selected tab,
in this case to a purple for emphasis,
but it can be used to change a number of properties,
to indicate to the user that they've selected a tab.*/
source.setProperty("backgroundColor", "rgba(188, 45, 210, 1)");
/* I'm sure there's a more elegant solution,
but for tab switching, I'm just using an IF statement.
Based on the button selected, the coordinating,
Container is shown, while the others are hidden.
The backgroundColor of the other buttons is reset,
as well, so the selected tab is highlighted.*/
if (tabSel == redTab.id) {
yelTab.resetPropertyToOriginal("backgroundColor");
greenTab.resetPropertyToOriginal("backgroundColor");
blueTab.resetPropertyToOriginal("backgroundColor");
redBox.show();
yellowBox.hide();
greenBox.hide();
blueBox.hide();
} else if (tabSel == yelTab.id) {
redTab.resetPropertyToOriginal("backgroundColor");
greenTab.resetPropertyToOriginal("backgroundColor");
blueTab.resetPropertyToOriginal("backgroundColor");
yellowBox.show();
redBox.hide();
greenBox.hide();
blueBox.hide();
} else if (tabSel == greenTab.id) {
yelTab.resetPropertyToOriginal("backgroundColor");
redTab.resetPropertyToOriginal("backgroundColor");
blueTab.resetPropertyToOriginal("backgroundColor");
greenBox.show();
redBox.hide();
yellowBox.hide();
blueBox.hide();
} else if (tabSel == blueTab.id) {
yelTab.resetPropertyToOriginal("backgroundColor");
redTab.resetPropertyToOriginal("backgroundColor");
greenTab.resetPropertyToOriginal("backgroundColor");
blueBox.show();
redBox.hide();
yellowBox.hide();
greenBox.hide();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 | |
4 | |
4 | |
3 |