使用 IntraWeb (23) - 基本控件之 TIWTimer、TIWProgressBar、TIWProgressIndicator、TIWTimeEdit    


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;





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;





©著作权归作者所有:来自51CTO博客作者JLee79的原创作品,如需转载,请注明出处,否则将追究法律责任

更多相关文章

  1. 使用 IntraWeb (24) - 基本控件之 TIWFileUploader、TIWFile
  2. zabbix监控默认的item key列表
  3. MySQL默认数据库介绍
  4. .NetCore实践篇:分布式监控Zipkin持久化之殇
  5. 用jQuery的attr()设置option默认选中无效的解决 attr设置属性失
  6. 上海老男孩IT教育:Linux运维入门教程09-01 (Samba服务)
  7. 如何更改苹果Mac默认截图保存格式?
  8. nginx配置文件
  9. Celery+django如何显示任务的执行进度条

随机推荐

  1. Android使用ksoap2调用C#中的webservice
  2. 1.1 创建android工程
  3. 初识Android系统平台
  4. Android View系列 - 坐标系
  5. Android(安卓)SDK 源码下载,eclipse关联
  6. 视频专辑: 善知堂android 4.0.3 就业视频
  7. 给Activity切换加入动画
  8. 知识储备:Android系统架构
  9. android 1.5 NDK发布
  10. qpython3:安卓上运行Python