使用 IntraWeb (28) - 基本控件之 TIWTemplateProcessorHTML、TIWLayoutMgrHTML、TIWLayoutMgrForm TIWTemplateProcessorHTML //使用外部的 html 文件做模板TIWLayoutMgrHTML //直接输入 Html 文本做模板...
使用 IntraWeb (28) - 基本控件之 TIWTemplateProcessorHTML、TIWLayoutMgrHTML、TIWLayoutMgrForm
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 := '';
end;
TIWLayoutMgrHTML 所在单元及继承链:
IWLayoutMgrHTML.TIWLayoutMgrHTML < TIWContainerLayout < TIWBaseContainerLayout < TIWBaseLayoutComponent < TIWVCLComponent < TComponent < TPersistent < TObject
主要成员:
property HTML: TStringList //
property OnUnknownTag: TIWUnknownTagEvent //
本文标题为:使用 IntraWeb (28) - 基本控件之 TIWTemplateProcessorHTML、TIWLayoutMgrHTML、TIWLayoutMgrForm
基础教程推荐
- this[] 指的是什么内容 讨论 2023-11-30
- 浅析canvas元素的html尺寸和css尺寸对元素视觉的影响 2024-04-26
- CSS3的几个标签速记(推荐) 2024-04-07
- js禁止页面刷新与后退的方法 2024-01-08
- JS前端广告拦截实现原理解析 2024-04-22
- 浅谈Vue2和Vue3的数据响应 2023-10-08
- 关于文字内容过长,导致文本内容超出html 标签宽度的解决方法之自动换行 2023-10-28
- Ajax实现动态加载数据 2023-02-01
- vue离线环境如何安装脚手架vue-cli 2025-01-19
- 基于Vue制作组织架构树组件 2024-04-08
