使用 IntraWeb (23) - 基本控件之 TIWTimer、TIWProgressBar、TIWProgressIndicator、TIWTimeEdit
TIWTimer //和 TTimer 没多大区别, 它的默认事件现在是异步的(OnAsyncTimer), 在网络上使用 OnTimer 肯定是非常糟糕的
TIWProgressBar //进度条
TIWProgressIndicator //进度提示器; 这是个新东西, 非常好; 当碰到时间较长的加载时(同步或异步)都可以用用; 使用前需要先关联到窗体的 ProgressIndicator 属性
TIWTimeEdit //个人认为这个东西一点用也没有; 只是给个分钟数按 8 小时换算成天、周之类, 如果需要还不如写个函数.
TIWTimer 所在单元及继承链:
IWCompExtCtrls.TIWTimer
主要成员:
property Interval: Integer //
property Enabled: Boolean // property OnTimer: TNotifyEvent //
property OnAsyncTimer: TIWAsyncEvent //
TIWProgressBar 所在单元及继承链:
IWCompProgressBar.TIWProgressBar
主要成员:
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
主要成员:
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 //是否以窗口的形式呈现; 默认 True
property ImageVisible: Boolean //是否显示 Loading 动画图片; 默认 True
property UserDefined: Boolean //是否禁用; 默认 False
property 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;

使用 IntraWeb (23) - 基本控件之 TIWTimer、TIWProgressBar、TIWProgressIndicator、TIWTimeEdit的更多相关文章
- 使用 IntraWeb (24) - 基本控件之 TIWFileUploader、TIWFile
TIWFileUploader 是基于 Ajax 的上传控件, 最初是 Andrew Valums 开发, 从 IntraWeb XIV 纳入并替换 TIWFile. 虽然从组件面板上还能看到 TIW ...
- 使用 IntraWeb (29) - 基本控件之 TIWAutherList、TIWAutherINI、TIWAutherEvent
TIWAutherList //通过一组户名与密码验证登陆 TIWAutherINI //通过记录户名与密码信息的 #Auth.ini 文件验证登陆 TIWAutherEvent //通过其 OnCh ...
- 使用 IntraWeb (28) - 基本控件之 TIWTemplateProcessorHTML、TIWLayoutMgrHTML、TIWLayoutMgrForm
TIWTemplateProcessorHTML //使用外部的 html 文件做模板 TIWLayoutMgrHTML //直接输入 Html 文本做模板 TIWLayoutMgrForm //这应 ...
- 使用 IntraWeb (26) - 基本控件之 TIWMenu
TIWMenu 的任务是让原来的 TMainMenu 呈现在网页上, 通过其 AttachedMenu 属性关联一个 TMainMenu 是必需的. TIWMenu 所在单元及继承链: IWCompM ...
- 使用 IntraWeb (25) - 基本控件之 TIWRegion
这应该是 IW 中最重要的容器了, 和它同父的还有 TIWTabControl TIWRegion 所在单元及继承链: IWRegion.TIWRegion 主要成员: property Align: ...
- 使用 IntraWeb (22) - 基本控件之 TIWCalendar
TIWCalendar: 日历控件, 继承于 TIWCustomGrid, 所以它和 TIWGrid 共同属性特多. 它的 Cell 是 TIWCalendarCell 对象, 直接从 TIWGrid ...
- 使用 IntraWeb (20) - 基本控件之 TIWGrid
TIWGrid 最终通过 Html Table 呈现; 其每个 Cell 都是一个 TIWGridCell 对象, Cell 对象的 Control 属性非常好, 可以非常方便地嵌入其他控件. TIW ...
- 使用 IntraWeb (19) - 基本控件之 TIWTreeView
这是个饱受非议的控件; 我通过尝试, 理解了非议, 也能理解作者. 总之向作者的思路靠拢吧, 还是不错的. TIWTreeView 所在单元及继承链: IWCompTreeview.TIWTreeVi ...
- 使用 IntraWeb (16) - 基本控件之 TIWList、TIWListbox、TIWComboBox、TIWOrderedListbox
TIWList //列表; 它对应 Html 中的 OL.LI(某些选项下会用表格模拟); TIWListbox 和 TIWComboBox 则对应 Html 在的 Option TIWListbox ...
随机推荐
- iOS8 自定义navigationItem.titleView
navigationBar其实有三个子视图,leftBarButtonItem,rightBarButtonItem,以及titleView.前两种的自定义请参考http://www.cnblogs. ...
- [HAOI2008]移动玩具(状压&带权二分图)
题目描述 • 一个 4 × 4 的 0/1 矩阵 • 每次可以交换相邻两个元素 • 求从初始状态到目标状态的最小交换次数 输入格式 前四行,每行一个长为 4 的 0/1 字符串,描述初始状态. 后四行 ...
- 360 / 小米 / 百度 随身wifi Ubuntu 下作为无线网卡使用
这篇文章说得其实很好了,http://www.freemindworld.com/blog/2013/131010_360_wifi_in_linux.shtml 不过因为专利问题,官网貌似不直接提供 ...
- springMVC版本和jdk版本不匹配造成的问题
一个简单的例子项目,使用springMVC的版本是3.2,jdk的版本是1.7,使用的是注解的处理器适配器和处理器映射器.spring的xml配置文件中单独配置每个handler,可以正常的使用,如果 ...
- 【mac】7z 终端命令行
链接:http://www.2cto.com/os/201410/341079.html 7z指令 7z是7zip压缩工具的常用压缩文件格式.7zip是一个开源的压缩工具,软件本身十分小巧,功能强大, ...
- MYSQL 添加外键报错
2014年6月16日 10:48:51 出错的部分提示摘录: #1452 - Cannot add or update a child row: a foreign key constraint fa ...
- iis6 和iis7s上整个网站重定向
iis6 和iis7s上整个网站重定向 重定向作用: 重定向(Redirect)就是通过各种方法将各种网络请求重新定个方向转到其它位置.举例说明:就像我XX公司,之前用的网络域名是“www.bb. ...
- 2018ACM/ICPC 青岛现场赛 E题 Plants vs. Zombies
题意: 你的房子在0点,1,2,3,...,n(n<=1e5)点每个点都有一颗高度为0的花,浇一次水花会长a[i]. 你有一个机器人刚开始在你家,最多走m步,每一步只能往前走或者往后走,每走到一 ...
- CF1064A 【Make a triangle!】
要让这个三角形合法,只需满足三角形不等式 即$a+b>c$,设$c=max\left\{a,b,c\right\}$,上式转化为$c<a+b$ 如果已经满足,不需消耗代价 否则消耗$c-a ...
- stm32+ESP8266AT指令详细说明
最近公司团队的项目用到ESP8266,使用的是stm32c8t6芯片,软件使用MDK,于是写下调试过程中的一些注意点.具体代码和涉及思路不能外泄,这里只给出我们调试过程中的注意的方面. 关于ESP82 ...