我可以在LiveCode中更改进度条的默认颜色吗?

时间:2013-03-07 22:03:12

标签: user-experience livecode

有没有办法将进度条的默认颜色更改为任何颜色 绿色以外?例如,我希望它变成红色直到它到达 100%,然后变为绿色。

1 个答案:

答案 0 :(得分:2)

在LiveCode列表服务中询问了这个问题,我在这里回答,因为其他人可能觉得它很有用。

不可以这样做,但很容易创建一个自定义进度条,您可以根据自己的喜好设置颜色。

创建两个图形。一个用于边框,一个用于条形图。根据需要设置颜色和图形效果。对它们进行分组,然后将以下内容添加到组脚本中:

setProp uPercent pPercent -- 0..100
   put the rect of grc "border" of me into tRect
   put round(item 1 of tRect+(item 3 of tRect-item 1 of tRect)*pPercent/100) into item 3 of tRect
   set the rect of grc "bar" of me to tRect
end uPercent
相关问题