使用 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 ...
随机推荐
- Python 装饰器入门(上)
翻译前想说的话: 这是一篇介绍python装饰器的文章,对比之前看到的类似介绍装饰器的文章,个人认为无人可出其右,文章由浅到深,由函数介绍到装饰器的高级应用,每个介绍必有例子说明.文章太长,看完原文后 ...
- fuzz for test of the Net::HTTP::GET
use Net::HTTP::GET; % %0e%0f ' *%26 @.jpg>; my $count = 0; for @chars X @chars X @chars X @chars ...
- docker之容器访问和网络连接(三)
前言 当一台服务器上部署了多个应用容器,它们直接可能需要相互通信,比如web应用容器需要访问mysql数据库容器. 主机访问容器 通过映射端口的形式我们可以在外部访问容器内的服务 # 将主机的127. ...
- linux中serial driver理解【转】
转自:http://blog.csdn.net/laoliu_lcl/article/details/39967225 英文文档地址:myandroid/kernel_imx/Documentatio ...
- springcloud中Feign配置详解
Spring Cloud中Feign配置详解 到目前为止,小伙伴们对Feign的使用已经掌握的差不多了,我们在前文也提到Feign是对Ribbon和Hystrix的整合,那么在Feign中,我们要如何 ...
- MAC连接安卓手机通过adb指令安装apk
Android的apk可以通过adb命令来安装.在MAC电脑上,如果想通过命令行的方式给安卓手机安装apk,需要做以下操作: 一句话概括就是:将安卓SDK的adb命令添加到环境变量中,然后通过adb ...
- @PostConstruct和@PreConstruct
详情参见:https://www.cnblogs.com/landiljy/p/5764515.html 1.@PostConstruct说明 被@PostConstruct修饰的方法会在服务器加载S ...
- 06 Go 1.6 Release Notes
Go 1.6 Release Notes Introduction to Go 1.6 Changes to the language Ports Tools Cgo Compiler Toolcha ...
- numpy和pandas简单使用
numpy和pandas简单使用 import numpy as np import pandas as pd 一维数据分析 numpy中使用array, pandas中使用series numpy一 ...
- TimedSupervisorTask
啊啊啊 UnsupportedOperationException Lists.emptyLIst() . add (String[] ) 这他妈的不行.. .2017/09/13 16:42:16. ...