使用 IntraWeb (28) - 基本控件之 TIWTemplateProcessorHTML、TIWLayoutMgrHTML、TIWLayoutMgrForm
2014-06-20 11:20
806 查看
TIWTemplateProcessorHTML //使用外部的 html 文件做模板 TIWLayoutMgrHTML //直接输入 Html 文本做模板 TIWLayoutMgrForm //这应该只是内部使用的东西, 对用户没有意义 {需要把它们关联到窗体的 LayoutMgr 属性; 主模板需要通过 IWServerController.MasterTemplate 指定}
TIWTemplateProcessorHTML 所在单元及继承链:
IWTemplateProcessorHTML.TIWTemplateProcessorHTML < TIWContainerLayout < TIWBaseContainerLayout < TIWBaseLayoutComponent < TIWVCLComponent < TComponent < TPersistent < TObject
主要成员:
property Enabled: Boolean //使用或禁用模板, 默认 True property MasterFormTag: Boolean //是否使用主模板, 默认是 True; 如果要使用当前模板应该让它是 False property TagType: TIWTemplateLayoutHTMLTagType //ttBorland、ttIntraWeb(默认); 默认使用 {%控件名%} 嵌入控件, 如果选择 ttBorland 则用 {#控件名#} property Templates: TIWTemplateFiles //Templates.Default 默认指向 Templates\窗体名.html(如: IWForm1.html, 要求 Utf8格式), 也可以修改它(譬如动态变换模板时) property RenderStyles: Boolean //? property RemoveHiddenInputs: Boolean //移除隐藏控件, 默认 False property MasterTemplate: string //也可以指定页面级的主模板, 但一般没必要 property OnUnknownTag: TIWUnknownTagEvent //处理没有对应控件情况, 一般用于自定义标签 property OnBeforeProcess: TIWTemplateProcessEvent // property OnAfterProcess: TIWTemplateProcessEvent // function Able: Boolean //可通过该函数判断模板是否可用 function TemplatePathname: string; //可获取模板的详细地址 //在模板中使用容器中的控件: {% 容器名.控件名 %}
OnUnknownTag 事件测试:
//假如在模板中自定义了 {%BaiduLogo%} procedure TIWForm1.IWTemplateProcessorHTML1UnknownTag(const AName: string; var VValue: string); begin if AName = 'BaiduLogo' then VValue := '<img src="http://www.baidu.com/img/baidu_sylogo1.gif"/>'; end;
TIWLayoutMgrHTML 所在单元及继承链:
IWLayoutMgrHTML.TIWLayoutMgrHTML < TIWContainerLayout < TIWBaseContainerLayout < TIWBaseLayoutComponent < TIWVCLComponent < TComponent < TPersistent < TObject
主要成员:
property HTML: TStringList // property OnUnknownTag: TIWUnknownTagEvent //
相关文章推荐
- 使用 IntraWeb (6) - 页面模板: TIWLayoutMgrHTML、TIWTemplateProcessorHTML
- 使用 IntraWeb (21) - 基本控件之 TIWTabControl
- 使用 IntraWeb (19) - 基本控件之 TIWTreeView
- 使用 IntraWeb (29) - 基本控件之 TIWAutherList、TIWAutherINI、TIWAutherEvent
- 使用 IntraWeb (12) - 基本控件之 TIWGradButton、TIWImageButton
- 使用 IntraWeb (17) - 基本控件之 TIWRadioButton、TIWRadioGroup、TIWCheckBox
- 学习使用bootstrap基本控件(table、form、button)
- 使用htmlcontrol实现各种基本控件
- 使用 IntraWeb (26) - 基本控件之 TIWMenu
- 使用 IntraWeb (20) - 基本控件之 TIWGrid
- 后台C#代码获取html控件的值使用的Request.Form["name"] 中间的那个应该是空间的name 而不是id
- 使用 IntraWeb (23) - 基本控件之 TIWTimer、TIWProgressBar、TIWProgressIndicator、TIWTimeEdit
- 使用 IntraWeb (13) - 基本控件之 TIWLabel、TIWLink、TIWURL、TIWURLWindow
- 使用 IntraWeb (25) - 基本控件之 TIWRegion
- 使用 IntraWeb (38) - TIWAppForm、TIWForm、TIWBaseHTMLForm、TIWBaseForm
- 使用 IntraWeb (27) - 基本控件之 TIWAudio、TIWMPEG、TIWFlash、TIWSilverlight、TIWSilverlightVideo、TIWApplet、TIWQuickTime、TIWActiveX
- 使用 IntraWeb (11) - 基本控件之 TIWButton
- 使用 IntraWeb (16) - 基本控件之 TIWList、TIWListbox、TIWComboBox、TIWOrderedListbox
- Silverlight 4 RIA Service dataform Template, 代码选择控件,Validate验证使用技巧
- 后台C#代码获取html控件的值使用的Request.Form["name"] 中间的那个应该是空间的name 而不是id