Skip to content

圆形进度条-RoundProgressbar

描述


圆形进度条,父对象为ui,无子对象

事件


onValueChange: 进度条当前值发生变化时触发,触发函数定义:onValueChange(value),value表示当前进度条的值。

onUserEvent:接收自定义事件,当订阅了某自定义事件,通过service.emitEvent(name, value)广播时触发。

属性


名称功能说明脚本例子
xx坐标 (只读属性)var x = ui.form-name.progressbar-name.x; 获取对象的x坐标
yy坐标 (只读属性)var y = ui.form-name.progressbar-name.y; 获取对象的y坐标
width宽 (只读属性)var width = ui.form-name.progressbar-name.width; 获取对象的宽
height高 (只读属性)var height = ui.form-name.progressbar-name.width; 获取对象的高
enabled使能:如果选中,对象处于激活状态,否则处于“禁止”状态,对所有触摸操作无反应。ui.form-name.progressbar-name.enabled=0 禁止对象
visible可见:如果选中,对象可见,否则隐藏ui.form-name.progressbar-name.visible=0 隐藏对象
font
字体

layer图层:显示图层,值为0-Bottom_Layer, 1-Top_Layer.ui.form-name.progressbar-name.layer=0 将控件置于显示底层,如果其他top层的控件与该控件重合,将覆盖该控件.
verbose事件通知:当触发条件满足时,ExpOS主动向device.com0发送事件消息。仅当选择device.com0通讯协议为script mode时适用。ui.form-name.progressbar-name.verbose=1 设置对象触发的事件有效时向device.com0发送事件消息
minimum
最小值
ui.form-name.progressbar-name.minimum=0 设置value最小值为0
maximum
最大值
ui.form-name.progressbar-name.maximum=100 设置value最大值为100
value
进度值,必须在maximum和maximum之间
ui.form-name.progressbar-name.value=4 设置进度当前值为4
textVisible
进度标识文字可见
ui.form-name.progressbar-name.textVisible=0 隐藏进度标识文字
textColor文字颜色,颜色定义参看 控件对象ui.form-name.progressbar-name.textColor='#00ff00' 设置文字颜色为绿色
textFormat文字格式:0-Percent百分比显示,1-Value实际值显示ui.form-name.progressbar-name.textFormat=0 设置百分比显示进度
style进度条显示风格:值为0-Donut, 1-Pieui.form-name.progressbar-name.textFormat=0 设置显示风格为donut
grooveBackgroundColor轨道背景颜色,颜色定义参看 控件对象ui.form-name.progressbar-name.grooveBackgroundColor='#ff0000' 设置轨道背景为红色
grooveBackgroundColorType轨道背景色类型:0-Linear_A, 1-Linear_B, 2-Radial_A, 3-Radial_B, 4-Circle, 5-Pure, 6-No_Color可选ui.form-name.progressbar-name.grooveBackgroundColorType=0 设置轨道背景颜色类型为Linear_A
grooveWidth
轨道宽度,单位:像素
ui.form-name.progressbar-name.grooveWidth=5 设置对象轨道宽为5个像素
chunkColor进度块颜色,颜色定义参看 控件对象ui.form-name.progressbar-name.chunkColor='#ff0000' 设置进度块为红色
chunkColorType进度块颜色类型:0-Linear_A, 1-Linear_B, 2-Radial_A, 3-Radial_B, 4-Circle, 5-Pure, 6-No_Color可选ui.form-name.progressbar-name.chunkColorType=0 设置进度块颜色类型为Linear_A
chunkWidth
进度块宽度,单位:像素
ui.form-name.progressbar-name.chunkWidth=5 设置进度块宽为5个像素
chunkCapType进度块头部类型:0-Flat平头, 1-Round圆头ui.form-name.progressbar-name.chunkCapType=1 设置进度块头部为圆形

方法


名称功能说明脚本例子
setFontSize(size)设置字体大小ui.form-name.progressbar-name.setFontSize(12) 设置字体为12号
move(x,y)移动对象:将对象移动到(x,y)坐标位置,坐标系的原点在屏幕的左上角。ui.form-name.progressbar-name.move(10,10) 移动对象到坐标(10,10)
resize(width, height)
设置对象宽和高
ui.form-name.progressbar-name.resize(30,20) 设置对象宽30像素,高20像素