AntdUI.Progress 用于展示任务完成进度,可做线性进度、圆形进度、步骤进度或加载状态。
import win.ui;
import dotNet.AntdUI;
/*DSG{{*/
var winform = win.form(text="AntdUI Progress";right=520;bottom=220)
winform.add(host={cls="custom";left=20;top=20;right=500;bottom=80;z=1})
/*}}*/
var progress = AntdUI.Progress(winform.host);
progress.Value = 0.65;
progress.Text = "导入中";
progress.TextUnit = "%";
progress.Shape = AntdUI.TShapeProgress.Round;
progress.State = AntdUI.TType.Success;
winform.show();
win.loopMessage();
var p = AntdUI.Progress(winform.host);
p.Shape = AntdUI.TShapeProgress.Circle;
p.Value = 0.42;
p.UseTextCenter = true;
Value:进度值,通常为 0 到 1。Shape:形状,常用 Round、Circle、Mini、Steps。State:状态色,常用 Success/Info/Warn/Error。Loading:加载动画状态。Text、TextUnit、UseSystemText、UseTextCenter:文本显示。Steps、StepSize、StepGap:步骤进度样式。Back、Fill、ForeColor:背景、填充、文本色。progress.ValueFormatChanged = function(sender,e){
// 需要自定义显示文本时处理
}
Value 不是百分比整数,0.65 表示 65%。Loading = true。