Hi, I posted a similar version of the code below last week, and now I'm trying to update the values in the string col box() / table box() to be blue and underlined so they appear to be hyperlinks. The table box << text color() command was not working for me, but the string col box << text color() works. Is there a way to do this so the header of the column, "names" in the example below, does not change color? Is there a way to set the values to be underlined?
Thanks
Mike
Names Default To Here( 1 );
//dummy data table
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
// create a list of columns. In the example table, the first 4 columns are categorical index columns, so we'll use 20 columns starting at column 5 (4 + i)
colList = {};
for( i = 1, i<=20, i++,
colList[i] = as column(dt, 4 + i) << get name();
);
// new window, table box with selectable rows
nw = New Window( "Example",
vlb = vlistbox(
mainOlb = Outline Box( "Table", // used for referencing scrolling back to top
tb = Table Box(
scb = String Col Box( "names", colList ), // scb will be used later to color in blue to indicate it is a pseudo-hyperlink
<<set selectable rows() // making the rows selectable is how we can capture that row selection has changed, and the <<set row change function() will scroll to the corresponding distribution
)
)
);
);
scb << text color(rgb color(0,0,255)); // any way to set it so only the values are blue, and not the header, 'names' in this case?
scb << set underline(1); // not a real command
//append some distributions in their own context boxes, but keep a reference variable for the conext box cb[i].
cb = {};
for( i = 1, i <= 20, i++,
vlb << append(
cb[i] = contextbox(
distribution(column(4 + i)) // put the i'th distribution in context box[i]
)
);
vlb<<append(buttonbox("Back", nw << scroll window(mainOlb))); //back to top
);
//set what happens when a row is selected. itemNum is a matrix of all selected rows.
// The 'this' variable here explained: When a row is selected, the set row change function(x) is called. The input variable x is copy of the table box. So 'this' refers to a copy of the table box.
// 'this << get selected rows()' just returns a matrix of the selected rows. Since we can't set max # of rows selected, we just use the first.
tb << set row change function(
Function( {this},
Print( this << get selected rows );
itemNum = this << get selected rows();
if(nrows(itemNum) > 0,
nw << scroll window(cb[itemNum[1]]);
);
)
);
JMP standard version 16.2.0