博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用 IntraWeb (23) - 基本控件之 TIWTimer、TIWProgressBar、TIWProgressIndicator、TIWTimeEdit...
阅读量:7116 次
发布时间:2019-06-28

本文共 2891 字,大约阅读时间需要 9 分钟。

TIWTimer             //和 TTimer 没多大区别, 它的默认事件现在是异步的(OnAsyncTimer), 在网络上使用 OnTimer 肯定是非常糟糕的TIWProgressBar       //进度条TIWProgressIndicator //进度提示器; 这是个新东西, 非常好; 当碰到时间较长的加载时(同步或异步)都可以用用; 使用前需要先关联到窗体的 ProgressIndicator 属性TIWTimeEdit          //个人认为这个东西一点用也没有; 只是给个分钟数按 8 小时换算成天、周之类, 如果需要还不如写个函数.

TIWTimer 所在单元及继承链:
IWCompExtCtrls.TIWTimer < TIWBaseHTML40Component < TIWBaseHTMLComponent < TIWBaseComponent < TComponent < TPersistent < TObject
主要成员:

property Interval: Integer //property Enabled: Boolean  //property OnTimer: TNotifyEvent       //property OnAsyncTimer: TIWAsyncEvent //

TIWProgressBar 所在单元及继承链:
IWCompProgressBar.TIWProgressBar < TIWCustomControl < TIWBaseHTMLControl < TIWBaseControl < TIWVCLBaseControl < TControl < TComponent < TPersistent < TObject
主要成员:

property BGColor: TIWColor //底色property Color: TIWColor   //进度色property Percent: Integer  //当前进度(0-100)property ShowText: Boolean //是否显示进度比例文本property Font: TIWFont     //

测试:

{在窗体上放 IWTimer1、TIWProgressBar1}procedure TIWForm1.IWAppFormCreate(Sender: TObject);begin  IWProgressBar1.ShowText := True;  IWProgressBar1.Color := $0000FF;  IWProgressBar1.Font.Color := $FFFFFF;end;procedure TIWForm1.IWTimer1AsyncTimer(Sender: TObject; EventParams: TStringList);begin  IWProgressBar1.Percent := IWProgressBar1.Percent + 10;  if IWProgressBar1.Percent >= 100 then IWTimer1.Enabled := False;end;
o_w231.png

TIWProgressIndicator 所在单元及继承链:
IWCompProgressIndicator.TIWProgressIndicator < TComponent < TPersistent < TObject
主要成员:

property Css: string  //这个弹出的等待窗口其实就是一个包含着 Table 的 Div, 可通过 Css 或下面几个属性弄得好看一点property BGColor: TIWColor  //property BoxColor: TIWColor //property BoxBorderColor: TIWColor //property BoxBorderWidth: Integer  //property Opacity: Integer //透明度(0-100); 但等待窗口弹出时, 整个页面会有一个透明的遮罩层 property Mode: TIWProgressIndicatorMode	//有效模式: pimAsync(异步)、pimSync(同步,默认)、pimBoth(两者都用)property BoxVisible: Boolean   //是否以窗口的形式呈现; 默认 Trueproperty ImageVisible: Boolean //是否显示 Loading 动画图片; 默认 Trueproperty UserDefined: Boolean  //是否禁用; 默认 Falseproperty PreScript: TStrings       //property PostScript: TStrings	   //property PreAsyncScript: TStrings  //property PostAsyncScript: TStrings //property ProgressTextSettings: TIWProgressTextSettings //提示文本相关设置property RenderTag: TIWHTMLTag //function Render: string	//Render 方法和 RenderTag 属性应该老控件没有的; 在调试时它们还是有点用的

测试:

{在窗体上放 IWProgressIndicator1 和两个按钮}procedure TIWForm1.IWAppFormCreate(Sender: TObject);begin  Self.ProgressIndicator := IWProgressIndicator1; //关联到 IWProgressIndicator1  IWProgressIndicator1.Mode := pimBoth;           //让同步异步都有进度提示  IWProgressIndicator1.ProgressTextSettings.Text := '正在载入...';  IWProgressIndicator1.ProgressTextSettings.Font.Color := clWebGreen;end;{同步事件}procedure TIWForm1.IWButton1Click(Sender: TObject);begin  Sleep(3000); //等待 3 秒, 用于测试end;{异步事件}procedure TIWForm1.IWButton2AsyncClick(Sender: TObject; EventParams: TStringList);begin  Sleep(3000);end;
o_w232.png

转载地址:http://wuwel.baihongyu.com/

你可能感兴趣的文章
海洋迅雷VIP帐号获取器
查看>>
强制活动目录的站点复制
查看>>
在图形中添加一个图例
查看>>
os 模块 python file 与文件路径
查看>>
nginx 跳转配置
查看>>
VLAN概述
查看>>
我的友情链接
查看>>
部署Cacti监控平台
查看>>
我的友情链接
查看>>
HDU - 2041 - 超级楼梯(dp)
查看>>
α冲刺 (7/10)
查看>>
Autoit 自动化安装软件
查看>>
shell 脚本-----循环数组
查看>>
IBM x系列255服务器系统带宽特性
查看>>
8.23 课程-1 (history Tabb补全 别名 文件名展开{})
查看>>
重写equals方法
查看>>
Merge into 详细介绍
查看>>
MySQL Server参数优化 - innodb_file_per_table(独立表空间)
查看>>
ubuntu中文出现乱码
查看>>
Linux系统命令之tcpdump
查看>>