使用 IntraWeb (11) - 基本控件之 TIWButton
所在单元及继承链:
IWCompButton.TIWButton < TIWCustomControl < TIWBaseHTMLControl < TIWBaseControl < TIWVCLBaseControl < TControl < TComponent < TPersistent < TObject
主要成员:
property ButtonType: TIWButtonType //!, 示例中详述
property HotKey: string //热键; 譬如: HotKey = 'j', 那么热键就是: Alt+J
property Confirmation: string //指定此信息后, 将弹出问询窗; 只有确认后才会执行 OnClick; 这非常方便, 也很有创意
property DoSubmitValidation: Boolean //是否在提交时验证其他...
property ExtraTagParams: TStringList //添加 Html Tag; 不要用于修改 Html Tag
property FriendlyName: string //呈现给用户的名称
property ScriptEvents: TIWScriptEvents //客户端的 js 事件脚本
property WebColor: TIWColor //没看出和 Color 的区别
property WebFont: TIWFont //没看出和 Font 的区别
property Css: string //引用在样式表中定义的类; 譬如在样式表定义有 .MyClass1, 这里就可以设置 Css := 'MyClass1';
property StyleRenderOptions: TIWStyleRenderOptions //指定哪些类别的样式设置可用于最终的呈现; 因为一些属性可能会和样式表有冲突
property Caption: TCaption //标题
property Text: TCaption //在该控件中, Text 和 Caption 没有区别
property DoRefreshControl: Boolean //它默认是 False, 但在修改某些属性时必须让它为 True 才会有效 property OnClick: TNotifyEvent //与 ScriptEvents 中的 onclick 不同, 这会使整个页面提交, 就像 Submit 按钮一样
property OnAsyncClick: TIWAsyncEvent //异步 Click; 难得见到这么简单的 AJAX 的实现
property OnHTMLTag: TIWOnHTMLTag //事件发生在呈现 Html Tag 时; 可借机修改那些 Tag function RenderHTML(AContext: TIWCompContext): TIWHTMLTag //类似的还有 RenderStyle 等, 这应该是在继承控件时使用的; 现在可以使用 OnHTMLTag
function GetSubmitParam: string //?
function OwnerForm: TIWBaseForm //所属窗体; 譬如获取 IWButton1.OwnerForm.Name 的结果是 IWForm1
ButtonType 属性:
//在 Html 中的按钮有三种 Type: button、 submit、 reset, 分别表示: 一般按钮、提交按钮、重置按钮
//该属性的本意就是这个, 但现在它不起作用
//它默认是 button, 是否是指定为 submit 也不重要, TIWButton.OnClick 会自动提交; 但 reset 还是有用的 //在作者没有修正前, 可以先通过它的 OnHTMLTag 事件设置:
procedure TIWForm1.IWButton1HTMLTag(ASender: TObject; ATag: TIWHTMLTag); //可能需手动 uses IWHTMLTag
begin
ATag.Params.Values['type'] := 'reset';
end; {能接受重置的其他输入控件必须和重置按钮在同一 Region 内, 或都不在 Region 内}
DoSubmitValidation、FriendlyName 属性:
//在空窗体上放 IWEdit1、IWButton1, 写代码如下:
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
IWEdit1.Required := True; //指定为必填字段
IWEdit1.FriendlyName := '姓名字段'; //在验证提示时将使用这个名称
// IWButton1.DoSubmitValidation := False; //TIWButton.DoSubmitValidation 默认是 True; 如果指定为 False, 就不会执行验证了
end; procedure TIWForm1.IWButton1Click(Sender: TObject);
begin
//只是测试提交, 这里不需要有代码
end; //测试: 运行后, 清空 IWEdit1, 点击按钮, 将会弹出验证提示.
ExtraTagParams 属性:
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
IWButton1.ExtraTagParams.Add('style = color: red');
end;
Css 属性:
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
ExtraHeader.Add('<style>');
ExtraHeader.Add('.MyClass1 {color: blue;}');
ExtraHeader.Add('</style>'); IWButton1.Css := 'MyClass1';
end;
使用 IntraWeb (11) - 基本控件之 TIWButton的更多相关文章
- 微软 microsoft calendar control 11.0 控件下载
微软 microsoft calendar control 11.0 控件下载 https://files.cnblogs.com/files/mqingqing123/csccal2.rar
- 使用 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 (23) - 基本控件之 TIWTimer、TIWProgressBar、TIWProgressIndicator、TIWTimeEdit
TIWTimer //和 TTimer 没多大区别, 它的默认事件现在是异步的(OnAsyncTimer), 在网络上使用 OnTimer 肯定是非常糟糕的 TIWProgressBar //进度条 ...
- 使用 IntraWeb (22) - 基本控件之 TIWCalendar
TIWCalendar: 日历控件, 继承于 TIWCustomGrid, 所以它和 TIWGrid 共同属性特多. 它的 Cell 是 TIWCalendarCell 对象, 直接从 TIWGrid ...
- 使用 IntraWeb (20) - 基本控件之 TIWGrid
TIWGrid 最终通过 Html Table 呈现; 其每个 Cell 都是一个 TIWGridCell 对象, Cell 对象的 Control 属性非常好, 可以非常方便地嵌入其他控件. TIW ...
随机推荐
- [转载]JavaScript 运行机制详解:再谈Event Loop
https://app.yinxiang.com/shard/s8/sh/b72fe246-a89d-434b-85f0-a36420849b84/59bad790bdcf6b0a66b8b93d5e ...
- Requests中出现大量ASYNC_NETWORK_IO等待
七夕活动,网页显示异常:504 Gateway Time-out The server didn't respond in time.开发询问数据库是否正常,当时正连接在实例上查询数据,感觉响应确实慢 ...
- Android的layout_weight和weightSum
先看一下weightSum属性的功能描述:定义weight总和的最大值.如果未指定该值,以所有子视图的layout_weight属性的累加值作为总和的最大值.把weightSum的定义搁在这里,先去看 ...
- mybatis开发dao的方法——(三)
------------------------1. SqlSession使用范围------------------- 1.1 SqlSessionFactoryBuilder 通过S ...
- oracle 建用户
create user username identified by password; grant dba to username; 注意当对用户赋予resource角色时将同时赋予unlimite ...
- 【干货】已Window7 系统为例,谈谈boot引导程序-------附带看看数据隐藏
来源:Unit 3: Unix/Linux File System 3.1 Unix/Linux File System Booting Process 使用工具:EnCase Forensic 学习 ...
- nginx tomcat 自动部署python脚本【转】
#!/usr/bin/env python #--coding:utf8-- import sys,subprocess,os,datetime,paramiko,re local_path='/ho ...
- Python的CGI编程实现-通过接口运行服务器py脚本
yum 安装apcche [apache]yum 安装Apache(Centos 6.9) https://www.cnblogs.com/lauren1003/p/5993654.html只需一行命 ...
- Node.js模块定义总结
为了让Node.js的文件可以相互调用,Node.js提供了一个简单的模块系统.模块是Node.js 应用程序的基本组成部分,文件和模块是一一对应的.换言之,一个 Node.js 文件就是一个模块,这 ...
- hadoop-2.7.2-HA安装笔记
配置方案如图 NN DN ZK ZKFC JN RM NM(任务管理器) HMaster Region Server Node1 1 1 1 1 1 Node2 1 1 1 1 1 1 1 Nod ...