更改字符串列框或表格框的顏色和下劃線內容。嗨,我上週發布了一個類似版本的代碼,現在我正在嘗試將字符串 col box() / table box() 中的值更新為藍色和下劃線,這樣它們看起來就是超鏈接。 table box << text color() 命令對我不起作用,但 string col box << text color() 有效。 有沒有辦法做到這一點,下面示例中的列標題“名稱”不會改變顏色?有沒有辦法設置要加下劃線的值?
謝謝
麥克風
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=""> 0,
nw << scroll window(cb[itemNum[1]]);
);
)
);
</SET>JMP 標準版本 16.2.0
腳本回复:更改字符串列框或表格框的顏色和下劃線內容。謝謝彼得。 那是一個很棒的演講,而且很有幫助。
回复:更改字符串列框或表格框的顏色和下劃線內容。Justin Chilton 和我在 Discovery 2018 峰會上做了一個包含 col boxes 的演講。
在 JSL 中增強您的用戶界面(美國 2018 113)
回复:更改字符串列框或表格框的顏色和下劃線內容。非常感謝亞爾莫。我感謝對行為的幫助和洞察力。
回复:更改字符串列框或表格框的顏色和下劃線內容。您應該能夠通過“正確”構建 Col Box 來避免崩潰。 如果我沒記錯的話 << append 對我有用,但你不能使用 << Set。我之前曾就此聯繫過支持人員。 問題應該在 JMP17 上得到解決。
我為他們提供的例子是這個(這將使 JMP16 崩潰):
Names Default To Here(1);
stop(); // THIS WILL CRASH JMP
nw = New WindoW("",
Table Box(
cb = Col Box("icons",
Icon Box("Excluded"),
Icon Box("Excluded"),
)
)
);
cb << Set({"a", "b"});
因此,如果我要使用 Col Box 並想替換值,我總是會重建它。
回复:更改字符串列框或表格框的顏色和下劃線內容。你好@jthi ,很抱歉打擾您,但我希望您或 JMP 團隊的某個人能夠進一步詳細說明 JMP 在構建列框時崩潰的部分。 關於如何避免這種行為的任何提示?
回复:更改字符串列框或表格框的顏色和下劃線內容。您能否進一步詳細說明有關 JMP 崩潰的部分?它是可預測的,還是在 col box() 中有大量項目時會發生?在許多情況下,我可能想避免這種情況,因為它很可能用在可以繪製任意數量參數的腳本中。 從幾塊地塊到一千塊左右。
回复:更改字符串列框或表格框的顏色和下劃線內容。使用 col box 也有一些其他的缺點,例如更難從中獲取值,有時你可以在構建 Col Box 時使 JMP 崩潰......但我不知道除了改變 String Col Box 標題顏色之外的任何簡單方法<<文本顏色將改變所有元素的顏色。
回复:更改字符串列框或表格框的顏色和下劃線內容。謝謝亞爾莫。 它確實看起來更好,雖然有不能右鍵單擊和“製作成數據表”的缺點,但我認為該功能並不那麼重要。
我在這裡輸入了這兩個問題,但我只是自己回答了它們......什麼代碼將文本更改為藍色?為什麼按鈕框只顯示為文本而不是我們看到的常見按鈕,例如此處的“返回”頂部示例?答案是你的 << Underline Style(1);做這兩件事。 似乎它是按鈕框的替代顯示。 謝謝分享,之前不知道。
回复:更改字符串列框或表格框的顏色和下劃線內容。您可以使用 Col Box 而不是 String Col Box 並在 col box 中使用按鈕框
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 = Col Box( "names", {}), // scb will be used later to color in blue to indicate it is a pseudo-hyperlink
)
)
);
);
For Each({col}, colList,
scb << Append(Button Box(col, << Set Function(function({this},
nw << scroll window(cb[Contains(colList, this << Get Button Name)]);
)), << Underline Style(1);
));
);
//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></APPEND>