简体   繁体   English

单击/选中时,Spotfire按钮更改颜色

[英]Spotfire button change color when clicked / selected

I am trying to make the buttons created in Spotfire to change color or fade when they are clicked. 我试图使在Spotfire中创建的按钮在单击时更改颜色或褪色。 Basically we want the buttons to show they are marked when selected. 基本上,我们希望按钮显示在选中时已被标记。

What is the best way to do this? 做这个的最好方式是什么?

Thank you for your time. 感谢您的时间。

If you're editing the HTML around a button, it looks like you can make it bold or change the size of the text, though you can't change the color (Or, oddly enough, underline or italicize the text in the button). 如果您正在编辑按钮周围的HTML,尽管您无法更改颜色(或者,奇怪的是,在按钮上用下划线或斜体显示),但看起来可以将其设为粗体或更改文本大小。 。

So copy the html code for the text area into a string, and on your script for the button click, add the following general setup. 因此,将文本区域的html代码复制到字符串中,然后在脚本上单击按钮,添加以下常规设置。

Example Initial HTML: 初始HTML示例:

<p><SpotfireControl id="724c2b260722473caecaef18a2b3b695" />
</p>

Example Code (vTextArea is a parameter of Type Visualization referencing the text area your button is in): 示例代码(vTextArea是Type Visualization的参数,它引用按钮所在的文本区域):

from Spotfire.Dxp.Application.Visuals import VisualContent
from System import Guid

page = Application.Document.ActivePageReference

fullhtml = '<p><font size="3"><b><SpotfireControl id="724c2b260722473caecaef18a2b3b695" /></b></font></p>'

ta=vTextArea.As[VisualContent]()
ta.HtmlContent=fullhtml

I know this doesn't do exactly what you were asking for, but it does succeed in showing the user which button they've clicked. 我知道这并不能完全满足您的要求,但是确实可以向用户显示他们单击了哪个按钮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM