使用 IntraWeb (14) - 基本控件之 TIWHRule、TIWRectangle

本文介绍如何使用Delphi创建HTML中的横线(TIWHRule)和矩形(TIWRectangle)元素,并展示了如何通过代码设置这些元素的样式,如颜色、位置等。


 
TIWHRule    //一条横线, 对应 Html 中的 <hr/> TIWRectangle //矩形; 中间可以有行文本, 文本可任意对齐 


TIWHRule 所在单元及继承链:
IWHTMLControls.TIWHRule < TIWCustomControl < TIWBaseHTMLControl < TIWBaseControl < TIWVCLBaseControl < TControl < TComponent < TPersistent < TObject

它没什么特别的成员, 下面是通过样式表把它改成红线:




 
procedure TIWForm1.IWAppFormCreate(Sender: TObject); begin   IWHRule1.Width := Width div 2;   IWHRule1.Height := 3;   IWHRule1.Left := (Width - IWHRule1.Width) div 2;   IWHRule1.Top := 60;   IWHRule1.Anchors := [akLeft, akTop, akRight]; end; procedure TIWForm1.IWHRule1HTMLTag(ASender: TObject; ATag: TIWHTMLTag); begin   ATag.Params.Values['style'] := ATag.Params.Values['style'] + 'background-color: red; border:0;'; end; 



TIWRectangle 所在单元及继承链:
IWCompRectangle.TIWRectangle < TIWCustomRectangle < TIWCustomControl < TIWBaseHTMLControl < TIWBaseControl < TIWVCLBaseControl < TControl < TComponent < TPersistent < TObject

主要成员:




 
property BorderOptions: TIWBorderOptions //边框选项; 主要是 Width 和 Color property Color: TIWColor                //矩形的颜色 property Alignment: TAlignment          //文本水平对齐方式 property VAlign: TIWVerticalAlignment    //文本垂直对齐方式 property Text: TCaption                  //文本 


示例:




 
procedure TIWForm1.IWAppFormCreate(Sender: TObject); begin   IWRectangle1.BorderOptions.Width := 1;   IWRectangle1.BorderOptions.Color := $0000FF;   IWRectangle1.Color := $F0E0E0;   IWRectangle1.Text := '万一的 Delphi 博客';   IWRectangle1.Font.Color := $0000FF;   IWRectangle1.Font.Size := 16;   IWRectangle1.Alignment := taCenter;   IWRectangle1.VAlign := vaMiddle; end;
New property TIWForm.KeepAlive property. When true, IntraWeb will generate JavaScript code that will send a special request to IWServer avoiding session expiration. New method ReleaseAndRedirect() in TIWBaseForm. It can be used to release the current active form and redirect to other URL internal to the IntraWeb application, e.g. a registered content handler. New properties of TContentBase (content handlers base class): CanStartSession: Boolean; RequireSessionStart: Boolean; A Slim Reader/Writer lock object is used in TIWStandAloneServer and TIWServerInternalFiles instead of TMultiReadExclusiveWriteSynchronizer object. This new lock is available under Windows Vista and up, and should increase IW server performance under heavy concurrency/load. New Event description tab in IWScriptEvents editor with some valuable information about JavaScript events Modification in TIWBaseForm: ExecuteForm() and GenerateForm() methods were made static (non virtual). These methods now call DoExecuteForm() and DoGenerateForm() virtual (protected) methods. Bug fix: User cache directory is deleted when session expires. Modification in routines responsible for cache directory removal. In our tests it fixed cache directory removal when application terminates. Bug fix: TIWDBCheckBox could raise an exception during rendering when attached to a empty DataSet Bug fix: When deploying the application as ISAPI, session tracking without cookies would fail Bug fix: When a IW application was compiled with runtime packages, TIWAppInfo.GetAppFullFileName was returning the name and path of the BPL file, not the EXE/DLL main file Bug fix: TContentRedirect could fail if ServerController.AllowMultipleSessionsPerUser = True Bug fix: IW Splitter didn't work with Internet Explorer 11
官方最新版14.2.3,支持XE3~10.2 Important Installation Notices Windows XP Users Windows XP SP2 introduced a firewall setting that can block communication with web server applications, by closing certain ports. If prompted by the firewall to unblock certain ports on loading Delphi, please acknowledge for correct functioning of IntraWeb. For more information, please see the FAQ on our web site at <http://www.atozed.com/intraweb/FAQ> . First time installing IntraWeb? Please make sure you removed the Bundled Edition of IntraWeb that is included with your RAD Studio / Delphi / C++ Builder. If you still did not remove the Bundled Edtion, please access the link below before proceeding <http://docs.atozed.com/docs.dll/technical information/Installing or Upgrading IntraWeb.html> 3rd Party Notices IntraWeb XII uses NativeXML for content parsing/generation in the IWP RSS feed modules NativeXML License information Copyright (c) 2003 - 2011 Simdesign BV. All rights reserved. THIS SOFTWARE IS PROVIDED BY SIMDESIGN BV "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SIMDESIGN BV OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值