使用 IntraWeb (15) - 基本控件之 TIWEdit、TIWMemo、TIWText

TIWEdit //单行文本框, 通过 PasswordPrompt 属性可以作为密码框
TIWMemo //多行文本框
TIWText //相当于多行的 TIWLabel 或不能编辑的 TIWMemo

TIWEdit 所在单元及继承链:
IWCompEdit.TIWEdit

主要成员:


property Text: TCaption          //文本
property PasswordPrompt: Boolean //是否以 * 代替文本; 以做密码字段
property Alignment: TAlignment   //对齐方式
property BGColor: TIWColor       //背景色
property FocusColor: TIWColor    //获取焦点时的背景色
property DoSubmitValidation: Boolean //在提交时是否执行验证
property Editable: Boolean           //能否编辑
property NonEditableAsLabel: Boolean //= True, 且 Editable = False 时, 将以 IWLabel 呈现
property MaxLength: Integer  //最大长度
property ReadOnly: Boolean   //是否是只读
property Required: Boolean   //是否是必填字段

property OnSubmit: TNotifyEvent       //在其获取焦点后, 按 Enter 将引发 OnSubmit; 如果没有使用该事件, 将调用当前窗体的 OnDefaultAction 事件.
property OnAsyncChange: TIWAsyncEvent //

procedure Clear //清空

TIWMemo 所在单元及继承链:
IWCompMemo.TIWMemo

主要成员:


property Lines: TStringList //
property Text: TCaption     //
property BGColor: TIWColor  //
property Editable: Boolean  //
property InvisibleBorder: Boolean //是否隐藏边框
property HorizScrollBar: Boolean  //是否显示横向滚动条
property VertScrollBar: Boolean   //是否显示纵向滚动条
property Required: Boolean        //

property OnAsyncChange: TIWAsyncEvent  //

procedure Clear //

TIWText 所在单元及继承链:

IWCompText.TIWText

主要成员:


property BGColor: TIWColor      //
property ConvertSpaces: Boolean //是否转换连续的空格; 如果不转换连续的空格将只呈现为一个空格, 默认 False
property Lines: TStringList     //
property RawText: Boolean       //有这个属性的控件还有: TIWLabel、TIWLink、TIWUrl, 但它在 TIWText 在应该最常用
property UseFrame: Boolean      //是否使用框架
property WantReturns: Boolean   //是否将将换行符识别为 <br>, 默认是 True
property Text: TCaption         //

procedure Clear  //

RawText 属性测试:


procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
  IWText1.Clear;
  IWText1.RawText := True;
  with IWText1.Lines do begin
    Add(‘<table border="1" rules="all" width="100%">‘);
    Add(‘<tr><td>111</td><td>222</td></tr>‘);
    Add(‘<tr><td>333</td><td>444</td></tr>‘);
    Add(‘</table>‘);
  end;
end;

使用 IntraWeb (15) - 基本控件之 TIWEdit、TIWMemo、TIWText

时间: 2024-08-10 23:27:01

使用 IntraWeb (15) - 基本控件之 TIWEdit、TIWMemo、TIWText的相关文章

使用 IntraWeb (28) - 基本控件之 TIWTemplateProcessorHTML、TIWLayoutMgrHTML、TIWLayoutMgrForm

TIWTemplateProcessorHTML //使用外部的 html 文件做模板 TIWLayoutMgrHTML //直接输入 Html 文本做模板 TIWLayoutMgrForm //这应该只是内部使用的东西, 对用户没有意义 {需要把它们关联到窗体的 LayoutMgr 属性; 主模板需要通过 IWServerController.MasterTemplate 指定} TIWTemplateProcessorHTML 所在单元及继承链: IWTemplateProcessorHTM

使用 IntraWeb (26) - 基本控件之 TIWMenu

TIWMenu 的任务是让原来的 TMainMenu 呈现在网页上, 通过其 AttachedMenu 属性关联一个 TMainMenu 是必需的. TIWMenu 所在单元及继承链: IWCompMenu.TIWMenu 主要成员: property TextOffset: Integer //菜单文本偏移(只读) property AttachedMenu: TMainMenu //指定要包装的 TMainMenu property ItemSpacing: TIWSpaceItems //

使用 IntraWeb (13) - 基本控件之 TIWLabel、TIWLink、TIWURL、TIWURLWindow

TIWLabel    // TIWLink      //内部链接 TIWURL      //外部链接 TIWURLWindow //页内框架, 就是 <iframe></iframe> TIWLabel 所在单元及继承链:IWCompLabel.TIWLabel < TIWCustomLabel < TIWCustomControl < TIWBaseHTMLControl < TIWBaseControl < TIWVCLBaseControl

使用 IntraWeb (16) - 基本控件之 TIWList、TIWListbox、TIWComboBox、TIWOrderedListbox

TIWList //列表; 它对应 Html 中的 OL.LI(某些选项下会用表格模拟); TIWListbox 和 TIWComboBox 则对应 Html 在的 Option TIWListbox //列表框 TIWComboBox //组合下拉框 TIWOrderedListbox //可手动调整顺序的列表; 好像是新增的, 还不成熟 TIWList 所在单元及继承链: IWHTMLControls.TIWList 主要成员: property Items: TStringList //

使用 IntraWeb (22) - 基本控件之 TIWCalendar

TIWCalendar: 日历控件, 继承于 TIWCustomGrid, 所以它和 TIWGrid 共同属性特多. 它的 Cell 是 TIWCalendarCell 对象, 直接从 TIWGridCell 继承. TIWCalendar 所在单元及继承链: IWCompCalendar.TIWCalendar 主要成员: property Cell[const ARow: Integer, const AColumn: Integer]: TIWCalendarCell // propert

使用 IntraWeb (23) - 基本控件之 TIWTimer、TIWProgressBar、TIWProgressIndicator、TIWTimeEdit

TIWTimer //和 TTimer 没多大区别, 它的默认事件现在是异步的(OnAsyncTimer), 在网络上使用 OnTimer 肯定是非常糟糕的 TIWProgressBar //进度条 TIWProgressIndicator //进度提示器; 这是个新东西, 非常好; 当碰到时间较长的加载时(同步或异步)都可以用用; 使用前需要先关联到窗体的 ProgressIndicator 属性 TIWTimeEdit //个人认为这个东西一点用也没有; 只是给个分钟数按 8 小时换算成天.

使用 IntraWeb (17) - 基本控件之 TIWRadioButton、TIWRadioGroup、TIWCheckBox

TIWRadioButton //单选 TIWRadioGroup //单选组 TIWCheckBox //复选 TIWRadioButton 所在单元及继承链: IWCompRadioButton.TIWRadioButton 主要成员: property Editable: Boolean // property Checked: Boolean // property Group: string //分组名; 在统一母体中的单选按钮, 组名相同者互斥 property Value: str

使用 IntraWeb (25) - 基本控件之 TIWRegion

这应该是 IW 中最重要的容器了, 和它同父的还有 TIWTabControl TIWRegion 所在单元及继承链: IWRegion.TIWRegion 主要成员: property Align: TAlign property Anchors: TAnchors property BorderOptions: TIWContainerBorderOptions //设置边框的宽度.颜色.样式 property Color: TIWColor property ClipRegion: Boo

使用 IntraWeb (21) - 基本控件之 TIWTabControl

TIWTabControl 包含的是 TIWTabPage; 设计时通过右键菜单 Add Page 添加(再给页面添加东西时一定要先选定页面); 下面例子是动态添加的. TIWTabControl 所在单元及继承链: IWCompTabControl.TIWTabControl 主要成员: property Pages: TList //TIWTabPage 对象的集合; 但它是 TList 类型, 使用前需转换下 property ActiveTabFont: TIWFont //当前 Tab